#ifndef __pci_h
#define __pci_h
#include "oslib/os.h"

typedef bits pci_hardware_address_input_flags;
typedef bits pci_hardware_address_output_flags;
typedef bits pci_address;
typedef int  pci_function;
typedef bits pci_id;

os_error *xpci_find_by_id(int vendor,
         int device,
         int subsystem_vendor,
         int handle_in,
         int subsystem_device,
         int *handle_out);

os_error *xpci_read_id(int handle,
         pci_id *id,
         pci_id *subsystem_id);

os_error *xpci_hardware_address(bits flags,
         int index,
         int handle,
         int *flags_out,
         bits *pci_addr,
         bits *area_size,
         void **logical);

os_error *xpci_query_hardware_address(pci_hardware_address_input_flags flags,
         int address_index,
         pci_function function,
         pci_hardware_address_output_flags *flags_out,
         pci_address *pci_address,
         int *length,
         byte **log_addr);

os_error *xosmemory_map_physical_range(bits flags,
         bits phys_base,
         bits range,
         int *size,
         byte **base);


#endif
