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