diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-04-27 19:52:34 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-04-27 19:52:34 -0400 |
commit | af6eeb156c7da47ff5df03a3da04432c8ac4460c (patch) | |
tree | fd141359332b95dcb2260cbf3704c70c32f96e68 /litmus/locking.c | |
parent | 52056e94a94517e250f7f4e36e7470a4b002404e (diff) |
fix minor bugs. there is still a bug in GEDF PAI.
Diffstat (limited to 'litmus/locking.c')
-rw-r--r-- | litmus/locking.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/litmus/locking.c b/litmus/locking.c index 48b548a61f63..cb11c04ed0d4 100644 --- a/litmus/locking.c +++ b/litmus/locking.c | |||
@@ -282,6 +282,8 @@ static long do_litmus_dgl_lock(dgl_wait_state_t *dgl_wait) | |||
282 | 282 | ||
283 | dgl_wait->nr_remaining = dgl_wait->size; | 283 | dgl_wait->nr_remaining = dgl_wait->size; |
284 | 284 | ||
285 | TRACE_CUR("Locking DGL with size %d\n", dgl_wait->size); | ||
286 | |||
285 | // try to acquire each lock. enqueue (non-blocking) if it is unavailable. | 287 | // try to acquire each lock. enqueue (non-blocking) if it is unavailable. |
286 | for(i = 0; i < dgl_wait->size; ++i) { | 288 | for(i = 0; i < dgl_wait->size; ++i) { |
287 | struct litmus_lock *l = dgl_wait->locks[i]; | 289 | struct litmus_lock *l = dgl_wait->locks[i]; |
@@ -339,7 +341,7 @@ static long do_litmus_dgl_lock(dgl_wait_state_t *dgl_wait) | |||
339 | } | 341 | } |
340 | 342 | ||
341 | TRACE_CUR("Didn't have to suspend after all, but calling schedule() anyway.\n"); | 343 | TRACE_CUR("Didn't have to suspend after all, but calling schedule() anyway.\n"); |
342 | BUG(); | 344 | //BUG(); |
343 | } | 345 | } |
344 | 346 | ||
345 | raw_spin_unlock_irqrestore(dgl_lock, irqflags); | 347 | raw_spin_unlock_irqrestore(dgl_lock, irqflags); |
@@ -357,14 +359,14 @@ all_acquired: | |||
357 | return 0; | 359 | return 0; |
358 | } | 360 | } |
359 | 361 | ||
360 | //static int supports_dgl(struct litmus_lock *l) | 362 | static int supports_dgl(struct litmus_lock *l) |
361 | //{ | 363 | { |
362 | // struct litmus_lock_ops* ops = l->ops; | 364 | struct litmus_lock_ops* ops = l->ops; |
363 | // | 365 | |
364 | // return (ops->dgl_lock && | 366 | return (ops->dgl_lock && |
365 | // ops->is_owner && | 367 | ops->is_owner && |
366 | // ops->enable_priority); | 368 | ops->enable_priority); |
367 | //} | 369 | } |
368 | 370 | ||
369 | asmlinkage long sys_litmus_dgl_lock(void* __user usr_dgl_ods, int dgl_size) | 371 | asmlinkage long sys_litmus_dgl_lock(void* __user usr_dgl_ods, int dgl_size) |
370 | { | 372 | { |
@@ -393,11 +395,11 @@ asmlinkage long sys_litmus_dgl_lock(void* __user usr_dgl_ods, int dgl_size) | |||
393 | struct od_table_entry *entry = get_entry_for_od(dgl_ods[i]); | 395 | struct od_table_entry *entry = get_entry_for_od(dgl_ods[i]); |
394 | if(entry && is_lock(entry)) { | 396 | if(entry && is_lock(entry)) { |
395 | dgl_wait_state.locks[i] = get_lock(entry); | 397 | dgl_wait_state.locks[i] = get_lock(entry); |
396 | // if(!supports_dgl(dgl_wait_state.locks[i])) { | 398 | if(!supports_dgl(dgl_wait_state.locks[i])) { |
397 | // TRACE_CUR("Lock %d does not support all required DGL operations.\n", | 399 | TRACE_CUR("Lock %d does not support all required DGL operations.\n", |
398 | // dgl_wait_state.locks[i]->ident); | 400 | dgl_wait_state.locks[i]->ident); |
399 | // goto out; | 401 | goto out; |
400 | // } | 402 | } |
401 | } | 403 | } |
402 | else { | 404 | else { |
403 | TRACE_CUR("Invalid lock identifier\n"); | 405 | TRACE_CUR("Invalid lock identifier\n"); |
@@ -468,11 +470,11 @@ asmlinkage long sys_litmus_dgl_unlock(void* __user usr_dgl_ods, int dgl_size) | |||
468 | entry = get_entry_for_od(dgl_ods[i]); | 470 | entry = get_entry_for_od(dgl_ods[i]); |
469 | if(entry && is_lock(entry)) { | 471 | if(entry && is_lock(entry)) { |
470 | dgl_locks[i] = get_lock(entry); | 472 | dgl_locks[i] = get_lock(entry); |
471 | // if(!supports_dgl(dgl_locks[i])) { | 473 | if(!supports_dgl(dgl_locks[i])) { |
472 | // TRACE_CUR("Lock %d does not support all required DGL operations.\n", | 474 | TRACE_CUR("Lock %d does not support all required DGL operations.\n", |
473 | // dgl_locks[i]->ident); | 475 | dgl_locks[i]->ident); |
474 | // goto out; | 476 | goto out; |
475 | // } | 477 | } |
476 | } | 478 | } |
477 | else { | 479 | else { |
478 | TRACE_CUR("Invalid lock identifier\n"); | 480 | TRACE_CUR("Invalid lock identifier\n"); |