summaryrefslogtreecommitdiff
path: root/src/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-08 15:21:41 -0700
committerRuss Cox <rsc@golang.org>2009-05-08 15:21:41 -0700
commit1ea895d9a458c9e4a91993924fcd39ce7f1dcabe (patch)
tree5b8c80c41b4110b57cef1a0945350c2caf7557e2 /src/runtime/proc.c
parent206ea17d5fe6ad6d6492afe73ec2d72ce399a3fd (diff)
downloadgolang-1ea895d9a458c9e4a91993924fcd39ce7f1dcabe.tar.gz
move things out of sys into os and runtime
R=r OCL=28569 CL=28573
Diffstat (limited to 'src/runtime/proc.c')
-rw-r--r--src/runtime/proc.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/runtime/proc.c b/src/runtime/proc.c
index 3875916e7..d52adf94c 100644
--- a/src/runtime/proc.c
+++ b/src/runtime/proc.c
@@ -129,7 +129,7 @@ initdone(void)
}
void
-sys·Goexit(void)
+goexit(void)
{
if(debug > 1){
lock(&debuglock);
@@ -137,7 +137,7 @@ sys·Goexit(void)
unlock(&debuglock);
}
g->status = Gmoribund;
- sys·Gosched();
+ gosched();
}
void
@@ -431,7 +431,7 @@ scheduler(void)
case Gmoribund:
gp->status = Gdead;
if(--sched.gcount == 0)
- sys_Exit(0);
+ exit(0);
break;
}
if(gp->readyonstop){
@@ -461,7 +461,7 @@ scheduler(void)
// before running g again. If g->status is Gmoribund,
// kills off g.
void
-sys·Gosched(void)
+gosched(void)
{
if(g == m->g0)
throw("gosched of g0");
@@ -529,7 +529,7 @@ sys·exitsyscall(void)
// The scheduler will ready g and put this m to sleep.
// When the scheduler takes g awa from m,
// it will undo the sched.mcpu++ above.
- sys·Gosched();
+ gosched();
}
/*
@@ -784,7 +784,7 @@ sys·newproc(int32 siz, byte* fn, byte* arg0)
mcpy(sp, (byte*)&arg0, siz);
sp -= sizeof(uintptr);
- *(byte**)sp = (byte*)sys·Goexit;
+ *(byte**)sp = (byte*)goexit;
sp -= sizeof(uintptr); // retpc used by gogo
newg->sched.SP = sp;
@@ -839,3 +839,21 @@ sys·deferreturn(int32 arg0)
jmpdefer(sp);
}
+void
+runtime·Breakpoint(void)
+{
+ breakpoint();
+}
+
+void
+runtime·Goexit(void)
+{
+ goexit();
+}
+
+void
+runtime·Gosched(void)
+{
+ gosched();
+}
+