WKern
Loading...
Searching...
No Matches
pci.h
Go to the documentation of this file.
1
2/*
3WKern - A Bare Metal OS / Kernel I am making (For Fun)
4Copyright (C) 2025 Wdboyes13
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19#pragma once
20#include <types/nums.h>
21
22#define PCI_INTERRUPT_LINE 0x3C
23
24extern u32 bar0;
25extern u8 virtio_bus;
26extern u8 virtio_slot;
27extern u8 virtio_func;
28extern u8 virtio_irq;
29
31u32 PciConfigRead(u8 bus, u8 slot, u8 func, u8 offset);
unsigned int u32
32-Bit Unsigned Int
Definition nums.h:30
unsigned char u8
8-Bit Unsigned Int
Definition nums.h:32
u8 virtio_slot
Definition scconfig.c:27
u8 virtio_bus
Definition scconfig.c:26
u32 bar0
Definition scconfig.c:30
u8 virtio_irq
Definition scconfig.c:25
u32 FindVirtionetDev()
Search for VirtNet Device.
Definition scconfig.c:59
u8 virtio_func
Definition scconfig.c:28
u32 PciConfigRead(u8 bus, u8 slot, u8 func, u8 offset)
Reads a 32-bit value from PCI configuration space.
Definition scconfig.c:48