--- Gnu-Mach/kern/lock.c 2020/09/02 04:36:57 1.1 +++ Gnu-Mach/kern/lock.c 2020/09/02 04:45:15 1.1.1.2 @@ -34,14 +34,15 @@ * Locking primitives implementation */ -#include -#include +#include +#include #include #include #include #if MACH_KDB #include +#include #include #endif @@ -103,7 +104,7 @@ boolean_t simple_lock_try(simple_lock_t #endif /* NCPUS > 1 */ #if NCPUS > 1 -int lock_wait_time = 100; +static int lock_wait_time = 100; #else /* NCPUS > 1 */ /* @@ -111,7 +112,7 @@ int lock_wait_time = 100; * thought something magical would happen to the * want_write bit while we are executing. */ -int lock_wait_time = 0; +static int lock_wait_time = 0; #endif /* NCPUS > 1 */ #if MACH_SLOCKS && NCPUS == 1 @@ -161,8 +162,8 @@ void simple_lock( info = &simple_locks_info[simple_locks_taken++]; info->l = l; /* XXX we want our return address, if possible */ -#ifdef i386 - info->ra = *((unsigned int *)&l - 1); +#if defined(__i386__) + info->ra = *((unsigned long *)&l - 1); #endif /* i386 */ } @@ -179,8 +180,8 @@ boolean_t simple_lock_try( info = &simple_locks_info[simple_locks_taken++]; info->l = l; /* XXX we want our return address, if possible */ -#ifdef i386 - info->ra = *((unsigned int *)&l - 1); +#if defined(__i386__) + info->ra = *((unsigned long *)&l - 1); #endif /* i386 */ return TRUE; @@ -222,7 +223,7 @@ void lock_init( lock_t l, boolean_t can_sleep) { - bzero((char *)l, sizeof(lock_data_t)); + memset(l, 0, sizeof(lock_data_t)); simple_lock_init(&l->interlock); l->want_write = FALSE; l->want_upgrade = FALSE; @@ -621,7 +622,7 @@ void db_show_all_slocks(void) info = &simple_locks_info[i]; db_printf("%d: ", i); db_printsym(info->l, DB_STGY_ANY); -#if i386 +#if defined(__i386__) db_printf(" locked by "); db_printsym(info->ra, DB_STGY_PROC); #endif