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

Commit f94ec73

Browse files
authored
Update Syntax column to reflect returned values.
1 parent 20a1831 commit f94ec73

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ The API definition is:
88

99
|Function | Syntax and Function | Example |
1010
|---------|---------------------|---------|
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 ();`
26-
11+
|ECALL_YIELD|`void 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|`void 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|`void 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 |`void 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 |`void 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()|`Int64 ECALL_CSRR_MTIME()`<br> 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()|`Int64 ECALL_CSRR_MCYCLE()`<br> 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()|`Int64 ECALL_CSRR_MINSTR()`<br> 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()|`Int64 ECALL_CSRR_MHPMC3()`<br> 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()|`Int64 ECALL_CSRR_MHPMC4()`<br> 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()|`Int64 ECALL_CSRR_MISA()`<br> 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()|`Int64 ECALL_CSRR_MVENDID()`<br> 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()|`Int64 ECALL_CSRR_MARCHID()`<br> 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()|`Int64 ECALL_CSRR_MIMPID()`<br> 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()|`Int64 ECALL_CSRR_MHARTID()`<br> Returns MHARTID to a variable in a zone, MHARTID is a privileged registered normally only available in M mode. |`Int64 mhardid = ECALL_CSRR_ MHARTID ();`

0 commit comments

Comments
 (0)