view src/spinlock.h @ 383:3f243b59bcee

move global variable in console.cbc to kernel_context
author anatofuz
date Mon, 20 Jul 2020 16:42:45 +0900
parents 7c200a8328fa
children
line wrap: on
line source

// Mutual exclusion lock.
#ifndef SPINLOCK_H
struct spinlock {
    uint        locked;     // Is the lock held?

    // For debugging:
    char        *name;      // Name of lock.
    struct cpu  *cpu;       // The cpu holding the lock.
    uint        pcs[10];    // The call stack (an array of program counters)
    // that locked the lock.
};
#define SPINLOCK_H
#endif // SPINLOCK_H