diff options
Diffstat (limited to 'sys/include/arch')
-rw-r--r-- | sys/include/arch/amd64/cpu.h | 6 | ||||
-rw-r--r-- | sys/include/arch/amd64/intr.h | 1 | ||||
-rw-r--r-- | sys/include/arch/amd64/ipi.h | 62 | ||||
-rw-r--r-- | sys/include/arch/amd64/isa/i8042var.h | 4 |
4 files changed, 18 insertions, 55 deletions
diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h index 6ed675e..5adff29 100644 --- a/sys/include/arch/amd64/cpu.h +++ b/sys/include/arch/amd64/cpu.h @@ -52,15 +52,15 @@ #define CPU_VENDOR_INTEL 0x00000001 #define CPU_VENDOR_AMD 0x00000002 -typedef uint16_t ipi_pend_t; +typedef uint32_t ipi_pend_t; struct cpu_info { uint32_t apicid; uint32_t feat; uint32_t vendor; /* Vendor (see CPU_VENDOR_*) */ + uint8_t preempt : 1; /* CPU is preemptable */ uint8_t ipi_dispatch : 1; /* 1: IPIs being dispatched */ - uint8_t ipi_id; - ipi_pend_t ipi_pending[N_IPIVEC]; + ipi_pend_t ipi_pending; uint8_t id; /* MI Logical ID */ uint8_t model : 4; /* CPU model number */ uint8_t family : 4; /* CPU family ID */ diff --git a/sys/include/arch/amd64/intr.h b/sys/include/arch/amd64/intr.h index 6d9bb09..6e011fa 100644 --- a/sys/include/arch/amd64/intr.h +++ b/sys/include/arch/amd64/intr.h @@ -36,6 +36,7 @@ #define IST_HW_IRQ 2U #define IST_SW_INT 3U #define IST_SYSCALL 4U +#define IST_DBFLT 5U /* Upper 4 bits of interrupt vector */ #define IPL_SHIFT 4 diff --git a/sys/include/arch/amd64/ipi.h b/sys/include/arch/amd64/ipi.h index 1a3b51c..48243e7 100644 --- a/sys/include/arch/amd64/ipi.h +++ b/sys/include/arch/amd64/ipi.h @@ -34,9 +34,16 @@ #include <machine/cpu.h> #include <machine/lapic.h> +/* + * IPI_VECTOR is the main vector used for all misc + * IPIs, the HALT_VECTOR is used to slam the system + * to a screetching halt. + */ +#define IPI_VECTOR 0x21 +#define HALT_VECTOR 0x22 + /* Fixed IPI IDs */ -#define IPI_HALT 0 -#define IPI_TLB 1 +#define IPI_TLB 0 /* * Represents an interprocessor interrupt @@ -53,57 +60,8 @@ struct cpu_ipi { int(*handler)(struct cpu_ipi *ipi); }; -/* - * Represents an interrupt vector for a - * specific IPI - * - * @ipi: IPIs associated with this vector - * @cookie: Used to verify an instance - * @nipi: Number of IPIs associated - * @vec: System interrupt vector number - */ -struct ipi_vector { - struct cpu_ipi ipi[IPI_PER_VEC]; - uint16_t cookie; - uint8_t nipi; - uint8_t vec; -}; - int md_ipi_alloc(struct cpu_ipi **res); -int md_ipi_send(struct cpu_info *ci); +int md_ipi_send(struct cpu_info *ci, ipi_pend_t ipi); void md_ipi_init(void); -/* - * Get the vector an IPI belongs to - * - * @ipi: IPI to check - */ -__always_inline static inline uint8_t -ipi_vector(uint8_t ipi) -{ - return ipi / N_IPIVEC; -} - -/* - * Get the handler index an IPI belongs - * to - * - * @ipi: IPI to check - */ -__always_inline static inline uint8_t -ipi_index(uint8_t ipi) -{ - return ipi % (sizeof(ipi_pend_t) * 8); -} - -__always_inline static inline int -cpu_ipi_send(struct cpu_info *ci, uint8_t ipi) -{ - uint8_t vec = ipi_vector(ipi); - uint8_t idx = ipi_index(ipi); - - ci->ipi_pending[vec] |= BIT(idx); - return md_ipi_send(ci); -} - #endif /* !_MACHINE_IPI_H_ */ diff --git a/sys/include/arch/amd64/isa/i8042var.h b/sys/include/arch/amd64/isa/i8042var.h index 13c3095..9619920 100644 --- a/sys/include/arch/amd64/isa/i8042var.h +++ b/sys/include/arch/amd64/isa/i8042var.h @@ -74,6 +74,10 @@ #define I8042_LED_NUM BIT(1) #define I8042_LED_CAPS BIT(2) +/* Extended scancode types */ +#define I8042_XSC_ENDPR 0 /* End pressed */ +#define I8042_XSC_ENDRL 1 /* End released */ + /* Quirks */ #define I8042_HOSTILE BIT(0) /* If EC likes throwing NMIs */ |