<commit_before>#ifndef KERNEL_PCI_H
#define KERNEL_PCI_H

#include "common.h"
#include "device.h"

#define PCI_ID_ANY      ((uint16_t) ~0)

#define BAR_TYPE_32     0x00
#define BAR_TYPE_64     0x02

#define BAR_TYPE(x)     (x & 0x7)
#define BAR_ADDR_32(x)  (x & 0xFFFFFFFC)
#define BAR_ADDR_64(x)  ((x & 0xFFFFFFF0) + ((*((&x) + 1) & 0xFFFFFFFF) << 32))

typedef struct pci_ident {
    uint32_t class, class_mask; //class << 24 | subclass << 16 | progif << 8 | revision
    uint16_t vendor, device;
} pci_ident_t;

typedef struct pci_device {
    device_t device;
    pci_ident_t ident;
    uint8_t interrupt;
    uint32_t bar[6];
} pci_device_t;

typedef struct pci_driver {
    driver_t driver;
    pci_ident_t *supported;
    uint32_t supported_len;
} pci_driver_t;

#endif<commit_msg>Exposed pci_bus<commit_after>#ifndef KERNEL_PCI_H
#define KERNEL_PCI_H

#include "common.h"
#include "device.h"

#define PCI_ID_ANY      ((uint16_t) ~0)

#define BAR_TYPE_32     0x00
#define BAR_TYPE_64     0x02

#define BAR_TYPE(x)     (x & 0x7)
#define BAR_ADDR_32(x)  (x & 0xFFFFFFFC)
#define BAR_ADDR_64(x)  ((x & 0xFFFFFFF0) + ((*((&x) + 1) & 0xFFFFFFFF) << 32))

typedef struct pci_ident {
    uint32_t class, class_mask; //class << 24 | subclass << 16 | progif << 8 | revision
    uint16_t vendor, device;
} pci_ident_t;

typedef struct pci_device {
    device_t device;
    pci_ident_t ident;
    uint8_t interrupt;
    uint32_t bar[6];
} pci_device_t;

typedef struct pci_driver {
    driver_t driver;
    pci_ident_t *supported;
    uint32_t supported_len;
} pci_driver_t;

extern bus_t pci_bus;

#endif
{'fraction_non_alphanumeric': 0.11430356027482823, 'fraction_numerical': 0.05121798875702686, 'mean_word_length': 3.9444444444444446, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6553394', 'n_tokens_mistral': 716, 'n_tokens_neox': 658, 'n_words': 151}