diff --git a/source/include/platform/acfreebsd.h b/source/include/platform/acfreebsd.h index 3e438aa0c..20c5687c2 100644 --- a/source/include/platform/acfreebsd.h +++ b/source/include/platform/acfreebsd.h @@ -114,7 +114,7 @@ *****************************************************************************/ #ifndef __ACFREEBSD_H__ -#define __ACFREEBSD_H__ +#define __ACFREEBSD_H__ /* FreeBSD uses GCC */ @@ -123,78 +123,58 @@ #include #include -#define ACPI_THREAD_ID lwpid_t -#define ACPI_UINTPTR_T uintptr_t -#define ACPI_USE_LOCAL_CACHE -#define __cdecl +#define ACPI_UINTPTR_T uintptr_t + +#define ACPI_USE_LOCAL_CACHE +#define ACPI_USE_SYSTEM_CLIBRARY + +#define __cdecl #ifdef _KERNEL -#include "opt_acpi.h" -#endif -#ifdef ACPI_DEBUG -#define ACPI_DEBUG_OUTPUT /* for backward compatibility */ -#define ACPI_DISASSEMBLER -#endif - -#ifdef _KERNEL #include #include #include #include #include -#ifdef DEBUGGER_THREADING -#undef DEBUGGER_THREADING -#endif /* DEBUGGER_THREADING */ +#include "opt_acpi.h" -#define DEBUGGER_THREADING 0 /* integrated with DDB */ +#define ACPI_THREAD_ID lwpid_t + +#ifdef ACPI_DEBUG +#define ACPI_DEBUG_OUTPUT /* for backward compatibility */ +#define ACPI_DISASSEMBLER +#endif #ifdef ACPI_DEBUG_OUTPUT #include "opt_ddb.h" #ifdef DDB -#define ACPI_DEBUGGER +#define ACPI_DEBUGGER #endif /* DDB */ #endif /* ACPI_DEBUG_OUTPUT */ -#else /* _KERNEL */ +#ifdef DEBUGGER_THREADING +#undef DEBUGGER_THREADING +#endif /* DEBUGGER_THREADING */ -/* Not building kernel code, so use libc */ -#define ACPI_USE_STANDARD_HEADERS -#define ACPI_FLUSH_CPU_CACHE() +#define DEBUGGER_THREADING 0 /* integrated with DDB */ + +#else /* _KERNEL */ #if __STDC_HOSTED__ #include #endif -#define __cli() -#define __sti() +#define ACPI_THREAD_ID pthread_t -#endif /* _KERNEL */ +/* Not building kernel code, so use libc */ +#define ACPI_USE_STANDARD_HEADERS +#define ACPI_FLUSH_CPU_CACHE() -/* Always use FreeBSD code over our local versions */ -#define ACPI_USE_SYSTEM_CLIBRARY +#define __cli() +#define __sti() -#if defined(_KERNEL) && (__FreeBSD_version < 700020) -/* Or strstr (used in debugging mode, also move to libkern) */ -static __inline char * -strstr (char *s, char *find) -{ - char c, sc; - size_t len; - - if ((c = *find++) != 0) { - len = strlen (find); - do { - do { - if ((sc = *s++) == 0) - return (NULL); - } while (sc != c); - } while (strncmp (s, find, len) != 0); - s--; - } - return ((char *) s); -} #endif /* _KERNEL */ #endif /* __ACFREEBSD_H__ */