tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pchb@acpi



On Fri, Jul 29, 2011 at 09:24:49AM +0200, Martin Husemann wrote:
> On Thu, Jul 28, 2011 at 03:13:28PM -0500, David Young wrote:
> > Here is a new snapshot of the PCI information that I'm reading out of
> > PCI Configuration Space.  This time the format is slightly different,
> > and the property list includes the I/O-space reservations and the legacy
> > VGA regions.
> 
> This sounds like strictly structured one-time used data. Using property lists
> here seems like an unecessary waste (data and code size) to me.

*shrug* I thought that the direction that we were going for conveying
information from MD sources to MI code was property lists---e.g., Plug
'n' Play or ACPI info -> PCI/ISA autoconfiguration: property lists.

I am not 100% comfortable with using property lists for this purpose.
As you may know, I have written a property-list helper library (look for
ppath in the mailing lists) simply to make property lists more bearable!

I actually collect the information for the PCI-ranges property list
using a struct that I find much easier to use in C code than a property
list:

typedef enum pci_alloc_regtype {
          PCI_ALLOC_REGTYPE_NONE = 0
        , PCI_ALLOC_REGTYPE_BAR = 1
        , PCI_ALLOC_REGTYPE_WIN = 2
        , PCI_ALLOC_REGTYPE_CBWIN = 3
        , PCI_ALLOC_REGTYPE_VGA_EN = 4
} pci_alloc_regtype_t;

typedef enum pci_alloc_space {
          PCI_ALLOC_SPACE_IO = 0
        , PCI_ALLOC_SPACE_MEM = 1
} pci_alloc_space_t;

typedef enum pci_alloc_flags {
          PCI_ALLOC_F_PREFETCHABLE = 0x1
} pci_alloc_flags_t;

typedef struct pci_alloc {
        TAILQ_ENTRY(pci_alloc)          pal_link;
        pcitag_t                        pal_tag;
        uint64_t                        pal_addr;
        uint64_t                        pal_size;
        pci_alloc_regtype_t             pal_type;
        struct pci_alloc_reg {
                int                     r_ofs;
                pcireg_t                r_val;
                pcireg_t                r_mask;
        }                               pal_reg[3];
        pci_alloc_space_t               pal_space;
        pci_alloc_flags_t               pal_flags;
} pci_alloc_t;

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 344-0444 x24


Home | Main Index | Thread Index | Old Index