Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 20a1831

Browse files
authored
Update README.md formating
1 parent 01f1eb7 commit 20a1831

File tree

1 file changed

+17
-83
lines changed

1 file changed

+17
-83
lines changed

README.md

Lines changed: 17 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -6,87 +6,21 @@ The design point of the MultiZone nanoKernel is to be minimalist - additional se
66

77
The API definition is:
88

9-
Function Syntax and function Example
10-
ECALL_YIELD ECALL_YIELD() ECALL_YIELD();
11-
Indicates to the nanoKernel scheduler
12-
that the Zone has nothing pressing to
13-
do and causes the nanoKernel to immediately
14-
move to the next Zone in context.
9+
|Function | Syntax and Function | Example |
10+
|---------|---------------------|---------|
11+
|ECALL_YIELD|`ECALL_YIELD();`<br> Indicates to the nanoKernel scheduler that the Zone has nothing pressing to do and causes the nanoKernel to immediately move to the next Zone in context.| `ECALL_YIELD();`<br>In the case of a three zone implementation with a tick time of 10ms, the maximum time to come back to context is 20ms, faster if the other zones Yield as well.|
12+
|ECALL_SEND|`ECALL_SEND([Zone #], [0-3][Int]);`<br> Send transmits a message from the current zone to the [Zone #]; the message size is an array of [4] integers and the nanoKernel manages transmission with no shared memory.|`ECALL_SEND(1, {201, 0, 0 ,0});`<br>Sends an array to Zone 1 of {201, 0, 0, 0}|
13+
|ECALL_RECV|`ECALL_RECV[Zone #], [0-3][int]);`<br>Checks the mailbox of the current Zone for a message from the listed Zone #, if a message exists it copies it to the array structure provided.| `int msg[4]={0,0,0,0};`<br>`ECALL_RECV(1, msg);`<br>If a message exists in the mailbox from zone 1, it copies it to msg, otherwise msg value is unchanged.|
14+
|ECALL_TRP_VECT |`ECALL_TRP_VECT([Exception Code], [Trap Handler])`<br>Registers a handler against a trap generated by anauthorized instructions; the TRAP #s are defined in the RISC-V Privileged Architectures definition V1.1, Table 3.6 Interrupt 0 types. https://riscv.org/specifications/privileged-isa/ |`ECALL_TRP_VECT(0x0, trap_0x0_handler);`<br>Where trap_0x0_handler is registered at the User level of privilege with:<br>`Void trap_0x0_handler(void)__attribute__((interrupt("user")));`<br>`void trap_0x0_handler(void){`<br>` // Your handler code here`<br>`}`|
15+
|ECALL_IRQ_VECT |`ECALL_IRQ_VECT([Interrupt #], [Trap Handler])`<br>Registers a handler for an interrupt that has been assigned to a Zone in the multizone.cfg file. <br> When an interrupt occurs, the nanoKernel will immediately pull the zone assigned to that interrupt into context and execute the registered interrupt handler. |`ECALL_IRQ_VECT(11, button_0_handler);`<br>Where button_0_handler is a registered at the user level of privilege with:<br>`void button_1_handler(void)__attribute__((interrupt("user")));`<br>`void button_1_handler(void){`<br>` // interrupt handler here`<br>`}`|
16+
|ECALL_CSRR_MTIME()| Returns MTIME to a variable in a zone, MTIME is a privileged registered normally only available in M mode. |`Int64 mtime = ECALL_CSRR_MTIME();`|
17+
|ECALL_CSRR_MCYCLE()| Returns MCYCLE to a variable in a zone, MCYCLE is a privileged registered normally only available in M mode. |`Int64 mcycle = ECALL_CSRR_MCYCLE();`
18+
|ECALL_CSRR_MINSTR()| Returns MINSTR to a variable in a zone, MINSTR is a privileged registered normally only available in M mode. |`Int64 minstr = ECALL_CSRR_MINSTR();`
19+
|ECALL_CSRR_MHPMC3()| Returns MHPMC3 to a variable in a zone, MHPMC3 is a privileged registered normally only available in M mode. |`Int64 mhpmc3 = ECALL_CSRR_MHPMC3();`
20+
|ECALL_CSRR_MHPMC4()| Returns MHPMC4 to a variable in a zone, MHPMC4 is a privileged registered normally only available in M mode. |`Int64 mhpmc3 = ECALL_CSRR_MHPMC4();`
21+
|ECALL_CSRR_MISA()| Returns MISA to a variable in a zone, MISA is a privileged registered normally only available in M mode. |`Int64 misa = ECALL_CSRR_MISA();`
22+
|ECALL_CSRR_MVENDID()| Returns MVENDID to a variable in a zone, MVENDID is a privileged registered normally only available in M mode. |`Int64 misa = ECALL_CSRR_MVENDID();`
23+
|ECALL_CSRR_MARCHID()| Returns MARCHID to a variable in a zone, MARCHID is a privileged registered normally only available in M mode. |`Int64 marchid = ECALL_CSRR_MARCHID();`
24+
|ECALL_CSRR_MIMPID()| Returns MIMPID to a variable in a zone, MIMPID is a privileged registered normally only available in M mode. |`Int64 mimpid = ECALL_CSRR_ MIMPID ();`
25+
|ECALL_CSRR_MHARTID()| Returns MHARTID to a variable in a zone, MHARTID is a privileged registered normally only available in M mode. |`Int64 mhardid = ECALL_CSRR_ MHARTID ();`
1526

16-
In the case of a three zone implementation with
17-
a tick time of 10ms, the maximum time to come
18-
back to context is 20ms, faster if the other
19-
zones Yield as well.
20-
21-
ECALL_SEND ECALL_SEND([Zone #], [0-3][Int]) ECALL_SEND(1, {201, 0, 0 ,0});
22-
Send transmits a message from the current zone Sends an array to Zone 1 of {201, 0, 0, 0}
23-
to the [Zone #]; the message size is an array
24-
of [4] integers and the nanoKernel manages
25-
transmission with no shared memory.
26-
27-
ECALL_RECV ECALL_RECV[Zone #], [0-3][int]); int msg[4]={0,0,0,0};
28-
Checks the mailbox of the current Zone for a ECALL_RECV(1, msg);
29-
message from the listed Zone #, if a message
30-
exists it copies it to the array structure
31-
provided.
32-
33-
If a message exists in the mailbox from zone 1,
34-
it copies it to msg, otherwise msg value is
35-
unchanged.
36-
37-
ECALL_TRP_VECT ECALL_TRP_VECT([Exception Code], [Trap Handler]) ECALL_TRP_VECT(0x0, trap_0x0_handler);
38-
Registers a handler against a trap generated by Where trap_0x0_handler is registered at the
39-
unauthorized instructions; the TRAP #s are defined User level of privilege with:
40-
in the RISC-V Privileged Architectures definition Void trap_0x0_handler(void)__attribute__((interrupt("user")));
41-
V1.1, Table 3.6 Interrupt 0 types. void trap_0x0_handler(void){
42-
https://riscv.org/specifications/privileged-isa/ // Your handler code here
43-
}
44-
45-
ECALL_IRQ_VECT ECALL_IRQ_VECT([Interrupt #], [Trap Handler]) ECALL_IRQ_VECT(11, button_0_handler);
46-
Registers a handler for an interrupt that has Where button_0_handler is registered at
47-
been assigned to a Zone in the multizone.cfg file. the user level of privilege with:
48-
void button_1_handler(void)__attribute__((interrupt("user")));
49-
When an interrupt occurs, the nanoKernel will void button_1_handler(void){
50-
immediately pull the zone assigned to that // interrupt handler here
51-
interrupt into context and execute the registered }
52-
interrupt handler.
53-
54-
ECALL_CSRR_MTIME() Returns MTIME to a variable in a zone, MTIME Int64 mtime = ECALL_CSRR_MTIME();
55-
is a privileged registered normally only
56-
available in M mode.
57-
58-
ECALL_CSRR_MCYCLE() Returns MCYCLE to a variable in a zone, MCYCLE Int64 mcycle = ECALL_CSRR_MCYCLE();
59-
is a privileged registered normally only
60-
available in M mode.
61-
62-
ECALL_CSRR_MINSTR() Returns MINSTR to a variable in a zone, MINSTR Int64 minstr = ECALL_CSRR_MINSTR();
63-
is a privileged registered normally only
64-
available in M mode.
65-
66-
ECALL_CSRR_MHPMC3() Returns MHPMC3 to a variable in a zone, MHPMC3 Int64 mhpmc3 = ECALL_CSRR_MHPMC3();
67-
is a privileged registered normally only available
68-
in M mode.
69-
70-
ECALL_CSRR_MHPMC4() Returns MHPMC4 to a variable in a zone, MHPMC4 Int64 mhpmc3 = ECALL_CSRR_MHPMC4();
71-
is a privileged registered normally only available
72-
in M mode.
73-
74-
ECALL_CSRR_MISA() Returns MISA to a variable in a zone, MISA is a Int64 misa = ECALL_CSRR_MISA();
75-
privileged registered normally only available in
76-
M mode.
77-
78-
ECALL_CSRR_MVENDID() Returns MVENDID to a variable in a zone, MVENDID Int64 misa = ECALL_CSRR_MVENDID();
79-
is a privileged registered normally only available
80-
in M mode.
81-
82-
ECALL_CSRR_MARCHID() Returns MARCHID to a variable in a zone, MARCHID Int64 marchid = ECALL_CSRR_MARCHID();
83-
is a privileged registered normally only available
84-
in M mode.
85-
86-
ECALL_CSRR_MIMPID() Returns MIMPID to a variable in a zone, MIMPID is Int64 mimpid = ECALL_CSRR_ MIMPID();
87-
a privileged registered normally only available
88-
in M mode.
89-
90-
ECALL_CSRR_MHARTID() Returns MHARTID to a variable in a zone, MHARTID Int64 mhardid = ECALL_CSRR_ MHARTID();
91-
is a privileged registered normally only available
92-
in M mode.

0 commit comments

Comments
 (0)