Reid Spencer | 4f6015a | 2004-07-17 10:04:49 +0000 | [diff] [blame^] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <title>System Library</title> |
| 6 | <link rel="stylesheet" href="llvm.css" type="text/css"> |
| 7 | </head> |
| 8 | <body> |
| 9 | |
| 10 | <div class="doc_title"> System Library</div> |
| 11 | |
| 12 | <div class="doc_warning">Warning: This document is a work in progress.</div> |
| 13 | |
| 14 | <ul> |
| 15 | <li><a href="#abstract">Abstract</a></li> |
| 16 | <li><a href="#requirements">System Library Requirements</a> |
| 17 | <ol> |
| 18 | <li><a href="#headers">Hide System Header Files</a></li> |
| 19 | <li><a href="#nofunc">No Exposed Functions</a></li> |
| 20 | <li><a href="#nodata">No Exposed Data</a></li> |
| 21 | <li><a href="#xcptns">No Exceptions</a></li> |
| 22 | <li><a href="#errors">Standard Error Codes</a></li> |
| 23 | <li><a href="#overhead">Minimize Overhead</a></li> |
| 24 | </ol></li> |
| 25 | <li><a href="#design">System Library Design</a> |
| 26 | <ol> |
| 27 | <li><a href="#opaque">Use Opaque Classes</a></li> |
| 28 | <li><a href="#common">Common Implementations</a></li> |
| 29 | <li><a href="#multi_imps">Multiple Implementations</a></li> |
| 30 | <li><a href="#lowlevel">Use Low Level Interfaces</a></li> |
| 31 | <li><a href="#memalloc">No Memory Allocation</a></li> |
| 32 | <li><a href="#virtuals">No Virtual Methods</a></li> |
| 33 | </ol></li> |
| 34 | <li><a href="#detail">System Library Details</a> |
| 35 | <ol> |
| 36 | <li><a href="#bug">Tracking Bugzilla Bug: 351</a></li> |
| 37 | <li><a href="#refimpl">Reference Implementatation</a></li> |
| 38 | </ol></li> |
| 39 | </ul> |
| 40 | |
| 41 | <div class="doc_author"> |
| 42 | <p>Written by the <a href="rspencer@x10sys.com">Reid Spencer</a></p> |
| 43 | </div> |
| 44 | |
| 45 | |
| 46 | <!-- *********************************************************************** --> |
| 47 | <div class="doc_section"><a name="abstract">Abstract</a></div> |
| 48 | <div class="doc_text"> |
| 49 | <p>This document describes the requirements, design, and implementation |
| 50 | details of LLVM's System Library. The library is composed of the header files |
| 51 | in <tt>llvm/include/llvm/System</tt> and the source files in |
| 52 | <tt>llvm/lib/System</tt>. The goal of this library is to completely shield |
| 53 | LLVM from the variations in operating system interfaces. By centralizing |
| 54 | LLVM's use of operating system interfaces, we make it possible for the LLVM |
| 55 | tool chain and runtime libraries to be more easily ported to new platforms. |
| 56 | The library also unclutters the rest of LLVM from #ifdef use and special |
| 57 | cases for specific operating systems.</p> |
| 58 | <p>The System Library was donated to LLVM by Reid Spencer who formulated the |
| 59 | original design as part of the eXtensible Programming System (XPS) which is |
| 60 | based, in part, on LLVM.</p> |
| 61 | </div> |
| 62 | |
| 63 | <!-- *********************************************************************** --> |
| 64 | <div class="doc_section"> |
| 65 | <a name="requirements">System Library Requirements</a> |
| 66 | </div> |
| 67 | <div class="doc_text"> |
| 68 | <p>The System library's requirements are aimed at shielding LLVM from the |
| 69 | variations in operating system interfaces. The following sections define the |
| 70 | requirements needed to fulfill this objective.</p> |
| 71 | </div> |
| 72 | |
| 73 | <!-- ======================================================================= --> |
| 74 | <div class="doc_subsection"><a name="headers">Hide System Header Files</a></div> |
| 75 | <div class="doc_text"> |
| 76 | <p>To be written.</p> |
| 77 | </div> |
| 78 | |
| 79 | <!-- ======================================================================= --> |
| 80 | <div class="doc_subsection"><a name="nofunc">No Exposed Functions</a></div> |
| 81 | <div class="doc_text"> |
| 82 | <p>To be written.</p> |
| 83 | </div> |
| 84 | |
| 85 | <!-- ======================================================================= --> |
| 86 | <div class="doc_subsection"><a name="nodata">No Exposed Data</a></div> |
| 87 | <div class="doc_text"> |
| 88 | <p>To be written.</p> |
| 89 | </div> |
| 90 | |
| 91 | <!-- ======================================================================= --> |
| 92 | <div class="doc_subsection"><a name="xcptns">No Exceptions</a></div> |
| 93 | <div class="doc_text"> |
| 94 | <p>To be written.</p> |
| 95 | </div> |
| 96 | |
| 97 | <!-- ======================================================================= --> |
| 98 | <div class="doc_subsection"><a name="errors">Standard Error Codes</a></div> |
| 99 | <div class="doc_text"> |
| 100 | <p>To be written.</p> |
| 101 | </div> |
| 102 | |
| 103 | <!-- ======================================================================= --> |
| 104 | <div class="doc_subsection"><a name="overhead">Minimize Overhead</a></div> |
| 105 | <div class="doc_text"> |
| 106 | <p>To be written.</p> |
| 107 | </div> |
| 108 | |
| 109 | <!-- *********************************************************************** --> |
| 110 | <div class="doc_section"><a name="design">System Library Design</a></div> |
| 111 | <div class="doc_text"> |
| 112 | <p>In order to fulfill the requirements of the system library, strict design |
| 113 | objectives must be maintained in the library as it evolves. The goal here |
| 114 | is to provide interfaces to operating system concepts (files, memory maps, |
| 115 | sockets, signals, locking, etc) efficiently and in such a way that the |
| 116 | remainder of LLVM is completely operating system agnostic.</p> |
| 117 | </div> |
| 118 | |
| 119 | <!-- ======================================================================= --> |
| 120 | <div class="doc_subsection"><a name="opaque">Use Opaque Classes</a></div> |
| 121 | <div class="doc_text"> |
| 122 | <p>no public data</p> |
| 123 | <p>onlyprimitive typed private/protected data</p> |
| 124 | <p>data size is "right" for platform, not max of all platforms</p> |
| 125 | <p>each class corresponds to O/S concept</p> |
| 126 | </div> |
| 127 | |
| 128 | <!-- ======================================================================= --> |
| 129 | <div class="doc_subsection"><a name="common">Common Implementations</a></div> |
| 130 | <div class="doc_text"> |
| 131 | <p>To be written.</p> |
| 132 | </div> |
| 133 | |
| 134 | <!-- ======================================================================= --> |
| 135 | <div class="doc_subsection"> |
| 136 | <a name="multi_imps">Multiple Implementations</a> |
| 137 | </div> |
| 138 | <div class="doc_text"> |
| 139 | <p>To be written.</p> |
| 140 | </div> |
| 141 | |
| 142 | <!-- ======================================================================= --> |
| 143 | <div class="doc_subsection"> |
| 144 | <a name="low_level">Use Low Level Interfaces</a> |
| 145 | </div> |
| 146 | <div class="doc_text"> |
| 147 | <p>To be written.</p> |
| 148 | </div> |
| 149 | |
| 150 | <!-- ======================================================================= --> |
| 151 | <div class="doc_subsection"><a name="memalloc">No Memory Allocation</a></div> |
| 152 | <div class="doc_text"> |
| 153 | <p>To be written.</p> |
| 154 | </div> |
| 155 | |
| 156 | <!-- ======================================================================= --> |
| 157 | <div class="doc_subsection"><a name="virtuals">No Virtual Methods</a></div> |
| 158 | <div class="doc_text"> |
| 159 | <p>To be written.</p> |
| 160 | </div> |
| 161 | |
| 162 | <!-- *********************************************************************** --> |
| 163 | <div class="doc_section"><a name="detail">System Library Details</a></div> |
| 164 | <div class="doc_text"> |
| 165 | <p>To be written.</p> |
| 166 | </div> |
| 167 | |
| 168 | <!-- ======================================================================= --> |
| 169 | <div class="doc_subsection"><a name="bug">Bug 251</a></div> |
| 170 | <div class="doc_text"> |
| 171 | <p>See <a href="http://llvm.cs.uiuc.edu/bugs/show_bug?bug=351">bug 351</a> |
| 172 | for further details on the progress of this work</p> |
| 173 | </div> |
| 174 | |
| 175 | <!-- ======================================================================= --> |
| 176 | <div class="doc_subsection"> |
| 177 | <a name="refimpl">Reference Implementation</a> |
| 178 | </div> |
| 179 | <div class="doc_text"> |
| 180 | <p>The <tt>linux</tt> implementation of the system library will always be the |
| 181 | reference implementation. This means that (a) the concepts defined by the |
| 182 | linux must be identically replicated in the other implementations and (b) the |
| 183 | linux implementation must always be complete (provide implementations for all |
| 184 | concepts).</p> |
| 185 | </div> |
| 186 | |
| 187 | <!-- *********************************************************************** --> |
| 188 | |
| 189 | <hr> |
| 190 | <address> |
| 191 | <a href="http://jigsaw.w3.org/css-validator/check/referer"><img |
| 192 | src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a> |
| 193 | <a href="http://validator.w3.org/check/referer"><img |
| 194 | src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a> |
| 195 | |
| 196 | <a href="mailto:rspencer@x10sys.com">Reid Spencer</a><br> |
| 197 | <a href="http://llvm.cs.uiuc.edu">LLVM Compiler Infrastructure</a><br> |
| 198 | Last modified: $Date$ |
| 199 | </address> |
| 200 | </body> |
| 201 | </html> |