1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-09-14 12:27:34 +00:00
serenity/Kernel/Arch/x86_64/PCI/MSI.h
Pankaj Raghav f0b6eb6932 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.
2023-05-07 21:16:41 +02:00

22 lines
666 B
C

/*
* 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);