many minor mods: name changes
This commit is contained in:
parent
7f9fd963fd
commit
36e934583a
|
@ -9,9 +9,9 @@
|
|||
Version: $Header$
|
||||
*/
|
||||
|
||||
extern char **_argv, **_environ;
|
||||
extern int _argc;
|
||||
unsigned int Arguments_Argc;
|
||||
extern char **argv, **environ;
|
||||
extern int argc;
|
||||
unsigned int _Arguments__Argc;
|
||||
|
||||
static char *
|
||||
findname(s1, s2)
|
||||
|
@ -42,27 +42,27 @@ scopy(src, dst, max)
|
|||
return i + 1;
|
||||
}
|
||||
|
||||
Arguments()
|
||||
_Arguments_()
|
||||
{
|
||||
Arguments_Argc = _argc;
|
||||
_Arguments__Argc = argc;
|
||||
}
|
||||
|
||||
unsigned
|
||||
_Arguments_Argv(n, argument, l, u, s)
|
||||
_Arguments__Argv(n, argument, l, u, s)
|
||||
unsigned int u;
|
||||
char *argument;
|
||||
{
|
||||
|
||||
if (n >= _argc) return 0;
|
||||
return scopy(_argv[n], argument, u);
|
||||
if (n >= argc) return 0;
|
||||
return scopy(argv[n], argument, u);
|
||||
}
|
||||
|
||||
unsigned
|
||||
_Arguments_GetEnv(name, nn, nu, ns, value, l, u, s)
|
||||
_Arguments__GetEnv(name, nn, nu, ns, value, l, u, s)
|
||||
char *name, *value;
|
||||
unsigned int nu, u;
|
||||
{
|
||||
register char **p = _environ;
|
||||
register char **p = environ;
|
||||
register char *v = 0;
|
||||
|
||||
while (*p && !(v = findname(name, *p++))) {
|
||||
|
|
|
@ -74,14 +74,14 @@
|
|||
; - procedure instance identifier (PROC)
|
||||
; and returns the old traphandler.
|
||||
|
||||
exa _handler
|
||||
exa handler
|
||||
exp $SIG
|
||||
pro $SIG, 0
|
||||
lae _handler
|
||||
lae handler
|
||||
loi EM_PSIZE
|
||||
lal PROC
|
||||
loi EM_PSIZE
|
||||
lae _handler
|
||||
lae handler
|
||||
sti EM_PSIZE
|
||||
ret EM_PSIZE
|
||||
end ?
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
;
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
|
||||
; _LtoUset is called for set displays containing { expr1 .. expr2 }.
|
||||
; LtoUset is called for set displays containing { expr1 .. expr2 }.
|
||||
; It has six parameters, of which the caller must pop five:
|
||||
; - The set in which bits must be set.
|
||||
; - the lower bound of the set type.
|
||||
|
@ -25,8 +25,8 @@
|
|||
#define USETSIZ 2*EM_WSIZE
|
||||
#define LWB EM_WSIZE
|
||||
#define UPB 0
|
||||
exp $_LtoUset
|
||||
pro $_LtoUset,0
|
||||
exp $LtoUset
|
||||
pro $LtoUset,0
|
||||
lal SETBASE ; address of initial set
|
||||
lol SETSIZE
|
||||
los EM_WSIZE ; load initial set
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Author: Ceriel J.H. Jacobs
|
||||
Version: $Header$
|
||||
*/
|
||||
_StringAssign(dstsiz, srcsiz, dstaddr, srcaddr)
|
||||
StringAssign(dstsiz, srcsiz, dstaddr, srcaddr)
|
||||
register char *dstaddr, *srcaddr;
|
||||
{
|
||||
while (srcsiz > 0) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
#ifndef NOFLOAT
|
||||
double
|
||||
_absd(i)
|
||||
absd(i)
|
||||
double i;
|
||||
{
|
||||
return i >= 0 ? i : -i;
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
; Version: $Header$
|
||||
;
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $_absf
|
||||
pro $_absf,0
|
||||
exp $absf
|
||||
pro $absf,0
|
||||
mes 5
|
||||
mes 9,8
|
||||
lal 0
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Version: $Header$
|
||||
*/
|
||||
|
||||
_absi(i)
|
||||
absi(i)
|
||||
{
|
||||
return i >= 0 ? i : -i;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Version: $Header$
|
||||
*/
|
||||
long
|
||||
_absl(i)
|
||||
absl(i)
|
||||
long i;
|
||||
{
|
||||
return i >= 0 ? i : -i;
|
||||
|
|
|
@ -15,7 +15,7 @@ typedef unsigned pcnt;
|
|||
typedef unsigned long pcnt;
|
||||
#endif
|
||||
|
||||
_blockmove(siz, dst, src)
|
||||
blockmove(siz, dst, src)
|
||||
pcnt siz;
|
||||
register char *dst, *src;
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ static struct errm {
|
|||
|
||||
extern exit();
|
||||
|
||||
_catch(trapno)
|
||||
catch(trapno)
|
||||
int trapno;
|
||||
{
|
||||
register struct errm *ep = &errors[0];
|
||||
|
@ -64,7 +64,7 @@ _catch(trapno)
|
|||
while (ep->errno != trapno && ep->errmes != 0) ep++;
|
||||
if (p = ep->errmes) {
|
||||
while (*p) p++;
|
||||
_Traps_Message(ep->errmes, 0, (int) (p - ep->errmes), 1);
|
||||
_Traps__Message(ep->errmes, 0, (int) (p - ep->errmes), 1);
|
||||
}
|
||||
else {
|
||||
int i = trapno;
|
||||
|
@ -81,8 +81,8 @@ _catch(trapno)
|
|||
while (i /= 10);
|
||||
while (s > buf) *p++ = *--s;
|
||||
*p = 0;
|
||||
_Traps_Message(q, 0, (int) (p - q), 1);
|
||||
_Traps__Message(q, 0, (int) (p - q), 1);
|
||||
}
|
||||
if (trapno != M2_FORCH) exit(trapno);
|
||||
SIG(_catch);
|
||||
SIG(catch);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ static struct descr *descrs[10];
|
|||
static struct descr **ppdescr = descrs;
|
||||
|
||||
char *
|
||||
_new_stackptr(pdescr, a)
|
||||
new_stackptr(pdescr, a)
|
||||
register struct descr *pdescr;
|
||||
{
|
||||
pcnt size = (((pdescr->highminlow + 1) * pdescr->size +
|
||||
|
@ -45,7 +45,7 @@ _new_stackptr(pdescr, a)
|
|||
else return (char *) &a + size;
|
||||
}
|
||||
|
||||
_copy_array(p, a)
|
||||
copy_array(p, a)
|
||||
register char *p;
|
||||
{
|
||||
register char *q;
|
||||
|
|
|
@ -34,7 +34,7 @@ CallAtEnd(p)
|
|||
return 1;
|
||||
}
|
||||
|
||||
_halt()
|
||||
halt()
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -13,35 +13,35 @@
|
|||
|
||||
#define STACKSIZE 2048 /* maximum stack size for a coroutine */
|
||||
|
||||
exa _handler
|
||||
exa _environ
|
||||
exa _argv
|
||||
exa _argc
|
||||
exa _CurrentProcess
|
||||
exa _MainProcess
|
||||
exa _StackBase
|
||||
exa _MainLB
|
||||
exa _StackSize
|
||||
exp $_catch
|
||||
exa handler
|
||||
exa environ
|
||||
exa argv
|
||||
exa argc
|
||||
exa CurrentProcess
|
||||
exa MainProcess
|
||||
exa StackBase
|
||||
exa MainLB
|
||||
exa StackSize
|
||||
exp $catch
|
||||
inp $trap_handler
|
||||
|
||||
_handler
|
||||
con $_catch
|
||||
_environ
|
||||
handler
|
||||
con $catch
|
||||
environ
|
||||
bss EM_PSIZE,0,0
|
||||
_argv
|
||||
argv
|
||||
bss EM_PSIZE,0,0
|
||||
_argc
|
||||
argc
|
||||
bss EM_WSIZE,0,0
|
||||
_CurrentProcess
|
||||
CurrentProcess
|
||||
bss EM_PSIZE,0,0
|
||||
_MainProcess
|
||||
MainProcess
|
||||
bss EM_PSIZE,0,0
|
||||
_StackBase
|
||||
StackBase
|
||||
bss EM_PSIZE,0,0
|
||||
_MainLB
|
||||
MainLB
|
||||
bss EM_PSIZE,0,0
|
||||
_StackSize
|
||||
StackSize
|
||||
bss EM_WSIZE,0,0
|
||||
mainroutine
|
||||
bss 2*EM_PSIZE,0,0
|
||||
|
@ -50,50 +50,50 @@ mainroutine
|
|||
pro $m_a_i_n, STACKSIZE
|
||||
|
||||
loc STACKSIZE
|
||||
ste _StackSize
|
||||
ste StackSize
|
||||
|
||||
lor 0
|
||||
lae _MainLB
|
||||
lae MainLB
|
||||
sti EM_PSIZE
|
||||
|
||||
lal -EM_WSIZE
|
||||
adp EM_WSIZE
|
||||
lae _StackBase
|
||||
lae StackBase
|
||||
sti EM_PSIZE
|
||||
|
||||
lae mainroutine
|
||||
adp 2*EM_PSIZE
|
||||
dup EM_PSIZE
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
sti EM_PSIZE
|
||||
lae _MainProcess
|
||||
lae MainProcess
|
||||
sti EM_PSIZE
|
||||
|
||||
lal EM_WSIZE+EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
lae _environ ; save environment pointer
|
||||
lae environ ; save environment pointer
|
||||
sti EM_PSIZE
|
||||
|
||||
lal EM_WSIZE
|
||||
loi EM_PSIZE
|
||||
lae _argv ; save argument pointer
|
||||
lae argv ; save argument pointer
|
||||
sti EM_PSIZE
|
||||
|
||||
lol 0
|
||||
ste _argc ; save argument count
|
||||
ste argc ; save argument count
|
||||
|
||||
lpi $trap_handler
|
||||
sig
|
||||
asp EM_PSIZE
|
||||
cal $_M2M
|
||||
cal $_halt
|
||||
cal $__M2M_
|
||||
cal $halt
|
||||
loc 0 ; should not get here
|
||||
ret EM_WSIZE
|
||||
end
|
||||
|
||||
pro $trap_handler,0
|
||||
lol 0 ; trap number
|
||||
lae _handler
|
||||
lae handler
|
||||
loi EM_PSIZE
|
||||
cai
|
||||
lpi $trap_handler
|
||||
|
|
|
@ -17,7 +17,7 @@ typedef unsigned pcnt;
|
|||
typedef long pcnt;
|
||||
#endif
|
||||
|
||||
_load(siz, addr, p)
|
||||
load(siz, addr, p)
|
||||
register char *addr;
|
||||
register pcnt siz;
|
||||
{
|
||||
|
|
|
@ -8,10 +8,20 @@
|
|||
Author: Ceriel J.H. Jacobs
|
||||
Version: $Header$
|
||||
*/
|
||||
_stackprio(n)
|
||||
|
||||
static unsigned prio;
|
||||
|
||||
stackprio(n)
|
||||
unsigned n;
|
||||
{
|
||||
unsigned old = prio;
|
||||
|
||||
if (n > prio) prio = n;
|
||||
return old;
|
||||
}
|
||||
|
||||
_unstackprio()
|
||||
unstackprio(n)
|
||||
unsigned n;
|
||||
{
|
||||
prio = n;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ typedef unsigned pcnt;
|
|||
typedef long pcnt;
|
||||
#endif
|
||||
|
||||
_store(siz, addr, p)
|
||||
store(siz, addr, p)
|
||||
register char *addr;
|
||||
register pcnt siz;
|
||||
{
|
||||
|
|
|
@ -57,18 +57,18 @@
|
|||
; place in the stack. Therefore, in the runtime startoff a piece of the
|
||||
; stack is allocated for coroutines.
|
||||
|
||||
exp $_SYSTEM_NEWPROCESS
|
||||
exp $_SYSTEM_TRANSFER
|
||||
inp $_ChkSize
|
||||
exp $_SYSTEM__NEWPROCESS
|
||||
exp $_SYSTEM__TRANSFER
|
||||
inp $ChkSize
|
||||
|
||||
pro $_SYSTEM_NEWPROCESS, 0
|
||||
pro $_SYSTEM__NEWPROCESS, 0
|
||||
|
||||
; This procedure only initializes the area used for saving the stack.
|
||||
; Its definition is:
|
||||
; PROCEDURE NEWPROCESS(P:PROC; A:ADDRESS; n:CARDINAL; VAR p1:ADDRESS);
|
||||
|
||||
lol 2*EM_PSIZE ; size of frame (n)
|
||||
cal $_ChkSize
|
||||
cal $ChkSize
|
||||
asp EM_WSIZE
|
||||
lfr EM_WSIZE
|
||||
sil EM_PSIZE ; store size in area (indicated by A)
|
||||
|
@ -89,10 +89,10 @@
|
|||
ret 0
|
||||
end 0
|
||||
|
||||
_target
|
||||
target
|
||||
bss EM_PSIZE, 0, 0
|
||||
|
||||
pro $_SYSTEM_TRANSFER, 0
|
||||
pro $_SYSTEM__TRANSFER, 0
|
||||
|
||||
; This procedure does all the hard work.
|
||||
; It must save the current environment, and restore the one to which the
|
||||
|
@ -107,7 +107,7 @@ _target
|
|||
loi EM_PSIZE
|
||||
loi EM_PSIZE ; address of target coroutine
|
||||
dup EM_PSIZE
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
dup EM_PSIZE
|
||||
lal 0
|
||||
|
@ -119,69 +119,69 @@ _target
|
|||
asp EM_PSIZE
|
||||
ret 0 ; just return
|
||||
1
|
||||
lae _target
|
||||
sti EM_PSIZE ; store it in _target
|
||||
lae target
|
||||
sti EM_PSIZE ; store it in target
|
||||
|
||||
; Now, we save the current stack
|
||||
; Use local base from main program
|
||||
|
||||
lor 0 ; load LB
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
adp -2*EM_PSIZE
|
||||
sti EM_PSIZE ; save it
|
||||
lor 1 ; load SP
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
adp -EM_PSIZE
|
||||
sti EM_PSIZE ; save it
|
||||
; Now, we must find a stack we can temporarily use.
|
||||
; Just take the one from the main program.
|
||||
lae _MainProcess
|
||||
lae MainProcess
|
||||
loi EM_PSIZE
|
||||
adp -EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
str 1 ; temporary stackpointer
|
||||
|
||||
lae _MainLB
|
||||
lae MainLB
|
||||
loi EM_PSIZE
|
||||
str 0
|
||||
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
lae _MainProcess
|
||||
lae MainProcess
|
||||
loi EM_PSIZE
|
||||
cmp
|
||||
zeq *2
|
||||
|
||||
lae _StackBase
|
||||
lae StackBase
|
||||
loi EM_PSIZE
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE-EM_WSIZE
|
||||
loi EM_WSIZE ; get size
|
||||
ngi EM_WSIZE
|
||||
ads EM_WSIZE ; gives source address
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE ; destination address
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE-EM_WSIZE
|
||||
loi EM_WSIZE
|
||||
bls EM_WSIZE ; copy
|
||||
|
||||
2
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
dup EM_PSIZE
|
||||
lae _CurrentProcess
|
||||
lae CurrentProcess
|
||||
sti EM_PSIZE ; store target process descriptor in _CurrentProcess
|
||||
lae _MainProcess
|
||||
lae MainProcess
|
||||
loi EM_PSIZE
|
||||
cmp
|
||||
zeq *4
|
||||
; Now check if the coroutine was called before
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
|
@ -189,45 +189,45 @@ _target
|
|||
cmp
|
||||
zeq *5
|
||||
; No, it was'nt
|
||||
lae _StackBase
|
||||
lae StackBase
|
||||
loi EM_PSIZE
|
||||
str 1 ; new stack pointer
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
zer EM_PSIZE
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE
|
||||
sti EM_PSIZE
|
||||
cai
|
||||
loc 0
|
||||
cal $_exit
|
||||
cal $exit
|
||||
ret 0
|
||||
5
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE ; push source address
|
||||
lae _StackBase
|
||||
lae StackBase
|
||||
loi EM_PSIZE ; subtract size from this and we have the destination address
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE-EM_WSIZE
|
||||
loi EM_WSIZE
|
||||
ngi EM_WSIZE
|
||||
ads EM_WSIZE ; got it
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -3*EM_PSIZE-EM_WSIZE
|
||||
loi EM_WSIZE
|
||||
bls EM_WSIZE
|
||||
4
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -2*EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
str 0 ; restore LB
|
||||
lae _target
|
||||
lae target
|
||||
loi EM_PSIZE
|
||||
adp -EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
|
@ -235,13 +235,13 @@ _target
|
|||
ret 0
|
||||
end 0
|
||||
|
||||
pro $_ChkSize, 0
|
||||
pro $ChkSize, 0
|
||||
lol 0
|
||||
loc 3*EM_PSIZE+EM_WSIZE
|
||||
sbi EM_WSIZE
|
||||
dup EM_WSIZE
|
||||
stl 0
|
||||
loe _StackSize
|
||||
loe StackSize
|
||||
cmu EM_WSIZE
|
||||
zle *1
|
||||
loc M2_TOOLARGE ; trap number for "stack size too large"
|
||||
|
|
Loading…
Reference in a new issue