Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
fe725c00
Commit
fe725c00
authored
May 15, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Make all variables used across getcontext volatile.
From-SVN: r187549
parent
eb606595
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
libgo/runtime/proc.c
+17
-10
No files found.
libgo/runtime/proc.c
View file @
fe725c00
...
@@ -1322,7 +1322,7 @@ __go_go(void (*fn)(void*), void* arg)
...
@@ -1322,7 +1322,7 @@ __go_go(void (*fn)(void*), void* arg)
{
{
byte
*
sp
;
byte
*
sp
;
size_t
spsize
;
size_t
spsize
;
G
*
volatile
newg
;
// volatile to avoid longjmp warning
G
*
newg
;
schedlock
();
schedlock
();
...
@@ -1363,19 +1363,26 @@ __go_go(void (*fn)(void*), void* arg)
...
@@ -1363,19 +1363,26 @@ __go_go(void (*fn)(void*), void* arg)
if
(
sp
==
nil
)
if
(
sp
==
nil
)
runtime_throw
(
"nil g->stack0"
);
runtime_throw
(
"nil g->stack0"
);
getcontext
(
&
newg
->
context
);
{
newg
->
context
.
uc_stack
.
ss_sp
=
sp
;
// Avoid warnings about variables clobbered by
// longjmp.
byte
*
volatile
vsp
=
sp
;
size_t
volatile
vspsize
=
spsize
;
G
*
volatile
vnewg
=
newg
;
getcontext
(
&
vnewg
->
context
);
vnewg
->
context
.
uc_stack
.
ss_sp
=
vsp
;
#ifdef MAKECONTEXT_STACK_TOP
#ifdef MAKECONTEXT_STACK_TOP
newg
->
context
.
uc_stack
.
ss_sp
+=
spsize
;
vnewg
->
context
.
uc_stack
.
ss_sp
+=
v
spsize
;
#endif
#endif
newg
->
context
.
uc_stack
.
ss_size
=
spsize
;
vnewg
->
context
.
uc_stack
.
ss_size
=
v
spsize
;
makecontext
(
&
newg
->
context
,
kickoff
,
0
);
makecontext
(
&
v
newg
->
context
,
kickoff
,
0
);
newprocreadylocked
(
newg
);
newprocreadylocked
(
v
newg
);
schedunlock
();
schedunlock
();
return
newg
;
return
v
newg
;
//printf(" goid=%d\n", newg->goid);
}
}
}
// Put on gfree list. Sched must be locked.
// Put on gfree list. Sched must be locked.
...
...
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