diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2001-02-12 03:15:43 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2001-02-12 03:15:43 +0000 |
commit | 0e619322a9e8aa86df25ef55281aba3279da1265 (patch) | |
tree | d7132de0a2f38556e014c6c77df4168775ca7808 | |
parent | 0f9122defa0efed05ca8290ac5f06abe91ee0a85 (diff) | |
download | FreeBSD-src-0e619322a9e8aa86df25ef55281aba3279da1265.zip FreeBSD-src-0e619322a9e8aa86df25ef55281aba3279da1265.tar.gz |
Change all instances of `CURPROC' and `CURTHD' to `curproc,' in order
to stay consistent.
Requested by: bde
-rw-r--r-- | sys/kern/kern_mutex.c | 20 | ||||
-rw-r--r-- | sys/kern/subr_turnstile.c | 20 | ||||
-rw-r--r-- | sys/kern/subr_witness.c | 20 | ||||
-rw-r--r-- | sys/sys/mutex.h | 30 |
4 files changed, 45 insertions, 45 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index aec8b2c..6d7b103 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -287,7 +287,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) { int rval; - MPASS(CURPROC != NULL); + MPASS(curproc != NULL); /* * _mtx_trylock does not accept MTX_NOSWITCH option. @@ -295,7 +295,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) KASSERT((opts & MTX_NOSWITCH) == 0, ("mtx_trylock() called with invalid option flag(s) %d", opts)); - rval = _obtain_lock(m, CURTHD); + rval = _obtain_lock(m, curproc); #ifdef WITNESS if (rval && m->mtx_witness != NULL) { @@ -325,7 +325,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) void _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line) { - struct proc *p = CURPROC; + struct proc *p = curproc; if ((m->mtx_lock & MTX_FLAGMASK) == (uintptr_t)p) { m->mtx_recurse++; @@ -473,7 +473,7 @@ _mtx_lock_spin(struct mtx *m, int opts, u_int mtx_intr, const char *file, CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); for (;;) { - if (_obtain_lock(m, CURPROC)) + if (_obtain_lock(m, curproc)) break; while (m->mtx_lock != MTX_UNOWNED) { @@ -511,7 +511,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) struct mtx *m1; int pri; - p = CURPROC; + p = curproc; MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line); if (mtx_recursed(m)) { @@ -987,7 +987,7 @@ witness_destroy(struct mtx *m) { struct mtx *m1; struct proc *p; - p = CURPROC; + p = curproc; LIST_FOREACH(m1, &p->p_heldmtx, mtx_held) { if (m1 == m) { LIST_REMOVE(m, mtx_held); @@ -1072,7 +1072,7 @@ witness_enter(struct mtx *m, int flags, const char *file, int line) if (witness_cold || m->mtx_witness == NULL || panicstr) return; w = m->mtx_witness; - p = CURPROC; + p = curproc; if (flags & MTX_SPIN) { if ((m->mtx_flags & MTX_SPIN) == 0) @@ -1256,7 +1256,7 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line) w->w_line = line; m->mtx_line = line; m->mtx_file = file; - p = CURPROC; + p = curproc; MPASS(m->mtx_held.le_prev == NULL); LIST_INSERT_HEAD(&p->p_heldmtx, (struct mtx*)m, mtx_held); } @@ -1315,7 +1315,7 @@ witness_sleep(int check_only, struct mtx *mtx, const char *file, int line) int n = 0; KASSERT(!witness_cold, ("%s: witness_cold\n", __FUNCTION__)); - p = CURPROC; + p = curproc; LIST_FOREACH(m, &p->p_heldmtx, mtx_held) { if (m == mtx) continue; @@ -1643,7 +1643,7 @@ witness_list(struct proc *p) DB_SHOW_COMMAND(mutexes, db_witness_list) { - witness_list(CURPROC); + witness_list(curproc); } DB_SHOW_COMMAND(witness, db_witness_display) diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index aec8b2c..6d7b103 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -287,7 +287,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) { int rval; - MPASS(CURPROC != NULL); + MPASS(curproc != NULL); /* * _mtx_trylock does not accept MTX_NOSWITCH option. @@ -295,7 +295,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) KASSERT((opts & MTX_NOSWITCH) == 0, ("mtx_trylock() called with invalid option flag(s) %d", opts)); - rval = _obtain_lock(m, CURTHD); + rval = _obtain_lock(m, curproc); #ifdef WITNESS if (rval && m->mtx_witness != NULL) { @@ -325,7 +325,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) void _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line) { - struct proc *p = CURPROC; + struct proc *p = curproc; if ((m->mtx_lock & MTX_FLAGMASK) == (uintptr_t)p) { m->mtx_recurse++; @@ -473,7 +473,7 @@ _mtx_lock_spin(struct mtx *m, int opts, u_int mtx_intr, const char *file, CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); for (;;) { - if (_obtain_lock(m, CURPROC)) + if (_obtain_lock(m, curproc)) break; while (m->mtx_lock != MTX_UNOWNED) { @@ -511,7 +511,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) struct mtx *m1; int pri; - p = CURPROC; + p = curproc; MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line); if (mtx_recursed(m)) { @@ -987,7 +987,7 @@ witness_destroy(struct mtx *m) { struct mtx *m1; struct proc *p; - p = CURPROC; + p = curproc; LIST_FOREACH(m1, &p->p_heldmtx, mtx_held) { if (m1 == m) { LIST_REMOVE(m, mtx_held); @@ -1072,7 +1072,7 @@ witness_enter(struct mtx *m, int flags, const char *file, int line) if (witness_cold || m->mtx_witness == NULL || panicstr) return; w = m->mtx_witness; - p = CURPROC; + p = curproc; if (flags & MTX_SPIN) { if ((m->mtx_flags & MTX_SPIN) == 0) @@ -1256,7 +1256,7 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line) w->w_line = line; m->mtx_line = line; m->mtx_file = file; - p = CURPROC; + p = curproc; MPASS(m->mtx_held.le_prev == NULL); LIST_INSERT_HEAD(&p->p_heldmtx, (struct mtx*)m, mtx_held); } @@ -1315,7 +1315,7 @@ witness_sleep(int check_only, struct mtx *mtx, const char *file, int line) int n = 0; KASSERT(!witness_cold, ("%s: witness_cold\n", __FUNCTION__)); - p = CURPROC; + p = curproc; LIST_FOREACH(m, &p->p_heldmtx, mtx_held) { if (m == mtx) continue; @@ -1643,7 +1643,7 @@ witness_list(struct proc *p) DB_SHOW_COMMAND(mutexes, db_witness_list) { - witness_list(CURPROC); + witness_list(curproc); } DB_SHOW_COMMAND(witness, db_witness_display) diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index aec8b2c..6d7b103 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -287,7 +287,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) { int rval; - MPASS(CURPROC != NULL); + MPASS(curproc != NULL); /* * _mtx_trylock does not accept MTX_NOSWITCH option. @@ -295,7 +295,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) KASSERT((opts & MTX_NOSWITCH) == 0, ("mtx_trylock() called with invalid option flag(s) %d", opts)); - rval = _obtain_lock(m, CURTHD); + rval = _obtain_lock(m, curproc); #ifdef WITNESS if (rval && m->mtx_witness != NULL) { @@ -325,7 +325,7 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line) void _mtx_lock_sleep(struct mtx *m, int opts, const char *file, int line) { - struct proc *p = CURPROC; + struct proc *p = curproc; if ((m->mtx_lock & MTX_FLAGMASK) == (uintptr_t)p) { m->mtx_recurse++; @@ -473,7 +473,7 @@ _mtx_lock_spin(struct mtx *m, int opts, u_int mtx_intr, const char *file, CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); for (;;) { - if (_obtain_lock(m, CURPROC)) + if (_obtain_lock(m, curproc)) break; while (m->mtx_lock != MTX_UNOWNED) { @@ -511,7 +511,7 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) struct mtx *m1; int pri; - p = CURPROC; + p = curproc; MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line); if (mtx_recursed(m)) { @@ -987,7 +987,7 @@ witness_destroy(struct mtx *m) { struct mtx *m1; struct proc *p; - p = CURPROC; + p = curproc; LIST_FOREACH(m1, &p->p_heldmtx, mtx_held) { if (m1 == m) { LIST_REMOVE(m, mtx_held); @@ -1072,7 +1072,7 @@ witness_enter(struct mtx *m, int flags, const char *file, int line) if (witness_cold || m->mtx_witness == NULL || panicstr) return; w = m->mtx_witness; - p = CURPROC; + p = curproc; if (flags & MTX_SPIN) { if ((m->mtx_flags & MTX_SPIN) == 0) @@ -1256,7 +1256,7 @@ witness_try_enter(struct mtx *m, int flags, const char *file, int line) w->w_line = line; m->mtx_line = line; m->mtx_file = file; - p = CURPROC; + p = curproc; MPASS(m->mtx_held.le_prev == NULL); LIST_INSERT_HEAD(&p->p_heldmtx, (struct mtx*)m, mtx_held); } @@ -1315,7 +1315,7 @@ witness_sleep(int check_only, struct mtx *mtx, const char *file, int line) int n = 0; KASSERT(!witness_cold, ("%s: witness_cold\n", __FUNCTION__)); - p = CURPROC; + p = curproc; LIST_FOREACH(m, &p->p_heldmtx, mtx_held) { if (m == mtx) continue; @@ -1643,7 +1643,7 @@ witness_list(struct proc *p) DB_SHOW_COMMAND(mutexes, db_witness_list) { - witness_list(CURPROC); + witness_list(curproc); } DB_SHOW_COMMAND(witness, db_witness_display) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 0557512..5f5f64b 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -250,32 +250,32 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); * mtx_recursed(m) returns non-zero if the lock `m' is presently recursed. */ #define mtx_lock(m) do { \ - MPASS(CURPROC != NULL); \ - _get_sleep_lock((m), CURTHD, 0); \ + MPASS(curproc != NULL); \ + _get_sleep_lock((m), curproc, 0); \ CTR5(KTR_LOCK, STR_mtx_lock_slp, (m)->mtx_description, (m), \ (m)->mtx_recurse, __FILE__, __LINE__); \ WITNESS_ENTER((m), (m)->mtx_flags, __FILE__, __LINE__); \ } while (0) #define mtx_lock_spin(m) do { \ - MPASS(CURPROC != NULL); \ - _get_spin_lock((m), CURTHD, 0); \ + MPASS(curproc != NULL); \ + _get_spin_lock((m), curproc, 0); \ CTR5(KTR_LOCK, STR_mtx_lock_spn, (m)->mtx_description, (m), \ (m)->mtx_recurse, __FILE__, __LINE__); \ WITNESS_ENTER((m), (m)->mtx_flags, __FILE__, __LINE__); \ } while (0) #define mtx_unlock(m) do { \ - MPASS(CURPROC != NULL); \ + MPASS(curproc != NULL); \ WITNESS_EXIT((m), (m)->mtx_flags, __FILE__, __LINE__); \ mtx_assert((m), MA_OWNED); \ - _rel_sleep_lock((m), CURTHD, 0); \ + _rel_sleep_lock((m), curproc, 0); \ CTR5(KTR_LOCK, STR_mtx_unlock_slp, (m)->mtx_description, (m), \ (m)->mtx_recurse, __FILE__, __LINE__); \ } while (0) #define mtx_unlock_spin(m) do { \ - MPASS(CURPROC != NULL); \ + MPASS(curproc != NULL); \ WITNESS_EXIT((m), (m)->mtx_flags, __FILE__, __LINE__); \ mtx_assert((m), MA_OWNED); \ _rel_spin_lock((m)); \ @@ -284,8 +284,8 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); } while (0) #define mtx_lock_flags(m, opts) do { \ - MPASS(CURPROC != NULL); \ - _get_sleep_lock((m), CURTHD, (opts)); \ + MPASS(curproc != NULL); \ + _get_sleep_lock((m), curproc, (opts)); \ if (((opts) & MTX_QUIET) == 0) \ CTR5(KTR_LOCK, STR_mtx_lock_slp, \ (m)->mtx_description, (m), (m)->mtx_recurse, \ @@ -295,8 +295,8 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); } while (0) #define mtx_lock_spin_flags(m, opts) do { \ - MPASS(CURPROC != NULL); \ - _get_spin_lock((m), CURTHD, (opts)); \ + MPASS(curproc != NULL); \ + _get_spin_lock((m), curproc, (opts)); \ if (((opts) & MTX_QUIET) == 0) \ CTR5(KTR_LOCK, STR_mtx_lock_spn, \ (m)->mtx_description, (m), (m)->mtx_recurse, \ @@ -306,11 +306,11 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); } while (0) #define mtx_unlock_flags(m, opts) do { \ - MPASS(CURPROC != NULL); \ + MPASS(curproc != NULL); \ WITNESS_EXIT((m), ((m)->mtx_flags | (opts)), __FILE__, \ __LINE__); \ mtx_assert((m), MA_OWNED); \ - _rel_sleep_lock((m), CURTHD, (opts)); \ + _rel_sleep_lock((m), curproc, (opts)); \ if (((opts) & MTX_QUIET) == 0) \ CTR5(KTR_LOCK, STR_mtx_unlock_slp, \ (m)->mtx_description, (m), (m)->mtx_recurse, \ @@ -323,7 +323,7 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); * check will be optimized out. */ #define mtx_unlock_spin_flags(m, opts) do { \ - MPASS(CURPROC != NULL); \ + MPASS(curproc != NULL); \ WITNESS_EXIT((m), ((m)->mtx_flags | (opts)), __FILE__, \ __LINE__); \ mtx_assert((m), MA_OWNED); \ @@ -340,7 +340,7 @@ int _mtx_trylock(struct mtx *m, int opts, const char *file, int line); #define mtx_trylock_flags(m, opts) \ _mtx_trylock((m), (opts), __FILE__, __LINE__) -#define mtx_owned(m) (((m)->mtx_lock & MTX_FLAGMASK) == (uintptr_t)CURTHD) +#define mtx_owned(m) (((m)->mtx_lock & MTX_FLAGMASK) == (uintptr_t)curproc) #define mtx_recursed(m) ((m)->mtx_recurse != 0) |