patch-2.4.0-test9 linux/drivers/acpi/include/acobject.h

Next file: linux/drivers/acpi/include/acoutput.h
Previous file: linux/drivers/acpi/include/acnamesp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/drivers/acpi/include/acobject.h linux/drivers/acpi/include/acobject.h
@@ -1,7 +1,8 @@
 
 /******************************************************************************
  *
- * Name: acobject.h - Definition of ACPI_OBJECT_INTERNAL (Internal object only)
+ * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT  (Internal object only)
+ *       $Revision: 71 $
  *
  *****************************************************************************/
 
@@ -26,17 +27,14 @@
 #ifndef _ACOBJECT_H
 #define _ACOBJECT_H
 
-#include "actypes.h"
-#include "macros.h"
-#include "internal.h"
 
 /*
- * The ACPI_OBJECT_INTERNAL is used to pass AML operands from the dispatcher
+ * The ACPI_OPERAND_OBJECT  is used to pass AML operands from the dispatcher
  * to the interpreter, and to keep track of the various handlers such as
  * address space handlers and notify handlers.  The object is a constant
  * size in order to allow them to be cached and reused.
  *
- * All variants of the ACPI_OBJECT_INTERNAL are defined with the same
+ * All variants of the ACPI_OPERAND_OBJECT  are defined with the same
  * sequence of field types, with fields that are not used in a particular
  * variant being named "Reserved".  This is not strictly necessary, but
  * may in some circumstances simplify understanding if these structures
@@ -60,32 +58,31 @@
  */
 
 
-#define ACPI_OBJECT_COMMON_HEADER           /* Two 32-bit fields */\
-	u8                      data_type;          /* To differentiate various internal objs */\
-	u8                      type;               /* ACPI_OBJECT_TYPE */\
-	u8                      size;               /* Size of entire descriptor */\
-	u8                      flags;\
-	u16                     reference_count;    /* For object deletion management */\
-	u16                     acpi_cm_fill2;\
-	union acpi_obj_internal *next; \
+#define ACPI_OBJECT_COMMON_HEADER           /* Two 32-bit fields, one pointer, 8-bit flag */\
+	u8                          data_type;          /* To differentiate various internal objs */\
+	u8                          type;               /* ACPI_OBJECT_TYPE */\
+	u16                         reference_count;    /* For object deletion management */\
+	u8                          flags; \
 
 /* Defines for flag byte above */
 
-#define AO_STATIC_ALLOCATION        0x1
+#define AOPOBJ_STATIC_ALLOCATION    0x1
+#define AOPOBJ_DATA_VALID           0x2
+#define AOPOBJ_INITIALIZED          0x4
 
 
 /*
  * Common bitfield for the field objects
  */
 #define ACPI_COMMON_FIELD_INFO              /* Three 32-bit values */\
-	u32                     offset;             /* Byte offset within containing object */\
-	u16                     length;             /* # of bits in buffer */ \
-	u8                      granularity;\
-	u8                      bit_offset;         /* Bit offset within min read/write data unit */\
-	u8                      access;             /* Access_type */\
-	u8                      lock_rule;\
-	u8                      update_rule;\
-	u8                      access_attribute;
+	u8                          granularity;\
+	u16                         length; \
+	u32                         offset;             /* Byte offset within containing object */\
+	u8                          bit_offset;         /* Bit offset within min read/write data unit */\
+	u8                          access;             /* Access_type */\
+	u8                          lock_rule;\
+	u8                          update_rule;\
+	u8                          access_attribute;
 
 
 /******************************************************************************
@@ -98,25 +95,23 @@
 typedef struct /* COMMON */
 {
 	ACPI_OBJECT_COMMON_HEADER
-	UCHAR   first_non_common_byte;
 
 } ACPI_OBJECT_COMMON;
 
 
+typedef struct /* CACHE_LIST */
+{
+	ACPI_OBJECT_COMMON_HEADER
+	union acpi_operand_obj      *next;              /* Link for object cache and internal lists*/
+
+} ACPI_OBJECT_CACHE_LIST;
+
+
 typedef struct /* NUMBER - has value */
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     value;
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	void                    *reserved_p1;
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u32                         value;
 
 } ACPI_OBJECT_NUMBER;
 
@@ -125,16 +120,8 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     length;         /* # of bytes in string, excluding trailing null */
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	char                    *pointer;       /* String value in AML stream or in allocated space */
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u32                         length;
+	NATIVE_CHAR                 *pointer;       /* String value in AML stream or in allocated space */
 
 } ACPI_OBJECT_STRING;
 
