]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] reduce stack usage of sanitize_e820_map
authorBenjamin LaHaise <bcrl@redhat.com>
Thu, 15 Aug 2002 07:59:57 +0000 (00:59 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 15 Aug 2002 07:59:57 +0000 (00:59 -0700)
Currently, sanitize_e820_map uses 0x738 bytes of stack.  The patch below
moves the arrays into __initdata, reducing stack usage to 0x34 bytes.

arch/i386/kernel/setup.c

index e04c0fb4cdbcc9f49a0fb31507287971aad4926d..17bc61fc66551bd968657737d18097b64b8c9f8d 100644 (file)
@@ -275,16 +275,17 @@ static void __init print_memory_map(char *who)
  * replaces the original e820 map with a new one, removing overlaps.
  *
  */
+struct change_member {
+       struct e820entry *pbios; /* pointer to original bios entry */
+       unsigned long long addr; /* address for this change point */
+};
+struct change_member change_point_list[2*E820MAX] __initdata;
+struct change_member *change_point[2*E820MAX] __initdata;
+struct e820entry *overlap_list[E820MAX] __initdata;
+struct e820entry new_bios[E820MAX] __initdata;
+
 static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
 {
-       struct change_member {
-               struct e820entry *pbios; /* pointer to original bios entry */
-               unsigned long long addr; /* address for this change point */
-       };
-       struct change_member change_point_list[2*E820MAX];
-       struct change_member *change_point[2*E820MAX];
-       struct e820entry *overlap_list[E820MAX];
-       struct e820entry new_bios[E820MAX];
        struct change_member *change_tmp;
        unsigned long current_type, last_type;
        unsigned long long last_addr;