|
@@ -308,8 +308,37 @@ static bool mem_avoid_overlap(struct mem_vector *img)
|
|
}
|
|
}
|
|
|
|
|
|
static unsigned long slots[KERNEL_IMAGE_SIZE / CONFIG_PHYSICAL_ALIGN];
|
|
static unsigned long slots[KERNEL_IMAGE_SIZE / CONFIG_PHYSICAL_ALIGN];
|
|
|
|
+
|
|
|
|
+struct slot_area {
|
|
|
|
+ unsigned long addr;
|
|
|
|
+ int num;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#define MAX_SLOT_AREA 100
|
|
|
|
+
|
|
|
|
+static struct slot_area slot_areas[MAX_SLOT_AREA];
|
|
|
|
+
|
|
static unsigned long slot_max;
|
|
static unsigned long slot_max;
|
|
|
|
|
|
|
|
+static unsigned long slot_area_index;
|
|
|
|
+
|
|
|
|
+static void store_slot_info(struct mem_vector *region, unsigned long image_size)
|
|
|
|
+{
|
|
|
|
+ struct slot_area slot_area;
|
|
|
|
+
|
|
|
|
+ if (slot_area_index == MAX_SLOT_AREA)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ slot_area.addr = region->start;
|
|
|
|
+ slot_area.num = (region->size - image_size) /
|
|
|
|
+ CONFIG_PHYSICAL_ALIGN + 1;
|
|
|
|
+
|
|
|
|
+ if (slot_area.num > 0) {
|
|
|
|
+ slot_areas[slot_area_index++] = slot_area;
|
|
|
|
+ slot_max += slot_area.num;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
static void slots_append(unsigned long addr)
|
|
static void slots_append(unsigned long addr)
|
|
{
|
|
{
|
|
/* Overflowing the slots list should be impossible. */
|
|
/* Overflowing the slots list should be impossible. */
|