Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1875 → Rev 2216

/drivers/devman/acpica/tools/acpixtract/Makefile
1,16 → 1,73
#
# acpixtract - extract binary ACPI tables from acpidump text output
#
# NOTE: This makefile is intended to be used in the Linux environment,
# with the Linux directory structure. It will not work directly
# on the native ACPICA source tree.
#
 
#
# Configuration
# Notes:
# gcc should be version 4 or greater, otherwise some of the options
# used will not be recognized.
# Global optimization flags (such as -O2, -Os) are not used, since
# they cause issues on some compilers.
# The _GNU_SOURCE symbol is required for many hosts.
#
PROG= acpixtract
SRCS= acpixtract.c
 
CFLAGS+= -Wall -O2 -D_LINUX -DACPI_APPLICATION -Wstrict-prototypes -I../../include
HOST = _LINUX
NOMAN = YES
COMPILE = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $?
 
ACPICA_COMPONENTS =
ACPICA_SRC = ../..
ACPICA_COMMON = $(ACPICA_SRC)/common
ACPICA_CORE = $(ACPICA_SRC)$(ACPICA_COMPONENTS)
ACPICA_TOOLS = $(ACPICA_SRC)/tools
ACPICA_OSL = $(ACPICA_SRC)/os_specific/service_layers
INSTALLDIR = /usr/bin
INSTALLPROG = cp --remove-destination $(PROG) $(INSTALLDIR)
 
acpixtract : $(patsubst %.c,%.o, $(SRCS))
$(CC) $(LDFLAGS) $(patsubst %.c,%.o, $(SRCS)) -o $(PROG)
CFLAGS+= \
-D$(HOST) \
-D_GNU_SOURCE \
-I$(ACPICA_SRC)/include
 
CLEANFILES= $(PROG)
CWARNINGFLAGS = \
-ansi \
-Wall \
-Wbad-function-cast \
-Wdeclaration-after-statement \
-Werror \
-Wformat=2 \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wstrict-aliasing=0 \
-Wstrict-prototypes \
-Wswitch-default \
-Wpointer-arith \
-Wundef
 
OBJS = \
acpixtract.o
 
#
# Root rule
#
$(PROG) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(PROG)
 
#
# acpixtract source
#
acpixtract.o : $(ACPICA_TOOLS)/acpixtract/acpixtract.c
$(COMPILE)
 
 
clean :
rm -f $(CLEANFILES) $(patsubst %.c,%.o, $(SRCS))
rm -f $(PROG) $(PROG).exe $(OBJS)
 
install :
$(INSTALLPROG)
/drivers/devman/acpica/tools/acpixtract/acpixtract.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
122,54 → 122,54
 
/* Note: This is a 32-bit program only */
 
#define VERSION 0x20100107
#define VERSION 0x20110330
#define FIND_HEADER 0
#define EXTRACT_DATA 1
#define BUFFER_SIZE 256
#define MIN_HEADER_LENGTH 6 /* strlen ("DSDT @") */
 
 
/* Local prototypes */
 
void
static void
CheckAscii (
char *Name,
int Count);
 
void
static void
NormalizeSignature (
char *Signature);
 
unsigned int
static unsigned int
GetNextInstance (
char *InputPathname,
char *Signature);
 
int
static int
ExtractTables (
char *InputPathname,
char *Signature,
unsigned int MinimumInstances);
 
size_t
static size_t
GetTableHeader (
FILE *InputFile,
unsigned char *OutputData);
 
unsigned int
static unsigned int
CountTableInstances (
char *InputPathname,
char *Signature);
 
int
static int
ListTables (
char *InputPathname);
 
size_t
static size_t
ConvertLine (
char *InputLine,
unsigned char *OutputData);
 
void
static void
DisplayUsage (
void);
 
196,9 → 196,9
struct TableInfo *Next;
};
 
struct TableInfo *ListHead = NULL;
char Filename[16];
unsigned char Data[16];
static struct TableInfo *ListHead = NULL;
static char Filename[16];
static unsigned char Data[16];
 
 
/******************************************************************************
209,7 → 209,7
*
******************************************************************************/
 
void
static void
DisplayUsage (
void)
{
240,7 → 240,7
*
******************************************************************************/
 
void
static void
CheckAscii (
char *Name,
int Count)
270,7 → 270,7
*
******************************************************************************/
 
void
static void
NormalizeSignature (
char *Signature)
{
295,7 → 295,7
*
******************************************************************************/
 
size_t
static size_t
ConvertLine (
char *InputLine,
unsigned char *OutputData)
353,7 → 353,7
*
******************************************************************************/
 
size_t
static size_t
GetTableHeader (
FILE *InputFile,
unsigned char *OutputData)
401,7 → 401,7
*
******************************************************************************/
 
unsigned int
static unsigned int
CountTableInstances (
char *InputPathname,
char *Signature)
459,7 → 459,7
*
******************************************************************************/
 
unsigned int
static unsigned int
GetNextInstance (
char *InputPathname,
char *Signature)
520,7 → 520,7
*
******************************************************************************/
 
int
static int
ExtractTables (
char *InputPathname,
char *Signature,
577,6 → 577,13
{
case FIND_HEADER:
 
/* Ignore lines that are too short to be header lines */
 
if (strlen (Buffer) < MIN_HEADER_LENGTH)
{
continue;
}
 
/* Ignore empty lines and lines that start with a space */
 
if ((Buffer[0] == ' ') ||
585,6 → 592,19
continue;
}
 
/*
* Ignore lines that are not of the form <sig> @ <addr>. Examples:
*
* DSDT @ 0x737e4000
* XSDT @ 0x737f2fff
* RSD PTR @ 0xf6cd0
* SSDT @ (nil)
*/
if (!strstr (Buffer, " @ "))
{
continue;
}
 
NormalizeSignature (Buffer);
strncpy (ThisSignature, Buffer, 4);
 
639,8 → 659,8
OutputFile = NULL;
State = FIND_HEADER;
 
printf ("Acpi table [%4.4s] - % 7d bytes written to %s\n",
ThisSignature, TotalBytesWritten, Filename);
printf ("Acpi table [%4.4s] - %u bytes written to %s\n",
ThisSignature, (unsigned int) TotalBytesWritten, Filename);
continue;
}
 
684,8 → 704,8
{
/* Received an EOF while extracting data */
 
printf ("Acpi table [%4.4s] - % 7d bytes written to %s\n",
ThisSignature, TotalBytesWritten, Filename);
printf ("Acpi table [%4.4s] - %u bytes written to %s\n",
ThisSignature, (unsigned int) TotalBytesWritten, Filename);
}
}
 
707,7 → 727,7
*
******************************************************************************/
 
int
static int
ListTables (
char *InputPathname)
{