Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1403)

Delta Between Two Patch Sets: src/pkg/runtime/cgo/gcc_openbsd_386.c

Issue 6855086: cgo: enable cgo on OpenBSD (Closed)
Left Patch Set: diff -r b9a1e8e1d2dd https://code.google.com/p/go/ Created 12 years, 4 months ago
Right Patch Set: diff -r 03a6b8c9c396 https://code.google.com/p/go/ Created 12 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/os/user/lookup_unix.go ('k') | src/pkg/runtime/cgo/gcc_openbsd_amd64.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 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 <sys/types.h> 5 #include <sys/types.h>
6 #include <dlfcn.h> 6 #include <dlfcn.h>
7 #include <pthread.h> 7 #include <pthread.h>
8 #include <signal.h> 8 #include <signal.h>
9 #include <string.h> 9 #include <string.h>
10 #include <errno.h> 10 #include <errno.h>
11 #include "libcgo.h" 11 #include "libcgo.h"
12 12
13 static void* threadentry(void*); 13 static void* threadentry(void*);
14 14
15 #define TCB_SIZE 16 15 // TCB_SIZE is sizeof(struct thread_control_block),·
16 // defined in /usr/src/lib/librthread/tcb.h
17 #define TCB_SIZE (4 * sizeof(void *))
16 #define TLS_SIZE (2 * sizeof(void *)) 18 #define TLS_SIZE (2 * sizeof(void *))
17 19
18 void *__get_tcb(void); 20 void *__get_tcb(void);
19 void __set_tcb(void *); 21 void __set_tcb(void *);
20 22
21 static void 23 static void
22 tcb_fixup(int mainthread) 24 tcb_fixup(int mainthread)
23 { 25 {
24 void *newtcb, *oldtcb; 26 void *newtcb, *oldtcb;
25 27
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 */ 156 */
155 asm volatile ( 157 asm volatile (
156 "movl %0, %%gs:-8\n" // MOVL g, -8(GS) 158 "movl %0, %%gs:-8\n" // MOVL g, -8(GS)
157 "movl %1, %%gs:-4\n" // MOVL m, -4(GS) 159 "movl %1, %%gs:-4\n" // MOVL m, -4(GS)
158 :: "r"(ts.g), "r"(ts.m) 160 :: "r"(ts.g), "r"(ts.m)
159 ); 161 );
160 162
161 crosscall_386(ts.fn); 163 crosscall_386(ts.fn);
162 return nil; 164 return nil;
163 } 165 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b