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
1c05a90a
Commit
1c05a90a
authored
Mar 24, 2011
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: fix freebsd-amd64 (and part of 386)
R=rsc CC=golang-dev
https://golang.org/cl/4285063
parent
913c8d73
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
8 deletions
+28
-8
src/pkg/runtime/freebsd/386/signal.c
src/pkg/runtime/freebsd/386/signal.c
+3
-2
src/pkg/runtime/freebsd/amd64/defs.h
src/pkg/runtime/freebsd/amd64/defs.h
+19
-4
src/pkg/runtime/freebsd/amd64/signal.c
src/pkg/runtime/freebsd/amd64/signal.c
+3
-2
src/pkg/runtime/freebsd/defs.c
src/pkg/runtime/freebsd/defs.c
+2
-0
src/pkg/runtime/freebsd/os.h
src/pkg/runtime/freebsd/os.h
+1
-0
No files found.
src/pkg/runtime/freebsd/386/signal.c
View file @
1c05a90a
...
...
@@ -137,7 +137,9 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
if
(
restart
)
sa
.
sa_flags
|=
SA_RESTART
;
sa
.
sa_mask
=
~
0ULL
;
sa
.
__sigaction_u
.
__sa_sigaction
=
(
uintptr
)
fn
;
if
(
fn
==
runtime
·
sighandler
)
fn
=
(
void
*
)
runtime
·
sigtramp
;
sa
.
__sigaction_u
.
__sa_sigaction
=
(
void
*
)
fn
;
runtime
·
sigaction
(
i
,
&
sa
,
nil
);
}
...
...
@@ -165,7 +167,6 @@ runtime·initsig(int32 queue)
void
runtime
·
resetcpuprofiler
(
int32
hz
)
{
Sigaction
sa
;
Itimerval
it
;
runtime
·
memclr
((
byte
*
)
&
it
,
sizeof
it
);
...
...
src/pkg/runtime/freebsd/amd64/defs.h
View file @
1c05a90a
...
...
@@ -61,6 +61,9 @@ enum {
BUS_OBJERR
=
0x3
,
SEGV_MAPERR
=
0x1
,
SEGV_ACCERR
=
0x2
,
ITIMER_REAL
=
0
,
ITIMER_VIRTUAL
=
0x1
,
ITIMER_PROF
=
0x2
,
};
// Types
...
...
@@ -83,7 +86,7 @@ struct ThrParam {
int64
*
child_tid
;
int64
*
parent_tid
;
int32
flags
;
byte
pad0
[
4
];
byte
pad
_godefs_
0
[
4
];
Rtprio
*
rtp
;
void
*
spare
[
3
];
};
...
...
@@ -93,7 +96,7 @@ struct Sigaltstack {
int8
*
ss_sp
;
uint64
ss_size
;
int32
ss_flags
;
byte
pad0
[
4
];
byte
pad
_godefs_
0
[
4
];
};
typedef
struct
Sigset
Sigset
;
...
...
@@ -114,7 +117,7 @@ struct StackT {
int8
*
ss_sp
;
uint64
ss_size
;
int32
ss_flags
;
byte
pad0
[
4
];
byte
pad
_godefs_
0
[
4
];
};
typedef
struct
Siginfo
Siginfo
;
...
...
@@ -178,6 +181,18 @@ struct Ucontext {
StackT
uc_stack
;
int32
uc_flags
;
int32
__spare__
[
4
];
byte
pad0
[
12
];
byte
pad_godefs_0
[
12
];
};
typedef
struct
Timeval
Timeval
;
struct
Timeval
{
int64
tv_sec
;
int64
tv_usec
;
};
typedef
struct
Itimerval
Itimerval
;
struct
Itimerval
{
Timeval
it_interval
;
Timeval
it_value
;
};
#pragma pack off
src/pkg/runtime/freebsd/amd64/signal.c
View file @
1c05a90a
...
...
@@ -145,7 +145,9 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
if
(
restart
)
sa
.
sa_flags
|=
SA_RESTART
;
sa
.
sa_mask
=
~
0ULL
;
sa
.
__sigaction_u
.
__sa_sigaction
=
(
uintptr
)
fn
;
if
(
fn
==
runtime
·
sighandler
)
fn
=
(
void
*
)
runtime
·
sigtramp
;
sa
.
__sigaction_u
.
__sa_sigaction
=
(
void
*
)
fn
;
runtime
·
sigaction
(
i
,
&
sa
,
nil
);
}
...
...
@@ -173,7 +175,6 @@ runtime·initsig(int32 queue)
void
runtime
·
resetcpuprofiler
(
int32
hz
)
{
Sigaction
sa
;
Itimerval
it
;
runtime
·
memclr
((
byte
*
)
&
it
,
sizeof
it
);
...
...
src/pkg/runtime/freebsd/defs.c
View file @
1c05a90a
...
...
@@ -19,6 +19,7 @@
#include <sys/rtprio.h>
#include <sys/thr.h>
#include <sys/_sigset.h>
#include <sys/unistd.h>
enum
{
$
PROT_NONE
=
PROT_NONE
,
...
...
@@ -103,4 +104,5 @@ typedef siginfo_t $Siginfo;
typedef
mcontext_t
$
Mcontext
;
typedef
ucontext_t
$
Ucontext
;
typedef
struct
timeval
$
Timeval
;
typedef
struct
itimerval
$
Itimerval
;
src/pkg/runtime/freebsd/os.h
View file @
1c05a90a
...
...
@@ -7,3 +7,4 @@ void runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
struct
sigaction
;
void
runtime
·
sigaction
(
int32
,
struct
sigaction
*
,
struct
sigaction
*
);
void
runtiem
·
setitimerval
(
int32
,
Itimerval
*
,
Itimerval
*
);
void
runtime
·
setitimer
(
int32
,
Itimerval
*
,
Itimerval
*
);
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