Force coreboot mconf to create temp files in the output directory
[coreboot.git] / src / devices / device_util.c
index 84fb11505c26def8f937c1bf533ef7ea962a9d48..526490a8c199ab132dcce9bb9adc382e89042cbb 100644 (file)
@@ -109,6 +109,26 @@ struct device *dev_find_slot_on_smbus(unsigned int bus, unsigned int addr)
        return result;
 }
 
+/**
+ * Given a Local APIC ID, find the device structure.
+ *
+ * @param apic_id The Local APIC ID number.
+ * @return Pointer to the device structure (if found), 0 otherwise.
+ */
+device_t dev_find_lapic(unsigned apic_id)
+{
+       device_t dev, result = NULL;
+
+       for (dev = all_devices; dev; dev = dev->next) {
+               if (dev->path.type == DEVICE_PATH_APIC &&
+                   dev->path.apic.apic_id == apic_id) {
+                       result = dev;
+                       break;
+               }
+       }
+       return result;
+}
+
 /**
  * Find a device of a given vendor and type.
  *
@@ -551,7 +571,7 @@ void report_resource_stored(device_t dev, struct resource *resource,
                sprintf(buf, "bus %02x ", dev->link_list->secondary);
 #endif
        }
-       printk(BIOS_DEBUG, "%s %02lx <- [0x%010Lx - 0x%010Lx] size 0x%08Lx "
+       printk(BIOS_DEBUG, "%s %02lx <- [0x%010llx - 0x%010llx] size 0x%08llx "
               "gran 0x%02x %s%s%s\n", dev_path(dev), resource->index,
                base, end, resource->size, resource->gran, buf,
                resource_type(resource), comment);
@@ -766,7 +786,7 @@ void show_one_resource(int debug_level, struct device *dev,
 */
 
        do_printk(debug_level, "%s %02lx <- [0x%010llx - 0x%010llx] "
-                 "size 0x%08Lx gran 0x%02x %s%s%s\n", dev_path(dev),
+                 "size 0x%08llx gran 0x%02x %s%s%s\n", dev_path(dev),
                  resource->index, base, end, resource->size, resource->gran,
                  buf, resource_type(resource), comment);
 }