Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
parent
77a0a5b519
commit
fa325e9b42
1021 changed files with 5688 additions and 6193 deletions
|
|
@ -16,7 +16,7 @@ extern void setmcontext(mcontext_t*);
|
|||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
|
|
@ -48,7 +48,7 @@ extern void setmcontext(mcontext_t*);
|
|||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
|
|
@ -117,5 +117,3 @@ struct ucontext {
|
|||
stack_t uc_stack;
|
||||
int __spare__[8];
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ threadexitsall(char *msg)
|
|||
if(msg == nil)
|
||||
msg = "";
|
||||
|
||||
/*
|
||||
/*
|
||||
* Only one guy, ever, gets to run this.
|
||||
* If two guys do it, inevitably they end up
|
||||
* tripping over each other in the underlying
|
||||
|
|
@ -401,4 +401,3 @@ _threadpexit(void)
|
|||
{
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,4 +28,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
|||
va_list arg;
|
||||
|
||||
tos = (ulong*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(ulong);
|
||||
sp = tos - 16;
|
||||
sp = tos - 16;
|
||||
ucp->mc.pc = (long)func;
|
||||
ucp->mc.sp = (long)sp;
|
||||
va_start(arg, argc);
|
||||
|
|
@ -22,4 +22,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,5 +22,3 @@ swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,4 +47,3 @@ __swapcontext_ret: \n\
|
|||
clr %o0 \n\
|
||||
.size __swapcontext_ret, .-__swapcontext_ret \n\
|
||||
");
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
static int
|
||||
timefmt(Fmt *fmt)
|
||||
{
|
||||
static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
vlong ns;
|
||||
Tm tm;
|
||||
ns = nsec();
|
||||
tm = *localtime(time(0));
|
||||
return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d",
|
||||
return fmtprint(fmt, "%s %2d %02d:%02d:%02d.%03d",
|
||||
mon[tm.mon], tm.mday, tm.hour, tm.min, tm.sec,
|
||||
(int)(ns%1000000000)/1000000);
|
||||
}
|
||||
|
|
@ -246,8 +246,8 @@ startprocfn(void *v)
|
|||
|
||||
/*
|
||||
* indirect through here so that parent need not wait for child zombie
|
||||
*
|
||||
* slight race - if child exits and then another process starts before we
|
||||
*
|
||||
* slight race - if child exits and then another process starts before we
|
||||
* manage to exit, we'll be running on a freed stack.
|
||||
*/
|
||||
static int
|
||||
|
|
@ -314,7 +314,7 @@ threadexitsall(char *msg)
|
|||
if(msg == nil)
|
||||
msg = "";
|
||||
|
||||
/*
|
||||
/*
|
||||
* Only one guy, ever, gets to run this.
|
||||
* If two guys do it, inevitably they end up
|
||||
* tripping over each other in the underlying
|
||||
|
|
@ -442,7 +442,7 @@ makecontext(ucontext_t *uc, void (*fn)(void), int argc, ...)
|
|||
{
|
||||
int i, *sp;
|
||||
va_list arg;
|
||||
|
||||
|
||||
sp = (int*)uc->uc_stack.ss_sp+uc->uc_stack.ss_size/4;
|
||||
va_start(arg, argc);
|
||||
for(i=0; i<4 && i<argc; i++)
|
||||
|
|
@ -460,4 +460,3 @@ swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1 @@
|
|||
#include "Linux.c"
|
||||
|
||||
|
|
|
|||
|
|
@ -20,4 +20,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,4 +22,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,5 +28,3 @@ swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|||
setcontext(ucp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
* You have to put locks in all the channels and all the Alt
|
||||
* structures. At the beginning of an alt you have to lock all
|
||||
* the channels, but then to try to actually exec an op you
|
||||
* have to lock the other guy's alt structure, so that other
|
||||
* have to lock the other guy's alt structure, so that other
|
||||
* people aren't trying to use him in some other op at the
|
||||
* same time.
|
||||
*
|
||||
*
|
||||
* For Plan 9 apps, it's just not worth the extra effort.
|
||||
*/
|
||||
static QLock chanlock;
|
||||
|
|
@ -415,4 +415,3 @@ channbrecvul(Channel *c)
|
|||
return val;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,13 +66,13 @@ sigpass(int sig)
|
|||
kill(sigpid, sig);
|
||||
}
|
||||
|
||||
static int sigs[] =
|
||||
static int sigs[] =
|
||||
{
|
||||
SIGHUP, SIGINT, SIGQUIT, SIGILL,
|
||||
SIGTRAP, SIGABRT, SIGBUS, SIGFPE,
|
||||
SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE,
|
||||
SIGALRM, SIGTERM, SIGCHLD, SIGSTOP,
|
||||
/*SIGTSTP, SIGTTIN, SIGTTOU,*/ SIGURG,
|
||||
/*SIGTSTP, SIGTTIN, SIGTTOU,*/ SIGURG,
|
||||
SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF,
|
||||
#ifdef SIGWINCH
|
||||
SIGWINCH,
|
||||
|
|
@ -84,7 +84,7 @@ static int sigs[] =
|
|||
SIGEMT,
|
||||
#endif
|
||||
#ifdef SIGPWR
|
||||
SIGPWR,
|
||||
SIGPWR,
|
||||
#endif
|
||||
#ifdef SIGINFO
|
||||
SIGINFO,
|
||||
|
|
|
|||
|
|
@ -206,4 +206,3 @@ threadexecl(Channel *cpid, int fd[3], char *cmd, ...)
|
|||
if(pid >= 0)
|
||||
threadexits("threadexecl");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,3 @@ struct Ioproc
|
|||
char err[ERRMAX];
|
||||
Ioproc *next;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -34,4 +34,3 @@ void makecontext(ucontext_t*, void(*)(void), int, ...);
|
|||
int swapcontext(ucontext_t*, ucontext_t*);
|
||||
int _getmcontext(mcontext_t*);
|
||||
void _setmcontext(mcontext_t*);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,4 +21,3 @@ void makecontext(ucontext_t*, void(*)(void), int, ...);
|
|||
int swapcontext(ucontext_t*, ucontext_t*);
|
||||
int _getmcontext(mcontext_t*);
|
||||
void _setmcontext(mcontext_t*);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,4 +7,3 @@ threadmain(int argc, char **argv)
|
|||
{
|
||||
print("hello, world\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ threadalloc(void (*fn)(void*), void *arg, uint stack)
|
|||
t->context.uc.uc_stack.ss_size = t->stksize-64;
|
||||
#if defined(__sun__) && !defined(__MAKECONTEXT_V2_SOURCE) /* sigh */
|
||||
/* can avoid this with __MAKECONTEXT_V2_SOURCE but only on SunOS 5.9 */
|
||||
t->context.uc.uc_stack.ss_sp =
|
||||
t->context.uc.uc_stack.ss_sp =
|
||||
(char*)t->context.uc.uc_stack.ss_sp
|
||||
+t->context.uc.uc_stack.ss_size;
|
||||
#endif
|
||||
|
|
@ -164,7 +164,7 @@ _threadcreate(Proc *p, void (*fn)(void*), void *arg, uint stack)
|
|||
/* defend against bad C libraries */
|
||||
if(stack < (256<<10))
|
||||
stack = 256<<10;
|
||||
|
||||
|
||||
t = threadalloc(fn, arg, stack);
|
||||
t->proc = p;
|
||||
addthreadinproc(p, t);
|
||||
|
|
@ -228,7 +228,7 @@ threadidle(void)
|
|||
{
|
||||
int n;
|
||||
Proc *p;
|
||||
|
||||
|
||||
p = proc();
|
||||
n = p->nswitch;
|
||||
lock(&p->lock);
|
||||
|
|
@ -466,7 +466,7 @@ int
|
|||
threadid(void)
|
||||
{
|
||||
_Thread *t;
|
||||
|
||||
|
||||
t = proc()->thread;
|
||||
return t->id;
|
||||
}
|
||||
|
|
@ -534,7 +534,7 @@ static void
|
|||
threadqunlock(QLock *l, ulong pc)
|
||||
{
|
||||
_Thread *ready;
|
||||
|
||||
|
||||
lock(&l->l);
|
||||
/*print("qlock unlock %p @%#x by %p (owner %p)\n", l, pc, (*threadnow)(), l->owner); */
|
||||
if(l->owner == 0){
|
||||
|
|
@ -578,7 +578,7 @@ threadrlock(RWLock *l, int block, ulong pc)
|
|||
addthread(&l->rwaiting, (*threadnow)());
|
||||
unlock(&l->l);
|
||||
_threadswitch();
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
@ -677,7 +677,7 @@ threadrwakeup(Rendez *r, int all, ulong pc)
|
|||
if((t = r->waiting.head) == nil)
|
||||
break;
|
||||
delthread(&r->waiting, t);
|
||||
_threadready(t);
|
||||
_threadready(t);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
@ -865,7 +865,7 @@ delproc(Proc *p)
|
|||
unlock(&_threadprocslock);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* notify - for now just use the usual mechanisms
|
||||
*/
|
||||
void
|
||||
|
|
@ -901,14 +901,12 @@ threadinfo(void *v, char *s)
|
|||
fprint(2, "proc %p %s%s\n", (void*)p->osprocid, p->msg,
|
||||
p->sysproc ? " (sysproc)": "");
|
||||
for(t=p->allthreads.head; t; t=t->allnext){
|
||||
fprint(2, "\tthread %d %s: %s %s\n",
|
||||
t->id,
|
||||
t == p->thread ? "Running" :
|
||||
fprint(2, "\tthread %d %s: %s %s\n",
|
||||
t->id,
|
||||
t == p->thread ? "Running" :
|
||||
onrunqueue(p, t) ? "Ready" : "Sleeping",
|
||||
t->state, t->name);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
|
|||
/*
|
||||
* OS X before 10.5 (Leopard) does not provide
|
||||
* swapcontext nor makecontext, so we have to use our own.
|
||||
* In theory, Leopard does provide them, but when we use
|
||||
* In theory, Leopard does provide them, but when we use
|
||||
* them, they seg fault. Maybe we're using them wrong.
|
||||
* So just use our own versions, even on Leopard.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ procwait(int pid)
|
|||
Waiter me;
|
||||
Waitmsg *msg;
|
||||
int i;
|
||||
|
||||
|
||||
memset(&me, 0, sizeof me);
|
||||
me.pid = pid;
|
||||
me.r.l = &waiting.lk;
|
||||
|
||||
|
||||
qlock(&waiting.lk);
|
||||
for(i=0; i<waiting.nmsg; i++){
|
||||
if(waiting.msg[i]->pid == pid){
|
||||
|
|
|
|||
|
|
@ -40,4 +40,3 @@ void makecontext(ucontext_t*, void(*)(void), int, ...);
|
|||
int swapcontext(ucontext_t*, ucontext_t*);
|
||||
int libthread_getmcontext(mcontext_t*);
|
||||
void libthread_setmcontext(mcontext_t*);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue