Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
fb32d60c
Commit
fb32d60c
authored
May 30, 2012
by
Joel Sing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: make go work on netbsd/386
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/6254055
parent
992a11b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
52 deletions
+28
-52
src/pkg/runtime/signal_netbsd_386.c
src/pkg/runtime/signal_netbsd_386.c
+11
-0
src/pkg/runtime/sys_netbsd_386.s
src/pkg/runtime/sys_netbsd_386.s
+16
-51
src/pkg/runtime/sys_netbsd_amd64.s
src/pkg/runtime/sys_netbsd_amd64.s
+1
-1
No files found.
src/pkg/runtime/signal_netbsd_386.c
View file @
fb32d60c
...
...
@@ -7,6 +7,7 @@
#include "signals_GOOS.h"
#include "os_GOOS.h"
extern
void
runtime
·
lwp_tramp
(
void
);
extern
void
runtime
·
sigtramp
(
void
);
typedef
struct
sigaction
{
...
...
@@ -136,3 +137,13 @@ runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
sa
.
_sa_u
.
_sa_sigaction
=
(
void
*
)
fn
;
runtime
·
sigaction
(
i
,
&
sa
,
nil
);
}
void
runtime
·
lwp_mcontext_init
(
McontextT
*
mc
,
void
*
stack
,
M
*
m
,
G
*
g
,
void
(
*
fn
)(
void
))
{
mc
->
__gregs
[
REG_EIP
]
=
(
uint32
)
runtime
·
lwp_tramp
;
mc
->
__gregs
[
REG_UESP
]
=
(
uint32
)
stack
;
mc
->
__gregs
[
REG_EBX
]
=
(
uint32
)
m
;
mc
->
__gregs
[
REG_EDX
]
=
(
uint32
)
g
;
mc
->
__gregs
[
REG_ESI
]
=
(
uint32
)
fn
;
}
src/pkg/runtime/sys_netbsd_386.s
View file @
fb32d60c
...
...
@@ -202,57 +202,22 @@ TEXT runtime·sigtramp(SB),7,$44
MOVL
BX
,
g
(
CX
)
RET
//
int32
rfork_thread
(
int32
flags
,
void
*
stack
,
M
*
m
,
G
*
g
,
void
(*
fn
)(
void
))
;
TEXT
runtime
·
rfork_thread
(
SB
),7,$8
MOVL
flags
+
8
(
SP
),
AX
MOVL
stack
+
12
(
SP
),
CX
//
Copy
m
,
g
,
fn
off
parent
stack
for
use
by
child
.
SUBL
$
16
,
CX
MOVL
mm
+
16
(
SP
),
SI
MOVL
SI
,
0
(
CX
)
MOVL
gg
+
20
(
SP
),
SI
MOVL
SI
,
4
(
CX
)
MOVL
fn
+
24
(
SP
),
SI
MOVL
SI
,
8
(
CX
)
MOVL
$
1234
,
12
(
CX
)
MOVL
CX
,
SI
MOVL
$
0
,
0
(
SP
)
//
syscall
gap
MOVL
AX
,
4
(
SP
)
//
arg
1
-
flags
MOVL
$
251
,
AX
//
sys_rfork
//
int32
lwp_create
(
void
*
context
,
uintptr
flags
,
void
*
lwpid
)
;
TEXT
runtime
·
lwp_create
(
SB
),7,$16
MOVL
$
0
,
0
(
SP
)
MOVL
context
+
0
(
FP
),
AX
MOVL
AX
,
4
(
SP
)
//
arg
1
-
context
MOVL
flags
+
4
(
FP
),
AX
MOVL
AX
,
8
(
SP
)
//
arg
2
-
flags
MOVL
lwpid
+
8
(
FP
),
AX
MOVL
AX
,
12
(
SP
)
//
arg
3
-
lwpid
MOVL
$
309
,
AX
//
sys__lwp_create
INT
$
0x80
//
Return
if
rfork
syscall
failed
JCC
4
(
PC
)
JCC
2
(
PC
)
NEGL
AX
MOVL
AX
,
48
(
SP
)
RET
//
In
parent
,
return
.
CMPL
AX
,
$
0
JEQ
3
(
PC
)
MOVL
AX
,
48
(
SP
)
RET
//
In
child
,
on
new
stack
.
MOVL
SI
,
SP
//
Paranoia
:
check
that
SP
is
as
we
expect
.
MOVL
12
(
SP
),
BP
CMPL
BP
,
$
1234
JEQ
2
(
PC
)
INT
$
3
//
Reload
registers
MOVL
0
(
SP
),
BX
//
m
MOVL
4
(
SP
),
DX
//
g
MOVL
8
(
SP
),
SI
//
fn
//
Initialize
m
->
procid
to
thread
ID
MOVL
$
299
,
AX
//
sys_getthrid
INT
$
0x80
MOVL
AX
,
m_procid
(
BX
)
TEXT
runtime
·
lwp_tramp
(
SB
),7,$0
//
Set
FS
to
point
at
m
->
tls
LEAL
m_tls
(
BX
),
BP
...
...
@@ -317,13 +282,13 @@ TEXT runtime·osyield(SB),7,$-4
INT
$
0x80
RET
TEXT
runtime
·
thrsleep
(
SB
),7,$-4
MOVL
$
300
,
AX
//
sys_thrsleep
TEXT
runtime
·
lwp_park
(
SB
),7,$-4
MOVL
$
434
,
AX
//
sys__lwp_park
INT
$
0x80
RET
TEXT
runtime
·
thrwakeup
(
SB
),7,$-4
MOVL
$
3
01
,
AX
//
sys_thrwakeup
TEXT
runtime
·
lwp_unpark
(
SB
),7,$-4
MOVL
$
3
21
,
AX
//
sys__lwp_unpark
INT
$
0x80
RET
...
...
src/pkg/runtime/sys_netbsd_amd64.s
View file @
fb32d60c
...
...
@@ -8,7 +8,7 @@
#include "zasm_GOOS_GOARCH.h"
//
int
64
lwp_create
(
void
*
context
,
uintptr
flags
,
void
*
lwpid
)
//
int
32
lwp_create
(
void
*
context
,
uintptr
flags
,
void
*
lwpid
)
TEXT
runtime
·
lwp_create
(
SB
),7,$0
MOVQ
context
+
0
(
FP
),
DI
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment