annotate src/spinlock.h @ 182:d00a1d0758cb

tweak
author anatofuz
date Mon, 20 Jan 2020 17:30:08 +0900
parents 7c200a8328fa
children 3f243b59bcee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // Mutual exclusion lock.
173
7c200a8328fa fix user malloc and spinlock redefinition
kono
parents: 0
diff changeset
2 #ifndef SPINLOCK_H
0
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 struct spinlock {
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 uint locked; // Is the lock held?
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // For debugging:
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 char *name; // Name of lock.
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 struct cpu *cpu; // The cpu holding the lock.
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 uint pcs[10]; // The call stack (an array of program counters)
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // that locked the lock.
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 };
173
7c200a8328fa fix user malloc and spinlock redefinition
kono
parents: 0
diff changeset
12 #endif // SPINLOCK_H
7c200a8328fa fix user malloc and spinlock redefinition
kono
parents: 0
diff changeset
13 #define SPINLOCK_H