Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2012 20:25:01 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r234147 - in stable/9/sys: i386/conf kern x86/acpica
Message-ID:  <201204112025.q3BKP19o094189@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Apr 11 20:25:01 2012
New Revision: 234147
URL: http://svn.freebsd.org/changeset/base/234147

Log:
  MFC 233305,233623:
  - Mark the 'lapics' and 'ioapics' arrays here static since they are
    private to this file.  The 'lapics' array was actually shadowing a
    completely different 'lapics' array that is private to local_apic.c.
  - Allocate the ioapics[] array dynamically since it is only needed for the
    duration of madt_setup_io().  This avoids having the array take up
    permanent space in the BSS.

Modified:
  stable/9/sys/x86/acpica/madt.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)
  stable/9/sys/kern/subr_witness.c   (props changed)

Modified: stable/9/sys/x86/acpica/madt.c
==============================================================================
--- stable/9/sys/x86/acpica/madt.c	Wed Apr 11 20:19:29 2012	(r234146)
+++ stable/9/sys/x86/acpica/madt.c	Wed Apr 11 20:25:01 2012	(r234147)
@@ -50,12 +50,12 @@ __FBSDID("$FreeBSD$");
 #include <dev/pci/pcivar.h>
 
 /* These two arrays are indexed by APIC IDs. */
-struct ioapic_info {
+static struct {
 	void *io_apic;
 	UINT32 io_vector;
-} ioapics[MAX_APIC_ID + 1];
+} *ioapics;
 
-struct lapic_info {
+static struct lapic_info {
 	u_int la_enabled:1;
 	u_int la_acpi_id:8;
 } lapics[MAX_APIC_ID + 1];
@@ -162,7 +162,10 @@ madt_setup_io(void)
 		printf("Try disabling either ACPI or apic support.\n");
 		panic("Using MADT but ACPI doesn't work");
 	}
-		    
+
+	ioapics = malloc(sizeof(*ioapics) * (MAX_APIC_ID + 1), M_MADT,
+	    M_WAITOK | M_ZERO);
+
 	/* First, we run through adding I/O APIC's. */
 	madt_walk_table(madt_parse_apics, NULL);
 
@@ -194,6 +197,9 @@ madt_setup_io(void)
 	/* Finally, we throw the switch to enable the I/O APIC's. */
 	acpi_SetDefaultIntrModel(ACPI_INTR_APIC);
 
+	free(ioapics, M_MADT);
+	ioapics = NULL;
+
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204112025.q3BKP19o094189>