@@ -143,16 +130,10 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     length;         /* # of bytes in buffer */
-	u32                     sequence;       /* Sequential count of buffers created */
-	u32                     reserved3;
-	u32                     reserved4;
-
-	u8                      *pointer;       /* points to the buffer in allocated space */
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u32                         length;
+	u32                         sequence;       /* Sequential count of buffers created */
+
+	u8                          *pointer;       /* points to the buffer in allocated space */
 
 } ACPI_OBJECT_BUFFER;
 
@@ -161,16 +142,10 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     count;          /* # of elements in package */
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	union acpi_obj_internal **elements;     /* Array of pointers to Acpi_objects */
-	union acpi_obj_internal **next_element; /* used only while initializing */
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u32                         count;          /* # of elements in package */
+
+	union acpi_operand_obj      **elements;     /* Array of pointers to Acpi_objects */
+	union acpi_operand_obj      **next_element; /* used only while initializing */
 
 } ACPI_OBJECT_PACKAGE;
 
@@ -180,13 +155,9 @@
 	ACPI_OBJECT_COMMON_HEADER
 
 	ACPI_COMMON_FIELD_INFO
-	u32                     sequence;           /* Container's sequence number */
+	u32                         sequence;           /* Container's sequence number */
 
-	union acpi_obj_internal *container;         /* Containing object (Buffer) */
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	union acpi_operand_obj      *container;         /* Containing object (Buffer) */
 
 } ACPI_OBJECT_FIELD_UNIT;
 
@@ -195,16 +166,9 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     reserved1;
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	ACPI_HANDLE             handle;
-	union acpi_obj_internal *sys_handler;       /* Handler for system notifies */
-	union acpi_obj_internal *drv_handler;       /* Handler for driver notifies */
-	union acpi_obj_internal *addr_handler;      /* Handler for Address space */
-	void                    *reserved_p5;
+	union acpi_operand_obj      *sys_handler;        /* Handler for system notifies */
+	union acpi_operand_obj      *drv_handler;        /* Handler for driver notifies */
+	union acpi_operand_obj      *addr_handler;       /* Handler for Address space */
 
 } ACPI_OBJECT_DEVICE;
 
@@ -213,18 +177,7 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u16                     lock_count;
-	u16                     thread_id;
-	u16                     signal_count;
-	u16                     fill1;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	void                    *semaphore;
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	void                        *semaphore;
 
 } ACPI_OBJECT_EVENT;
 
@@ -234,21 +187,17 @@
 typedef struct /* METHOD */
 {
 	ACPI_OBJECT_COMMON_HEADER
+	u8                          method_flags;
+	u8                          param_count;
+
+	u32                         pcode_length;
 
-	u8                      method_flags;
-	u8                      param_count;
-	u8                      concurrency;
-	u8                      fill1;
-	u32                     pcode_length;
-	u32                     table_length;
-	ACPI_OWNER_ID           owning_id;
-	u16                     reserved4;
-
-	u8                      *pcode;
-	u8                      *acpi_table;
-	void                    *parser_op;
-	void                    *semaphore;
-	void                    *reserved_p5;
+	void                        *semaphore;
+	u8                          *pcode;
+
+	u8                          concurrency;
+	u8                          thread_count;
+	ACPI_OWNER_ID               owning_id;
 
 } ACPI_OBJECT_METHOD;
 
@@ -256,45 +205,31 @@
 typedef struct /* MUTEX */
 {
 	ACPI_OBJECT_COMMON_HEADER
+	u16                         sync_level;
 
-	u16                     lock_count;
-	u16                     thread_id;
-	u16                     sync_level;
-	u16                     fill1;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	void                    *semaphore;
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	void                        *semaphore;
 
 } ACPI_OBJECT_MUTEX;
 
