os-workshop

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 234d4735e49c2a246be293a4e29863926ba2085a
parent f5a30bda1c5b2fea531e640cf28082d6450b7fb0
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 14 May 2022 20:05:39 -0700

example: change stack allocation for threads examples

Diffstat:
Mexample/ex10-threads-cooperative.c | 4++--
Mexample/ex11-threads-preemptive.c | 6+++---
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/example/ex10-threads-cooperative.c b/example/ex10-threads-cooperative.c @@ -15,13 +15,13 @@ #define MEMORY_TOP (DRAM_BASE + DRAM_SIZE) -static uint8_t* next_stack = (void*) (MEMORY_TOP - 1024*1024); +static uint8_t* next_stack = (void*) (MEMORY_TOP - 4096); static uint8_t* next_heap = (void*) (DRAM_BASE + 1024*1024); void* alloc_stack(void) { void* s = next_stack; next_stack -= 8192; - memset(next_stack, 0xee, 8192); + memset(next_stack, 0xee, 4096); return s; } diff --git a/example/ex11-threads-preemptive.c b/example/ex11-threads-preemptive.c @@ -15,13 +15,13 @@ #define MEMORY_TOP (DRAM_BASE + DRAM_SIZE) -static uint8_t* next_stack = (void*) (MEMORY_TOP - 1024*1024); +static uint8_t* next_stack = (void*) (MEMORY_TOP - 4096); static uint8_t* next_heap = (void*) (DRAM_BASE + 1024*1024); void* alloc_stack(void) { void* s = next_stack; - next_stack -= 8192; - memset(next_stack, 0xee, 8192); + next_stack -= 4096; + memset(next_stack, 0xee, 4096); return s; }