Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
7b454bb1
Commit
7b454bb1
authored
Jul 09, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
defined external registers g and m
SVN=126521
parent
1e9adf82
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
rt2_amd64.c
src/runtime/rt2_amd64.c
+5
-5
runtime.c
src/runtime/runtime.c
+5
-0
runtime.h
src/runtime/runtime.h
+10
-9
No files found.
src/runtime/rt2_amd64.c
View file @
7b454bb1
...
...
@@ -36,11 +36,11 @@ traceback(uint8 *pc, uint8 *sp, void* r15)
int32
counter
;
int32
i
;
int8
*
name
;
U
u
;
G
g
;
Stktop
*
stktop
;
// store local copy of per-process data block that we can write as we unwind
mcpy
((
byte
*
)
&
u
,
(
byte
*
)
r15
,
sizeof
(
U
));
mcpy
((
byte
*
)
&
g
,
(
byte
*
)
r15
,
sizeof
(
G
));
counter
=
0
;
name
=
"panic"
;
...
...
@@ -48,9 +48,9 @@ traceback(uint8 *pc, uint8 *sp, void* r15)
callpc
=
pc
;
if
((
uint8
*
)
_morestack
<
pc
&&
pc
<
(
uint8
*
)
_endmorestack
)
{
// call site in _morestack(); pop to earlier stack block to get true caller
stktop
=
(
Stktop
*
)
u
.
stackbase
;
u
.
stackbase
=
stktop
->
oldbase
;
u
.
stackguard
=
stktop
->
oldguard
;
stktop
=
(
Stktop
*
)
g
.
stackbase
;
g
.
stackbase
=
stktop
->
oldbase
;
g
.
stackguard
=
stktop
->
oldguard
;
sp
=
stktop
->
oldsp
;
pc
=
((
uint8
**
)
sp
)[
1
];
sp
+=
16
;
// two irrelevant calls on stack - morestack, plus the call morestack made
...
...
src/runtime/runtime.c
View file @
7b454bb1
...
...
@@ -571,9 +571,14 @@ check(void)
initsig
();
}
extern
register
u
;
uint32
a
;
void
_newproc
(
byte
*
fn
,
int32
siz
,
byte
*
args
)
{
a
=
u
;
prints
(
"_newproc fn="
);
sys
·
printpointer
(
fn
);
prints
(
"; siz="
);
...
...
src/runtime/runtime.h
View file @
7b454bb1
...
...
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
* basic types
*/
...
...
@@ -61,15 +60,15 @@ struct Map
int32
unused
;
void
(
*
fun
[])(
void
);
};
typedef
struct
U
U
;
struct
U
typedef
struct
G
G
;
struct
G
{
byte
*
stackguard
;
// must not move
byte
*
stackbase
;
// must not move
U
*
ufor
;
// dbl ll of all u
U
*
ubak
;
U
*
runqfor
;
// dbl ll of runnable
U
*
runqbak
;
G
*
ufor
;
// dbl ll of all u
G
*
ubak
;
G
*
runqfor
;
// dbl ll of runnable
G
*
runqbak
;
};
typedef
struct
M
M
;
struct
M
...
...
@@ -77,13 +76,15 @@ struct M
byte
*
istackguard
;
// must not move
byte
*
istackbase
;
// must not move
};
extern
register
G
*
g
;
// R15
extern
register
M
*
m
;
// R14
/*
* global variables
*/
U
*
allu
;
M
*
allm
;
U
*
runq
;
G
*
allu
;
G
*
runq
;
/*
* defined constants
...
...
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