提交 2cd67e63 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Make spinlock.name a const char*

上级 76c882f1
...@@ -131,7 +131,7 @@ cv_wakeup(struct condvar *cv) ...@@ -131,7 +131,7 @@ cv_wakeup(struct condvar *cv)
} }
void void
initcondvar(struct condvar *cv, char *n) initcondvar(struct condvar *cv, const char *n)
{ {
initlock(&cv->lock, n); initlock(&cv->lock, n);
LIST_INIT(&cv->waiters); LIST_INIT(&cv->waiters);
......
...@@ -45,7 +45,7 @@ void cgaputc(int c); ...@@ -45,7 +45,7 @@ void cgaputc(int c);
extern u64 ticks; extern u64 ticks;
extern struct spinlock tickslock; extern struct spinlock tickslock;
extern struct condvar cv_ticks; extern struct condvar cv_ticks;
void initcondvar(struct condvar *, char *); void initcondvar(struct condvar *, const char *);
void cv_sleep(struct condvar *cv, struct spinlock*); void cv_sleep(struct condvar *cv, struct spinlock*);
void cv_sleepto(struct condvar *cv, struct spinlock*, u64); void cv_sleepto(struct condvar *cv, struct spinlock*, u64);
void cv_wakeup(struct condvar *cv); void cv_wakeup(struct condvar *cv);
...@@ -266,7 +266,7 @@ void acquire(struct spinlock*); ...@@ -266,7 +266,7 @@ void acquire(struct spinlock*);
int tryacquire(struct spinlock*); int tryacquire(struct spinlock*);
void getcallerpcs(void*, uptr*); void getcallerpcs(void*, uptr*);
int holding(struct spinlock*); int holding(struct spinlock*);
void initlock(struct spinlock*, char*); void initlock(struct spinlock*, const char*);
void release(struct spinlock*); void release(struct spinlock*);
void pushcli(void); void pushcli(void);
void popcli(void); void popcli(void);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "mtrace.h" #include "mtrace.h"
void void
initlock(struct spinlock *lk, char *name) initlock(struct spinlock *lk, const char *name)
{ {
#if SPINLOCK_DEBUG #if SPINLOCK_DEBUG
lk->name = name; lk->name = name;
......
...@@ -8,7 +8,7 @@ struct spinlock { ...@@ -8,7 +8,7 @@ struct spinlock {
#if SPINLOCK_DEBUG #if SPINLOCK_DEBUG
// For debugging: // For debugging:
char *name; // Name of lock. const char *name; // Name of lock.
struct cpu *cpu; // The cpu holding the lock. struct cpu *cpu; // The cpu holding the lock.
uptr pcs[10]; // The call stack (an array of program counters) uptr pcs[10]; // The call stack (an array of program counters)
// that locked the lock. // that locked the lock.
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论