clang-format
This commit is contained in:
@@ -30,11 +30,9 @@
|
||||
#ifndef _CPU_H_
|
||||
#define _CPU_H_
|
||||
|
||||
|
||||
#include <spinlock.h>
|
||||
#include <threadlist.h>
|
||||
#include <machine/vm.h> /* for TLBSHOOTDOWN_MAX */
|
||||
|
||||
#include <machine/vm.h> /* for TLBSHOOTDOWN_MAX */
|
||||
|
||||
/*
|
||||
* Per-cpu structure
|
||||
@@ -47,51 +45,51 @@
|
||||
*/
|
||||
|
||||
struct cpu {
|
||||
/*
|
||||
* Fixed after allocation.
|
||||
*/
|
||||
struct cpu *c_self; /* Canonical address of this struct */
|
||||
unsigned c_number; /* This cpu's cpu number */
|
||||
unsigned c_hardware_number; /* Hardware-defined cpu number */
|
||||
/*
|
||||
* Fixed after allocation.
|
||||
*/
|
||||
struct cpu *c_self; /* Canonical address of this struct */
|
||||
unsigned c_number; /* This cpu's cpu number */
|
||||
unsigned c_hardware_number; /* Hardware-defined cpu number */
|
||||
|
||||
/*
|
||||
* Accessed only by this cpu.
|
||||
*/
|
||||
struct thread *c_curthread; /* Current thread on cpu */
|
||||
struct threadlist c_zombies; /* List of exited threads */
|
||||
unsigned c_hardclocks; /* Counter of hardclock() calls */
|
||||
unsigned c_spinlocks; /* Counter of spinlocks held */
|
||||
/*
|
||||
* Accessed only by this cpu.
|
||||
*/
|
||||
struct thread *c_curthread; /* Current thread on cpu */
|
||||
struct threadlist c_zombies; /* List of exited threads */
|
||||
unsigned c_hardclocks; /* Counter of hardclock() calls */
|
||||
unsigned c_spinlocks; /* Counter of spinlocks held */
|
||||
|
||||
/*
|
||||
* Accessed by other cpus.
|
||||
* Protected by the runqueue lock.
|
||||
*/
|
||||
bool c_isidle; /* True if this cpu is idle */
|
||||
struct threadlist c_runqueue; /* Run queue for this cpu */
|
||||
struct spinlock c_runqueue_lock;
|
||||
/*
|
||||
* Accessed by other cpus.
|
||||
* Protected by the runqueue lock.
|
||||
*/
|
||||
bool c_isidle; /* True if this cpu is idle */
|
||||
struct threadlist c_runqueue; /* Run queue for this cpu */
|
||||
struct spinlock c_runqueue_lock;
|
||||
|
||||
/*
|
||||
* Accessed by other cpus.
|
||||
* Protected by the IPI lock.
|
||||
*
|
||||
* TLB shootdown requests made to this CPU are queued in
|
||||
* c_shootdown[], with c_numshootdown holding the number of
|
||||
* requests. TLBSHOOTDOWN_MAX is the maximum number that can
|
||||
* be queued at once, which is machine-dependent.
|
||||
*
|
||||
* The contents of struct tlbshootdown are also machine-
|
||||
* dependent and might reasonably be either an address space
|
||||
* and vaddr pair, or a paddr, or something else.
|
||||
*/
|
||||
uint32_t c_ipi_pending; /* One bit for each IPI number */
|
||||
struct tlbshootdown c_shootdown[TLBSHOOTDOWN_MAX];
|
||||
unsigned c_numshootdown;
|
||||
struct spinlock c_ipi_lock;
|
||||
/*
|
||||
* Accessed by other cpus.
|
||||
* Protected by the IPI lock.
|
||||
*
|
||||
* TLB shootdown requests made to this CPU are queued in
|
||||
* c_shootdown[], with c_numshootdown holding the number of
|
||||
* requests. TLBSHOOTDOWN_MAX is the maximum number that can
|
||||
* be queued at once, which is machine-dependent.
|
||||
*
|
||||
* The contents of struct tlbshootdown are also machine-
|
||||
* dependent and might reasonably be either an address space
|
||||
* and vaddr pair, or a paddr, or something else.
|
||||
*/
|
||||
uint32_t c_ipi_pending; /* One bit for each IPI number */
|
||||
struct tlbshootdown c_shootdown[TLBSHOOTDOWN_MAX];
|
||||
unsigned c_numshootdown;
|
||||
struct spinlock c_ipi_lock;
|
||||
|
||||
/*
|
||||
* Accessed by other cpus. Protected inside hangman.c.
|
||||
*/
|
||||
HANGMAN_ACTOR(c_hangman);
|
||||
/*
|
||||
* Accessed by other cpus. Protected inside hangman.c.
|
||||
*/
|
||||
HANGMAN_ACTOR(c_hangman);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -161,10 +159,10 @@ void cpu_halt(void);
|
||||
*/
|
||||
|
||||
/* IPI types */
|
||||
#define IPI_PANIC 0 /* System has called panic() */
|
||||
#define IPI_OFFLINE 1 /* CPU is requested to go offline */
|
||||
#define IPI_UNIDLE 2 /* Runnable threads are available */
|
||||
#define IPI_TLBSHOOTDOWN 3 /* MMU mapping(s) need invalidation */
|
||||
#define IPI_PANIC 0 /* System has called panic() */
|
||||
#define IPI_OFFLINE 1 /* CPU is requested to go offline */
|
||||
#define IPI_UNIDLE 2 /* Runnable threads are available */
|
||||
#define IPI_TLBSHOOTDOWN 3 /* MMU mapping(s) need invalidation */
|
||||
|
||||
void ipi_send(struct cpu *target, int code);
|
||||
void ipi_broadcast(int code);
|
||||
@@ -172,5 +170,4 @@ void ipi_tlbshootdown(struct cpu *target, const struct tlbshootdown *mapping);
|
||||
|
||||
void interprocessor_interrupt(void);
|
||||
|
||||
|
||||
#endif /* _CPU_H_ */
|
||||
|
||||
Reference in New Issue
Block a user