Clean up AMD64 memory management code, remove dependency on pd.lock

This commit is contained in:
2026-01-27 19:03:03 +01:00
parent 8bda300f6a
commit a3b62ebd3d
14 changed files with 104 additions and 178 deletions

View File

@@ -8,6 +8,8 @@
#define MUTEX 2000
/* __thread char letter; */
void app_thread1 (void);
int spawn (void (*fn) (void)) {
@@ -23,26 +25,30 @@ int spawn (void (*fn) (void)) {
void app_main (void) {
mutex_create (MUTEX);
/* letter = 'd'; */
spawn (&app_thread1);
for (;;) {
mutex_lock (MUTEX);
/* mutex_lock (MUTEX); */
for (int i = 0; i < 3; i++)
test ('a');
/* for (int i = 0; i < 3; i++) */
/* test (letter); */
mutex_unlock (MUTEX);
/* mutex_unlock (MUTEX); */
}
}
void app_thread1 (void) {
/* letter = 'c'; */
for (;;) {
mutex_lock (MUTEX);
/* mutex_lock (MUTEX); */
for (int i = 0; i < 3; i++)
test ('b');
/* for (int i = 0; i < 3; i++) */
/* test (letter); */
mutex_unlock (MUTEX);
/* mutex_unlock (MUTEX); */
}
quit ();