diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-18 16:55:12 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-07-26 12:14:18 +0200 |
commit | 724bca75dfd24ab12ae3f25c2ffb10037c14e7d3 (patch) | |
tree | ae055a4734ebd348de58d05d3fe11690bd3727b0 /kern | |
parent | ba8d965054a5496d4346444d1e29e7c9cdd9ab67 (diff) |
yyy more general locks, crashes, maybe b/c interrupt handler
Diffstat (limited to 'kern')
-rw-r--r-- | kern/processor.c | 2 | ||||
-rw-r--r-- | kern/processor.h | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/kern/processor.c b/kern/processor.c index 48e9273..a7c3fbf 100644 --- a/kern/processor.c +++ b/kern/processor.c @@ -155,7 +155,7 @@ void pset_init( simple_lock_init(&pset->ref_lock); queue_init(&pset->all_psets); pset->active = FALSE; - simple_lock_init(&pset->lock); + pset_lock_init (pset); pset->pset_self = IP_NULL; pset->pset_name_self = IP_NULL; pset->max_priority = BASEPRI_USER; diff --git a/kern/processor.h b/kern/processor.h index b81526c..69ddf87 100644 --- a/kern/processor.h +++ b/kern/processor.h @@ -68,7 +68,7 @@ struct processor_set { decl_simple_lock_data(, ref_lock) /* lock for ref count */ queue_chain_t all_psets; /* link for all_psets */ boolean_t active; /* is pset in use */ - decl_simple_lock_data(, lock) /* lock for everything else */ + struct lock lock; /* lock for everything else */ struct ipc_port * pset_self; /* port for operations */ struct ipc_port * pset_name_self; /* port for information */ int max_priority; /* maximum priority */ @@ -216,8 +216,9 @@ extern processor_t processor_ptr[NCPUS]; /* Useful lock macros */ -#define pset_lock(pset) simple_lock(&(pset)->lock) -#define pset_unlock(pset) simple_unlock(&(pset)->lock) +#define pset_lock_init(pset) lock_init(&(pset)->lock, FALSE) +#define pset_lock(pset) lock_write(&(pset)->lock) +#define pset_unlock(pset) lock_write_done(&(pset)->lock) #define pset_ref_lock(pset) simple_lock(&(pset)->ref_lock) #define pset_ref_unlock(pset) simple_unlock(&(pset)->ref_lock) |