diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-21 19:34:47 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-21 19:34:47 +0200 |
commit | a2952398e5de8746a761a59686619d08d376bce3 (patch) | |
tree | df2373bb1119468873c667624769455c36dc3786 /kern/lock.c | |
parent | ba1b3afd50913473f3036a63b4a82d7ba5c42009 (diff) | |
parent | 92e98a7f4d4fa75b286a067e1d1caef514fccb0d (diff) |
Merge branch 'master' into master-gdb_stubs
Diffstat (limited to 'kern/lock.c')
-rw-r--r-- | kern/lock.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/kern/lock.c b/kern/lock.c index 44d4448e..3c74fec8 100644 --- a/kern/lock.c +++ b/kern/lock.c @@ -133,7 +133,7 @@ unsigned int simple_locks_taken = 0; struct simple_locks_info { simple_lock_t l; - unsigned int ra; + void *ra; } simple_locks_info[NSLINFO]; void check_simple_locks(void) @@ -161,10 +161,8 @@ void simple_lock( info = &simple_locks_info[simple_locks_taken++]; info->l = l; - /* XXX we want our return address, if possible */ -#if defined(__i386__) - info->ra = *((unsigned long *)&l - 1); -#endif /* i386 */ + info->ra = + __builtin_extract_return_addr (__builtin_return_address (0)); } boolean_t simple_lock_try( @@ -179,10 +177,8 @@ boolean_t simple_lock_try( info = &simple_locks_info[simple_locks_taken++]; info->l = l; - /* XXX we want our return address, if possible */ -#if defined(__i386__) - info->ra = *((unsigned long *)&l - 1); -#endif /* i386 */ + info->ra = + __builtin_extract_return_addr (__builtin_return_address (0)); return TRUE; } @@ -250,9 +246,9 @@ void lock_sleepable( */ void lock_write( - register lock_t l) + lock_t l) { - register int i; + int i; check_simple_locks(); simple_lock(&l->interlock); @@ -308,7 +304,7 @@ void lock_write( } void lock_done( - register lock_t l) + lock_t l) { simple_lock(&l->interlock); @@ -340,9 +336,9 @@ void lock_done( } void lock_read( - register lock_t l) + lock_t l) { - register int i; + int i; check_simple_locks(); simple_lock(&l->interlock); @@ -387,9 +383,9 @@ void lock_read( * Returns TRUE if the upgrade *failed*. */ boolean_t lock_read_to_write( - register lock_t l) + lock_t l) { - register int i; + int i; check_simple_locks(); simple_lock(&l->interlock); @@ -443,7 +439,7 @@ boolean_t lock_read_to_write( } void lock_write_to_read( - register lock_t l) + lock_t l) { simple_lock(&l->interlock); @@ -474,7 +470,7 @@ void lock_write_to_read( */ boolean_t lock_try_write( - register lock_t l) + lock_t l) { simple_lock(&l->interlock); @@ -513,7 +509,7 @@ boolean_t lock_try_write( */ boolean_t lock_try_read( - register lock_t l) + lock_t l) { simple_lock(&l->interlock); @@ -547,7 +543,7 @@ boolean_t lock_try_read( * Returns FALSE if the upgrade *failed*. */ boolean_t lock_try_read_to_write( - register lock_t l) + lock_t l) { check_simple_locks(); simple_lock(&l->interlock); |