Rev 133 | Rev 146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 133 | Rev 137 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | <para>The code accessing thread local storage uses a segment register FS |
62 | <para>The code accessing thread local storage uses a segment register FS |
63 | as a base. The thread local storage is stored in the hidden 64-bit part |
63 | as a base. The thread local storage is stored in the hidden 64-bit part |
64 | of the FS register which must be written using priviledged machine |
64 | of the FS register which must be written using priviledged machine |
65 | specific instructions. Special syscall to change this register is |
65 | specific instructions. Special syscall to change this register is |
66 | provided to user applications. The TLS address for this platform is |
66 | provided to user applications. The TLS address for this platform is |
67 | expected to point just after the end of the thread local data.</para> |
67 | expected to point just after the end of the thread local data. The |
- | 68 | application sometimes need to get a real address of the thread local |
|
- | 69 | data in its address space but it is impossible to read the base of the |
|
- | 70 | FS segmentation register. The solution is to add the self-reference |
|
- | 71 | address to the end of thread local data, so that the application can |
|
- | 72 | read the address as %gs:0. </para> |
|
- | 73 | ||
- | 74 | <figure float="1"> |
|
- | 75 | <title>IA32 & AMD64</title> |
|
- | 76 | ||
- | 77 | <mediaobject id="tldia32"> |
|
- | 78 | <imageobject role="pdf"> |
|
- | 79 | <imagedata fileref="images/tld_ia32.pdf" format="PDF" /> |
|
- | 80 | </imageobject> |
|
- | 81 | ||
- | 82 | <imageobject role="html"> |
|
- | 83 | <imagedata fileref="images/tld_ia32.png" format="PNG" /> |
|
- | 84 | </imageobject> |
|
- | 85 | ||
- | 86 | <imageobject role="fop"> |
|
- | 87 | <imagedata fileref="images/tld_ia32.svg" format="SVG" /> |
|
- | 88 | </imageobject> |
|
- | 89 | </mediaobject> |
|
- | 90 | </figure> |
|
68 | </section> |
91 | </section> |
69 | 92 | ||
70 | <section> |
93 | <section> |
71 | <title>Fast SYSCALL/SYSRET Support</title> |
94 | <title>Fast SYSCALL/SYSRET Support</title> |
72 | 95 | ||
Line 123... | Line 146... | ||
123 | supposed to emulate it. HelenOS expects that the TLS pointer is in the |
146 | supposed to emulate it. HelenOS expects that the TLS pointer is in the |
124 | K1 register. Upon encountering the reserved instruction exception and |
147 | K1 register. Upon encountering the reserved instruction exception and |
125 | checking that the application is requesting a TLS pointer, it returns |
148 | checking that the application is requesting a TLS pointer, it returns |
126 | the contents of the K1 register. The K1 register is expected to point |
149 | the contents of the K1 register. The K1 register is expected to point |
127 | 0x7000 bytes after the beginning of the thread local data.</para> |
150 | 0x7000 bytes after the beginning of the thread local data.</para> |
- | 151 | ||
- | 152 | <figure float="1"> |
|
- | 153 | <title>MIPS & PPC</title> |
|
- | 154 | ||
- | 155 | <mediaobject id="tldmips"> |
|
- | 156 | <imageobject role="pdf"> |
|
- | 157 | <imagedata fileref="images/tld_mips.pdf" format="PDF" /> |
|
- | 158 | </imageobject> |
|
- | 159 | ||
- | 160 | <imageobject role="html"> |
|
- | 161 | <imagedata fileref="images/tld_mips.png" format="PNG" /> |
|
- | 162 | </imageobject> |
|
- | 163 | ||
- | 164 | <imageobject role="fop"> |
|
- | 165 | <imagedata fileref="images/tld_mips.svg" format="SVG" /> |
|
- | 166 | </imageobject> |
|
- | 167 | </mediaobject> |
|
- | 168 | </figure> |
|
128 | </section> |
169 | </section> |
129 | </section> |
170 | </section> |
130 | 171 | ||
131 | <section> |
172 | <section> |
132 | <title>Power PC</title> |
173 | <title>Power PC</title> |
133 | 174 | ||
134 | <para></para> |
175 | <para></para> |
- | 176 | ||
- | 177 | <section> |
|
- | 178 | <title>Thread Local Storage</title> |
|
- | 179 | ||
- | 180 | <para>The Power PC thread local storage uses R2 register to hold an |
|
- | 181 | address, that is 0x7000 bytes after the beginning of the thread local |
|
- | 182 | data. Overally it is the same as on the MIPS architecture.</para> |
|
- | 183 | </section> |
|
135 | </section> |
184 | </section> |
136 | 185 | ||
137 | <section> |
186 | <section> |
138 | <title>IA-64</title> |
187 | <title>IA-64</title> |
139 | 188 | ||
140 | <para></para> |
189 | <para></para> |
- | 190 | ||
- | 191 | <figure float="1"> |
|
- | 192 | <title>IA64</title> |
|
- | 193 | ||
- | 194 | <mediaobject id="tldia64"> |
|
- | 195 | <imageobject role="pdf"> |
|
- | 196 | <imagedata fileref="images/tld_ia64.pdf" format="PDF" /> |
|
- | 197 | </imageobject> |
|
- | 198 | ||
- | 199 | <imageobject role="html"> |
|
- | 200 | <imagedata fileref="images/tld_ia64.png" format="PNG" /> |
|
- | 201 | </imageobject> |
|
- | 202 | ||
- | 203 | <imageobject role="fop"> |
|
- | 204 | <imagedata fileref="images/tld_ia64.svg" format="SVG" /> |
|
- | 205 | </imageobject> |
|
- | 206 | </mediaobject> |
|
- | 207 | </figure> |
|
141 | </section> |
208 | </section> |
142 | </appendix> |
209 | </appendix> |
143 | 210 |