<commit_before>/* SPDX-License-Identifier: BSD-2-Clause */

#pragma once
#include <tilck/common/basic_defs.h>

struct pci_vendor {
   u16 vendor_id;
   const char *name;
};

struct pci_device_class {
   u8 class_id;
   u8 subclass_id;
   u8 progif_id;
   const char *class_name;
   const char *subclass_name;
   const char *progif_name;
};

struct pci_device_loc {

   u16 seg;       /* PCI Segment Group Number */
   u8 bus;        /* PCI Bus */
   u8 dev  : 5;   /* PCI Device Number */
   u8 func : 3;   /* PCI Function Number */
};

static ALWAYS_INLINE struct pci_device_loc
pci_make_loc(u16 seg, u8 bus, u8 dev, u8 func)
{
   return (struct pci_device_loc) {
      .seg = seg,
      .bus = bus,
      .dev = dev,
      .func = func
   };
}

struct pci_device_basic_info {
<commit_msg>[pci] Expose a `raw` value in struct pci_device_loc<commit_after>/* SPDX-License-Identifier: BSD-2-Clause */

#pragma once
#include <tilck/common/basic_defs.h>

struct pci_vendor {
   u16 vendor_id;
   const char *name;
};

struct pci_device_class {
   u8 class_id;
   u8 subclass_id;
   u8 progif_id;
   const char *class_name;
   const char *subclass_name;
   const char *progif_name;
};

struct pci_device_loc {

   union {

      struct {
         u16 seg;       /* PCI Segment Group Number */
         u8 bus;        /* PCI Bus */
         u8 dev  : 5;   /* PCI Device Number */
         u8 func : 3;   /* PCI Function Number */
      };

      u32 raw;
   };
};

static ALWAYS_INLINE struct pci_device_loc
pci_make_loc(u16 seg, u8 bus, u8 dev, u8 func)
{
   struct pci_device_loc ret;
   ret.seg  = seg;
   ret.bus  = bus;
   ret.dev  = dev  & 0b11111;
   ret.func = func & 0b00111;
   return ret;
}

struct pci_device_basic_info {

{'fraction_non_alphanumeric': 0.10590277777777778, 'fraction_numerical': 0.028935185185185185, 'mean_word_length': 2.4718875502008033, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '7476458', 'n_tokens_mistral': 667, 'n_tokens_neox': 651, 'n_words': 175}