ACPICA: Eliminate acpi_native_uint type v2

No longer needed; replaced mostly with u32, but also acpi_size
where a type that changes 32/64 bit on 32/64-bit platforms is
required.

v2: Fix a cast of a 32-bit int to a pointer in ACPI to avoid a compiler warning.
from David Howells

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
This commit is contained in:
Bob Moore
2008-06-10 13:42:13 +08:00
committed by Andi Kleen
parent 11f2a61ab4
commit 67a119f990
48 changed files with 206 additions and 221 deletions

View File

@@ -221,7 +221,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
* dsinit
*/
acpi_status
acpi_ds_initialize_objects(acpi_native_uint table_index,
acpi_ds_initialize_objects(u32 table_index,
struct acpi_namespace_node *start_node);
/*

View File

@@ -140,7 +140,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
*/
ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
extern acpi_native_uint acpi_gbl_permanent_mmap;
extern u8 acpi_gbl_permanent_mmap;
/* These addresses are calculated from FADT address values */

View File

@@ -80,12 +80,12 @@
*/
#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b)))
#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_size)(b)))
#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
/* Pointer/Integer type conversions */
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i)
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
@@ -296,22 +296,22 @@ struct acpi_integer_overlay {
/*
* Rounding macros (Power of two boundaries only)
*/
#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \
(~(((acpi_native_uint) boundary)-1)))
#define ACPI_ROUND_DOWN(value, boundary) (((acpi_size)(value)) & \
(~(((acpi_size) boundary)-1)))
#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \
(((acpi_native_uint) boundary)-1)) & \
(~(((acpi_native_uint) boundary)-1)))
#define ACPI_ROUND_UP(value, boundary) ((((acpi_size)(value)) + \
(((acpi_size) boundary)-1)) & \
(~(((acpi_size) boundary)-1)))
/* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */
/* Note: sizeof(acpi_size) evaluates to either 4 or 8 (32- vs 64-bit mode) */
#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a,4)
#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a,8)
#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint))
#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a,sizeof(acpi_size))
#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a,4)
#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a,8)
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_native_uint))
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,sizeof(acpi_size))
#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a))
@@ -322,7 +322,7 @@ struct acpi_integer_overlay {
#define ACPI_ROUND_UP_TO(value,boundary) (((value) + ((boundary)-1)) / (boundary))
#define ACPI_IS_MISALIGNED(value) (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1))
#define ACPI_IS_MISALIGNED(value) (((acpi_size)value) & (sizeof(acpi_size)-1))
/*
* Bitmask creation

View File

@@ -86,8 +86,7 @@ acpi_status acpi_ns_initialize_devices(void);
acpi_status acpi_ns_load_namespace(void);
acpi_status
acpi_ns_load_table(acpi_native_uint table_index,
struct acpi_namespace_node *node);
acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node);
/*
* nswalk - walk the namespace
@@ -108,12 +107,11 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct
* nsparse - table parsing
*/
acpi_status
acpi_ns_parse_table(acpi_native_uint table_index,
struct acpi_namespace_node *start_node);
acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);
acpi_status
acpi_ns_one_complete_parse(acpi_native_uint pass_number,
acpi_native_uint table_index,
acpi_ns_one_complete_parse(u32 pass_number,
u32 table_index,
struct acpi_namespace_node *start_node);
/*

View File

@@ -144,7 +144,7 @@ void acpi_os_release_mutex(acpi_mutex handle);
void *acpi_os_allocate(acpi_size size);
void __iomem *acpi_os_map_memory(acpi_physical_address where,
acpi_native_uint length);
acpi_size length);
void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);

View File

@@ -98,7 +98,7 @@ void acpi_free(void *address);
*/
acpi_status acpi_reallocate_root_table(void);
acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address);
acpi_status acpi_find_root_pointer(acpi_size *rsdp_address);
acpi_status acpi_load_tables(void);
@@ -108,15 +108,15 @@ acpi_status acpi_unload_table_id(acpi_owner_id id);
acpi_status
acpi_get_table_header(acpi_string signature,
acpi_native_uint instance,
u32 instance,
struct acpi_table_header *out_table_header);
acpi_status
acpi_get_table(acpi_string signature,
acpi_native_uint instance, struct acpi_table_header **out_table);
u32 instance, struct acpi_table_header **out_table);
acpi_status
acpi_get_table_by_index(acpi_native_uint table_index,
acpi_get_table_by_index(u32 table_index,
struct acpi_table_header **out_table);
acpi_status

View File

@@ -142,7 +142,7 @@ struct acpi_init_walk_info {
u16 package_init;
u16 object_count;
acpi_owner_id owner_id;
acpi_native_uint table_index;
u32 table_index;
};
struct acpi_get_devices_info {

View File

@@ -49,7 +49,7 @@ acpi_status acpi_allocate_root_table(u32 initial_table_count);
/*
* tbfadt - FADT parse/convert/validate
*/
void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
void acpi_tb_parse_fadt(u32 table_index, u8 flags);
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
@@ -58,8 +58,7 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
*/
acpi_status
acpi_tb_find_table(char *signature,
char *oem_id,
char *oem_table_id, acpi_native_uint * table_index);
char *oem_id, char *oem_table_id, u32 *table_index);
/*
* tbinstal - Table removal and deletion
@@ -69,30 +68,28 @@ acpi_status acpi_tb_resize_root_table_list(void);
acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc);
acpi_status
acpi_tb_add_table(struct acpi_table_desc *table_desc,
acpi_native_uint * table_index);
acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index);
acpi_status
acpi_tb_store_table(acpi_physical_address address,
struct acpi_table_header *table,
u32 length, u8 flags, acpi_native_uint * table_index);
u32 length, u8 flags, u32 *table_index);
void acpi_tb_delete_table(struct acpi_table_desc *table_desc);
void acpi_tb_terminate(void);
void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index);
void acpi_tb_delete_namespace_by_owner(u32 table_index);
acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index);
acpi_status acpi_tb_allocate_owner_id(u32 table_index);
acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index);
acpi_status acpi_tb_release_owner_id(u32 table_index);
acpi_status
acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id);
acpi_status acpi_tb_get_owner_id(u32 table_index, acpi_owner_id *owner_id);
u8 acpi_tb_is_table_loaded(acpi_native_uint table_index);
u8 acpi_tb_is_table_loaded(u32 table_index);
void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded);
void acpi_tb_set_table_loaded_flag(u32 table_index, u8 is_loaded);
/*
* tbutils - table manager utilities
@@ -103,14 +100,14 @@ void
acpi_tb_print_table_header(acpi_physical_address address,
struct acpi_table_header *header);
u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length);
u8 acpi_tb_checksum(u8 *buffer, u32 length);
acpi_status
acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
void
acpi_tb_install_table(acpi_physical_address address,
u8 flags, char *signature, acpi_native_uint table_index);
u8 flags, char *signature, u32 table_index);
acpi_status
acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);

View File

@@ -110,10 +110,10 @@
* usually used for memory allocation, efficient loop counters, and array
* indexes. The types are similar to the size_t type in the C library and are
* required because there is no C type that consistently represents the native
* data width.
* data width. ACPI_SIZE is needed because there is no guarantee that a
* kernel-level C library is present.
*
* ACPI_SIZE 16/32/64-bit unsigned value
* ACPI_NATIVE_UINT 16/32/64-bit unsigned value
* ACPI_NATIVE_INT 16/32/64-bit signed value
*
*/
@@ -147,9 +147,9 @@ typedef int INT32;
/*! [End] no source code translation !*/
typedef u64 acpi_native_uint;
typedef s64 acpi_native_int;
typedef u64 acpi_size;
typedef u64 acpi_io_address;
typedef u64 acpi_physical_address;
@@ -186,9 +186,9 @@ typedef int INT32;
/*! [End] no source code translation !*/
typedef u32 acpi_native_uint;
typedef s32 acpi_native_int;
typedef u32 acpi_size;
typedef u32 acpi_io_address;
typedef u32 acpi_physical_address;
@@ -202,10 +202,6 @@ typedef u32 acpi_physical_address;
#error unknown ACPI_MACHINE_WIDTH
#endif
/* Variable-width type, used instead of clib size_t */
typedef acpi_native_uint acpi_size;
/*******************************************************************************
*
* OS-dependent and compiler-dependent types
@@ -219,7 +215,7 @@ typedef acpi_native_uint acpi_size;
/* Value returned by acpi_os_get_thread_id */
#ifndef acpi_thread_id
#define acpi_thread_id acpi_native_uint
#define acpi_thread_id acpi_size
#endif
/* Object returned from acpi_os_create_lock */
@@ -231,7 +227,7 @@ typedef acpi_native_uint acpi_size;
/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
#ifndef acpi_cpu_flags
#define acpi_cpu_flags acpi_native_uint
#define acpi_cpu_flags acpi_size
#endif
/* Object returned from acpi_os_create_cache */

View File

@@ -172,7 +172,7 @@ char *acpi_ut_strstr(char *string1, char *string2);
void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count);
void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count);
void *acpi_ut_memset(void *dest, u8 value, acpi_size count);
int acpi_ut_to_upper(int c);
@@ -476,7 +476,7 @@ u8 acpi_ut_valid_acpi_name(u32 name);
acpi_name acpi_ut_repair_name(char *name);
u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
u8 acpi_ut_valid_acpi_char(char character, u32 position);
acpi_status
acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);