-/*  Flags for Region */
-
-#define INITIAL_REGION_FLAGS        0x0000  /* value set when the region is created */
-#define REGION_AGRUMENT_DATA_VALID  0x0001  /* Addr/Len are set */
-#define REGION_INITIALIZED          0x0002  /* region init handler has been called */
-			  /* this includes _REG method, if any */
 
 typedef struct /* REGION */
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u16                     space_id;
-	u16                     region_flags;       /* bits defined above */
-	u32                     address;
-	u32                     length;
-	u32                     reserved4;          /* Region Specific data (PCI _ADR) */
-
-	union acpi_obj_internal *method;            /* Associated control method */
-	union acpi_obj_internal *addr_handler;      /* Handler for system notifies */
-	union acpi_obj_internal *link;              /* Link in list of regions */
-			   /* list is owned by Addr_handler */
-	ACPI_NAMED_OBJECT      *REGmethod;          /* _REG method for this region (if any) */
-	ACPI_NAMED_OBJECT      *nte;                /* containing object */
+	u8                          space_id;
+	u32                         length;
+	u32                         address;
+	void                        *region_context;    /* Region Specific data (Handler->Context
+			  optional things like PCI _ADR) */
+
+	/* TBD: [Restructure] This field can go away when Pass3 is implemented */
+	union acpi_operand_obj      *method;            /* Associated control method */
+
+
+	union acpi_operand_obj      *addr_handler;      /* Handler for system notifies */
+	ACPI_NAMESPACE_NODE         *REGmethod;         /* _REG method for this region (if any) */
+	ACPI_NAMESPACE_NODE         *node;              /* containing object */
+	union acpi_operand_obj      *next;
 
 } ACPI_OBJECT_REGION;
 
@@ -303,16 +238,11 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     system_level;
-	u32                     resource_order;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	ACPI_HANDLE             handle;
-	union acpi_obj_internal *sys_handler;       /* Handler for system notifies */
-	union acpi_obj_internal *drv_handler;       /* Handler for driver notifies */
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u32                         system_level;
+	u32                         resource_order;
+
+	union acpi_operand_obj      *sys_handler;       /* Handler for system notifies */
+	union acpi_operand_obj      *drv_handler;       /* Handler for driver notifies */
 
 } ACPI_OBJECT_POWER_RESOURCE;
 
@@ -321,17 +251,13 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     proc_id;
-	ACPI_IO_ADDRESS         pblk_address;
-	u16                     fill1;
-	u32                     pblk_length;
-	u32                     reserved4;
-
-	ACPI_HANDLE             handle;
-	union acpi_obj_internal *sys_handler;       /* Handler for system notifies */
-	union acpi_obj_internal *drv_handler;       /* Handler for driver notifies */
-	union acpi_obj_internal *addr_handler;      /* Handler for Address space */
-	void                    *reserved_p5;
+	u32                         proc_id;
+	u32                         length;
+	ACPI_IO_ADDRESS             address;
+
+	union acpi_operand_obj      *sys_handler;       /* Handler for system notifies */
+	union acpi_operand_obj      *drv_handler;       /* Handler for driver notifies */
+	union acpi_operand_obj      *addr_handler;      /* Handler for Address space */
 
 } ACPI_OBJECT_PROCESSOR;
 
@@ -340,16 +266,9 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     reserved1;
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	ACPI_HANDLE             handle;
-	union acpi_obj_internal *sys_handler;       /* Handler for system notifies */
-	union acpi_obj_internal *drv_handler;       /* Handler for driver notifies */
-	union acpi_obj_internal *addr_handler;      /* Handler for Address space */
-	void                    *reserved_p5;
+	union acpi_operand_obj      *sys_handler;       /* Handler for system notifies */
+	union acpi_operand_obj      *drv_handler;       /* Handler for driver notifies */
+	union acpi_operand_obj      *addr_handler;      /* Handler for Address space */
 
 } ACPI_OBJECT_THERMAL_ZONE;
 
@@ -358,18 +277,14 @@
  * Internal types
  */
 
+
 typedef struct /* FIELD */
 {
 	ACPI_OBJECT_COMMON_HEADER
 
 	ACPI_COMMON_FIELD_INFO
-	u32                     reserved4;
 
-	union acpi_obj_internal *container;         /* Containing object */
-	void                    *reserved_p2;
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	union acpi_operand_obj      *container;         /* Containing object */
 
 } ACPI_OBJECT_FIELD;
 
@@ -379,13 +294,10 @@
 	ACPI_OBJECT_COMMON_HEADER
 
 	ACPI_COMMON_FIELD_INFO
-	u32                     value;              /* Value to store into Bank_select */
+	u32                         value;              /* Value to store into Bank_select */
 
-	ACPI_HANDLE             bank_select;        /* Bank select register */
-	union acpi_obj_internal *container;         /* Containing object */
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	ACPI_HANDLE                 bank_select;        /* Bank select register */
+	union acpi_operand_obj      *container;         /* Containing object */
 
 } ACPI_OBJECT_BANK_FIELD;
 
