Add a helper function to determine the number of enabled CPUs
[coreboot.git] / src / include / device / device.h
index fde64304b666239dac9494b43155260010d92faa..0aea1d6087ee3a3ec2be198719432fc6c5b75767 100644 (file)
@@ -16,6 +16,9 @@ struct smbus_bus_operations;
 struct chip_operations {
        void (*enable_dev)(struct device *dev);
        const char *name;
+#if CONFIG_GENERATE_SMBIOS_TABLES
+       int (*get_smbios_data)(device_t dev, int *handle, unsigned long *current);
+#endif
 };
 
 #define CHIP_NAME(X) .name = X,
@@ -31,6 +34,9 @@ struct device_operations {
        void (*enable)(device_t dev);
        void (*set_link)(device_t dev, unsigned int link);
        void (*reset_bus)(struct bus *bus);
+#if CONFIG_GENERATE_SMBIOS_TABLES
+       int (*get_smbios_data)(device_t dev, int *handle, unsigned long *current);
+#endif
        const struct pci_operations *ops_pci;
        const struct smbus_bus_operations *ops_smbus_bus;
        const struct pci_bus_operations *ops_pci_bus;
@@ -64,6 +70,8 @@ struct device {
        struct device_path path;
        unsigned        vendor;
        unsigned        device;
+       u16             subsystem_vendor;
+       u16             subsystem_device;
        unsigned int    class;          /* 3 bytes: (base, sub, prog-if) */
        unsigned int    hdr_type;       /* PCI header type */
        unsigned int    enabled : 1;    /* set if we should enable the device */
@@ -120,10 +128,12 @@ void run_bios(struct device *dev, unsigned long addr);
 /* Helper functions */
 device_t find_dev_path(struct bus *parent, struct device_path *path);
 device_t alloc_find_dev(struct bus *parent, struct device_path *path);
-device_t dev_find_device (unsigned int vendor, unsigned int device, device_t from);
+device_t dev_find_device (u16 vendor, u16 device, device_t from);
 device_t dev_find_class (unsigned int class, device_t from);
 device_t dev_find_slot (unsigned int bus, unsigned int devfn);
 device_t dev_find_slot_on_smbus (unsigned int bus, unsigned int addr);
+device_t dev_find_lapic(unsigned apic_id);
+int dev_count_cpu(void);
 
 /* Debug functions */
 void print_resource_tree(struct device * root, int debug_level,
@@ -146,4 +156,10 @@ extern struct device_operations default_dev_ops_root;
 void pci_domain_read_resources(struct device *dev);
 unsigned int pci_domain_scan_bus(struct device *dev, unsigned int max);
 unsigned int scan_static_bus(device_t bus, unsigned int max);
+
+void ram_resource(device_t dev, unsigned long index,
+                 unsigned long basek, unsigned long sizek);
+void tolm_test(void *gp, struct device *dev, struct resource *new);
+u32 find_pci_tolm(struct bus *bus);
+
 #endif /* DEVICE_H */