Merge branch 'master' into for_paulus

This commit is contained in:
Kumar Gala
2007-02-12 21:17:37 -06:00
1078 changed files with 57101 additions and 26524 deletions

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20060707
#define ACPI_CA_VERSION 0x20070126
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -115,6 +115,10 @@
#define ACPI_NUM_OWNERID_MASKS 8
/* Size of the root table array is increased by this increment */
#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
@@ -152,6 +156,11 @@
#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
#define ACPI_PATH_SEPARATOR '.'
/* Sizes for ACPI table headers */
#define ACPI_OEM_ID_SIZE 6
#define ACPI_OEM_TABLE_ID_SIZE 8
/* Constants used in searching for the RSDP in low memory */
#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -159,6 +159,10 @@ void
acpi_db_create_execution_threads(char *num_threads_arg,
char *num_loops_arg, char *method_name_arg);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
#endif
/*
* dbfileio - Debugger file I/O commands
*/
@@ -214,4 +218,6 @@ void acpi_db_prep_namestring(char *name);
struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
void acpi_db_uint32_to_hex_string(u32 value, char *buffer);
#endif /* __ACDEBUG_H__ */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -97,9 +97,11 @@ typedef const struct acpi_dmtable_info {
#define ACPI_DMT_CHKSUM 20
#define ACPI_DMT_SPACEID 21
#define ACPI_DMT_GAS 22
#define ACPI_DMT_MADT 23
#define ACPI_DMT_SRAT 24
#define ACPI_DMT_EXIT 25
#define ACPI_DMT_DMAR 23
#define ACPI_DMT_MADT 24
#define ACPI_DMT_SRAT 25
#define ACPI_DMT_EXIT 26
#define ACPI_DMT_SIG 27
typedef
void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
@@ -108,6 +110,7 @@ struct acpi_dmtable_data {
char *signature;
struct acpi_dmtable_info *table_info;
ACPI_TABLE_HANDLER table_handler;
char *name;
};
struct acpi_op_walk_info {
@@ -139,7 +142,9 @@ extern const char *acpi_gbl_match_ops[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
@@ -147,6 +152,11 @@ extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
@@ -201,6 +211,8 @@ void acpi_dm_dump_asf(struct acpi_table_header *table);
void acpi_dm_dump_cpep(struct acpi_table_header *table);
void acpi_dm_dump_dmar(struct acpi_table_header *table);
void acpi_dm_dump_fadt(struct acpi_table_header *table);
void acpi_dm_dump_srat(struct acpi_table_header *table);
@@ -314,7 +326,7 @@ acpi_dm_resource_template(struct acpi_op_walk_info *info,
union acpi_parse_object *op,
u8 * byte_data, u32 byte_count);
u8 acpi_dm_is_resource_template(union acpi_parse_object *op);
acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
void acpi_dm_indent(u32 level);

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -210,7 +210,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
* dsinit
*/
acpi_status
acpi_ds_initialize_objects(struct acpi_table_desc *table_desc,
acpi_ds_initialize_objects(acpi_native_uint table_index,
struct acpi_namespace_node *start_node);
/*

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -178,8 +178,10 @@
#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
#define AE_CTRL_PARSE_CONTINUE (acpi_status) (0x000C | AE_CODE_CONTROL)
#define AE_CTRL_PARSE_PENDING (acpi_status) (0x000D | AE_CODE_CONTROL)
#define AE_CODE_CTRL_MAX 0x000B
#define AE_CODE_CTRL_MAX 0x000D
#ifdef DEFINE_ACPI_GLOBALS
@@ -291,7 +293,9 @@ char const *acpi_gbl_exception_names_ctrl[] = {
"AE_CTRL_TRANSFER",
"AE_CTRL_BREAK",
"AE_CTRL_CONTINUE",
"AE_CTRL_SKIP"
"AE_CTRL_SKIP",
"AE_CTRL_PARSE_CONTINUE",
"AE_CTRL_PARSE_PENDING"
};
#endif /* ACPI GLOBALS */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,37 +58,6 @@
#define ACPI_INIT_GLOBAL(a,b) a
#endif
/*
* Keep local copies of these FADT-based registers. NOTE: These globals
* are first in this file for alignment reasons on 64-bit systems.
*/
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
/*****************************************************************************
*
* Debug support
*
****************************************************************************/
/* Runtime configuration of debug print levels */
extern u32 acpi_dbg_level;
extern u32 acpi_dbg_layer;
/* Procedure nesting level for debug output */
extern u32 acpi_gbl_nesting_level;
/* Support for dynamic control method tracing mechanism */
ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_flags;
/*****************************************************************************
*
* Runtime configuration (static defaults that can be overriden at runtime)
@@ -133,6 +102,34 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
*/
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
/*****************************************************************************
*
* Debug support
*
****************************************************************************/
/* Runtime configuration of debug print levels */
extern u32 acpi_dbg_level;
extern u32 acpi_dbg_layer;
/* Procedure nesting level for debug output */
extern u32 acpi_gbl_nesting_level;
/* Event counters */
ACPI_EXTERN u32 acpi_gpe_count;
/* Support for dynamic control method tracing mechanism */
ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_flags;
/*****************************************************************************
*
* ACPI Table globals
@@ -140,47 +137,29 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
****************************************************************************/
/*
* Table pointers.
* Although these pointers are somewhat redundant with the global acpi_table,
* they are convenient because they are typed pointers.
* acpi_gbl_root_table_list is the master list of ACPI tables found in the
* RSDT/XSDT.
*
* These tables are single-table only; meaning that there can be at most one
* of each in the system. Each global points to the actual table.
*/
ACPI_EXTERN u32 acpi_gbl_table_flags;
ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT;
ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT;
ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS;
ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
/*
* Since there may be multiple SSDTs and PSDTs, a single pointer is not
* sufficient; Therefore, there isn't one!
* acpi_gbl_FADT is a local copy of the FADT, converted to a common format.
*/
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;
/* The root table can be either an RSDT or an XSDT */
/* These addresses are calculated from FADT address values */
ACPI_EXTERN u8 acpi_gbl_root_table_type;
#define ACPI_TABLE_TYPE_RSDT 'R'
#define ACPI_TABLE_TYPE_XSDT 'X'
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
/*
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths:
* If we are executing a method that exists in a 32-bit ACPI table,
* use only the lower 32 bits of the (internal) 64-bit Integer.
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
* 2, use only the lower 32 bits of the internal 64-bit Integer.
*/
ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
/*
* ACPI Table info arrays
*/
extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
/*****************************************************************************
*
* Mutual exlusion within ACPICA subsystem
@@ -188,7 +167,7 @@ extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
****************************************************************************/
/*
* Predefined mutex objects. This array contains the
* Predefined mutex objects. This array contains the
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
* (The table maps local handles to the real OS handles)
*/
@@ -197,6 +176,7 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
/*
* Global lock semaphore works in conjunction with the actual HW global lock
*/
ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
/*
@@ -220,6 +200,7 @@ ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE regis
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
#endif
/* Object caches */
@@ -240,7 +221,6 @@ ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
/* Misc */
ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
ACPI_EXTERN u32 acpi_gbl_original_mode;
ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
@@ -260,12 +240,19 @@ ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags;
extern const u8 acpi_gbl_decode_to8bit[8];
extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
extern const char *acpi_gbl_highest_dstate_names[4];
extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
/* Exception codes */
extern char const *acpi_gbl_exception_names_env[];
extern char const *acpi_gbl_exception_names_pgm[];
extern char const *acpi_gbl_exception_names_tbl[];
extern char const *acpi_gbl_exception_names_aml[];
extern char const *acpi_gbl_exception_names_ctrl[];
/*****************************************************************************
*
* Namespace globals

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,8 +61,6 @@
/*
* hwacpi - high level functions
*/
acpi_status acpi_hw_initialize(void);
acpi_status acpi_hw_set_mode(u32 mode);
u32 acpi_hw_get_mode(void);
@@ -84,7 +82,7 @@ acpi_hw_low_level_read(u32 width,
acpi_status
acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
acpi_status acpi_hw_clear_acpi_status(u32 flags);
acpi_status acpi_hw_clear_acpi_status(void);
/*
* hwgpe - GPE support

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -277,12 +277,6 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer time);
acpi_status acpi_ex_system_do_stall(u32 time);
acpi_status
acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
union acpi_operand_object *obj_desc);
acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
acpi_status
@@ -451,10 +445,14 @@ acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
/*
* exutils - interpreter/scanner utilities
*/
acpi_status acpi_ex_enter_interpreter(void);
void acpi_ex_enter_interpreter(void);
void acpi_ex_exit_interpreter(void);
void acpi_ex_reacquire_interpreter(void);
void acpi_ex_relinquish_interpreter(void);
void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
u8 acpi_ex_acquire_global_lock(u32 rule);

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -80,8 +80,8 @@ union acpi_parse_object;
* table below also!
*/
#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
#define ACPI_MTX_TABLES 1 /* Data for ACPI tables */
#define ACPI_MTX_NAMESPACE 2 /* ACPI Namespace */
#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
@@ -162,7 +162,7 @@ struct acpi_mutex_info {
typedef enum {
ACPI_IMODE_LOAD_PASS1 = 0x01,
ACPI_IMODE_LOAD_PASS2 = 0x02,
ACPI_IMODE_EXECUTE = 0x0E
ACPI_IMODE_EXECUTE = 0x03
} acpi_interpreter_mode;
union acpi_name_union {
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
/* Namespace Node flags */
#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
#define ANOBJ_RESERVED 0x02 /* Available for future use */
#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
@@ -219,25 +219,42 @@ struct acpi_namespace_node {
* ACPI Table Descriptor. One per ACPI table
*/
struct acpi_table_desc {
struct acpi_table_desc *prev;
struct acpi_table_desc *next;
struct acpi_table_desc *installed_desc;
acpi_physical_address address;
struct acpi_table_header *pointer;
u8 *aml_start;
u64 physical_address;
acpi_size length;
u32 aml_length;
u32 length; /* Length fixed at 32 bits */
union acpi_name_union signature;
acpi_owner_id owner_id;
u8 type;
u8 allocation;
u8 loaded_into_namespace;
u8 flags;
};
struct acpi_table_list {
struct acpi_table_desc *next;
/* Flags for above */
#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
#define ACPI_TABLE_ORIGIN_MAPPED (1)
#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
#define ACPI_TABLE_ORIGIN_MASK (3)
#define ACPI_TABLE_IS_LOADED (4)
/* One internal RSDT for table management */
struct acpi_internal_rsdt {
struct acpi_table_desc *tables;
u32 count;
u32 size;
u8 flags;
};
/* Flags for above */
#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
#define ACPI_ROOT_ALLOW_RESIZE (2)
/* Predefined (fixed) table indexes */
#define ACPI_TABLE_INDEX_DSDT (0)
#define ACPI_TABLE_INDEX_FACS (1)
struct acpi_find_context {
char *search_for;
acpi_handle *list;
@@ -350,7 +367,7 @@ struct acpi_gpe_event_info {
union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
u8 flags; /* Misc info about this GPE */
u8 register_bit; /* This GPE bit within the register */
u8 gpe_number; /* This GPE */
};
/* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -855,12 +872,30 @@ struct acpi_bit_register_info {
****************************************************************************/
struct acpi_db_method_info {
acpi_handle thread_gate;
acpi_handle main_thread_gate;
acpi_handle thread_complete_gate;
u32 *threads;
u32 num_threads;
u32 num_created;
u32 num_completed;
char *name;
char **args;
u32 flags;
u32 num_loops;
char pathname[128];
char **args;
/*
* Arguments to be passed to method for the command
* Threads -
* the Number of threads, ID of current thread and
* Index of current thread inside all them created.
*/
char init_args;
char *arguments[4];
char num_threads_str[11];
char id_of_thread_str[11];
char index_of_thread_str[11];
};
struct acpi_integrity_info {
@@ -919,6 +954,8 @@ struct acpi_memory_list {
u32 total_allocated;
u32 total_freed;
u32 max_occupied;
u32 total_size;
u32 current_total_size;
u32 requests;
u32 hits;

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,25 +55,12 @@
#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
/* Size calculation */
#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
#if ACPI_MACHINE_WIDTH == 16
/*
* For 16-bit addresses, we have to assume that the upper 32 bits
* (out of 64) are zero.
*/
#define ACPI_LODWORD(l) ((u32)(l))
#define ACPI_HIDWORD(l) ((u32)(0))
#define ACPI_GET_ADDRESS(a) ((a).lo)
#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);}
#define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo)
#else
#ifdef ACPI_NO_INTEGER64_SUPPORT
/*
* acpi_integer is 32-bits, no 64-bit support on this platform
@@ -81,10 +68,6 @@
#define ACPI_LODWORD(l) ((u32)(l))
#define ACPI_HIDWORD(l) ((u32)(0))
#define ACPI_GET_ADDRESS(a) (a)
#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
#define ACPI_VALID_ADDRESS(a) (a)
#else
/*
@@ -92,11 +75,6 @@
*/
#define ACPI_LODWORD(l) ((u32)(u64)(l))
#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
#define ACPI_GET_ADDRESS(a) (a)
#define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b))
#define ACPI_VALID_ADDRESS(a) (a)
#endif
#endif
/*
@@ -134,15 +112,8 @@
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) 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)
#if ACPI_MACHINE_WIDTH == 16
#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
#else
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
#endif
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
@@ -223,28 +194,6 @@
/* The hardware supports unaligned transfers, just do the little-endian move */
#if ACPI_MACHINE_WIDTH == 16
/* No 64-bit integers */
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
#define ACPI_MOVE_16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
#define ACPI_MOVE_16_TO_64(d,s) ACPI_MOVE_16_TO_32(d,s)
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
#define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
/* 64-bit source, 16/32/64 destination */
#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
#else
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
@@ -262,7 +211,6 @@
#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
#endif
#else
/*
@@ -307,10 +255,7 @@
/* Macros based on machine integer width */
#if ACPI_MACHINE_WIDTH == 16
#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s)
#elif ACPI_MACHINE_WIDTH == 32
#if ACPI_MACHINE_WIDTH == 32
#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s)
#elif ACPI_MACHINE_WIDTH == 64
@@ -695,16 +640,6 @@
#define ACPI_DEBUGGER_EXEC(a)
#endif
/*
* For 16-bit code, we want to shrink some things even though
* we are using ACPI_DEBUG_OUTPUT to get the debug output
*/
#if ACPI_MACHINE_WIDTH == 16
#undef ACPI_DEBUG_ONLY_MEMBERS
#undef _VERBOSE_STRUCTURES
#define ACPI_DEBUG_ONLY_MEMBERS(a)
#endif
#ifdef ACPI_DEBUG_OUTPUT
/*
* 1) Set name to blanks

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -65,9 +65,13 @@
#define ACPI_NS_ERROR_IF_FOUND 0x08
#define ACPI_NS_PREFIX_IS_SCOPE 0x10
#define ACPI_NS_EXTERNAL 0x20
#define ACPI_NS_TEMPORARY 0x40
#define ACPI_NS_WALK_UNLOCK TRUE
#define ACPI_NS_WALK_NO_UNLOCK FALSE
/* Flags for acpi_ns_walk_namespace */
#define ACPI_NS_WALK_NO_UNLOCK 0
#define ACPI_NS_WALK_UNLOCK 0x01
#define ACPI_NS_WALK_TEMP_NODES 0x02
/*
* nsinit - Namespace initialization
@@ -82,7 +86,7 @@ acpi_status acpi_ns_initialize_devices(void);
acpi_status acpi_ns_load_namespace(void);
acpi_status
acpi_ns_load_table(struct acpi_table_desc *table_desc,
acpi_ns_load_table(acpi_native_uint table_index,
struct acpi_namespace_node *node);
/*
@@ -92,7 +96,7 @@ acpi_status
acpi_ns_walk_namespace(acpi_object_type type,
acpi_handle start_object,
u32 max_depth,
u8 unlock_before_callback,
u32 flags,
acpi_walk_callback user_function,
void *context, void **return_value);
@@ -106,11 +110,12 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
* nsparse - table parsing
*/
acpi_status
acpi_ns_parse_table(struct acpi_table_desc *table_desc,
struct acpi_namespace_node *scope);
acpi_ns_parse_table(acpi_native_uint table_index,
struct acpi_namespace_node *start_node);
acpi_status
acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc);
acpi_ns_one_complete_parse(acpi_native_uint pass_number,
acpi_native_uint table_index);
/*
* nsaccess - Top-level namespace access

View File

@@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,15 @@
* 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 it to be cached and reused.
*
* Note: The object is optimized to be aligned and will not work if it is
* byte-packed.
*/
#if ACPI_MACHINE_WIDTH == 64
#pragma pack(8)
#else
#pragma pack(4)
#endif
/*******************************************************************************
*
@@ -101,7 +109,8 @@ struct acpi_object_common {
ACPI_OBJECT_COMMON_HEADER};
struct acpi_object_integer {
ACPI_OBJECT_COMMON_HEADER acpi_integer value;
ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
acpi_integer value;
};
/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
};
struct acpi_object_processor {
ACPI_OBJECT_COMMON_HEADER u8 proc_id;
ACPI_OBJECT_COMMON_HEADER
/* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
u8 proc_id;
u8 length;
ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
};
@@ -406,4 +417,6 @@ union acpi_descriptor {
union acpi_parse_object op;
};
#pragma pack()
#endif /* _ACOBJECT_H */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -257,7 +257,7 @@
#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF)
#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_BUFFER,ARGI_TARGETREF)
#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
#define ARGI_LOCAL0 ARG_NONE
#define ARGI_LOCAL1 ARG_NONE

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -59,7 +59,6 @@ acpi_evaluate_reference(acpi_handle handle,
#define ACPI_BUS_FILE_ROOT "acpi"
extern struct proc_dir_entry *acpi_root_dir;
extern struct fadt_descriptor acpi_fadt;
enum acpi_bus_removal_type {
ACPI_BUS_REMOVAL_NORMAL = 0,
@@ -92,13 +91,12 @@ typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
typedef int (*acpi_op_lock) (struct acpi_device * device, int type);
typedef int (*acpi_op_start) (struct acpi_device * device);
typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
typedef int (*acpi_op_suspend) (struct acpi_device * device, int state);
typedef int (*acpi_op_resume) (struct acpi_device * device, int state);
typedef int (*acpi_op_suspend) (struct acpi_device * device, pm_message_t state);
typedef int (*acpi_op_resume) (struct acpi_device * device);
typedef int (*acpi_op_scan) (struct acpi_device * device);
typedef int (*acpi_op_bind) (struct acpi_device * device);
typedef int (*acpi_op_unbind) (struct acpi_device * device);
typedef int (*acpi_op_match) (struct acpi_device * device,
struct acpi_driver * driver);
typedef int (*acpi_op_shutdown) (struct acpi_device * device);
struct acpi_bus_ops {
u32 acpi_op_add:1;
@@ -111,7 +109,7 @@ struct acpi_bus_ops {
u32 acpi_op_scan:1;
u32 acpi_op_bind:1;
u32 acpi_op_unbind:1;
u32 acpi_op_match:1;
u32 acpi_op_shutdown:1;
u32 reserved:21;
};
@@ -126,16 +124,16 @@ struct acpi_device_ops {
acpi_op_scan scan;
acpi_op_bind bind;
acpi_op_unbind unbind;
acpi_op_match match;
acpi_op_shutdown shutdown;
};
struct acpi_driver {
struct list_head node;
char name[80];
char class[80];
atomic_t references;
char *ids; /* Supported Hardware IDs */
struct acpi_device_ops ops;
struct device_driver drv;
struct module *owner;
};
/*
@@ -185,7 +183,7 @@ struct acpi_device_dir {
typedef char acpi_bus_id[5];
typedef unsigned long acpi_bus_address;
typedef char acpi_hardware_id[9];
typedef char acpi_hardware_id[15];
typedef char acpi_unique_id[9];
typedef char acpi_device_name[40];
typedef char acpi_device_class[20];
@@ -296,11 +294,14 @@ struct acpi_device {
struct acpi_device_ops ops;
struct acpi_driver *driver;
void *driver_data;
struct kobject kobj;
struct device dev;
struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
};
#define acpi_driver_data(d) ((d)->driver_data)
#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
/*
* Events

View File

@@ -36,13 +36,14 @@
/* _HID definitions */
#define ACPI_POWER_HID "ACPI_PWR"
#define ACPI_PROCESSOR_HID "ACPI_CPU"
#define ACPI_SYSTEM_HID "ACPI_SYS"
#define ACPI_THERMAL_HID "ACPI_THM"
#define ACPI_BUTTON_HID_POWERF "ACPI_FPB"
#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB"
#define ACPI_POWER_HID "power_resource"
#define ACPI_PROCESSOR_HID "ACPI0007"
#define ACPI_SYSTEM_HID "acpi_system"
#define ACPI_THERMAL_HID "thermal"
#define ACPI_BUTTON_HID_POWERF "button_power"
#define ACPI_BUTTON_HID_SLEEPF "button_sleep"
#define ACPI_VIDEO_HID "video"
#define ACPI_BAY_HID "bay"
/* --------------------------------------------------------------------------
PCI
-------------------------------------------------------------------------- */

View File

@@ -8,7 +8,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@ acpi_status acpi_os_terminate(void);
/*
* ACPI Table interfaces
*/
acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address);
acpi_physical_address acpi_os_get_root_pointer(void);
acpi_status
acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
@@ -143,9 +143,7 @@ void acpi_os_release_mutex(acpi_mutex handle);
*/
void *acpi_os_allocate(acpi_size size);
acpi_status
acpi_os_map_memory(acpi_physical_address physical_address,
acpi_size size, void __iomem ** logical_address);
void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_native_uint length);
void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);

View File

@@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,10 @@
/*
* Global interfaces
*/
acpi_status
acpi_initialize_tables(struct acpi_table_desc *initial_storage,
u32 initial_table_count, u8 allow_resize);
acpi_status acpi_initialize_subsystem(void);
acpi_status acpi_enable_subsystem(u32 flags);
@@ -92,30 +96,28 @@ void acpi_free(void *address);
/*
* ACPI table manipulation interfaces
*/
acpi_status
acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address);
acpi_status acpi_reallocate_root_table(void);
acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address);
acpi_status acpi_load_tables(void);
acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
acpi_status acpi_unload_table_id(acpi_table_type table_type, acpi_owner_id id);
#ifdef ACPI_FUTURE_USAGE
acpi_status acpi_unload_table(acpi_table_type table_type);
acpi_status
acpi_get_table_header(acpi_table_type table_type,
u32 instance, struct acpi_table_header *out_table_header);
#endif /* ACPI_FUTURE_USAGE */
acpi_status acpi_unload_table_id(acpi_owner_id id);
acpi_status
acpi_get_table(acpi_table_type table_type,
u32 instance, struct acpi_buffer *ret_buffer);
acpi_get_table_header(acpi_string signature,
acpi_native_uint instance,
struct acpi_table_header *out_table_header);
acpi_status
acpi_get_firmware_table(acpi_string signature,
u32 instance,
u32 flags, struct acpi_table_header **table_pointer);
acpi_get_table(acpi_string signature,
acpi_native_uint instance, struct acpi_table_header **out_table);
acpi_status
acpi_get_table_by_index(acpi_native_uint table_index,
struct acpi_table_header **out_table);
/*
* Namespace and name interfaces
@@ -310,9 +312,9 @@ acpi_resource_to_address64(struct acpi_resource *resource,
/*
* Hardware (ACPI device) interfaces
*/
acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags);
acpi_status acpi_get_register(u32 register_id, u32 * return_value);
acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags);
acpi_status acpi_set_register(u32 register_id, u32 value);
acpi_status
acpi_set_firmware_waking_vector(acpi_physical_address physical_address);

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,8 @@ struct acpi_init_walk_info {
u16 buffer_init;
u16 package_init;
u16 object_count;
struct acpi_table_desc *table_desc;
acpi_owner_id owner_id;
acpi_native_uint table_index;
};
struct acpi_get_devices_info {

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -44,105 +44,75 @@
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */
#define SIZE_IN_HEADER 0
acpi_status acpi_allocate_root_table(u32 initial_table_count);
/*
* tbconvrt - Table conversion routines
* tbfadt - FADT parse/convert/validate
*/
acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info);
void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
acpi_status acpi_tb_convert_table_fadt(void);
acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info);
u32
acpi_tb_get_table_count(struct rsdp_descriptor *RSDP,
struct acpi_table_header *RSDT);
void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
/*
* tbget - Table "get" routines
*/
acpi_status
acpi_tb_get_table(struct acpi_pointer *address,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_table_header(struct acpi_pointer *address,
struct acpi_table_header *return_header);
acpi_status
acpi_tb_get_table_body(struct acpi_pointer *address,
struct acpi_table_header *header,
struct acpi_table_desc *table_info);
acpi_status
acpi_tb_get_table_ptr(acpi_table_type table_type,
u32 instance, struct acpi_table_header **table_ptr_loc);
acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address);
void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address);
acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr);
/*
* tbgetall - get multiple required tables
*/
acpi_status acpi_tb_get_required_tables(void);
/*
* tbinstall - Table installation
*/
acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info);
acpi_status
acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type);
acpi_status
acpi_tb_init_table_descriptor(acpi_table_type table_type,
struct acpi_table_desc *table_info);
/*
* tbremove - Table removal and deletion
*/
void acpi_tb_delete_all_tables(void);
void acpi_tb_delete_tables_by_type(acpi_table_type type);
void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc);
struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc
*table_desc);
/*
* tbxfroot - RSDP, RSDT utilities
* tbfind - find ACPI table
*/
acpi_status
acpi_tb_find_table(char *signature,
char *oem_id,
char *oem_table_id, struct acpi_table_header **table_ptr);
acpi_status acpi_tb_get_table_rsdt(void);
acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp);
char *oem_table_id, acpi_native_uint * table_index);
/*
* tbutils - common table utilities
* tbinstal - Table removal and deletion
*/
acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc);
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_verify_table_checksum(struct acpi_table_header *table_header);
u8 acpi_tb_sum_table(void *buffer, u32 length);
u8 acpi_tb_generate_checksum(struct acpi_table_header *table);
void acpi_tb_set_checksum(struct acpi_table_header *table);
acpi_tb_add_table(struct acpi_table_desc *table_desc,
acpi_native_uint * table_index);
acpi_status
acpi_tb_validate_table_header(struct acpi_table_header *table_header);
acpi_tb_store_table(acpi_physical_address address,
struct acpi_table_header *table,
u32 length, u8 flags, acpi_native_uint * 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);
acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index);
acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index);
acpi_status
acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id);
u8 acpi_tb_is_table_loaded(acpi_native_uint table_index);
void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded);
/*
* tbutils - table manager utilities
*/
u8 acpi_tb_tables_loaded(void);
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);
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);
acpi_status
acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
#endif /* __ACTABLES_H__ */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,15 +48,15 @@
* Values for description table header signatures. Useful because they make
* it more difficult to inadvertently type in the wrong signature.
*/
#define DSDT_SIG "DSDT" /* Differentiated System Description Table */
#define FADT_SIG "FACP" /* Fixed ACPI Description Table */
#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
#define PSDT_SIG "PSDT" /* Persistent System Description Table */
#define RSDP_SIG "RSD PTR " /* Root System Description Pointer */
#define RSDT_SIG "RSDT" /* Root System Description Table */
#define XSDT_SIG "XSDT" /* Extended System Description Table */
#define SSDT_SIG "SSDT" /* Secondary System Description Table */
#define RSDP_NAME "RSDP"
#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
#define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */
#define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */
#define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */
#define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */
#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
/*
* All tables and structures must be byte-packed to match the ACPI
@@ -83,27 +83,29 @@
*
******************************************************************************/
#define ACPI_TABLE_HEADER_DEF \
char signature[4]; /* ASCII table signature */\
u32 length; /* Length of table in bytes, including this header */\
u8 revision; /* ACPI Specification minor version # */\
u8 checksum; /* To make sum of entire table == 0 */\
char oem_id[6]; /* ASCII OEM identification */\
char oem_table_id[8]; /* ASCII OEM table identification */\
u32 oem_revision; /* OEM revision number */\
char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\
u32 asl_compiler_revision; /* ASL compiler version */
struct acpi_table_header {
ACPI_TABLE_HEADER_DEF};
char signature[ACPI_NAME_SIZE]; /* ASCII table signature */
u32 length; /* Length of table in bytes, including this header */
u8 revision; /* ACPI Specification minor version # */
u8 checksum; /* To make sum of entire table == 0 */
char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
u32 oem_revision; /* OEM revision number */
char asl_compiler_id[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */
u32 asl_compiler_revision; /* ASL compiler version */
};
/*
* GAS - Generic Address Structure (ACPI 2.0+)
*
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
* If misalignment is not supported, access to the Address field must be
* performed with care.
*/
struct acpi_generic_address {
u8 address_space_id; /* Address space where struct or register exists */
u8 register_bit_width; /* Size in bits of given register */
u8 register_bit_offset; /* Bit offset within the register */
u8 space_id; /* Address space where struct or register exists */
u8 bit_width; /* Size in bits of given register */
u8 bit_offset; /* Bit offset within the register */
u8 access_width; /* Minimum Access size (ACPI 3.0) */
u64 address; /* 64-bit address of struct or register */
};
@@ -114,10 +116,10 @@ struct acpi_generic_address {
*
******************************************************************************/
struct rsdp_descriptor {
struct acpi_table_rsdp {
char signature[8]; /* ACPI signature, contains "RSD PTR " */
u8 checksum; /* ACPI 1.0 checksum */
char oem_id[6]; /* OEM identification */
char oem_id[ACPI_OEM_ID_SIZE]; /* OEM identification */
u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
u32 length; /* Table length in bytes, including header (ACPI 2.0+) */
@@ -134,12 +136,14 @@ struct rsdp_descriptor {
*
******************************************************************************/
struct rsdt_descriptor {
ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
struct acpi_table_rsdt {
struct acpi_table_header header; /* Common ACPI table header */
u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
struct xsdt_descriptor {
ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
struct acpi_table_xsdt {
struct acpi_table_header header; /* Common ACPI table header */
u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
};
/*******************************************************************************
@@ -148,36 +152,27 @@ struct xsdt_descriptor {
*
******************************************************************************/
struct facs_descriptor {
struct acpi_table_facs {
char signature[4]; /* ASCII table signature */
u32 length; /* Length of structure, in bytes */
u32 hardware_signature; /* Hardware configuration signature */
u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */
u32 global_lock; /* Global Lock for shared hardware resources */
/* Flags (32 bits) */
u8 S4bios_f:1; /* 00: S4BIOS support is present */
u8:7; /* 01-07: Reserved, must be zero */
u8 reserved1[3]; /* 08-31: Reserved, must be zero */
u32 flags;
u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
u8 version; /* Version of this table (ACPI 2.0+) */
u8 reserved[31]; /* Reserved, must be zero */
};
/* Flag macros */
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
/* Global lock flags */
#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
/*
* Common FACS - This is a version-independent FACS structure used for internal use only
*/
struct acpi_common_facs {
u32 *global_lock;
u64 *firmware_waking_vector;
u8 vector_width;
};
/*******************************************************************************
*
* FADT - Fixed ACPI Description Table (Signature "FACP")
@@ -186,121 +181,98 @@ struct acpi_common_facs {
/* Fields common to all versions of the FADT */
#define ACPI_FADT_COMMON \
ACPI_TABLE_HEADER_DEF \
u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \
u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \
u16 sci_int; /* System vector of SCI interrupt */ \
u32 smi_cmd; /* Port address of SMI command port */ \
u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \
u8 pstate_cnt; /* Processor performance state control*/ \
u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \
u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \
u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \
u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \
u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \
u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \
u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \
u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \
u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \
u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \
u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \
u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \
u16 flush_size; /* Processor's memory cache line width, in bytes */ \
u16 flush_stride; /* Number of flush strides that need to be read */ \
u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \
u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \
u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \
u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \
u8 century; /* Index to century in RTC CMOS RAM */ \
u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ \
u8 reserved2; /* Reserved, must be zero */
/*
* ACPI 2.0+ FADT
*/
struct fadt_descriptor {
ACPI_FADT_COMMON
/* Flags (32 bits) */
u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
u8 proc_c1:1; /* 02: All processors support C1 state */
u8 plvl2_up:1; /* 03: C2 state works on MP system */
u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
u8 dock_cap:1; /* 09: Docking supported */
u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
u8 headless:1; /* 12: No local video capabilities or local input devices */
u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
u8:4; /* 20-23: Reserved, must be zero */
u8 reserved3; /* 24-31: Reserved, must be zero */
struct acpi_generic_address reset_register; /* Reset register address in GAS format */
struct acpi_table_fadt {
struct acpi_table_header header; /* Common ACPI table header */
u32 facs; /* 32-bit physical address of FACS */
u32 dsdt; /* 32-bit physical address of DSDT */
u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */
u16 sci_interrupt; /* System vector of SCI interrupt */
u32 smi_command; /* 32-bit Port address of SMI command port */
u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
u8 S4bios_request; /* Value to write to SMI CMD to enter S4BIOS state */
u8 pstate_control; /* Processor performance state control */
u32 pm1a_event_block; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
u32 pm1b_event_block; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
u32 pm1a_control_block; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
u32 pm1b_control_block; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
u32 pm2_control_block; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
u32 pm_timer_block; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
u32 gpe0_block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
u32 gpe1_block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */
u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */
u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */
u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */
u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */
u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */
u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */
u8 cst_control; /* Support for the _CST object and C States change notification */
u16 C2latency; /* Worst case HW latency to enter/exit C2 state */
u16 C3latency; /* Worst case HW latency to enter/exit C3 state */
u16 flush_size; /* Processor's memory cache line width, in bytes */
u16 flush_stride; /* Number of flush strides that need to be read */
u8 duty_offset; /* Processor duty cycle index in processor's P_CNT reg */
u8 duty_width; /* Processor duty cycle value bit width in P_CNT register. */
u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */
u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* Index to century in RTC CMOS RAM */
u16 boot_flags; /* IA-PC Boot Architecture Flags. See Table 5-10 for description */
u8 reserved; /* Reserved, must be zero */
u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
u8 reset_value; /* Value to write to the reset_register port to reset the system */
u8 reserved4[3]; /* These three bytes must be zero */
u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
u8 reserved4[3]; /* Reserved, must be zero */
u64 Xfacs; /* 64-bit physical address of FACS */
u64 Xdsdt; /* 64-bit physical address of DSDT */
struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
};
/* FADT flags */
#define ACPI_FADT_WBINVD (1) /* 00: The wbinvd instruction works properly */
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: The wbinvd flushes but does not invalidate */
#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: All processors support C1 state */
#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: C2 state works on MP system */
#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: Power button is handled as a generic feature */
#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: Sleep button is handled as a generic feature, or not present */
#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: RTC wakeup stat not in fixed register space */
#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup stat not possible from S4 */
#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: tmr_val is 32 bits 0=24-bits */
#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: Docking supported */
#define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: System reset via the FADT RESET_REG supported */
#define ACPI_FADT_SEALED_CASE (1<<11) /* 11: No internal expansion capabilities and case is sealed */
#define ACPI_FADT_HEADLESS (1<<12) /* 12: No local video capabilities or local input devices */
#define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: Must execute native instruction after writing SLP_TYPx register */
#define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
#define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
#define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: System is compatible with remote power on (ACPI 3.0) */
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: All local APICs must use cluster model (ACPI 3.0) */
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
/*
* "Down-revved" ACPI 2.0 FADT descriptor
* Defined here to allow compiler to generate the length of the struct
* FADT Prefered Power Management Profiles
*/
struct fadt_descriptor_rev2_minus {
ACPI_FADT_COMMON u32 flags;
struct acpi_generic_address reset_register; /* Reset register address in GAS format */
u8 reset_value; /* Value to write to the reset_register port to reset the system. */
u8 reserved7[3]; /* Reserved, must be zero */
enum acpi_prefered_pm_profiles {
PM_UNSPECIFIED = 0,
PM_DESKTOP = 1,
PM_MOBILE = 2,
PM_WORKSTATION = 3,
PM_ENTERPRISE_SERVER = 4,
PM_SOHO_SERVER = 5,
PM_APPLIANCE_PC = 6
};
/*
* ACPI 1.0 FADT
* Defined here to allow compiler to generate the length of the struct
*/
struct fadt_descriptor_rev1 {
ACPI_FADT_COMMON u32 flags;
};
/* FADT: Prefered Power Management Profiles */
#define PM_UNSPECIFIED 0
#define PM_DESKTOP 1
#define PM_MOBILE 2
#define PM_WORKSTATION 3
#define PM_ENTERPRISE_SERVER 4
#define PM_SOHO_SERVER 5
#define PM_APPLIANCE_PC 6
/* FADT: Boot Arch Flags */
/* FADT Boot Arch Flags */
#define BAF_LEGACY_DEVICES 0x0001
#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
@@ -312,59 +284,12 @@ struct fadt_descriptor_rev1 {
#pragma pack()
/*
* This macro is temporary until the table bitfield flag definitions
* are removed and replaced by a Flags field.
*/
#define ACPI_FLAG_OFFSET(d,f,o) (u8) (ACPI_OFFSET (d,f) + \
sizeof(((d *)0)->f) + o)
#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
/*
* Get the remaining ACPI tables
*/
#include "actbl1.h"
/*
* ACPI Table information. We save the table address, length,
* and type of memory allocation (mapped or allocated) for each
* table for 1) when we exit, and 2) if a new table is installed
*/
#define ACPI_MEM_NOT_ALLOCATED 0
#define ACPI_MEM_ALLOCATED 1
#define ACPI_MEM_MAPPED 2
/* Definitions for the Flags bitfield member of struct acpi_table_support */
#define ACPI_TABLE_SINGLE 0x00
#define ACPI_TABLE_MULTIPLE 0x01
#define ACPI_TABLE_EXECUTABLE 0x02
#define ACPI_TABLE_ROOT 0x00
#define ACPI_TABLE_PRIMARY 0x10
#define ACPI_TABLE_SECONDARY 0x20
#define ACPI_TABLE_ALL 0x30
#define ACPI_TABLE_TYPE_MASK 0x30
/* Data about each known table type */
struct acpi_table_support {
char *name;
char *signature;
void **global_ptr;
u8 sig_length;
u8 flags;
};
extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
* needed for certain workarounds */
/* Macros used to generate offsets to specific table fields */
#define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f)
#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f)
#define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f)
#define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f)
#define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f)
#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o)
#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o)
#include <acpi/actbl1.h>
#endif /* __ACTBL_H__ */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
@@ -73,12 +74,6 @@
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
/* Legacy names */
#define APIC_SIG "APIC" /* Multiple APIC Description Table */
#define BOOT_SIG "BOOT" /* Simple Boot Flag Table */
#define SBST_SIG "SBST" /* Smart Battery Specification Table */
/*
* All tables must be byte-packed to match the ACPI specification, since
* the tables are provided by the system BIOS.
@@ -91,31 +86,43 @@
* portable, so do not use any other bitfield types.
*/
/* Common Sub-table header (used in MADT, SRAT, etc.) */
struct acpi_subtable_header {
u8 type;
u8 length;
};
/*******************************************************************************
*
* ASF - Alert Standard Format table (Signature "ASF!")
*
* Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
*
******************************************************************************/
struct acpi_table_asf {
ACPI_TABLE_HEADER_DEF};
struct acpi_table_header header; /* Common ACPI table header */
};
#define ACPI_ASF_HEADER_DEF \
u8 type; \
u8 reserved; \
u16 length;
/* ASF subtable header */
struct acpi_asf_header {
ACPI_ASF_HEADER_DEF};
u8 type;
u8 reserved;
u16 length;
};
/* Values for Type field */
/* Values for Type field above */
#define ASF_INFO 0
#define ASF_ALERT 1
#define ASF_CONTROL 2
#define ASF_BOOT 3
#define ASF_ADDRESS 4
#define ASF_RESERVED 5
enum acpi_asf_type {
ACPI_ASF_TYPE_INFO = 0,
ACPI_ASF_TYPE_ALERT = 1,
ACPI_ASF_TYPE_CONTROL = 2,
ACPI_ASF_TYPE_BOOT = 3,
ACPI_ASF_TYPE_ADDRESS = 4,
ACPI_ASF_TYPE_RESERVED = 5
};
/*
* ASF subtables
@@ -124,7 +131,8 @@ ACPI_ASF_HEADER_DEF};
/* 0: ASF Information */
struct acpi_asf_info {
ACPI_ASF_HEADER_DEF u8 min_reset_value;
struct acpi_asf_header header;
u8 min_reset_value;
u8 min_poll_interval;
u16 system_id;
u32 mfg_id;
@@ -135,26 +143,49 @@ struct acpi_asf_info {
/* 1: ASF Alerts */
struct acpi_asf_alert {
ACPI_ASF_HEADER_DEF u8 assert_mask;
struct acpi_asf_header header;
u8 assert_mask;
u8 deassert_mask;
u8 alerts;
u8 data_length;
u8 array[1];
};
struct acpi_asf_alert_data {
u8 address;
u8 command;
u8 mask;
u8 value;
u8 sensor_type;
u8 type;
u8 offset;
u8 source_type;
u8 severity;
u8 sensor_number;
u8 entity;
u8 instance;
};
/* 2: ASF Remote Control */
struct acpi_asf_remote {
ACPI_ASF_HEADER_DEF u8 controls;
struct acpi_asf_header header;
u8 controls;
u8 data_length;
u16 reserved2;
u8 array[1];
};
struct acpi_asf_control_data {
u8 function;
u8 address;
u8 command;
u8 value;
};
/* 3: ASF RMCP Boot Options */
struct acpi_asf_rmcp {
ACPI_ASF_HEADER_DEF u8 capabilities[7];
struct acpi_asf_header header;
u8 capabilities[7];
u8 completion_code;
u32 enterprise_id;
u8 command;
@@ -166,9 +197,9 @@ struct acpi_asf_rmcp {
/* 4: ASF Address */
struct acpi_asf_address {
ACPI_ASF_HEADER_DEF u8 eprom_address;
struct acpi_asf_header header;
u8 eprom_address;
u8 devices;
u8 smbus_addresses[1];
};
/*******************************************************************************
@@ -178,7 +209,8 @@ struct acpi_asf_address {
******************************************************************************/
struct acpi_table_boot {
ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */
struct acpi_table_header header; /* Common ACPI table header */
u8 cmos_index; /* Index in CMOS RAM for the boot register */
u8 reserved[3];
};
@@ -189,7 +221,8 @@ struct acpi_table_boot {
******************************************************************************/
struct acpi_table_cpep {
ACPI_TABLE_HEADER_DEF u64 reserved;
struct acpi_table_header header; /* Common ACPI table header */
u64 reserved;
};
/* Subtable */
@@ -197,9 +230,9 @@ struct acpi_table_cpep {
struct acpi_cpep_polling {
u8 type;
u8 length;
u8 processor_id; /* Processor ID */
u8 processor_eid; /* Processor EID */
u32 polling_interval; /* Polling interval (msec) */
u8 id; /* Processor ID */
u8 eid; /* Processor EID */
u32 interval; /* Polling interval (msec) */
};
/*******************************************************************************
@@ -209,23 +242,97 @@ struct acpi_cpep_polling {
******************************************************************************/
struct acpi_table_dbgp {
ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
struct acpi_table_header header; /* Common ACPI table header */
u8 type; /* 0=full 16550, 1=subset of 16550 */
u8 reserved[3];
struct acpi_generic_address debug_port;
};
/*******************************************************************************
*
* DMAR - DMA Remapping table
*
******************************************************************************/
struct acpi_table_dmar {
struct acpi_table_header header; /* Common ACPI table header */
u8 width; /* Host Address Width */
u8 reserved[11];
};
/* DMAR subtable header */
struct acpi_dmar_header {
u16 type;
u16 length;
u8 flags;
u8 reserved[3];
};
/* Values for subtable type in struct acpi_dmar_header */
enum acpi_dmar_type {
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};
struct acpi_dmar_device_scope {
u8 entry_type;
u8 length;
u8 segment;
u8 bus;
};
/* Values for entry_type in struct acpi_dmar_device_scope */
enum acpi_dmar_scope_type {
ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
};
/*
* DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
*/
/* 0: Hardware Unit Definition */
struct acpi_dmar_hardware_unit {
struct acpi_dmar_header header;
u64 address; /* Register Base Address */
};
/* Flags */
#define ACPI_DMAR_INCLUDE_ALL (1)
/* 1: Reserved Memory Defininition */
struct acpi_dmar_reserved_memory {
struct acpi_dmar_header header;
u64 address; /* 4_k aligned base address */
u64 end_address; /* 4_k aligned limit address */
};
/* Flags */
#define ACPI_DMAR_ALLOW_ALL (1)
/*******************************************************************************
*
* ECDT - Embedded Controller Boot Resources Table
*
******************************************************************************/
struct ec_boot_resources {
ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
struct acpi_generic_address ec_data; /* Address of EC data register */
struct acpi_table_ecdt {
struct acpi_table_header header; /* Common ACPI table header */
struct acpi_generic_address control; /* Address of EC command/status register */
struct acpi_generic_address data; /* Address of EC data register */
u32 uid; /* Unique ID - must be same as the EC _UID method */
u8 gpe_bit; /* The GPE for the EC */
u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
u8 gpe; /* The GPE for the EC */
u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
};
/*******************************************************************************
@@ -234,22 +341,22 @@ struct ec_boot_resources {
*
******************************************************************************/
struct acpi_hpet_table {
ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */
struct acpi_generic_address base_address; /* Address of event timer block */
u8 hpet_number; /* HPET sequence number */
u16 clock_tick; /* Main counter min tick, periodic mode */
u8 attributes;
struct acpi_table_hpet {
struct acpi_table_header header; /* Common ACPI table header */
u32 id; /* Hardware ID of event timer block */
struct acpi_generic_address address; /* Address of event timer block */
u8 sequence; /* HPET sequence number */
u16 minimum_tick; /* Main counter min tick, periodic mode */
u8 flags;
};
#if 0 /* HPET flags to be converted to macros */
struct { /* Flags (8 bits) */
u8 page_protect:1; /* 00: No page protection */
u8 page_protect4:1; /* 01: 4_kB page protected */
u8 page_protect64:1; /* 02: 64_kB page protected */
u8:5; /* 03-07: Reserved, must be zero */
} flags;
#endif
/*! Flags */
#define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */
#define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */
#define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */
/*! [End] no source code translation !*/
/*******************************************************************************
*
@@ -257,148 +364,159 @@ struct { /* Flags (8 bits) */
*
******************************************************************************/
struct multiple_apic_table {
ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */
/* Flags (32 bits) */
u8 PCATcompat:1; /* 00: System also has dual 8259s */
u8:7; /* 01-07: Reserved, must be zero */
u8 reserved1[3]; /* 08-31: Reserved, must be zero */
struct acpi_table_madt {
struct acpi_table_header header; /* Common ACPI table header */
u32 address; /* Physical address of local APIC */
u32 flags;
};
/* Values for MADT PCATCompat */
/* Flags */
#define DUAL_PIC 0
#define MULTIPLE_APIC 1
#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
/* Common MADT Sub-table header */
/* Values for PCATCompat flag */
#define APIC_HEADER_DEF \
u8 type; \
u8 length;
#define ACPI_MADT_DUAL_PIC 0
#define ACPI_MADT_MULTIPLE_APIC 1
struct apic_header {
APIC_HEADER_DEF};
/* Values for subtable type in struct acpi_subtable_header */
/* Values for Type in struct apic_header */
#define APIC_PROCESSOR 0
#define APIC_IO 1
#define APIC_XRUPT_OVERRIDE 2
#define APIC_NMI 3
#define APIC_LOCAL_NMI 4
#define APIC_ADDRESS_OVERRIDE 5
#define APIC_IO_SAPIC 6
#define APIC_LOCAL_SAPIC 7
#define APIC_XRUPT_SOURCE 8
#define APIC_RESERVED 9 /* 9 and greater are reserved */
/* Flag definitions for MADT sub-tables */
#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \
u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
u8 : 4; /* 04-07: Reserved, must be zero */\
u8 reserved1; /* 08-15: Reserved, must be zero */
#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \
u8 processor_enabled: 1; /* 00: Processor is usable if set */\
u8 : 7; /* 01-07: Reserved, must be zero */\
u8 reserved2[3]; /* 08-31: Reserved, must be zero */
/* Values for MPS INTI flags */
#define POLARITY_CONFORMS 0
#define POLARITY_ACTIVE_HIGH 1
#define POLARITY_RESERVED 2
#define POLARITY_ACTIVE_LOW 3
#define TRIGGER_CONFORMS 0
#define TRIGGER_EDGE 1
#define TRIGGER_RESERVED 2
#define TRIGGER_LEVEL 3
enum acpi_madt_type {
ACPI_MADT_TYPE_LOCAL_APIC = 0,
ACPI_MADT_TYPE_IO_APIC = 1,
ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
ACPI_MADT_TYPE_NMI_SOURCE = 3,
ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
ACPI_MADT_TYPE_IO_SAPIC = 6,
ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */
};
/*
* MADT Sub-tables, correspond to Type in struct apic_header
* MADT Sub-tables, correspond to Type in struct acpi_subtable_header
*/
/* 0: processor APIC */
/* 0: Processor Local APIC */
struct madt_processor_apic {
APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
u8 local_apic_id; /* Processor's local APIC id */
ACPI_MADT_LFLAGS};
struct acpi_madt_local_apic {
struct acpi_subtable_header header;
u8 processor_id; /* ACPI processor id */
u8 id; /* Processor's local APIC id */
u32 lapic_flags;
};
/* 1: IO APIC */
struct madt_io_apic {
APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
struct acpi_madt_io_apic {
struct acpi_subtable_header header;
u8 id; /* I/O APIC ID */
u8 reserved; /* Reserved - must be zero */
u32 address; /* APIC physical address */
u32 interrupt; /* Global system interrupt where INTI lines start */
u32 global_irq_base; /* Global system interrupt where INTI lines start */
};
/* 2: Interrupt Override */
struct madt_interrupt_override {
APIC_HEADER_DEF u8 bus; /* 0 - ISA */
u8 source; /* Interrupt source (IRQ) */
u32 interrupt; /* Global system interrupt */
ACPI_MADT_IFLAGS};
struct acpi_madt_interrupt_override {
struct acpi_subtable_header header;
u8 bus; /* 0 - ISA */
u8 source_irq; /* Interrupt source (IRQ) */
u32 global_irq; /* Global system interrupt */
u16 inti_flags;
};
/* 3: NMI Sources */
/* 3: NMI Source */
struct madt_nmi_source {
APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */
struct acpi_madt_nmi_source {
struct acpi_subtable_header header;
u16 inti_flags;
u32 global_irq; /* Global system interrupt */
};
/* 4: Local APIC NMI */
struct madt_local_apic_nmi {
APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */
struct acpi_madt_local_apic_nmi {
struct acpi_subtable_header header;
u8 processor_id; /* ACPI processor id */
u16 inti_flags;
u8 lint; /* LINTn to which NMI is connected */
};
/* 5: Address Override */
struct madt_address_override {
APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */
struct acpi_madt_local_apic_override {
struct acpi_subtable_header header;
u16 reserved; /* Reserved, must be zero */
u64 address; /* APIC physical address */
};
/* 6: I/O Sapic */
struct madt_io_sapic {
APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
struct acpi_madt_io_sapic {
struct acpi_subtable_header header;
u8 id; /* I/O SAPIC ID */
u8 reserved; /* Reserved, must be zero */
u32 interrupt_base; /* Glocal interrupt for SAPIC start */
u32 global_irq_base; /* Global interrupt for SAPIC start */
u64 address; /* SAPIC physical address */
};
/* 7: Local Sapic */
struct madt_local_sapic {
APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
u8 local_sapic_id; /* SAPIC ID */
u8 local_sapic_eid; /* SAPIC EID */
struct acpi_madt_local_sapic {
struct acpi_subtable_header header;
u8 processor_id; /* ACPI processor id */
u8 id; /* SAPIC ID */
u8 eid; /* SAPIC EID */
u8 reserved[3]; /* Reserved, must be zero */
ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */
char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
u32 lapic_flags;
u32 uid; /* Numeric UID - ACPI 3.0 */
char uid_string[1]; /* String UID - ACPI 3.0 */
};
/* 8: Platform Interrupt Source */
struct madt_interrupt_source {
APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
u8 processor_id; /* Processor ID */
u8 processor_eid; /* Processor EID */
struct acpi_madt_interrupt_source {
struct acpi_subtable_header header;
u16 inti_flags;
u8 type; /* 1=PMI, 2=INIT, 3=corrected */
u8 id; /* Processor ID */
u8 eid; /* Processor EID */
u8 io_sapic_vector; /* Vector value for PMI interrupts */
u32 interrupt; /* Global system interrupt */
u32 global_irq; /* Global system interrupt */
u32 flags; /* Interrupt Source Flags */
};
#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H
/* Flags field above */
#define ACPI_MADT_CPEI_OVERRIDE (1)
/*
* Common flags fields for MADT subtables
*/
/* MADT Local APIC flags (lapic_flags) */
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
/* MADT MPS INTI flags (inti_flags) */
#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
/* Values for MPS INTI flags */
#define ACPI_MADT_POLARITY_CONFORMS 0
#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
#define ACPI_MADT_POLARITY_RESERVED 2
#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
#define ACPI_MADT_TRIGGER_CONFORMS (0)
#define ACPI_MADT_TRIGGER_EDGE (1<<2)
#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
/*******************************************************************************
*
* MCFG - PCI Memory Mapped Configuration table and sub-table
@@ -406,17 +524,19 @@ struct madt_interrupt_source {
******************************************************************************/
struct acpi_table_mcfg {
ACPI_TABLE_HEADER_DEF u8 reserved[8];
struct acpi_table_header header; /* Common ACPI table header */
u8 reserved[8];
};
/* Subtable */
struct acpi_mcfg_allocation {
u64 base_address; /* Base address, processor-relative */
u64 address; /* Base address, processor-relative */
u16 pci_segment; /* PCI segment group number */
u8 start_bus_number; /* Starting PCI Bus number */
u8 end_bus_number; /* Final PCI Bus number */
u32 reserved;
};
#endif
/*******************************************************************************
*
@@ -424,8 +544,9 @@ struct acpi_mcfg_allocation {
*
******************************************************************************/
struct smart_battery_table {
ACPI_TABLE_HEADER_DEF u32 warning_level;
struct acpi_table_sbst {
struct acpi_table_header header; /* Common ACPI table header */
u32 warning_level;
u32 low_level;
u32 critical_level;
};
@@ -436,9 +557,10 @@ struct smart_battery_table {
*
******************************************************************************/
struct system_locality_info {
ACPI_TABLE_HEADER_DEF u64 locality_count;
u8 entry[1][1];
struct acpi_table_slit {
struct acpi_table_header header; /* Common ACPI table header */
u64 locality_count;
u8 entry[1]; /* Real size = localities^2 */
};
/*******************************************************************************
@@ -448,7 +570,8 @@ struct system_locality_info {
******************************************************************************/
struct acpi_table_spcr {
ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
struct acpi_table_header header; /* Common ACPI table header */
u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
u8 reserved[3];
struct acpi_generic_address serial_port;
u8 interrupt_type;
@@ -459,7 +582,7 @@ struct acpi_table_spcr {
u8 stop_bits;
u8 flow_control;
u8 terminal_type;
u8 reserved2;
u8 reserved1;
u16 pci_device_id;
u16 pci_vendor_id;
u8 pci_bus;
@@ -467,7 +590,7 @@ struct acpi_table_spcr {
u8 pci_function;
u32 pci_flags;
u8 pci_segment;
u32 reserved3;
u32 reserved2;
};
/*******************************************************************************
@@ -477,12 +600,13 @@ struct acpi_table_spcr {
******************************************************************************/
struct acpi_table_spmi {
ACPI_TABLE_HEADER_DEF u8 reserved;
struct acpi_table_header header; /* Common ACPI table header */
u8 reserved;
u8 interface_type;
u16 spec_revision; /* Version of IPMI */
u8 interrupt_type;
u8 gpe_number; /* GPE assigned */
u8 reserved2;
u8 reserved1;
u8 pci_device_flag;
u32 interrupt;
struct acpi_generic_address ipmi_register;
@@ -498,58 +622,53 @@ struct acpi_table_spmi {
*
******************************************************************************/
struct system_resource_affinity {
ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
u64 reserved2; /* Reserved, must be zero */
struct acpi_table_srat {
struct acpi_table_header header; /* Common ACPI table header */
u32 table_revision; /* Must be value '1' */
u64 reserved; /* Reserved, must be zero */
};
/* SRAT common sub-table header */
/* Values for subtable type in struct acpi_subtable_header */
#define SRAT_SUBTABLE_HEADER \
u8 type; \
u8 length;
/* Values for Type above */
#define SRAT_CPU_AFFINITY 0
#define SRAT_MEMORY_AFFINITY 1
#define SRAT_RESERVED 2
enum acpi_srat_type {
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_RESERVED = 2
};
/* SRAT sub-tables */
struct static_resource_alloc {
SRAT_SUBTABLE_HEADER u8 proximity_domain_lo;
struct acpi_srat_cpu_affinity {
struct acpi_subtable_header header;
u8 proximity_domain_lo;
u8 apic_id;
/* Flags (32 bits) */
u8 enabled:1; /* 00: Use affinity structure */
u8:7; /* 01-07: Reserved, must be zero */
u8 reserved3[3]; /* 08-31: Reserved, must be zero */
u32 flags;
u8 local_sapic_eid;
u8 proximity_domain_hi[3];
u32 reserved4; /* Reserved, must be zero */
u32 reserved; /* Reserved, must be zero */
};
struct memory_affinity {
SRAT_SUBTABLE_HEADER u32 proximity_domain;
u16 reserved3;
/* Flags */
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
struct acpi_srat_mem_affinity {
struct acpi_subtable_header header;
u32 proximity_domain;
u16 reserved; /* Reserved, must be zero */
u64 base_address;
u64 address_length;
u32 reserved4;
/* Flags (32 bits) */
u8 enabled:1; /* 00: Use affinity structure */
u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
u8 non_volatile:1; /* 02: Memory is non-volatile */
u8:5; /* 03-07: Reserved, must be zero */
u8 reserved5[3]; /* 08-31: Reserved, must be zero */
u64 reserved6; /* Reserved, must be zero */
u64 length;
u32 memory_type; /* See acpi_address_range_id */
u32 flags;
u64 reserved1; /* Reserved, must be zero */
};
/* Flags */
#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
/*******************************************************************************
*
* TCPA - Trusted Computing Platform Alliance table
@@ -557,7 +676,8 @@ struct memory_affinity {
******************************************************************************/
struct acpi_table_tcpa {
ACPI_TABLE_HEADER_DEF u16 reserved;
struct acpi_table_header header; /* Common ACPI table header */
u16 reserved;
u32 max_log_length; /* Maximum length for the event log area */
u64 log_address; /* Address of the event log area */
};
@@ -569,7 +689,8 @@ struct acpi_table_tcpa {
******************************************************************************/
struct acpi_table_wdrt {
ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */
struct acpi_table_header header; /* Common ACPI table header */
u32 header_length; /* Watchdog Header Length */
u8 pci_segment; /* PCI Segment number */
u8 pci_bus; /* PCI Bus number */
u8 pci_device; /* PCI Device number */
@@ -582,58 +703,9 @@ struct acpi_table_wdrt {
u32 entries; /* Number of watchdog entries that follow */
};
#if 0 /* Flags, will be converted to macros */
u8 enabled:1; /* 00: Timer enabled */
u8:6; /* 01-06: Reserved */
u8 sleep_stop:1; /* 07: Timer stopped in sleep state */
#endif
/* Flags */
/* Macros used to generate offsets to specific table fields */
#define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f)
#define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f)
#define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f)
#define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f)
#define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f)
#define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f)
#define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f)
#define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f)
#define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f)
#define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f)
#define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f)
#define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f)
#define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f)
#define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f)
#define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f)
#define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f)
#define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f)
#define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f)
#define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f)
#define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f)
#define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f)
#define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f)
#define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f)
#define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f)
#define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f)
#define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f)
#define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f)
#define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f)
#define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f)
#define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f)
#define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f)
#define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f)
#define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f)
#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o)
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o)
#define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o)
#define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o)
#define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o)
#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o)
#define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */
/* Reset to default packing */

View File

@@ -1,49 +0,0 @@
/******************************************************************************
*
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACTBL2_H__
#define __ACTBL2_H__
/* Code moved to both actbl.h and actbl1.h */
#endif /* __ACTBL2_H__ */

View File

@@ -1,134 +0,0 @@
/******************************************************************************
*
* Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71
* This file includes tables specific to this
* specification revision.
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2003, R. Byron Moore
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __ACTBL71_H__
#define __ACTBL71_H__
/* 0.71 FADT address_space data item bitmasks defines */
/* If the associated bit is zero then it is in memory space else in io space */
#define SMI_CMD_ADDRESS_SPACE 0x01
#define PM1_BLK_ADDRESS_SPACE 0x02
#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
#define PM_TMR_BLK_ADDRESS_SPACE 0x08
#define GPE0_BLK_ADDRESS_SPACE 0x10
#define GPE1_BLK_ADDRESS_SPACE 0x20
/* Only for clarity in declarations */
typedef u64 IO_ADDRESS;
#pragma pack(1)
struct { /* Root System Descriptor Pointer */
NATIVE_CHAR signature[8]; /* contains "RSD PTR " */
u8 checksum; /* to make sum of struct == 0 */
NATIVE_CHAR oem_id[6]; /* OEM identification */
u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
};
/*****************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Root System Description Table */
/*****************************************/
struct {
struct acpi_table_header header; /* Table header */
u32 reserved_pad; /* IA64 alignment, must be 0 */
u64 table_offset_entry[1]; /* Array of pointers to other */
/* tables' headers */
};
/*******************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Firmware ACPI Control Structure */
/*******************************************/
struct {
NATIVE_CHAR signature[4]; /* signature "FACS" */
u32 length; /* length of structure, in bytes */
u32 hardware_signature; /* hardware configuration signature */
u32 reserved4; /* must be 0 */
u64 firmware_waking_vector; /* ACPI OS waking vector */
u64 global_lock; /* Global Lock */
u32 S4bios_f:1; /* Indicates if S4BIOS support is present */
u32 reserved1:31; /* must be 0 */
u8 reserved3[28]; /* reserved - must be zero */
};
/******************************************/
/* IA64 Extensions to ACPI Spec Rev 0.71 */
/* for the Fixed ACPI Description Table */
/******************************************/
struct {
struct acpi_table_header header; /* table header */
u32 reserved_pad; /* IA64 alignment, must be 0 */
u64 firmware_ctrl; /* 64-bit Physical address of FACS */
u64 dsdt; /* 64-bit Physical address of DSDT */
u8 model; /* System Interrupt Model */
u8 address_space; /* Address Space Bitmask */
u16 sci_int; /* System vector of SCI interrupt */
u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
u8 reserved2; /* reserved - must be zero */
u64 smi_cmd; /* Port address of SMI command port */
u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
u8 gpe1_base; /* offset in gpe model where gpe1 events start */
u8 reserved3; /* reserved */
u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */
u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
u8 century; /* index to century in RTC CMOS RAM */
u8 reserved4; /* reserved */
u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */
u32 reserved5:1; /* reserved - must be zero */
u32 proc_c1:1; /* all processors support C1 state */
u32 plvl2_up:1; /* C2 state works on MP system */
u32 pwr_button:1; /* Power button is handled as a generic feature */
u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */
u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */
u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */
u32 tmr_val_ext:1; /* tmr_val is 32 bits */
u32 dock_cap:1; /* Supports Docking */
u32 reserved6:22; /* reserved - must be zero */
};
#pragma pack()
#endif /* __ACTBL71_H__ */

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,8 @@
/*
* ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
* and must be either 16, 32, or 64
* and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
* 12/2006.
*/
#ifndef ACPI_MACHINE_WIDTH
#error ACPI_MACHINE_WIDTH not defined
@@ -149,7 +150,6 @@ typedef int INT32;
typedef u64 acpi_native_uint;
typedef s64 acpi_native_int;
typedef u64 acpi_table_ptr;
typedef u64 acpi_io_address;
typedef u64 acpi_physical_address;
@@ -189,48 +189,15 @@ typedef int INT32;
typedef u32 acpi_native_uint;
typedef s32 acpi_native_int;
typedef u64 acpi_table_ptr;
typedef u32 acpi_io_address;
typedef u64 acpi_physical_address;
typedef u32 acpi_physical_address;
#define ACPI_MAX_PTR ACPI_UINT32_MAX
#define ACPI_SIZE_MAX ACPI_UINT32_MAX
/*******************************************************************************
*
* Types specific to 16-bit targets
*
******************************************************************************/
#elif ACPI_MACHINE_WIDTH == 16
/*! [Begin] no source code translation (keep the typedefs as-is) */
typedef unsigned long UINT32;
typedef short INT16;
typedef long INT32;
/*! [End] no source code translation !*/
typedef u16 acpi_native_uint;
typedef s16 acpi_native_int;
typedef u32 acpi_table_ptr;
typedef u32 acpi_io_address;
typedef char *acpi_physical_address;
#define ACPI_MAX_PTR ACPI_UINT16_MAX
#define ACPI_SIZE_MAX ACPI_UINT16_MAX
#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
/* 64-bit integers cannot be supported */
#define ACPI_NO_INTEGER64_SUPPORT
#else
/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */
/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
#error unknown ACPI_MACHINE_WIDTH
#endif
@@ -311,36 +278,6 @@ typedef acpi_native_uint acpi_size;
*
******************************************************************************/
/*
* Pointer overlays to avoid lots of typecasting for
* code that accepts both physical and logical pointers.
*/
union acpi_pointers {
acpi_physical_address physical;
void *logical;
acpi_table_ptr value;
};
struct acpi_pointer {
u32 pointer_type;
union acpi_pointers pointer;
};
/* pointer_types for above */
#define ACPI_PHYSICAL_POINTER 0x01
#define ACPI_LOGICAL_POINTER 0x02
/* Processor mode */
#define ACPI_PHYSICAL_ADDRESSING 0x04
#define ACPI_LOGICAL_ADDRESSING 0x08
#define ACPI_MEMORY_MODE 0x0C
#define ACPI_PHYSMODE_PHYSPTR ACPI_PHYSICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
/* Logical defines and NULL */
#ifdef FALSE
@@ -442,7 +379,8 @@ typedef u64 acpi_integer;
/*
* Initialization state
*/
#define ACPI_INITIALIZED_OK 0x01
#define ACPI_SUBSYSTEM_INITIALIZE 0x01
#define ACPI_INITIALIZED_OK 0x02
/*
* Power state values
@@ -490,21 +428,6 @@ typedef u64 acpi_integer;
#define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 6
#define ACPI_NOTIFY_POWER_FAULT (u8) 7
/*
* Table types. These values are passed to the table related APIs
*/
typedef u32 acpi_table_type;
#define ACPI_TABLE_ID_RSDP (acpi_table_type) 0
#define ACPI_TABLE_ID_DSDT (acpi_table_type) 1
#define ACPI_TABLE_ID_FADT (acpi_table_type) 2
#define ACPI_TABLE_ID_FACS (acpi_table_type) 3
#define ACPI_TABLE_ID_PSDT (acpi_table_type) 4
#define ACPI_TABLE_ID_SSDT (acpi_table_type) 5
#define ACPI_TABLE_ID_XSDT (acpi_table_type) 6
#define ACPI_TABLE_ID_MAX 6
#define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1)
/*
* Types associated with ACPI names and objects. The first group of
* values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
@@ -637,7 +560,7 @@ typedef u32 acpi_event_status;
* | | | +--- Type of dispatch -- to method, handler, or none
* | | +--- Enabled for runtime?
* | +--- Enabled for wake?
* +--- System state when GPE ocurred (running/waking)
* +--- Unused
*/
#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
@@ -663,10 +586,6 @@ typedef u32 acpi_event_status;
#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
/*
* Flags for GPE and Lock interfaces
*/
@@ -815,13 +734,6 @@ struct acpi_buffer {
#define ACPI_SYS_MODE_LEGACY 0x0002
#define ACPI_SYS_MODES_MASK 0x0003
/*
* ACPI Table Info. One per ACPI table _type_
*/
struct acpi_table_info {
u32 count;
};
/*
* System info returned by acpi_get_system_info()
*/
@@ -833,8 +745,6 @@ struct acpi_system_info {
u32 reserved2;
u32 debug_level;
u32 debug_layer;
u32 num_table_types;
struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1];
};
/*

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -141,8 +141,6 @@ acpi_status acpi_ut_hardware_initialize(void);
void acpi_ut_subsystem_shutdown(void);
acpi_status acpi_ut_validate_fadt(void);
/*
* utclib - Local implementations of C library functions
*/
@@ -453,6 +451,8 @@ acpi_ut_short_divide(acpi_integer in_dividend,
/*
* utmisc
*/
const char *acpi_ut_validate_exception(acpi_status status);
u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
@@ -470,7 +470,7 @@ void acpi_ut_print_string(char *string, u8 max_length);
u8 acpi_ut_valid_acpi_name(u32 name);
acpi_name acpi_ut_repair_name(acpi_name name);
acpi_name acpi_ut_repair_name(char *name);
u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);

View File

@@ -7,7 +7,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -273,7 +273,7 @@
#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */
#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */
#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */
#define ARGI_DATAREFOBJ 0x16
/* Note: types above can expand to 0x1F maximum */

View File

@@ -6,7 +6,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -5,7 +5,7 @@
*****************************************************************************/
/*
* Copyright (C) 2000 - 2006, R. Byron Moore
* Copyright (C) 2000 - 2007, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@@ -293,4 +293,6 @@ struct pci_dev *alpha_gendev_to_pci(struct device *dev);
#define IOBASE_ROOT_BUS 5
#define IOBASE_FROM_HOSE 0x10000
extern struct pci_dev *isa_bridge;
#endif /* __ALPHA_PCI_H */

View File

@@ -39,7 +39,7 @@
* Calling conventions:
*
* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
* ACPI_INTERNAL_XFACE - Internal ACPI interfaces
* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
*/
@@ -59,11 +59,11 @@
int __acpi_acquire_global_lock(unsigned int *lock);
int __acpi_release_global_lock(unsigned int *lock);
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr))
#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
((Acq) = __acpi_release_global_lock((unsigned int *) GLptr))
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
((Acq) = __acpi_release_global_lock(&facs->global_lock))
/*
* Math helper asm macros
@@ -87,7 +87,7 @@ extern void check_acpi_pci(void);
static inline void check_acpi_pci(void) { }
#endif
#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI
extern int acpi_lapic;
extern int acpi_ioapic;
extern int acpi_noirq;
@@ -95,9 +95,9 @@ extern int acpi_strict;
extern int acpi_disabled;
extern int acpi_ht;
extern int acpi_pci_disabled;
static inline void disable_acpi(void)
{
acpi_disabled = 1;
static inline void disable_acpi(void)
{
acpi_disabled = 1;
acpi_ht = 0;
acpi_pci_disabled = 1;
acpi_noirq = 1;
@@ -114,9 +114,9 @@ extern int acpi_use_timer_override;
#endif
static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
static inline void acpi_disable_pci(void)
static inline void acpi_disable_pci(void)
{
acpi_pci_disabled = 1;
acpi_pci_disabled = 1;
acpi_noirq_set();
}
extern int acpi_irq_balance_set(char *str);
@@ -144,8 +144,6 @@ extern void acpi_reserve_bootmem(void);
#endif /*CONFIG_ACPI_SLEEP*/
extern u8 x86_acpiid_to_apicid[];
#define ARCH_HAS_POWER_INIT 1
#endif /*__KERNEL__*/

View File

@@ -3,13 +3,13 @@
#include <linux/acpi.h>
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
struct mpc_config_translation *translation)
{
Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
}
static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
struct mpc_config_translation *translation)
{
}
@@ -22,7 +22,7 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
char *productid)
{
if (mpc->mpc_oemptr) {
struct mp_config_oemtable *oem_table =
struct mp_config_oemtable *oem_table =
(struct mp_config_oemtable *)mpc->mpc_oemptr;
if (!strncmp(oem, "UNISYS", 6))
return parse_unisys_oem((char *)oem_table);
@@ -31,12 +31,13 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
}
#ifdef CONFIG_ACPI
static inline int es7000_check_dsdt(void)
{
struct acpi_table_header *header = NULL;
if(!acpi_get_table_header_early(ACPI_DSDT, &header))
acpi_table_print(header, 0);
if (!strncmp(header->oem_id, "UNISYS", 6))
struct acpi_table_header header;
memcpy(&header, 0, sizeof(struct acpi_table_header));
acpi_get_table_header(ACPI_SIG_DSDT, 0, &header);
if (!strncmp(header.oem_id, "UNISYS", 6))
return 1;
return 0;
}
@@ -44,7 +45,7 @@ static inline int es7000_check_dsdt(void)
/* Hook from generic ACPI tables.c */
static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
unsigned long oem_addr;
unsigned long oem_addr;
if (!find_unisys_acpi_oem_table(&oem_addr)) {
if (es7000_check_dsdt())
return parse_unisys_oem((char *)oem_addr);

View File

@@ -82,11 +82,11 @@ ia64_acpi_release_global_lock (unsigned int *lock)
return old & 0x1;
}
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
((Acq) = ia64_acpi_acquire_global_lock((unsigned int *) GLptr))
#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
((Acq) = ia64_acpi_release_global_lock((unsigned int *) GLptr))
#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
#define acpi_disabled 0 /* ACPI always enabled on IA64 */
#define acpi_noirq 0 /* ACPI always enabled on IA64 */
@@ -119,8 +119,6 @@ extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
#endif
extern u16 ia64_acpiid_to_sapicid[];
/*
* Refer Intel ACPI _PDC support document for bit definitions
*/

View File

@@ -19,4 +19,6 @@ extern unsigned long MAX_DMA_ADDRESS;
#define free_dma(x)
void dma_mark_clean(void *addr, size_t size);
#endif /* _ASM_IA64_DMA_H */

View File

@@ -19,7 +19,6 @@ enum esi_proc_type {
ESI_PROC_REENTRANT /* MP-safe and reentrant */
};
extern int ia64_esi_init (void);
extern struct ia64_sal_retval esi_call_phys (void *, u64 *);
extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *,
enum esi_proc_type,

View File

@@ -21,6 +21,7 @@ struct mm_struct;
struct pci_bus;
struct task_struct;
struct pci_dev;
struct msi_desc;
typedef void ia64_mv_setup_t (char **);
typedef void ia64_mv_cpu_init_t (void);
@@ -79,7 +80,7 @@ typedef unsigned short ia64_mv_readw_relaxed_t (const volatile void __iomem *);
typedef unsigned int ia64_mv_readl_relaxed_t (const volatile void __iomem *);
typedef unsigned long ia64_mv_readq_relaxed_t (const volatile void __iomem *);
typedef int ia64_mv_setup_msi_irq_t (unsigned int irq, struct pci_dev *pdev);
typedef int ia64_mv_setup_msi_irq_t (struct pci_dev *pdev, struct msi_desc *);
typedef void ia64_mv_teardown_msi_irq_t (unsigned int irq);
static inline void

View File

@@ -51,12 +51,13 @@ extern void efi_memmap_init(unsigned long *, unsigned long *);
#define IGNORE_PFN0 1 /* XXX fix me: ignore pfn 0 until TLB miss handler is updated... */
extern int register_active_ranges(u64 start, u64 end, void *arg);
#ifdef CONFIG_VIRTUAL_MEM_MAP
# define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */
extern unsigned long vmalloc_end;
extern struct page *vmem_map;
extern int find_largest_hole (u64 start, u64 end, void *arg);
extern int register_active_ranges (u64 start, u64 end, void *arg);
extern int create_mem_map_page_table (u64 start, u64 end, void *arg);
extern int vmemmap_find_next_valid_pfn(int, int);
#else

View File

@@ -137,7 +137,8 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t * pmd_entry, pte_t * pte)
static inline struct page *pte_alloc_one(struct mm_struct *mm,
unsigned long addr)
{
return virt_to_page(pgtable_quicklist_alloc());
void *pg = pgtable_quicklist_alloc();
return pg ? virt_to_page(pg) : NULL;
}
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,

View File

@@ -11,6 +11,7 @@
#include "acpi/acglobal.h"
#define SN_ACPI_BASE_SUPPORT() (acpi_gbl_DSDT->oem_revision >= 0x20101)
extern int sn_acpi_rev;
#define SN_ACPI_BASE_SUPPORT() (sn_acpi_rev >= 0x20101)
#endif /* _ASM_IA64_SN_ACPI_H */

View File

@@ -142,7 +142,7 @@ extern int pcibr_ate_alloc(struct pcibus_info *, int);
extern void pcibr_ate_free(struct pcibus_info *, int);
extern void ate_write(struct pcibus_info *, int, int, u64);
extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
void *resp);
void *resp, char **ssdt);
extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
int action, void *resp);
extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);

View File

@@ -70,10 +70,16 @@ extern void sn_irq_fixup(struct pci_dev *pci_dev,
struct sn_irq_info *sn_irq_info);
extern void sn_irq_unfixup(struct pci_dev *pci_dev);
extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
extern void sn_bus_fixup(struct pci_bus *);
extern void sn_acpi_bus_fixup(struct pci_bus *);
extern void sn_common_bus_fixup(struct pci_bus *, struct pcibus_bussoft *);
extern void sn_bus_store_sysdata(struct pci_dev *dev);
extern void sn_bus_free_sysdata(void);
extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
extern void sn_pci_fixup_slot(struct pci_dev *dev);
extern void sn_io_slot_fixup(struct pci_dev *);
extern void sn_acpi_slot_fixup(struct pci_dev *);
extern void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *,
struct sn_irq_info *);
extern void sn_pci_unfixup_slot(struct pci_dev *dev);
extern void sn_irq_lh_init(void);
#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */

View File

@@ -0,0 +1,9 @@
#ifndef _ASM_SWIOTLB_H
#define _ASM_SWIOTLB_H 1
#include <asm/machvec.h>
#define SWIOTLB_ARCH_NEED_LATE_INIT
#define SWIOTLB_ARCH_NEED_ALLOC
#endif /* _ASM_SWIOTLB_H */

View File

@@ -84,6 +84,7 @@ struct thread_info {
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
#define TIF_SYSCALL_TRACE 3 /* syscall trace active */
#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */
#define TIF_SINGLESTEP 5 /* restore singlestep on return to user mode */
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_MEMDIE 17
#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
@@ -92,7 +93,8 @@ struct thread_info {
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)

View File

@@ -291,11 +291,13 @@
#define __NR_sync_file_range 1300
#define __NR_tee 1301
#define __NR_vmsplice 1302
/* 1303 reserved for move_pages */
#define __NR_getcpu 1304
#ifdef __KERNEL__
#define NR_syscalls 279 /* length of syscall table */
#define NR_syscalls 281 /* length of syscall table */
#define __ARCH_WANT_SYS_RT_SIGACTION

View File

@@ -243,6 +243,10 @@ extern struct boot_mem_map boot_mem_map;
extern void add_memory_region(phys_t start, phys_t size, long type);
extern void prom_init(void);
extern void prom_free_prom_memory(void);
extern void free_init_pages(const char *what,
unsigned long begin, unsigned long end);
/*
* Initial kernel command line, usually setup by prom_init()

View File

@@ -17,6 +17,7 @@
#ifndef __ASM_DDB5XXX_DDB5477_H
#define __ASM_DDB5XXX_DDB5477_H
#include <irq.h>
/*
* This contains macros that are specific to DDB5477 or renamed from
@@ -251,14 +252,10 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
*/
#define NUM_CPU_IRQ 8
#define NUM_I8259_IRQ 16
#define NUM_VRC5477_IRQ 32
#define DDB_IRQ_BASE 0
#define I8259_IRQ_BASE DDB_IRQ_BASE
#define VRC5477_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
#define CPU_IRQ_BASE (VRC5477_IRQ_BASE + NUM_VRC5477_IRQ)
#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
#define VRC5477_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
/*
* vrc5477 irq defs
@@ -300,22 +297,22 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq);
/*
* i2859 irq assignment
*/
#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE)
#define I8259_IRQ_KEYBOARD (1 + I8259_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_CASCADE (2 + I8259_IRQ_BASE)
#define I8259_IRQ_UART_B (3 + I8259_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */
#define I8259_IRQ_UART_A (4 + I8259_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_PARALLEL (5 + I8259_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_RESERVED_6 (6 + I8259_IRQ_BASE)
#define I8259_IRQ_RESERVED_7 (7 + I8259_IRQ_BASE)
#define I8259_IRQ_RTC (8 + I8259_IRQ_BASE) /* who set this? */
#define I8259_IRQ_USB (9 + I8259_IRQ_BASE) /* ddb_setup */
#define I8259_IRQ_PMU (10 + I8259_IRQ_BASE) /* ddb_setup */
#define I8259_IRQ_RESERVED_11 (11 + I8259_IRQ_BASE)
#define I8259_IRQ_RESERVED_12 (12 + I8259_IRQ_BASE) /* m1543_irq_setup */
#define I8259_IRQ_RESERVED_13 (13 + I8259_IRQ_BASE)
#define I8259_IRQ_HDC1 (14 + I8259_IRQ_BASE) /* default and ddb_setup */
#define I8259_IRQ_HDC2 (15 + I8259_IRQ_BASE) /* default */
#define I8259_IRQ_RESERVED_0 (0 + I8259A_IRQ_BASE)
#define I8259_IRQ_KEYBOARD (1 + I8259A_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_CASCADE (2 + I8259A_IRQ_BASE)
#define I8259_IRQ_UART_B (3 + I8259A_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */
#define I8259_IRQ_UART_A (4 + I8259A_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_PARALLEL (5 + I8259A_IRQ_BASE) /* M1543 default */
#define I8259_IRQ_RESERVED_6 (6 + I8259A_IRQ_BASE)
#define I8259_IRQ_RESERVED_7 (7 + I8259A_IRQ_BASE)
#define I8259_IRQ_RTC (8 + I8259A_IRQ_BASE) /* who set this? */
#define I8259_IRQ_USB (9 + I8259A_IRQ_BASE) /* ddb_setup */
#define I8259_IRQ_PMU (10 + I8259A_IRQ_BASE) /* ddb_setup */
#define I8259_IRQ_RESERVED_11 (11 + I8259A_IRQ_BASE)
#define I8259_IRQ_RESERVED_12 (12 + I8259A_IRQ_BASE) /* m1543_irq_setup */
#define I8259_IRQ_RESERVED_13 (13 + I8259A_IRQ_BASE)
#define I8259_IRQ_HDC1 (14 + I8259A_IRQ_BASE) /* default and ddb_setup */
#define I8259_IRQ_HDC2 (15 + I8259A_IRQ_BASE) /* default */
/*

View File

@@ -14,6 +14,7 @@
#ifndef __ASM_DEC_INTERRUPTS_H
#define __ASM_DEC_INTERRUPTS_H
#include <irq.h>
#include <asm/mipsregs.h>
@@ -87,7 +88,7 @@
#define DEC_CPU_INR_SW1 1 /* software #1 */
#define DEC_CPU_INR_SW0 0 /* software #0 */
#define DEC_CPU_IRQ_BASE 0 /* first IRQ assigned to CPU */
#define DEC_CPU_IRQ_BASE MIPS_CPU_IRQ_BASE /* first IRQ assigned to CPU */
#define DEC_CPU_IRQ_NR(n) ((n) + DEC_CPU_IRQ_BASE)
#define DEC_CPU_IRQ_MASK(n) (1 << ((n) + CAUSEB_IP))

View File

@@ -91,6 +91,7 @@
#else
#define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x01000000)
#endif
#define MAX_DMA_PFN PFN_DOWN(virt_to_phys((void *)MAX_DMA_ADDRESS))
/* 8237 DMA controllers */
#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */

View File

@@ -24,6 +24,8 @@
#ifndef __ASM_EMMA2RH_EMMA2RH_H
#define __ASM_EMMA2RH_EMMA2RH_H
#include <irq.h>
/*
* EMMA2RH registers
*/
@@ -104,7 +106,8 @@
#define NUM_EMMA2RH_IRQ 96
#define CPU_EMMA2RH_CASCADE 2
#define EMMA2RH_IRQ_BASE 0
#define CPU_IRQ_BASE MIPS_CPU_IRQ_BASE
#define EMMA2RH_IRQ_BASE (CPU_IRQ_BASE + NUM_CPU_IRQ)
/*
* emma2rh irq defs

View File

@@ -33,7 +33,6 @@
#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
#define CPU_IRQ_BASE (EMMA2RH_GPIO_IRQ_BASE + NUM_EMMA2RH_IRQ_GPIO)
#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)

View File

@@ -18,6 +18,7 @@
#include <linux/spinlock.h>
#include <asm/io.h>
#include <irq.h>
/* i8259A PIC registers */
#define PIC_MASTER_CMD 0x20
@@ -42,8 +43,6 @@ extern void disable_8259A_irq(unsigned int irq);
extern void init_i8259_irqs(void);
#define I8259A_IRQ_BASE 0
/*
* Do the traditional i8259 interrupt polling thing. This is for the few
* cases where no better interrupt acknowledge method is available and we

View File

@@ -115,7 +115,7 @@ static inline void set_io_port_base(unsigned long base)
*/
static inline unsigned long virt_to_phys(volatile const void *address)
{
return (unsigned long)address - PAGE_OFFSET;
return (unsigned long)address - PAGE_OFFSET + PHYS_OFFSET;
}
/*
@@ -132,7 +132,7 @@ static inline unsigned long virt_to_phys(volatile const void *address)
*/
static inline void * phys_to_virt(unsigned long address)
{
return (void *)(address + PAGE_OFFSET);
return (void *)(address + PAGE_OFFSET - PHYS_OFFSET);
}
/*

View File

@@ -18,7 +18,7 @@
#ifdef CONFIG_I8259
static inline int irq_canonicalize(int irq)
{
return ((irq == 2) ? 9 : irq);
return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
}
#else
#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */

View File

@@ -13,8 +13,8 @@
#ifndef _ASM_IRQ_CPU_H
#define _ASM_IRQ_CPU_H
extern void mips_cpu_irq_init(int irq_base);
extern void rm7k_cpu_irq_init(int irq_base);
extern void rm9k_cpu_irq_init(int irq_base);
extern void mips_cpu_irq_init(void);
extern void rm7k_cpu_irq_init(void);
extern void rm9k_cpu_irq_init(void);
#endif /* _ASM_IRQ_CPU_H */

View File

@@ -39,6 +39,7 @@
#ifndef _LANGUAGE_ASSEMBLY
#include <linux/delay.h>
#include <linux/types.h>
#include <asm/io.h>
/* cpu pipeline flush */

View File

@@ -12,6 +12,8 @@
#ifndef __ASM_COBALT_H
#define __ASM_COBALT_H
#include <irq.h>
/*
* i8259 legacy interrupts used on Cobalt:
*
@@ -25,7 +27,7 @@
/*
* CPU IRQs are 16 ... 23
*/
#define COBALT_CPU_IRQ 16
#define COBALT_CPU_IRQ MIPS_CPU_IRQ_BASE
#define COBALT_GALILEO_IRQ (COBALT_CPU_IRQ + 2)
#define COBALT_SCC_IRQ (COBALT_CPU_IRQ + 3) /* pre-production has 85C30 */

View File

@@ -10,4 +10,6 @@
#define NR_IRQS 256
#include_next <irq.h>
#endif /* __ASM_MACH_EMMA2RH_IRQ_H */

View File

@@ -8,6 +8,38 @@
#ifndef __ASM_MACH_GENERIC_IRQ_H
#define __ASM_MACH_GENERIC_IRQ_H
#ifndef NR_IRQS
#define NR_IRQS 128
#endif
#ifdef CONFIG_I8259
#ifndef I8259A_IRQ_BASE
#define I8259A_IRQ_BASE 0
#endif
#endif
#ifdef CONFIG_IRQ_CPU
#ifndef MIPS_CPU_IRQ_BASE
#ifdef CONFIG_I8259
#define MIPS_CPU_IRQ_BASE 16
#else
#define MIPS_CPU_IRQ_BASE 0
#endif /* CONFIG_I8259 */
#endif
#ifdef CONFIG_IRQ_CPU_RM7K
#ifndef RM7K_CPU_IRQ_BASE
#define RM7K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+8)
#endif
#endif
#ifdef CONFIG_IRQ_CPU_RM9K
#ifndef RM9K_CPU_IRQ_BASE
#define RM9K_CPU_IRQ_BASE (MIPS_CPU_IRQ_BASE+12)
#endif
#endif
#endif /* CONFIG_IRQ_CPU */
#endif /* __ASM_MACH_GENERIC_IRQ_H */

View File

@@ -4,4 +4,6 @@
#define NR_IRQS 256
#include_next <irq.h>
#endif /* __ASM_MACH_MIPS_IRQ_H */

View File

@@ -0,0 +1,11 @@
#ifndef __ASM_MACH_VR41XX_IRQ_H
#define __ASM_MACH_VR41XX_IRQ_H
#include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */
#ifdef CONFIG_NEC_CMBVR4133
#include <asm/vr41xx/cmbvr4133.h> /* for I8259A_IRQ_BASE */
#endif
#include_next <irq.h>
#endif /* __ASM_MACH_VR41XX_IRQ_H */

View File

@@ -26,10 +26,12 @@
#ifndef _MIPS_ATLASINT_H
#define _MIPS_ATLASINT_H
#include <irq.h>
/*
* Interrupts 0..7 are used for Atlas CPU interrupts (nonEIC mode)
*/
#define MIPSCPU_INT_BASE 0
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
/* CPU interrupt offsets */
#define MIPSCPU_INT_SW0 0

View File

@@ -25,6 +25,8 @@
#ifndef _MIPS_MALTAINT_H
#define _MIPS_MALTAINT_H
#include <irq.h>
/*
* Interrupts 0..15 are used for Malta ISA compatible interrupts
*/
@@ -33,7 +35,7 @@
/*
* Interrupts 16..23 are used for Malta CPU interrupts (nonEIC mode)
*/
#define MIPSCPU_INT_BASE 16
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
/* CPU interrupt offsets */
#define MIPSCPU_INT_SW0 0

View File

@@ -33,7 +33,6 @@ extern void prom_printf(char *fmt, ...);
extern void prom_init_cmdline(void);
extern void prom_meminit(void);
extern void prom_fixup_mem_map(unsigned long start_mem, unsigned long end_mem);
extern unsigned long prom_free_prom_memory (void);
extern void mips_display_message(const char *str);
extern void mips_display_word(unsigned int num);
extern int get_ethernet_addr(char *ethernet_addr);

View File

@@ -20,10 +20,12 @@
#ifndef _MIPS_SEADINT_H
#define _MIPS_SEADINT_H
#include <irq.h>
/*
* Interrupts 0..7 are used for SEAD CPU interrupts
*/
#define MIPSCPU_INT_BASE 0
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
#define MIPSCPU_INT_UART0 2
#define MIPSCPU_INT_UART1 3

View File

@@ -17,10 +17,11 @@
#ifndef _MIPS_SIMINT_H
#define _MIPS_SIMINT_H
#include <irq.h>
#define SIM_INT_BASE 0
#define MIPSCPU_INT_MB0 2
#define MIPSCPU_INT_BASE 16
#define MIPSCPU_INT_BASE MIPS_CPU_IRQ_BASE
#define MIPS_CPU_TIMER_IRQ 7

View File

@@ -165,8 +165,6 @@
#ifndef __ASSEMBLY__
extern void mips_mt_regdump(unsigned long previous_mvpcontrol_value);
static inline unsigned int dvpe(void)
{
int res = 0;

View File

@@ -34,6 +34,20 @@
#ifndef __ASSEMBLY__
/*
* This gives the physical RAM offset.
*/
#ifndef PHYS_OFFSET
#define PHYS_OFFSET 0UL
#endif
/*
* It's normally defined only for FLATMEM config but it's
* used in our early mem init code for all memory models.
* So always define it.
*/
#define ARCH_PFN_OFFSET PFN_UP(PHYS_OFFSET)
#include <linux/pfn.h>
#include <asm/io.h>
@@ -132,20 +146,23 @@ typedef struct { unsigned long pgprot; } pgprot_t;
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
/*
* __pa()/__va() should be used only during mem init.
*/
#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
#else
#define __pa_page_offset(x) PAGE_OFFSET
#endif
#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x))
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x) + PHYS_OFFSET)
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET - PHYS_OFFSET))
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
#ifdef CONFIG_FLATMEM
#define pfn_valid(pfn) ((pfn) < max_mapnr)
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
#elif defined(CONFIG_SPARSEMEM)

View File

@@ -6,9 +6,10 @@
#ifndef __ASM_RTLX_H
#define __ASM_RTLX_H_
#include <irq.h>
#define LX_NODE_BASE 10
#define MIPSCPU_INT_BASE 16
#define MIPS_CPU_RTLX_IRQ 0
#define RTLX_VERSION 2

View File

@@ -3,6 +3,4 @@
#include <asm-generic/sections.h>
extern char _fdata;
#endif /* _ASM_SECTIONS_H */

View File

@@ -21,15 +21,16 @@
* HAL2 driver). This will prevent many complications, trust me ;-)
*/
#include <irq.h>
#include <asm/sgi/ioc.h>
#define SGINT_EISA 0 /* 16 EISA irq levels (Indigo2) */
#define SGINT_CPU 16 /* MIPS CPU define 8 interrupt sources */
#define SGINT_LOCAL0 24 /* 8 local0 irq levels */
#define SGINT_LOCAL1 32 /* 8 local1 irq levels */
#define SGINT_LOCAL2 40 /* 8 local2 vectored irq levels */
#define SGINT_LOCAL3 48 /* 8 local3 vectored irq levels */
#define SGINT_END 56 /* End of 'spaces' */
#define SGINT_CPU MIPS_CPU_IRQ_BASE /* MIPS CPU define 8 interrupt sources */
#define SGINT_LOCAL0 (SGINT_CPU+8) /* 8 local0 irq levels */
#define SGINT_LOCAL1 (SGINT_CPU+16) /* 8 local1 irq levels */
#define SGINT_LOCAL2 (SGINT_CPU+24) /* 8 local2 vectored irq levels */
#define SGINT_LOCAL3 (SGINT_CPU+32) /* 8 local3 vectored irq levels */
#define SGINT_END (SGINT_CPU+40) /* End of 'spaces' */
/*
* Individual interrupt definitions for the Indy and Indigo2

View File

@@ -44,9 +44,6 @@ struct smtc_ipi_q {
int depth;
};
extern struct smtc_ipi_q IPIQ[NR_CPUS];
extern struct smtc_ipi_q freeIPIq;
static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
{
long flags;

View File

@@ -488,7 +488,8 @@ extern size_t __copy_user(void *__to, const void *__from, size_t __n);
})
/*
* __copy_from_user: - Copy a block of data from user space, with less checking. * @to: Destination address, in kernel space.
* __copy_from_user: - Copy a block of data from user space, with less checking.
* @to: Destination address, in kernel space.
* @from: Source address, in user space.
* @n: Number of bytes to copy.
*

View File

@@ -35,8 +35,8 @@
#define CMBVR41XX_INTD_IRQ GIU_IRQ(CMBVR41XX_INTD_PIN)
#define CMBVR41XX_INTE_IRQ GIU_IRQ(CMBVR41XX_INTE_PIN)
#define I8259_IRQ_BASE 72
#define I8259_IRQ(x) (I8259_IRQ_BASE + (x))
#define I8259A_IRQ_BASE 72
#define I8259_IRQ(x) (I8259A_IRQ_BASE + (x))
#define TIMER_IRQ I8259_IRQ(0)
#define KEYBOARD_IRQ I8259_IRQ(1)
#define I8259_SLAVE_IRQ I8259_IRQ(2)
@@ -52,6 +52,5 @@
#define AUX_IRQ I8259_IRQ(12)
#define IDE_PRIMARY_IRQ I8259_IRQ(14)
#define IDE_SECONDARY_IRQ I8259_IRQ(15)
#define I8259_IRQ_LAST IDE_SECONDARY_IRQ
#endif /* __NEC_CMBVR4133_H */

View File

@@ -6,6 +6,34 @@
#include <linux/types.h>
#include <linux/sched.h>
#define PSW32_MASK_PER 0x40000000UL
#define PSW32_MASK_DAT 0x04000000UL
#define PSW32_MASK_IO 0x02000000UL
#define PSW32_MASK_EXT 0x01000000UL
#define PSW32_MASK_KEY 0x00F00000UL
#define PSW32_MASK_MCHECK 0x00040000UL
#define PSW32_MASK_WAIT 0x00020000UL
#define PSW32_MASK_PSTATE 0x00010000UL
#define PSW32_MASK_ASC 0x0000C000UL
#define PSW32_MASK_CC 0x00003000UL
#define PSW32_MASK_PM 0x00000f00UL
#define PSW32_ADDR_AMODE31 0x80000000UL
#define PSW32_ADDR_INSN 0x7FFFFFFFUL
#define PSW32_BASE_BITS 0x00080000UL
#define PSW32_ASC_PRIMARY 0x00000000UL
#define PSW32_ASC_ACCREG 0x00004000UL
#define PSW32_ASC_SECONDARY 0x00008000UL
#define PSW32_ASC_HOME 0x0000C000UL
#define PSW32_MASK_MERGE(CURRENT,NEW) \
(((CURRENT) & ~(PSW32_MASK_CC|PSW32_MASK_PM)) | \
((NEW) & (PSW32_MASK_CC|PSW32_MASK_PM)))
extern long psw32_user_bits;
#define COMPAT_USER_HZ 100
typedef u32 compat_size_t;

219
include/asm-s390/etr.h Normal file
View File

@@ -0,0 +1,219 @@
/*
* include/asm-s390/etr.h
*
* Copyright IBM Corp. 2006
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
*/
#ifndef __S390_ETR_H
#define __S390_ETR_H
/* ETR attachment control register */
struct etr_eacr {
unsigned int e0 : 1; /* port 0 stepping control */
unsigned int e1 : 1; /* port 1 stepping control */
unsigned int _pad0 : 5; /* must be 00100 */
unsigned int dp : 1; /* data port control */
unsigned int p0 : 1; /* port 0 change recognition control */
unsigned int p1 : 1; /* port 1 change recognition control */
unsigned int _pad1 : 3; /* must be 000 */
unsigned int ea : 1; /* ETR alert control */
unsigned int es : 1; /* ETR sync check control */
unsigned int sl : 1; /* switch to local control */
} __attribute__ ((packed));
/* Port state returned by steai */
enum etr_psc {
etr_psc_operational = 0,
etr_psc_semi_operational = 1,
etr_psc_protocol_error = 4,
etr_psc_no_symbols = 8,
etr_psc_no_signal = 12,
etr_psc_pps_mode = 13
};
/* Logical port state returned by stetr */
enum etr_lpsc {
etr_lpsc_operational_step = 0,
etr_lpsc_operational_alt = 1,
etr_lpsc_semi_operational = 2,
etr_lpsc_protocol_error = 4,
etr_lpsc_no_symbol_sync = 8,
etr_lpsc_no_signal = 12,
etr_lpsc_pps_mode = 13
};
/* ETR status words */
struct etr_esw {
struct etr_eacr eacr; /* attachment control register */
unsigned int y : 1; /* stepping mode */
unsigned int _pad0 : 5; /* must be 00000 */
unsigned int p : 1; /* stepping port number */
unsigned int q : 1; /* data port number */
unsigned int psc0 : 4; /* port 0 state code */
unsigned int psc1 : 4; /* port 1 state code */
} __attribute__ ((packed));
/* Second level data register status word */
struct etr_slsw {
unsigned int vv1 : 1; /* copy of validity bit data frame 1 */
unsigned int vv2 : 1; /* copy of validity bit data frame 2 */
unsigned int vv3 : 1; /* copy of validity bit data frame 3 */
unsigned int vv4 : 1; /* copy of validity bit data frame 4 */
unsigned int _pad0 : 19; /* must by all zeroes */
unsigned int n : 1; /* EAF port number */
unsigned int v1 : 1; /* validity bit ETR data frame 1 */
unsigned int v2 : 1; /* validity bit ETR data frame 2 */
unsigned int v3 : 1; /* validity bit ETR data frame 3 */
unsigned int v4 : 1; /* validity bit ETR data frame 4 */
unsigned int _pad1 : 4; /* must be 0000 */
} __attribute__ ((packed));
/* ETR data frames */
struct etr_edf1 {
unsigned int u : 1; /* untuned bit */
unsigned int _pad0 : 1; /* must be 0 */
unsigned int r : 1; /* service request bit */
unsigned int _pad1 : 4; /* must be 0000 */
unsigned int a : 1; /* time adjustment bit */
unsigned int net_id : 8; /* ETR network id */
unsigned int etr_id : 8; /* id of ETR which sends data frames */
unsigned int etr_pn : 8; /* port number of ETR output port */
} __attribute__ ((packed));
struct etr_edf2 {
unsigned int etv : 32; /* Upper 32 bits of TOD. */
} __attribute__ ((packed));
struct etr_edf3 {
unsigned int rc : 8; /* failure reason code */
unsigned int _pad0 : 3; /* must be 000 */
unsigned int c : 1; /* ETR coupled bit */
unsigned int tc : 4; /* ETR type code */
unsigned int blto : 8; /* biased local time offset */
/* (blto - 128) * 15 = minutes */
unsigned int buo : 8; /* biased utc offset */
/* (buo - 128) = leap seconds */
} __attribute__ ((packed));
struct etr_edf4 {
unsigned int ed : 8; /* ETS device dependent data */
unsigned int _pad0 : 1; /* must be 0 */
unsigned int buc : 5; /* biased ut1 correction */
/* (buc - 16) * 0.1 seconds */
unsigned int em : 6; /* ETS error magnitude */
unsigned int dc : 6; /* ETS drift code */
unsigned int sc : 6; /* ETS steering code */
} __attribute__ ((packed));
/*
* ETR attachment information block, two formats
* format 1 has 4 reserved words with a size of 64 bytes
* format 2 has 16 reserved words with a size of 96 bytes
*/
struct etr_aib {
struct etr_esw esw;
struct etr_slsw slsw;
unsigned long long tsp;
struct etr_edf1 edf1;
struct etr_edf2 edf2;
struct etr_edf3 edf3;
struct etr_edf4 edf4;
unsigned int reserved[16];
} __attribute__ ((packed,aligned(8)));
/* ETR interruption parameter */
struct etr_interruption_parameter {
unsigned int _pad0 : 8;
unsigned int pc0 : 1; /* port 0 state change */
unsigned int pc1 : 1; /* port 1 state change */
unsigned int _pad1 : 3;
unsigned int eai : 1; /* ETR alert indication */
unsigned int _pad2 : 18;
} __attribute__ ((packed));
/* Query TOD offset result */
struct etr_ptff_qto {
unsigned long long physical_clock;
unsigned long long tod_offset;
unsigned long long logical_tod_offset;
unsigned long long tod_epoch_difference;
} __attribute__ ((packed));
/* Inline assembly helper functions */
static inline int etr_setr(struct etr_eacr *ctrl)
{
int rc = -ENOSYS;
asm volatile(
" .insn s,0xb2160000,0(%2)\n"
"0: la %0,0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+d" (rc) : "m" (*ctrl), "a" (ctrl));
return rc;
}
/* Stores a format 1 aib with 64 bytes */
static inline int etr_stetr(struct etr_aib *aib)
{
int rc = -ENOSYS;
asm volatile(
" .insn s,0xb2170000,0(%2)\n"
"0: la %0,0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+d" (rc) : "m" (*aib), "a" (aib));
return rc;
}
/* Stores a format 2 aib with 96 bytes for specified port */
static inline int etr_steai(struct etr_aib *aib, unsigned int func)
{
register unsigned int reg0 asm("0") = func;
int rc = -ENOSYS;
asm volatile(
" .insn s,0xb2b30000,0(%2)\n"
"0: la %0,0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+d" (rc) : "m" (*aib), "a" (aib), "d" (reg0));
return rc;
}
/* Function codes for the steai instruction. */
#define ETR_STEAI_STEPPING_PORT 0x10
#define ETR_STEAI_ALTERNATE_PORT 0x11
#define ETR_STEAI_PORT_0 0x12
#define ETR_STEAI_PORT_1 0x13
static inline int etr_ptff(void *ptff_block, unsigned int func)
{
register unsigned int reg0 asm("0") = func;
register unsigned long reg1 asm("1") = (unsigned long) ptff_block;
int rc = -ENOSYS;
asm volatile(
" .word 0x0104\n"
" ipm %0\n"
" srl %0,28\n"
: "=d" (rc), "=m" (ptff_block)
: "d" (reg0), "d" (reg1), "m" (ptff_block) : "cc");
return rc;
}
/* Function codes for the ptff instruction. */
#define ETR_PTFF_QAF 0x00 /* query available functions */
#define ETR_PTFF_QTO 0x01 /* query tod offset */
#define ETR_PTFF_QSI 0x02 /* query steering information */
#define ETR_PTFF_ATO 0x40 /* adjust tod offset */
#define ETR_PTFF_STO 0x41 /* set tod offset */
#define ETR_PTFF_SFS 0x42 /* set fine steering rate */
#define ETR_PTFF_SGS 0x43 /* set gross steering rate */
/* Functions needed by the machine check handler */
extern void etr_switch_to_local(void);
extern void etr_sync_check(void);
#endif /* __S390_ETR_H */

View File

@@ -32,6 +32,6 @@ typedef struct {
#define HARDIRQ_BITS 8
extern void account_ticks(void);
extern void account_ticks(u64 time);
#endif /* __ASM_HARDIRQ_H */

View File

@@ -28,11 +28,7 @@ static inline unsigned long virt_to_phys(volatile void * address)
{
unsigned long real_address;
asm volatile(
#ifndef __s390x__
" lra %0,0(%1)\n"
#else /* __s390x__ */
" lrag %0,0(%1)\n"
#endif /* __s390x__ */
" jz 0f\n"
" la %0,0\n"
"0:"

View File

@@ -26,7 +26,6 @@ extern int register_page_fault_notifier(struct notifier_block *);
extern int unregister_page_fault_notifier(struct notifier_block *);
extern struct atomic_notifier_head s390die_chain;
enum die_val {
DIE_OOPS = 1,
DIE_BPT,
@@ -56,4 +55,6 @@ static inline int notify_die(enum die_val val, const char *str,
return atomic_notifier_call_chain(&s390die_chain, val, &args);
}
extern void die(const char *, struct pt_regs *, long);
#endif

View File

@@ -220,7 +220,8 @@ struct _lowcore
__u32 kernel_asce; /* 0xc4c */
__u32 user_asce; /* 0xc50 */
__u32 panic_stack; /* 0xc54 */
__u8 pad10[0xc60-0xc58]; /* 0xc58 */
__u32 user_exec_asce; /* 0xc58 */
__u8 pad10[0xc60-0xc5c]; /* 0xc5c */
/* entry.S sensitive area start */
struct cpuinfo_S390 cpu_data; /* 0xc60 */
__u32 ipl_device; /* 0xc7c */
@@ -310,7 +311,8 @@ struct _lowcore
__u64 kernel_asce; /* 0xd58 */
__u64 user_asce; /* 0xd60 */
__u64 panic_stack; /* 0xd68 */
__u8 pad10[0xd80-0xd70]; /* 0xd70 */
__u64 user_exec_asce; /* 0xd70 */
__u8 pad10[0xd80-0xd78]; /* 0xd78 */
/* entry.S sensitive area start */
struct cpuinfo_S390 cpu_data; /* 0xd80 */
__u32 ipl_device; /* 0xdb8 */

View File

@@ -9,6 +9,7 @@
#ifndef __S390_MMU_CONTEXT_H
#define __S390_MMU_CONTEXT_H
#include <asm/pgalloc.h>
/*
* get a new mmu context.. S390 don't know about contexts.
*/
@@ -16,29 +17,44 @@
#define destroy_context(mm) do { } while (0)
#ifndef __s390x__
#define LCTL_OPCODE "lctl"
#define PGTABLE_BITS (_SEGMENT_TABLE|USER_STD_MASK)
#else
#define LCTL_OPCODE "lctlg"
#define PGTABLE_BITS (_REGION_TABLE|USER_STD_MASK)
#endif
static inline void enter_lazy_tlb(struct mm_struct *mm,
struct task_struct *tsk)
{
}
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
struct task_struct *tsk)
struct task_struct *tsk)
{
if (prev != next) {
#ifndef __s390x__
S390_lowcore.user_asce = (__pa(next->pgd)&PAGE_MASK) |
(_SEGMENT_TABLE|USER_STD_MASK);
/* Load home space page table origin. */
asm volatile("lctl 13,13,%0"
: : "m" (S390_lowcore.user_asce) );
#else /* __s390x__ */
S390_lowcore.user_asce = (__pa(next->pgd) & PAGE_MASK) |
(_REGION_TABLE|USER_STD_MASK);
/* Load home space page table origin. */
asm volatile("lctlg 13,13,%0"
: : "m" (S390_lowcore.user_asce) );
#endif /* __s390x__ */
}
pgd_t *shadow_pgd = get_shadow_pgd(next->pgd);
if (prev != next) {
S390_lowcore.user_asce = (__pa(next->pgd) & PAGE_MASK) |
PGTABLE_BITS;
if (shadow_pgd) {
/* Load primary/secondary space page table origin. */
S390_lowcore.user_exec_asce =
(__pa(shadow_pgd) & PAGE_MASK) | PGTABLE_BITS;
asm volatile(LCTL_OPCODE" 1,1,%0\n"
LCTL_OPCODE" 7,7,%1"
: : "m" (S390_lowcore.user_exec_asce),
"m" (S390_lowcore.user_asce) );
} else if (switch_amode) {
/* Load primary space page table origin. */
asm volatile(LCTL_OPCODE" 1,1,%0"
: : "m" (S390_lowcore.user_asce) );
} else
/* Load home space page table origin. */
asm volatile(LCTL_OPCODE" 13,13,%0"
: : "m" (S390_lowcore.user_asce) );
}
cpu_set(smp_processor_id(), next->cpu_vm_mask);
}
@@ -51,4 +67,4 @@ static inline void activate_mm(struct mm_struct *prev,
set_fs(current->thread.mm_segment);
}
#endif
#endif /* __S390_MMU_CONTEXT_H */

View File

@@ -47,6 +47,17 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
if (!pgd)
return NULL;
if (s390_noexec) {
pgd_t *shadow_pgd = (pgd_t *)
__get_free_pages(GFP_KERNEL, PGD_ALLOC_ORDER);
struct page *page = virt_to_page(pgd);
if (!shadow_pgd) {
free_pages((unsigned long) pgd, PGD_ALLOC_ORDER);
return NULL;
}
page->lru.next = (void *) shadow_pgd;
}
for (i = 0; i < PTRS_PER_PGD; i++)
#ifndef __s390x__
pmd_clear(pmd_offset(pgd + i, i*PGDIR_SIZE));
@@ -58,6 +69,10 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(pgd_t *pgd)
{
pgd_t *shadow_pgd = get_shadow_pgd(pgd);
if (shadow_pgd)
free_pages((unsigned long) shadow_pgd, PGD_ALLOC_ORDER);
free_pages((unsigned long) pgd, PGD_ALLOC_ORDER);
}
@@ -71,6 +86,7 @@ static inline void pgd_free(pgd_t *pgd)
#define pmd_free(x) do { } while (0)
#define __pmd_free_tlb(tlb,x) do { } while (0)
#define pgd_populate(mm, pmd, pte) BUG()
#define pgd_populate_kernel(mm, pmd, pte) BUG()
#else /* __s390x__ */
static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
{
@@ -79,6 +95,17 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
if (!pmd)
return NULL;
if (s390_noexec) {
pmd_t *shadow_pmd = (pmd_t *)
__get_free_pages(GFP_KERNEL, PMD_ALLOC_ORDER);
struct page *page = virt_to_page(pmd);
if (!shadow_pmd) {
free_pages((unsigned long) pmd, PMD_ALLOC_ORDER);
return NULL;
}
page->lru.next = (void *) shadow_pmd;
}
for (i=0; i < PTRS_PER_PMD; i++)
pmd_clear(pmd + i);
return pmd;
@@ -86,6 +113,10 @@ static inline pmd_t * pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
static inline void pmd_free (pmd_t *pmd)
{
pmd_t *shadow_pmd = get_shadow_pmd(pmd);
if (shadow_pmd)
free_pages((unsigned long) shadow_pmd, PMD_ALLOC_ORDER);
free_pages((unsigned long) pmd, PMD_ALLOC_ORDER);
}
@@ -95,11 +126,22 @@ static inline void pmd_free (pmd_t *pmd)
pmd_free(pmd); \
} while (0)
static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
static inline void
pgd_populate_kernel(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
{
pgd_val(*pgd) = _PGD_ENTRY | __pa(pmd);
}
static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
{
pgd_t *shadow_pgd = get_shadow_pgd(pgd);
pmd_t *shadow_pmd = get_shadow_pmd(pmd);
if (shadow_pgd && shadow_pmd)
pgd_populate_kernel(mm, shadow_pgd, shadow_pmd);
pgd_populate_kernel(mm, pgd, pmd);
}
#endif /* __s390x__ */
static inline void
@@ -119,7 +161,13 @@ pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
static inline void
pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page)
{
pmd_populate_kernel(mm, pmd, (pte_t *)page_to_phys(page));
pte_t *pte = (pte_t *)page_to_phys(page);
pmd_t *shadow_pmd = get_shadow_pmd(pmd);
pte_t *shadow_pte = get_shadow_pte(pte);
pmd_populate_kernel(mm, pmd, pte);
if (shadow_pmd && shadow_pte)
pmd_populate_kernel(mm, shadow_pmd, shadow_pte);
}
/*
@@ -133,6 +181,17 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long vmaddr)
if (!pte)
return NULL;
if (s390_noexec) {
pte_t *shadow_pte = (pte_t *)
__get_free_page(GFP_KERNEL|__GFP_REPEAT);
struct page *page = virt_to_page(pte);
if (!shadow_pte) {
free_page((unsigned long) pte);
return NULL;
}
page->lru.next = (void *) shadow_pte;
}
for (i=0; i < PTRS_PER_PTE; i++) {
pte_clear(mm, vmaddr, pte + i);
vmaddr += PAGE_SIZE;
@@ -151,14 +210,30 @@ pte_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
static inline void pte_free_kernel(pte_t *pte)
{
free_page((unsigned long) pte);
pte_t *shadow_pte = get_shadow_pte(pte);
if (shadow_pte)
free_page((unsigned long) shadow_pte);
free_page((unsigned long) pte);
}
static inline void pte_free(struct page *pte)
{
__free_page(pte);
struct page *shadow_page = get_shadow_page(pte);
if (shadow_page)
__free_page(shadow_page);
__free_page(pte);
}
#define __pte_free_tlb(tlb,pte) tlb_remove_page(tlb,pte)
#define __pte_free_tlb(tlb, pte) \
({ \
struct mmu_gather *__tlb = (tlb); \
struct page *__pte = (pte); \
struct page *shadow_page = get_shadow_page(__pte); \
if (shadow_page) \
tlb_remove_page(__tlb, shadow_page); \
tlb_remove_page(__tlb, __pte); \
})
#endif /* _S390_PGALLOC_H */

View File

@@ -40,6 +40,7 @@ struct mm_struct;
extern pgd_t swapper_pg_dir[] __attribute__ ((aligned (4096)));
extern void paging_init(void);
extern void vmem_map_init(void);
/*
* The S390 doesn't have any external MMU info: the kernel page
@@ -223,6 +224,8 @@ extern unsigned long vmalloc_end;
#define _PAGE_TYPE_FILE 0x601 /* bit 0x002 is used for offset !! */
#define _PAGE_TYPE_RO 0x200
#define _PAGE_TYPE_RW 0x000
#define _PAGE_TYPE_EX_RO 0x202
#define _PAGE_TYPE_EX_RW 0x002
/*
* PTE type bits are rather complicated. handle_pte_fault uses pte_present,
@@ -243,11 +246,13 @@ extern unsigned long vmalloc_end;
* _PAGE_TYPE_FILE 11?1 -> 11?1
* _PAGE_TYPE_RO 0100 -> 1100
* _PAGE_TYPE_RW 0000 -> 1000
* _PAGE_TYPE_EX_RO 0110 -> 1110
* _PAGE_TYPE_EX_RW 0010 -> 1010
*
* pte_none is true for bits combinations 1000, 1100
* pte_none is true for bits combinations 1000, 1010, 1100, 1110
* pte_present is true for bits combinations 0000, 0010, 0100, 0110, 1001
* pte_file is true for bits combinations 1101, 1111
* swap pte is 1011 and 0001, 0011, 0101, 0111, 1010 and 1110 are invalid.
* swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid.
*/
#ifndef __s390x__
@@ -312,33 +317,100 @@ extern unsigned long vmalloc_end;
#define PAGE_NONE __pgprot(_PAGE_TYPE_NONE)
#define PAGE_RO __pgprot(_PAGE_TYPE_RO)
#define PAGE_RW __pgprot(_PAGE_TYPE_RW)
#define PAGE_EX_RO __pgprot(_PAGE_TYPE_EX_RO)
#define PAGE_EX_RW __pgprot(_PAGE_TYPE_EX_RW)
#define PAGE_KERNEL PAGE_RW
#define PAGE_COPY PAGE_RO
/*
* The S390 can't do page protection for execute, and considers that the
* same are read. Also, write permissions imply read permissions. This is
* the closest we can get..
* Dependent on the EXEC_PROTECT option s390 can do execute protection.
* Write permission always implies read permission. In theory with a
* primary/secondary page table execute only can be implemented but
* it would cost an additional bit in the pte to distinguish all the
* different pte types. To avoid that execute permission currently
* implies read permission as well.
*/
/*xwr*/
#define __P000 PAGE_NONE
#define __P001 PAGE_RO
#define __P010 PAGE_RO
#define __P011 PAGE_RO
#define __P100 PAGE_RO
#define __P101 PAGE_RO
#define __P110 PAGE_RO
#define __P111 PAGE_RO
#define __P100 PAGE_EX_RO
#define __P101 PAGE_EX_RO
#define __P110 PAGE_EX_RO
#define __P111 PAGE_EX_RO
#define __S000 PAGE_NONE
#define __S001 PAGE_RO
#define __S010 PAGE_RW
#define __S011 PAGE_RW
#define __S100 PAGE_RO
#define __S101 PAGE_RO
#define __S110 PAGE_RW
#define __S111 PAGE_RW
#define __S100 PAGE_EX_RO
#define __S101 PAGE_EX_RO
#define __S110 PAGE_EX_RW
#define __S111 PAGE_EX_RW
#ifndef __s390x__
# define PMD_SHADOW_SHIFT 1
# define PGD_SHADOW_SHIFT 1
#else /* __s390x__ */
# define PMD_SHADOW_SHIFT 2
# define PGD_SHADOW_SHIFT 2
#endif /* __s390x__ */
static inline struct page *get_shadow_page(struct page *page)
{
if (s390_noexec && !list_empty(&page->lru))
return virt_to_page(page->lru.next);
return NULL;
}
static inline pte_t *get_shadow_pte(pte_t *ptep)
{
unsigned long pteptr = (unsigned long) (ptep);
if (s390_noexec) {
unsigned long offset = pteptr & (PAGE_SIZE - 1);
void *addr = (void *) (pteptr ^ offset);
struct page *page = virt_to_page(addr);
if (!list_empty(&page->lru))
return (pte_t *) ((unsigned long) page->lru.next |
offset);
}
return NULL;
}
static inline pmd_t *get_shadow_pmd(pmd_t *pmdp)
{
unsigned long pmdptr = (unsigned long) (pmdp);
if (s390_noexec) {
unsigned long offset = pmdptr &
((PAGE_SIZE << PMD_SHADOW_SHIFT) - 1);
void *addr = (void *) (pmdptr ^ offset);
struct page *page = virt_to_page(addr);
if (!list_empty(&page->lru))
return (pmd_t *) ((unsigned long) page->lru.next |
offset);
}
return NULL;
}
static inline pgd_t *get_shadow_pgd(pgd_t *pgdp)
{
unsigned long pgdptr = (unsigned long) (pgdp);
if (s390_noexec) {
unsigned long offset = pgdptr &
((PAGE_SIZE << PGD_SHADOW_SHIFT) - 1);
void *addr = (void *) (pgdptr ^ offset);
struct page *page = virt_to_page(addr);
if (!list_empty(&page->lru))
return (pgd_t *) ((unsigned long) page->lru.next |
offset);
}
return NULL;
}
/*
* Certain architectures need to do special things when PTEs
@@ -347,7 +419,16 @@ extern unsigned long vmalloc_end;
*/
static inline void set_pte(pte_t *pteptr, pte_t pteval)
{
pte_t *shadow_pte = get_shadow_pte(pteptr);
*pteptr = pteval;
if (shadow_pte) {
if (!(pte_val(pteval) & _PAGE_INVALID) &&
(pte_val(pteval) & _PAGE_SWX))
pte_val(*shadow_pte) = pte_val(pteval) | _PAGE_RO;
else
pte_val(*shadow_pte) = _PAGE_TYPE_EMPTY;
}
}
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
@@ -465,7 +546,7 @@ static inline int pte_read(pte_t pte)
static inline void pgd_clear(pgd_t * pgdp) { }
static inline void pmd_clear(pmd_t * pmdp)
static inline void pmd_clear_kernel(pmd_t * pmdp)
{
pmd_val(pmdp[0]) = _PAGE_TABLE_INV;
pmd_val(pmdp[1]) = _PAGE_TABLE_INV;
@@ -473,24 +554,55 @@ static inline void pmd_clear(pmd_t * pmdp)
pmd_val(pmdp[3]) = _PAGE_TABLE_INV;
}
static inline void pmd_clear(pmd_t * pmdp)
{
pmd_t *shadow_pmd = get_shadow_pmd(pmdp);
pmd_clear_kernel(pmdp);
if (shadow_pmd)
pmd_clear_kernel(shadow_pmd);
}
#else /* __s390x__ */
static inline void pgd_clear(pgd_t * pgdp)
static inline void pgd_clear_kernel(pgd_t * pgdp)
{
pgd_val(*pgdp) = _PGD_ENTRY_INV | _PGD_ENTRY;
}
static inline void pmd_clear(pmd_t * pmdp)
static inline void pgd_clear(pgd_t * pgdp)
{
pgd_t *shadow_pgd = get_shadow_pgd(pgdp);
pgd_clear_kernel(pgdp);
if (shadow_pgd)
pgd_clear_kernel(shadow_pgd);
}
static inline void pmd_clear_kernel(pmd_t * pmdp)
{
pmd_val(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
pmd_val1(*pmdp) = _PMD_ENTRY_INV | _PMD_ENTRY;
}
static inline void pmd_clear(pmd_t * pmdp)
{
pmd_t *shadow_pmd = get_shadow_pmd(pmdp);
pmd_clear_kernel(pmdp);
if (shadow_pmd)
pmd_clear_kernel(shadow_pmd);
}
#endif /* __s390x__ */
static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
{
pte_t *shadow_pte = get_shadow_pte(ptep);
pte_val(*ptep) = _PAGE_TYPE_EMPTY;
if (shadow_pte)
pte_val(*shadow_pte) = _PAGE_TYPE_EMPTY;
}
/*
@@ -608,8 +720,11 @@ ptep_clear_flush(struct vm_area_struct *vma,
unsigned long address, pte_t *ptep)
{
pte_t pte = *ptep;
pte_t *shadow_pte = get_shadow_pte(ptep);
__ptep_ipte(address, ptep);
if (shadow_pte)
__ptep_ipte(address, shadow_pte);
return pte;
}

View File

@@ -50,6 +50,7 @@ struct cpuinfo_S390
unsigned long pgtable_cache_sz;
};
extern void s390_adjust_jiffies(void);
extern void print_cpu_info(struct cpuinfo_S390 *);
/* Lazy FPU handling on uni-processor */
@@ -144,7 +145,8 @@ struct stack_frame {
#ifndef __s390x__
#define start_thread(regs, new_psw, new_stackp) do { \
regs->psw.mask = PSW_USER_BITS; \
set_fs(USER_DS); \
regs->psw.mask = psw_user_bits; \
regs->psw.addr = new_psw | PSW_ADDR_AMODE; \
regs->gprs[15] = new_stackp ; \
} while (0)
@@ -152,13 +154,15 @@ struct stack_frame {
#else /* __s390x__ */
#define start_thread(regs, new_psw, new_stackp) do { \
regs->psw.mask = PSW_USER_BITS; \
set_fs(USER_DS); \
regs->psw.mask = psw_user_bits; \
regs->psw.addr = new_psw; \
regs->gprs[15] = new_stackp; \
} while (0)
#define start_thread31(regs, new_psw, new_stackp) do { \
regs->psw.mask = PSW_USER32_BITS; \
set_fs(USER_DS); \
regs->psw.mask = psw_user32_bits; \
regs->psw.addr = new_psw; \
regs->gprs[15] = new_stackp; \
} while (0)
@@ -201,9 +205,8 @@ unsigned long get_wchan(struct task_struct *p);
static inline void cpu_relax(void)
{
if (MACHINE_HAS_DIAG44)
asm volatile("diag 0,0,68" : : : "memory");
else
barrier();
asm volatile("diag 0,0,68");
barrier();
}
/*
@@ -327,6 +330,18 @@ static inline void disabled_wait(unsigned long code)
#endif /* __s390x__ */
}
/*
* Basic Machine Check/Program Check Handler.
*/
extern void s390_base_mcck_handler(void);
extern void s390_base_pgm_handler(void);
extern void s390_base_ext_handler(void);
extern void (*s390_base_mcck_handler_fn)(void);
extern void (*s390_base_pgm_handler_fn)(void);
extern void (*s390_base_ext_handler_fn)(void);
/*
* CPU idle notifier chain.
*/

View File

@@ -266,17 +266,12 @@ typedef struct
#define PSW_ASC_SECONDARY 0x0000800000000000UL
#define PSW_ASC_HOME 0x0000C00000000000UL
#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
extern long psw_user32_bits;
#endif /* __s390x__ */
#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \
PSW_MASK_MCHECK | PSW_DEFAULT_KEY)
#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
extern long psw_kernel_bits;
extern long psw_user_bits;
/* This macro merges a NEW PSW mask specified by the user into
the currently active PSW mask CURRENT, modifying only those

View File

@@ -18,7 +18,4 @@ struct reset_call {
extern void register_reset_call(struct reset_call *reset);
extern void unregister_reset_call(struct reset_call *reset);
extern void s390_reset_system(void);
extern void (*s390_reset_mcck_handler)(void);
extern void (*s390_reset_pgm_handler)(void);
#endif /* _ASM_S390_RESET_H */

39
include/asm-s390/sclp.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* include/asm-s390/sclp.h
*
* Copyright IBM Corp. 2007
* Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
*/
#ifndef _ASM_S390_SCLP_H
#define _ASM_S390_SCLP_H
#include <linux/types.h>
struct sccb_header {
u16 length;
u8 function_code;
u8 control_mask[3];
u16 response_code;
} __attribute__((packed));
#define LOADPARM_LEN 8
struct sclp_readinfo_sccb {
struct sccb_header header; /* 0-7 */
u16 rnmax; /* 8-9 */
u8 rnsize; /* 10 */
u8 _reserved0[24 - 11]; /* 11-23 */
u8 loadparm[LOADPARM_LEN]; /* 24-31 */
u8 _reserved1[91 - 32]; /* 32-90 */
u8 flags; /* 91 */
u8 _reserved2[100 - 92]; /* 92-99 */
u32 rnsize2; /* 100-103 */
u64 rnmax2; /* 104-111 */
u8 _reserved3[4096 - 112]; /* 112-4095 */
} __attribute__((packed, aligned(4096)));
extern struct sclp_readinfo_sccb s390_readinfo_sccb;
extern void sclp_readinfo_early(void);
#endif /* _ASM_S390_SCLP_H */

View File

@@ -3,4 +3,6 @@
#include <asm-generic/sections.h>
extern char _eshared[];
#endif

View File

@@ -42,6 +42,18 @@ struct mem_chunk {
extern struct mem_chunk memory_chunk[];
#ifdef CONFIG_S390_SWITCH_AMODE
extern unsigned int switch_amode;
#else
#define switch_amode (0)
#endif
#ifdef CONFIG_S390_EXEC_PROTECT
extern unsigned int s390_noexec;
#else
#define s390_noexec (0)
#endif
/*
* Machine features detected in head.S
*/
@@ -74,6 +86,9 @@ extern unsigned int console_mode;
extern unsigned int console_devno;
extern unsigned int console_irq;
extern char vmhalt_cmd[];
extern char vmpoff_cmd[];
#define CONSOLE_IS_UNDEFINED (console_mode == 0)
#define CONSOLE_IS_SCLP (console_mode == 1)
#define CONSOLE_IS_3215 (console_mode == 2)
@@ -141,13 +156,19 @@ struct ipl_parameter_block {
extern u32 ipl_flags;
extern u16 ipl_devno;
void do_reipl(void);
extern void do_reipl(void);
extern void ipl_save_parameters(void);
enum {
IPL_DEVNO_VALID = 1,
IPL_PARMBLOCK_VALID = 2,
IPL_NSS_VALID = 4,
};
#define NSS_NAME_SIZE 8
extern char kernel_nss_name[];
#define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \
IPL_PARMBLOCK_ORIGIN)
#define IPL_PARMBLOCK_SIZE (IPL_PARMBLOCK_START->hdr.len)

View File

@@ -0,0 +1,66 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <asm/byteorder.h>
#define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \
unsigned int __sh = (ah); \
unsigned int __sl = (al); \
asm volatile( \
" alr %1,%3\n" \
" brc 12,0f\n" \
" ahi %0,1\n" \
"0: alr %0,%2" \
: "+&d" (__sh), "+d" (__sl) \
: "d" (bh), "d" (bl) : "cc"); \
(sh) = __sh; \
(sl) = __sl; \
})
#define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \
unsigned int __sh = (ah); \
unsigned int __sl = (al); \
asm volatile( \
" slr %1,%3\n" \
" brc 3,0f\n" \
" ahi %0,-1\n" \
"0: slr %0,%2" \
: "+&d" (__sh), "+d" (__sl) \
: "d" (bh), "d" (bl) : "cc"); \
(sh) = __sh; \
(sl) = __sl; \
})
/* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */
#define umul_ppmm(wh, wl, u, v) ({ \
unsigned int __wh = u; \
unsigned int __wl = v; \
asm volatile( \
" ltr 1,%0\n" \
" mr 0,%1\n" \
" jnm 0f\n" \
" alr 0,%1\n" \
"0: ltr %1,%1\n" \
" jnm 1f\n" \
" alr 0,%0\n" \
"1: lr %0,0\n" \
" lr %1,1\n" \
: "+d" (__wh), "+d" (__wl) \
: : "0", "1", "cc"); \
wh = __wh; \
wl = __wl; \
})
#define udiv_qrnnd(q, r, n1, n0, d) \
do { unsigned int __r; \
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
(r) = __r; \
} while (0)
extern unsigned long __udiv_qrnnd (unsigned int *, unsigned int,
unsigned int , unsigned int);
#define UDIV_NEEDS_NORMALIZATION 0
#define abort() return 0
#define __BYTE_ORDER __BIG_ENDIAN

View File

@@ -31,6 +31,10 @@ typedef struct
__u16 cpu;
} sigp_info;
extern void machine_restart_smp(char *);
extern void machine_halt_smp(void);
extern void machine_power_off_smp(void);
extern void smp_setup_cpu_possible_map(void);
extern int smp_call_function_on(void (*func) (void *info), void *info,
int nonatomic, int wait, int cpu);
@@ -106,7 +110,7 @@ smp_call_function_on(void (*func) (void *info), void *info,
static inline void smp_send_stop(void)
{
/* Disable all interrupts/machine checks */
__load_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK);
__load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
}
#define smp_cpu_not_running(cpu) 1

View File

@@ -373,8 +373,8 @@ __set_psw_mask(unsigned long mask)
__load_psw_mask(mask | (__raw_local_irq_stosm(0x00) & ~(-1UL >> 8)));
}
#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS)
#define local_mcck_disable() __set_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK)
#define local_mcck_enable() __set_psw_mask(psw_kernel_bits)
#define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK)
#ifdef CONFIG_SMP

View File

@@ -1,11 +1,11 @@
/*************************************************************************
*
* tape390.h
* enables user programs to display messages on the tape device
* enables user programs to display messages and control encryption
* on s390 tape devices
*
* S390 and zSeries version
* Copyright (C) 2001 IBM Corporation
* Author(s): Despina Papadopoulou <despina_p@de.ibm.com>
* Copyright IBM Corp. 2001,2006
* Author(s): Michael Holzheu <holzheu@de.ibm.com>
*
*************************************************************************/
@@ -36,4 +36,68 @@ typedef struct display_struct {
char message2[8];
} display_struct;
/*
* Tape encryption support
*/
struct tape390_crypt_info {
char capability;
char status;
char medium_status;
} __attribute__ ((packed));
/* Macros for "capable" field */
#define TAPE390_CRYPT_SUPPORTED_MASK 0x01
#define TAPE390_CRYPT_SUPPORTED(x) \
((x.capability & TAPE390_CRYPT_SUPPORTED_MASK))
/* Macros for "status" field */
#define TAPE390_CRYPT_ON_MASK 0x01
#define TAPE390_CRYPT_ON(x) (((x.status) & TAPE390_CRYPT_ON_MASK))
/* Macros for "medium status" field */
#define TAPE390_MEDIUM_LOADED_MASK 0x01
#define TAPE390_MEDIUM_ENCRYPTED_MASK 0x02
#define TAPE390_MEDIUM_ENCRYPTED(x) \
(((x.medium_status) & TAPE390_MEDIUM_ENCRYPTED_MASK))
#define TAPE390_MEDIUM_LOADED(x) \
(((x.medium_status) & TAPE390_MEDIUM_LOADED_MASK))
/*
* The TAPE390_CRYPT_SET ioctl is used to switch on/off encryption.
* The "encryption_capable" and "tape_status" fields are ignored for this ioctl!
*/
#define TAPE390_CRYPT_SET _IOW('d', 2, struct tape390_crypt_info)
/*
* The TAPE390_CRYPT_QUERY ioctl is used to query the encryption state.
*/
#define TAPE390_CRYPT_QUERY _IOR('d', 3, struct tape390_crypt_info)
/* Values for "kekl1/2_type" and "kekl1/2_type_on_tape" fields */
#define TAPE390_KEKL_TYPE_NONE 0
#define TAPE390_KEKL_TYPE_LABEL 1
#define TAPE390_KEKL_TYPE_HASH 2
struct tape390_kekl {
unsigned char type;
unsigned char type_on_tape;
char label[65];
} __attribute__ ((packed));
struct tape390_kekl_pair {
struct tape390_kekl kekl[2];
} __attribute__ ((packed));
/*
* The TAPE390_KEKL_SET ioctl is used to set Key Encrypting Key labels.
*/
#define TAPE390_KEKL_SET _IOW('d', 4, struct tape390_kekl_pair)
/*
* The TAPE390_KEKL_QUERY ioctl is used to query Key Encrypting Key labels.
*/
#define TAPE390_KEKL_QUERY _IOR('d', 5, struct tape390_kekl_pair)
#endif

View File

@@ -45,6 +45,9 @@ extern void add_virt_timer_periodic(void *new);
extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires);
extern int del_virt_timer(struct vtimer_list *timer);
extern void init_cpu_vtimer(void);
extern void vtime_init(void);
#endif /* __KERNEL__ */
#endif /* _ASM_S390_TIMER_H */

Some files were not shown because too many files have changed in this diff Show More