Skip to content

Commit

Permalink
attempt to fix tutorial error for threads
Browse files Browse the repository at this point in the history
Signed-off-by: Birgit Brecknell <[email protected]>
  • Loading branch information
bbrcknl committed May 29, 2024
1 parent 627629a commit f464856
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tutorials/threads/threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ for your target architecture.
arg2, and arg3 respectively.

```c
/*-- filter TaskContent("threads-context-2", TaskContentType.ALL, subtask='context', completion='Hello2: arg1 0x1, arg2 0x2, arg3 0x3') -*/
seL4_UserContext regs = {0};
int error = seL4_TCB_ReadRegisters(tcb_cap_slot, 0, 0, sizeof(regs)/sizeof(seL4_Word), &regs);
ZF_LOGF_IFERR(error, "Failed to read the new thread's register set.\n");
Expand All @@ -476,9 +475,27 @@ arg2, and arg3 respectively.
ZF_LOGF_IFERR(error, "Failed to write the new thread's register set.\n"
"\tDid you write the correct number of registers? See arg4.\n");
seL4_DebugDumpScheduler();
```
/*- filter ExcludeDocs() -*/
```c
/*-- filter TaskContent("threads-context-2", TaskContentType.ALL, subtask='context', completion='Hello2: arg1 0x1, arg2 0x2, arg3 0x3') -*/
UNUSED seL4_UserContext regs = {0};
int error = seL4_TCB_ReadRegisters(tcb_cap_slot, 0, 0, sizeof(regs)/sizeof(seL4_Word), &regs);
ZF_LOGF_IFERR(error, "Failed to write the new thread's register set.\n"
"\tDid you write the correct number of registers? See arg4.\n");
sel4utils_arch_init_local_context((void*)new_thread,
(void *)1, (void *)2, (void *)3,
(void *)tcb_stack_top, &regs);
error = seL4_TCB_WriteRegisters(tcb_cap_slot, 0, 0, sizeof(regs)/sizeof(seL4_Word), &regs);
ZF_LOGF_IFERR(error, "Failed to write the new thread's register set.\n"
"\tDid you write the correct number of registers? See arg4.\n");
/*-- endfilter -*/
```
/*-- endfilter -*/

<details markdown='1'>
<summary style="display:list-item"><em>Quick solution</em></summary>

Expand Down

0 comments on commit f464856

Please sign in to comment.