LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "a.h" | 5 #include "a.h" |
6 | 6 |
7 /* | 7 /* |
8 * Helpers for building pkg/runtime. | 8 * Helpers for building pkg/runtime. |
9 */ | 9 */ |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 char *goarch; | 98 char *goarch; |
99 char *goos; | 99 char *goos; |
100 char *hdr; | 100 char *hdr; |
101 } zasmhdr[] = { | 101 } zasmhdr[] = { |
102 {"386", "windows", | 102 {"386", "windows", |
103 "#define get_tls(r) MOVL 0x14(FS), r\n" | 103 "#define get_tls(r) MOVL 0x14(FS), r\n" |
104 "#define g(r) 0(r)\n" | 104 "#define g(r) 0(r)\n" |
105 "#define m(r) 4(r)\n" | 105 "#define m(r) 4(r)\n" |
106 }, | 106 }, |
107 {"386", "plan9", | 107 {"386", "plan9", |
| 108 "// Plan 9 does not have per-process segment descriptors with\n" |
| 109 "// which to do thread-local storage. Instead, we will use a\n" |
| 110 "// fixed offset from the per-process TOS struct address for\n" |
| 111 "// the local storage. Since the process ID is contained in the\
n" |
| 112 "// TOS struct, we specify an offset for that here as well.\n" |
108 "#define get_tls(r) MOVL _tos(SB), r \n" | 113 "#define get_tls(r) MOVL _tos(SB), r \n" |
109 "#define g(r) -8(r)\n" | 114 "#define g(r) -8(r)\n" |
110 "#define m(r) -4(r)\n" | 115 "#define m(r) -4(r)\n" |
| 116 "#define procid(r) 48(r)\n" |
111 }, | 117 }, |
112 {"386", "linux", | 118 {"386", "linux", |
113 "// On Linux systems, what we call 0(GS) and 4(GS) for g and m\n
" | 119 "// On Linux systems, what we call 0(GS) and 4(GS) for g and m\n
" |
114 "// turn into %gs:-8 and %gs:-4 (using gcc syntax to denote\n" | 120 "// turn into %gs:-8 and %gs:-4 (using gcc syntax to denote\n" |
115 "// what the machine sees as opposed to 8l input).\n" | 121 "// what the machine sees as opposed to 8l input).\n" |
116 "// 8l rewrites 0(GS) and 4(GS) into these.\n" | 122 "// 8l rewrites 0(GS) and 4(GS) into these.\n" |
117 "//\n" | 123 "//\n" |
118 "// On Linux Xen, it is not allowed to use %gs:-8 and %gs:-4\n" | 124 "// On Linux Xen, it is not allowed to use %gs:-8 and %gs:-4\n" |
119 "// directly. Instead, we have to store %gs:0 into a temporary\
n" | 125 "// directly. Instead, we have to store %gs:0 into a temporary\
n" |
120 "// register and then use -8(%reg) and -4(%reg). This kind\n" | 126 "// register and then use -8(%reg) and -4(%reg). This kind\n" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 writefile(&out, file, 0); | 363 writefile(&out, file, 0); |
358 | 364 |
359 bfree(&in); | 365 bfree(&in); |
360 bfree(&b); | 366 bfree(&b); |
361 bfree(&out); | 367 bfree(&out); |
362 vfree(&argv); | 368 vfree(&argv); |
363 vfree(&lines); | 369 vfree(&lines); |
364 vfree(&fields); | 370 vfree(&fields); |
365 vfree(&seen); | 371 vfree(&seen); |
366 } | 372 } |
LEFT | RIGHT |