@@ -399,13 +311,10 @@
 	ACPI_OBJECT_COMMON_HEADER
 
 	ACPI_COMMON_FIELD_INFO
-	u32                     value;              /* Value to store into Index register */
+	u32                         value;              /* Value to store into Index register */
 
-	ACPI_HANDLE             index;              /* Index register */
-	ACPI_HANDLE             data;               /* Data register */
-	void                    *reserved_p3;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	ACPI_HANDLE                 index;              /* Index register */
+	ACPI_HANDLE                 data;               /* Data register */
 
 } ACPI_OBJECT_INDEX_FIELD;
 
@@ -414,16 +323,9 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u32                     reserved1;
-	u32                     reserved2;
-	u32                     reserved3;
-	u32                     reserved4;
-
-	ACPI_NAMED_OBJECT       *nte;               /* Parent device */
-	NOTIFY_HANDLER          handler;
-	void                    *context;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	ACPI_NAMESPACE_NODE         *node;               /* Parent device */
+	NOTIFY_HANDLER              handler;
+	void                        *context;
 
 } ACPI_OBJECT_NOTIFY_HANDLER;
 
@@ -432,19 +334,20 @@
 
 #define ADDR_HANDLER_DEFAULT_INSTALLED  0x1
 
+
 typedef struct /* ADDRESS HANDLER */
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u16                     space_id;
-	u16                     hflags;
-	ADDRESS_SPACE_HANDLER   handler;
-
-	ACPI_NAMED_OBJECT       *nte;               /* Parent device */
-	void                    *context;
-	ADDRESS_SPACE_SETUP     setup;
-	union acpi_obj_internal *link;              /* Link to next handler on device */
-	union acpi_obj_internal *region_list;       /* regions using this handler */
+	u8                          space_id;
+	u16                         hflags;
+	ADDRESS_SPACE_HANDLER       handler;
+
+	ACPI_NAMESPACE_NODE         *node;              /* Parent device */
+	void                        *context;
+	ADDRESS_SPACE_SETUP         setup;
+	union acpi_operand_obj      *region_list;       /* regions using this handler */
+	union acpi_operand_obj      *next;
 
 } ACPI_OBJECT_ADDR_HANDLER;
 
@@ -458,31 +361,27 @@
 {
 	ACPI_OBJECT_COMMON_HEADER
 
-	u16                     op_code;
-	u8                      fill1;
-	u8                      target_type;        /* Used for Index_op */
-	u32                     offset;             /* Used for Arg_op, Local_op, and Index_op */
-	u32                     reserved3;
-	u32                     reserved4;
-
-	void                    *object;            /* Name_op=>HANDLE to obj, Index_op=>ACPI_OBJECT_INTERNAL */
-	ACPI_NAMED_OBJECT       *nte;
-	union acpi_obj_internal **where;
-	void                    *reserved_p4;
-	void                    *reserved_p5;
+	u8                          target_type;        /* Used for Index_op */
+	u16                         op_code;
+	u32                         offset;             /* Used for Arg_op, Local_op, and Index_op */
+
+	void                        *object;            /* Name_op=>HANDLE to obj, Index_op=>ACPI_OPERAND_OBJECT */
+	ACPI_NAMESPACE_NODE         *node;
+	union acpi_operand_obj      **where;
 
 } ACPI_OBJECT_REFERENCE;
 
 
 /******************************************************************************
  *
- * ACPI_OBJECT_INTERNAL Descriptor - a giant union of all of the above
+ * ACPI_OPERAND_OBJECT  Descriptor - a giant union of all of the above
  *
  *****************************************************************************/
 
-typedef union acpi_obj_internal
+typedef union acpi_operand_obj
 {
 	ACPI_OBJECT_COMMON          common;
+	ACPI_OBJECT_CACHE_LIST      cache;
 	ACPI_OBJECT_NUMBER          number;
 	ACPI_OBJECT_STRING          string;
 	ACPI_OBJECT_BUFFER          buffer;
@@ -503,6 +402,6 @@
 	ACPI_OBJECT_NOTIFY_HANDLER  notify_handler;
 	ACPI_OBJECT_ADDR_HANDLER    addr_handler;
 
-} ACPI_OBJECT_INTERNAL;
+} ACPI_OPERAND_OBJECT;
 
 #endif /* _ACOBJECT_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)