Kernel panic with ACPI enabled

Nate Lawson nate at root.org
Thu Feb 9 11:23:43 PST 2006


John Baldwin wrote:
> On Wednesday 08 February 2006 14:12, Nate Lawson wrote:
>>I was thinking this goes in the ACPI init.  if (maxmem != 0) printf()
> 
> 
> Something like this:
> 
> Index: dev/acpica/acpi.c
> ===================================================================
> RCS file: /usr/cvs/src/sys/dev/acpica/acpi.c,v
> retrieving revision 1.219
> diff -u -r1.219 acpi.c
> --- dev/acpica/acpi.c	7 Nov 2005 21:52:06 -0000	1.219
> +++ dev/acpica/acpi.c	9 Feb 2006 16:22:51 -0000
> @@ -30,6 +30,9 @@
>  #include <sys/cdefs.h>
>  __FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.219 2005/11/07 21:52:06 jhb Exp $");
>  
> +#ifdef __i386__
> +#include "opt_maxmem.h"
> +#endif
>  #include "opt_acpi.h"
>  #include <sys/param.h>
>  #include <sys/kernel.h>
> @@ -284,6 +287,19 @@
>  	return_VALUE (0);
>      started = 1;
>  
> +#ifdef __i386__
> +    /* Warn about MAXMEM or hw.physmem use. */
> +    do {
> +#ifndef MAXMEM
> +	    u_long tmp;
> +
> +	    if (TUNABLE_ULONG_FETCH("hw.physmem", &tmp))
> +#endif
> +		printf("WARNING: Usage of MAXMEM or hw.physmem may cause "
> +		    "ACPI to panic!\n");
> +    } while (0);
> +#endif
> +    

I'd prefer it be in a separate function, something like:

int
acpi_check_sysconfig()
{
#ifdef __i386__
#ifndef MAXMEM
     u_long tmp;

     if (TUNABLE_ULONG_FETCH("hw.physmem", &tmp) != 0)
#endif
	printf("WARNING: Usage of MAXMEM or hw.physmem may cause "
	    "ACPI to panic!\n");
#endif /* __i386__ */
     return (0);
}

We might add other stuff there later.  Anyway, give this a check and 
commit it.  Thanks.

-- 
Nate


More information about the freebsd-acpi mailing list