Subversion Repositories Kolibri OS

Rev

Rev 1628 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2.  
  3. struct resource_list {
  4.     struct resource_list *next;
  5.     struct resource *res;
  6. //    struct pci_dev *dev;
  7. };
  8.  
  9. enum acpi_bus_device_type {
  10.     ACPI_BUS_TYPE_DEVICE = 0,
  11.     ACPI_BUS_TYPE_POWER,
  12.     ACPI_BUS_TYPE_PROCESSOR,
  13.     ACPI_BUS_TYPE_THERMAL,
  14.     ACPI_BUS_TYPE_POWER_BUTTON,
  15.     ACPI_BUS_TYPE_SLEEP_BUTTON,
  16.     ACPI_BUS_DEVICE_TYPE_COUNT
  17. };
  18.  
  19. /*
  20.  * _HID definitions
  21.  * HIDs must conform to ACPI spec(6.1.4)
  22.  * KolibriOS specific HIDs do not apply to this and begin with KOS:
  23.  */
  24.  
  25.  
  26. #define ACPI_POWER_HID              "KLBPOWER"
  27. #define ACPI_PROCESSOR_OBJECT_HID   "KLBCPU"
  28. #define ACPI_SYSTEM_HID             "KLBSYSTM"
  29. #define ACPI_THERMAL_HID            "KLBTHERM"
  30. #define ACPI_BUTTON_HID_POWERF      "KLBPWRBN"
  31. #define ACPI_BUTTON_HID_SLEEPF      "KLBSLPBN"
  32. #define ACPI_VIDEO_HID              "KLBVIDEO"
  33. #define ACPI_BAY_HID                "KLBIOBAY"
  34. #define ACPI_DOCK_HID               "KLBDOCK"
  35. /* Quirk for broken IBM BIOSes */
  36. #define ACPI_SMBUS_IBM_HID      "SMBUSIBM"
  37.  
  38.  
  39. struct acpi_bus_ops
  40. {
  41.     u32_t acpi_op_add:1;
  42.     u32_t acpi_op_start:1;
  43. };
  44.  
  45.  
  46. #define ACPI_ID_LEN     16 /* only 9 bytes needed here, 16 bytes are used */
  47.                            /* to workaround crosscompile issues */
  48.  
  49. struct acpi_device_ids
  50. {
  51.     u8  id[ACPI_ID_LEN];
  52.     u32 driver_data;
  53. };
  54.  
  55. struct acpi_device_flags {
  56.     u32 dynamic_status:1;
  57.     u32 bus_address:1;
  58.     u32 removable:1;
  59.     u32 ejectable:1;
  60.     u32 lockable:1;
  61.     u32 suprise_removal_ok:1;
  62.     u32 power_manageable:1;
  63.     u32 performance_manageable:1;
  64.     u32 wake_capable:1; /* Wakeup(_PRW) supported? */
  65.     u32 force_power_state:1;
  66.     u32 reserved:22;
  67. };
  68.  
  69. struct acpi_device_status {
  70.     u32 present:1;
  71.     u32 enabled:1;
  72.     u32 show_in_ui:1;
  73.     u32 functional:1;
  74.     u32 battery_present:1;
  75.     u32 reserved:27;
  76. };
  77. typedef char acpi_bus_id[8];
  78. typedef unsigned long acpi_bus_address;
  79. typedef char acpi_device_name[40];
  80. typedef char acpi_device_class[20];
  81.  
  82.  
  83. struct acpi_device_pnp
  84. {
  85.     acpi_bus_id       bus_id;       /* Object name */
  86.     acpi_bus_address  bus_address;  /* _ADR */
  87.     char *unique_id;                /* _UID */
  88.     struct list_head  ids;          /* _HID and _CIDs */
  89.     acpi_device_name  device_name;  /* Driver-determined */
  90.     acpi_device_class device_class; /*        "          */
  91. };
  92.  
  93.  
  94. struct acpi_device
  95. {
  96.     int device_type;
  97.     ACPI_HANDLE handle;     /* no handle for fixed hardware */
  98.     struct acpi_device *parent;
  99.     struct list_head children;
  100.     struct list_head node;
  101. //    struct list_head wakeup_list;
  102.     struct acpi_device_status status;
  103.     struct acpi_device_flags flags;
  104.     struct acpi_device_pnp pnp;
  105. //    struct acpi_device_power power;
  106. //    struct acpi_device_wakeup wakeup;
  107. //    struct acpi_device_perf performance;
  108. //    struct acpi_device_dir dir;
  109. //    struct acpi_device_ops ops;
  110. //    struct acpi_driver *driver;
  111.     void *driver_data;
  112. //    struct device dev;
  113.     struct acpi_bus_ops bus_ops;    /* workaround for different code path for hotplug */
  114.  //   enum acpi_bus_removal_type removal_type;    /* indicate for different removal type */
  115. };
  116.  
  117.  
  118.  
  119. #define acpi_device_bid(d)  ((d)->pnp.bus_id)
  120. #define acpi_device_adr(d)  ((d)->pnp.bus_address)
  121. char *acpi_device_hid(struct acpi_device *device);
  122. #define acpi_device_name(d) ((d)->pnp.device_name)
  123. #define acpi_device_class(d)    ((d)->pnp.device_class)
  124.  
  125. int acpi_match_device_ids(struct acpi_device *device,
  126.               const struct acpi_device_ids *ids);
  127.  
  128. int acpi_pci_irq_add_prt(ACPI_HANDLE handle, struct pci_bus *bus);
  129.