mirror of
https://github.com/RGBCube/serenity
synced 2025-09-14 22:36:17 +00:00
Kernel: Implement helpers to manipulate MSI(x) data structures
MSIx table entry is used to program interrupt vectors and it is architecture specific. Add helper functions declaration in Arch/PCIMSI.h. The definition of the function is placed in the respective arch specific code.
This commit is contained in:
parent
bf7ac06d7b
commit
f0b6eb6932
4 changed files with 115 additions and 0 deletions
22
Kernel/Arch/x86_64/PCI/MSI.h
Normal file
22
Kernel/Arch/x86_64/PCI/MSI.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Pankaj R <dev@pankajraghav.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Address register
|
||||
static constexpr u32 msi_address_base = 0xfee00000;
|
||||
static constexpr u8 msi_destination_shift = 12;
|
||||
static constexpr u32 msi_redirection_hint = 0x00000008;
|
||||
static constexpr u32 msi_destination_mode_logical = 0x00000004;
|
||||
|
||||
// Data register
|
||||
static constexpr u8 msi_data_vector_mask = 0xff;
|
||||
static constexpr u32 msi_trigger_mode_level = 0x00008000;
|
||||
static constexpr u32 msi_level_assert = 0x00004000;
|
||||
|
||||
// Vector control
|
||||
static constexpr u32 msi_vector_control_mask = 0x1;
|
||||
static constexpr u32 msi_vector_control_unmask = ~(0x1);
|
Loading…
Add table
Add a link
Reference in a new issue