annotate 3rdparty/packages/cc/sources/process.a @ 867:0198655f2552

Added sources
author boisy
date Thu, 16 Jan 2003 19:54:21 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
867
0198655f2552 Added sources
boisy
parents:
diff changeset
1 *
0198655f2552 Added sources
boisy
parents:
diff changeset
2 * Process system calls
0198655f2552 Added sources
boisy
parents:
diff changeset
3 *
0198655f2552 Added sources
boisy
parents:
diff changeset
4 use ..../defs/os9defs.a
0198655f2552 Added sources
boisy
parents:
diff changeset
5 psect process_a,0,0,2,0,0
0198655f2552 Added sources
boisy
parents:
diff changeset
6
0198655f2552 Added sources
boisy
parents:
diff changeset
7 * kill(pid,signal)
0198655f2552 Added sources
boisy
parents:
diff changeset
8 kill: lda 3,s get process id
0198655f2552 Added sources
boisy
parents:
diff changeset
9 ldb 5,s get signal number
0198655f2552 Added sources
boisy
parents:
diff changeset
10 os9 F$SEND
0198655f2552 Added sources
boisy
parents:
diff changeset
11 lbra _sysret
0198655f2552 Added sources
boisy
parents:
diff changeset
12
0198655f2552 Added sources
boisy
parents:
diff changeset
13 * wait(status)
0198655f2552 Added sources
boisy
parents:
diff changeset
14 wait: clra clear these so
0198655f2552 Added sources
boisy
parents:
diff changeset
15 clrb signal can be detected
0198655f2552 Added sources
boisy
parents:
diff changeset
16 os9 F$WAIT
0198655f2552 Added sources
boisy
parents:
diff changeset
17 lbcs _os9err
0198655f2552 Added sources
boisy
parents:
diff changeset
18
0198655f2552 Added sources
boisy
parents:
diff changeset
19 ldx 2,s
0198655f2552 Added sources
boisy
parents:
diff changeset
20 beq wait10
0198655f2552 Added sources
boisy
parents:
diff changeset
21 stb 1,x
0198655f2552 Added sources
boisy
parents:
diff changeset
22 clr ,x
0198655f2552 Added sources
boisy
parents:
diff changeset
23
0198655f2552 Added sources
boisy
parents:
diff changeset
24 wait10 tfr a,b
0198655f2552 Added sources
boisy
parents:
diff changeset
25 clra
0198655f2552 Added sources
boisy
parents:
diff changeset
26 rts
0198655f2552 Added sources
boisy
parents:
diff changeset
27
0198655f2552 Added sources
boisy
parents:
diff changeset
28 * setpr(pid,priority)
0198655f2552 Added sources
boisy
parents:
diff changeset
29 setpr: lda 3,s get process id
0198655f2552 Added sources
boisy
parents:
diff changeset
30 ldb 5,s get priority
0198655f2552 Added sources
boisy
parents:
diff changeset
31 os9 F$SPRIOR call os9
0198655f2552 Added sources
boisy
parents:
diff changeset
32 lbra _sysret
0198655f2552 Added sources
boisy
parents:
diff changeset
33
0198655f2552 Added sources
boisy
parents:
diff changeset
34 * chain(modname,paramsize,paramp,type,language,datasize)
0198655f2552 Added sources
boisy
parents:
diff changeset
35 *
0198655f2552 Added sources
boisy
parents:
diff changeset
36 * This call can never return to the caller. The stack pointer
0198655f2552 Added sources
boisy
parents:
diff changeset
37 * must be adjusted to point into the direct page which, in general,
0198655f2552 Added sources
boisy
parents:
diff changeset
38 * contains global variables belonging to the program. OS-9 will
0198655f2552 Added sources
boisy
parents:
diff changeset
39 * therefore overwrite these values making the state of the program
0198655f2552 Added sources
boisy
parents:
diff changeset
40 * undefined after the call.
0198655f2552 Added sources
boisy
parents:
diff changeset
41 * In addition, we cannot report the error here because the module
0198655f2552 Added sources
boisy
parents:
diff changeset
42 * name string could easily be in the direct page.
0198655f2552 Added sources
boisy
parents:
diff changeset
43 chain:
0198655f2552 Added sources
boisy
parents:
diff changeset
44 leau 0,s save the sp
0198655f2552 Added sources
boisy
parents:
diff changeset
45 leas $ff,y set the stack into the direct page
0198655f2552 Added sources
boisy
parents:
diff changeset
46
0198655f2552 Added sources
boisy
parents:
diff changeset
47 ldx 2,u get the module name pointer
0198655f2552 Added sources
boisy
parents:
diff changeset
48 ldy 4,u get the parameter area size
0198655f2552 Added sources
boisy
parents:
diff changeset
49 lda 9,u get the type
0198655f2552 Added sources
boisy
parents:
diff changeset
50 lsla
0198655f2552 Added sources
boisy
parents:
diff changeset
51 lsla
0198655f2552 Added sources
boisy
parents:
diff changeset
52 lsla
0198655f2552 Added sources
boisy
parents:
diff changeset
53 lsla
0198655f2552 Added sources
boisy
parents:
diff changeset
54 ora 11,u and the language
0198655f2552 Added sources
boisy
parents:
diff changeset
55 ldb 13,u get the data size
0198655f2552 Added sources
boisy
parents:
diff changeset
56 ldu 6,u get the parameter area beginning address
0198655f2552 Added sources
boisy
parents:
diff changeset
57
0198655f2552 Added sources
boisy
parents:
diff changeset
58 os9 F$CHAIN go do it
0198655f2552 Added sources
boisy
parents:
diff changeset
59
0198655f2552 Added sources
boisy
parents:
diff changeset
60 * return here indicates an error
0198655f2552 Added sources
boisy
parents:
diff changeset
61 os9 F$EXIT error code already in b reg.
0198655f2552 Added sources
boisy
parents:
diff changeset
62
0198655f2552 Added sources
boisy
parents:
diff changeset
63 * os9fork(modname,paramsize,paramp,language,type,datasize)
0198655f2552 Added sources
boisy
parents:
diff changeset
64 os9fork: pshs y,u save environment
0198655f2552 Added sources
boisy
parents:
diff changeset
65
0198655f2552 Added sources
boisy
parents:
diff changeset
66 ldx 6,s get module name
0198655f2552 Added sources
boisy
parents:
diff changeset
67 ldy 8,s get parameter area size
0198655f2552 Added sources
boisy
parents:
diff changeset
68 ldu 10,s get parameter area pointer
0198655f2552 Added sources
boisy
parents:
diff changeset
69 lda 13,s get language
0198655f2552 Added sources
boisy
parents:
diff changeset
70 ora 15,s and type
0198655f2552 Added sources
boisy
parents:
diff changeset
71 ldb 17,s get data size
0198655f2552 Added sources
boisy
parents:
diff changeset
72
0198655f2552 Added sources
boisy
parents:
diff changeset
73 os9 F$FORK call os9
0198655f2552 Added sources
boisy
parents:
diff changeset
74
0198655f2552 Added sources
boisy
parents:
diff changeset
75 * return here indicates either error or parent
0198655f2552 Added sources
boisy
parents:
diff changeset
76 puls y,u restore environment
0198655f2552 Added sources
boisy
parents:
diff changeset
77 lbcs _os9err
0198655f2552 Added sources
boisy
parents:
diff changeset
78 tfr a,b make an integer out of it
0198655f2552 Added sources
boisy
parents:
diff changeset
79 clra
0198655f2552 Added sources
boisy
parents:
diff changeset
80 * NOTE: the x register return value (points past name) is ignored
0198655f2552 Added sources
boisy
parents:
diff changeset
81 rts
0198655f2552 Added sources
boisy
parents:
diff changeset
82 endsect