mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 13:19:56 -04:00
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply fixes on top of newer things in tree (efi-stub). Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
@@ -83,7 +83,9 @@
|
||||
* Should the subsystem abort the loading of an ACPI table if the
|
||||
* table checksum is incorrect?
|
||||
*/
|
||||
#ifndef ACPI_CHECKSUM_ABORT
|
||||
#define ACPI_CHECKSUM_ABORT FALSE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generate a version of ACPICA that only supports "reduced hardware"
|
||||
@@ -100,7 +102,9 @@
|
||||
* ACPI PM timer
|
||||
* FACS table (Waking vectors and Global Lock)
|
||||
*/
|
||||
#ifndef ACPI_REDUCED_HARDWARE
|
||||
#define ACPI_REDUCED_HARDWARE FALSE
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
|
||||
@@ -125,8 +125,9 @@ struct acpi_exception_info {
|
||||
#define AE_NO_HANDLER EXCEP_ENV (0x001A)
|
||||
#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B)
|
||||
#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)
|
||||
#define AE_ACCESS EXCEP_ENV (0x001D)
|
||||
|
||||
#define AE_CODE_ENV_MAX 0x001C
|
||||
#define AE_CODE_ENV_MAX 0x001D
|
||||
|
||||
/*
|
||||
* Programmer exceptions
|
||||
@@ -227,7 +228,7 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
|
||||
EXCEP_TXT("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
|
||||
EXCEP_TXT("AE_NO_NAMESPACE", "A namespace has not been loaded"),
|
||||
EXCEP_TXT("AE_NO_MEMORY", "Insufficient dynamic memory"),
|
||||
EXCEP_TXT("AE_NOT_FOUND", "The name was not found in the namespace"),
|
||||
EXCEP_TXT("AE_NOT_FOUND", "A requested entity is not found"),
|
||||
EXCEP_TXT("AE_NOT_EXIST", "A required entity does not exist"),
|
||||
EXCEP_TXT("AE_ALREADY_EXISTS", "An entity already exists"),
|
||||
EXCEP_TXT("AE_TYPE", "The object type is incorrect"),
|
||||
@@ -259,7 +260,8 @@ static const struct acpi_exception_info acpi_gbl_exception_names_env[] = {
|
||||
EXCEP_TXT("AE_OWNER_ID_LIMIT",
|
||||
"There are no more Owner IDs available for ACPI tables or control methods"),
|
||||
EXCEP_TXT("AE_NOT_CONFIGURED",
|
||||
"The interface is not part of the current subsystem configuration")
|
||||
"The interface is not part of the current subsystem configuration"),
|
||||
EXCEP_TXT("AE_ACCESS", "Permission denied for the requested operation")
|
||||
};
|
||||
|
||||
static const struct acpi_exception_info acpi_gbl_exception_names_pgm[] = {
|
||||
|
||||
@@ -46,25 +46,25 @@
|
||||
|
||||
/* Method names - these methods can appear anywhere in the namespace */
|
||||
|
||||
#define METHOD_NAME__SB_ "_SB_"
|
||||
#define METHOD_NAME__HID "_HID"
|
||||
#define METHOD_NAME__CID "_CID"
|
||||
#define METHOD_NAME__UID "_UID"
|
||||
#define METHOD_NAME__SUB "_SUB"
|
||||
#define METHOD_NAME__ADR "_ADR"
|
||||
#define METHOD_NAME__INI "_INI"
|
||||
#define METHOD_NAME__STA "_STA"
|
||||
#define METHOD_NAME__REG "_REG"
|
||||
#define METHOD_NAME__SEG "_SEG"
|
||||
#define METHOD_NAME__BBN "_BBN"
|
||||
#define METHOD_NAME__PRT "_PRT"
|
||||
#define METHOD_NAME__CRS "_CRS"
|
||||
#define METHOD_NAME__PRS "_PRS"
|
||||
#define METHOD_NAME__AEI "_AEI"
|
||||
#define METHOD_NAME__PRW "_PRW"
|
||||
#define METHOD_NAME__SRS "_SRS"
|
||||
#define METHOD_NAME__BBN "_BBN"
|
||||
#define METHOD_NAME__CBA "_CBA"
|
||||
#define METHOD_NAME__CID "_CID"
|
||||
#define METHOD_NAME__CRS "_CRS"
|
||||
#define METHOD_NAME__HID "_HID"
|
||||
#define METHOD_NAME__INI "_INI"
|
||||
#define METHOD_NAME__PLD "_PLD"
|
||||
#define METHOD_NAME__PRS "_PRS"
|
||||
#define METHOD_NAME__PRT "_PRT"
|
||||
#define METHOD_NAME__PRW "_PRW"
|
||||
#define METHOD_NAME__REG "_REG"
|
||||
#define METHOD_NAME__SB_ "_SB_"
|
||||
#define METHOD_NAME__SEG "_SEG"
|
||||
#define METHOD_NAME__SRS "_SRS"
|
||||
#define METHOD_NAME__STA "_STA"
|
||||
#define METHOD_NAME__SUB "_SUB"
|
||||
#define METHOD_NAME__UID "_UID"
|
||||
|
||||
/* Method names - these methods must appear at the namespace root */
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ enum acpi_hotplug_mode {
|
||||
struct acpi_hotplug_profile {
|
||||
struct kobject kobj;
|
||||
bool enabled:1;
|
||||
bool ignore:1;
|
||||
enum acpi_hotplug_mode mode;
|
||||
};
|
||||
|
||||
@@ -222,7 +223,8 @@ struct acpi_device_power_flags {
|
||||
u32 power_resources:1; /* Power resources */
|
||||
u32 inrush_current:1; /* Serialize Dx->D0 */
|
||||
u32 power_removed:1; /* Optimize Dx->D0 */
|
||||
u32 reserved:28;
|
||||
u32 ignore_parent:1; /* Power is independent of parent power state */
|
||||
u32 reserved:27;
|
||||
};
|
||||
|
||||
struct acpi_device_power_state {
|
||||
@@ -311,7 +313,6 @@ struct acpi_device {
|
||||
unsigned int physical_node_count;
|
||||
struct list_head physical_node_list;
|
||||
struct mutex physical_node_lock;
|
||||
struct list_head power_dependent;
|
||||
void (*remove)(struct acpi_device *);
|
||||
};
|
||||
|
||||
@@ -339,20 +340,6 @@ struct acpi_bus_event {
|
||||
u32 data;
|
||||
};
|
||||
|
||||
struct acpi_eject_event {
|
||||
struct acpi_device *device;
|
||||
u32 event;
|
||||
};
|
||||
|
||||
struct acpi_hp_work {
|
||||
struct work_struct work;
|
||||
acpi_handle handle;
|
||||
u32 type;
|
||||
void *context;
|
||||
};
|
||||
void alloc_acpi_hp_work(acpi_handle handle, u32 type, void *context,
|
||||
void (*func)(struct work_struct *work));
|
||||
|
||||
extern struct kobject *acpi_kobj;
|
||||
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
|
||||
void acpi_bus_private_data_handler(acpi_handle, void *);
|
||||
@@ -391,7 +378,6 @@ int acpi_scan_add_handler(struct acpi_scan_handler *handler);
|
||||
int acpi_bus_register_driver(struct acpi_driver *driver);
|
||||
void acpi_bus_unregister_driver(struct acpi_driver *driver);
|
||||
int acpi_bus_scan(acpi_handle handle);
|
||||
void acpi_bus_hot_remove_device(void *context);
|
||||
void acpi_bus_trim(struct acpi_device *start);
|
||||
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
|
||||
int acpi_match_device_ids(struct acpi_device *device,
|
||||
@@ -399,6 +385,9 @@ int acpi_match_device_ids(struct acpi_device *device,
|
||||
int acpi_create_dir(struct acpi_device *);
|
||||
void acpi_remove_dir(struct acpi_device *);
|
||||
|
||||
typedef void (*acpi_hp_callback)(void *data, u32 src);
|
||||
|
||||
acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src);
|
||||
|
||||
/**
|
||||
* module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
|
||||
@@ -443,9 +432,9 @@ static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr)
|
||||
{
|
||||
return acpi_find_child(handle, addr, false);
|
||||
}
|
||||
void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr);
|
||||
int acpi_is_root_bridge(acpi_handle);
|
||||
struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
|
||||
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev))
|
||||
|
||||
int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
|
||||
int acpi_disable_wakeup_device_power(struct acpi_device *dev);
|
||||
@@ -456,8 +445,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
|
||||
acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler);
|
||||
int acpi_pm_device_sleep_state(struct device *, int *, int);
|
||||
void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
|
||||
void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
|
||||
#else
|
||||
static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
|
||||
acpi_notify_handler handler,
|
||||
@@ -478,10 +465,6 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
|
||||
return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
|
||||
m : ACPI_STATE_D0;
|
||||
}
|
||||
static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
|
||||
struct device *depdev) {}
|
||||
static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
|
||||
struct device *depdev) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PM_RUNTIME
|
||||
|
||||
@@ -77,54 +77,80 @@ struct acpi_signal_fatal_info {
|
||||
/*
|
||||
* OSL Initialization and shutdown primitives
|
||||
*/
|
||||
acpi_status __init acpi_os_initialize(void);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
|
||||
acpi_status acpi_os_initialize(void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
|
||||
acpi_status acpi_os_terminate(void);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ACPI Table interfaces
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_root_pointer
|
||||
acpi_physical_address acpi_os_get_root_pointer(void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override
|
||||
acpi_status
|
||||
acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
|
||||
acpi_string * new_val);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override
|
||||
acpi_status
|
||||
acpi_os_table_override(struct acpi_table_header *existing_table,
|
||||
struct acpi_table_header **new_table);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override
|
||||
acpi_status
|
||||
acpi_os_physical_table_override(struct acpi_table_header *existing_table,
|
||||
acpi_physical_address * new_address,
|
||||
u32 *new_table_length);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Spinlock primitives
|
||||
*/
|
||||
#ifndef acpi_os_create_lock
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
|
||||
acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_lock
|
||||
void acpi_os_delete_lock(acpi_spinlock handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_lock
|
||||
acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_lock
|
||||
void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Semaphore primitives
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore
|
||||
acpi_status
|
||||
acpi_os_create_semaphore(u32 max_units,
|
||||
u32 initial_units, acpi_semaphore * out_handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_semaphore
|
||||
acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_semaphore
|
||||
acpi_status
|
||||
acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal_semaphore
|
||||
acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Mutex primitives. May be configured to use semaphores instead via
|
||||
@@ -132,29 +158,48 @@ acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
|
||||
*/
|
||||
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_mutex
|
||||
acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_mutex
|
||||
void acpi_os_delete_mutex(acpi_mutex handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_mutex
|
||||
acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_mutex
|
||||
void acpi_os_release_mutex(acpi_mutex handle);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Memory allocation and mapping
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
|
||||
void *acpi_os_allocate(acpi_size size);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
|
||||
void *acpi_os_allocate_zeroed(acpi_size size);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
|
||||
void acpi_os_free(void *memory);
|
||||
#endif
|
||||
|
||||
void __iomem *acpi_os_map_memory(acpi_physical_address where,
|
||||
acpi_size length);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
|
||||
void *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
|
||||
#endif
|
||||
|
||||
void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
|
||||
void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
|
||||
void acpi_os_unmap_memory(void *logical_address, acpi_size size);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address
|
||||
acpi_status
|
||||
acpi_os_get_physical_address(void *logical_address,
|
||||
acpi_physical_address * physical_address);
|
||||
@@ -163,117 +208,195 @@ acpi_os_get_physical_address(void *logical_address,
|
||||
/*
|
||||
* Memory/Object Cache
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_cache
|
||||
acpi_status
|
||||
acpi_os_create_cache(char *cache_name,
|
||||
u16 object_size,
|
||||
u16 max_depth, acpi_cache_t ** return_cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_cache
|
||||
acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_purge_cache
|
||||
acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
|
||||
void *acpi_os_acquire_object(acpi_cache_t * cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_object
|
||||
acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interrupt handlers
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_install_interrupt_handler
|
||||
acpi_status
|
||||
acpi_os_install_interrupt_handler(u32 interrupt_number,
|
||||
acpi_osd_handler service_routine,
|
||||
void *context);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_remove_interrupt_handler
|
||||
acpi_status
|
||||
acpi_os_remove_interrupt_handler(u32 interrupt_number,
|
||||
acpi_osd_handler service_routine);
|
||||
|
||||
void acpi_os_gpe_count(u32 gpe_number);
|
||||
void acpi_os_fixed_event_count(u32 fixed_event_number);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Threads and Scheduling
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
|
||||
acpi_thread_id acpi_os_get_thread_id(void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_execute
|
||||
acpi_status
|
||||
acpi_os_execute(acpi_execute_type type,
|
||||
acpi_osd_exec_callback function, void *context);
|
||||
#endif
|
||||
|
||||
acpi_status
|
||||
acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context);
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_events_complete
|
||||
void acpi_os_wait_events_complete(void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_sleep
|
||||
void acpi_os_sleep(u64 milliseconds);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_stall
|
||||
void acpi_os_stall(u32 microseconds);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Platform and hardware-independent I/O interfaces
|
||||
*/
|
||||
acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_port
|
||||
acpi_status acpi_os_read_port(acpi_io_address address, u32 *value, u32 width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_port
|
||||
acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Platform and hardware-independent physical memory interfaces
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_memory
|
||||
acpi_status
|
||||
acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_memory
|
||||
acpi_status
|
||||
acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Platform and hardware-independent PCI configuration space access
|
||||
* Note: Can't use "Register" as a parameter, changed to "Reg" --
|
||||
* certain compilers complain.
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_pci_configuration
|
||||
acpi_status
|
||||
acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
|
||||
u32 reg, u64 *value, u32 width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_pci_configuration
|
||||
acpi_status
|
||||
acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
|
||||
u32 reg, u64 value, u32 width);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Miscellaneous
|
||||
*/
|
||||
u64 acpi_os_get_timer(void);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
|
||||
u8 acpi_os_readable(void *pointer, acpi_size length);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
|
||||
u8 acpi_os_writable(void *pointer, acpi_size length);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_timer
|
||||
u64 acpi_os_get_timer(void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal
|
||||
acpi_status acpi_os_signal(u32 function, void *info);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Debug print routines
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
|
||||
void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf
|
||||
void acpi_os_vprintf(const char *format, va_list args);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
|
||||
void acpi_os_redirect_output(void *destination);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
/*
|
||||
* Debug input
|
||||
*/
|
||||
u32 acpi_os_get_line(char *buffer);
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
|
||||
acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Obtain ACPI table(s)
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
|
||||
acpi_status
|
||||
acpi_os_get_table_by_name(char *signature,
|
||||
u32 instance,
|
||||
struct acpi_table_header **table,
|
||||
acpi_physical_address * address);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
|
||||
acpi_status
|
||||
acpi_os_get_table_by_index(u32 index,
|
||||
struct acpi_table_header **table,
|
||||
u32 *instance, acpi_physical_address * address);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
|
||||
acpi_status
|
||||
acpi_os_get_table_by_address(acpi_physical_address address,
|
||||
struct acpi_table_header **table);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Directory manipulation
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
|
||||
void *acpi_os_open_directory(char *pathname,
|
||||
char *wildcard_spec, char requested_file_type);
|
||||
#endif
|
||||
|
||||
/* requeste_file_type values */
|
||||
|
||||
#define REQUEST_FILE_ONLY 0
|
||||
#define REQUEST_DIR_ONLY 1
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
|
||||
char *acpi_os_get_next_filename(void *dir_handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
|
||||
void acpi_os_close_directory(void *dir_handle);
|
||||
#endif
|
||||
|
||||
#endif /* __ACPIOSXF_H__ */
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20130725
|
||||
#define ACPI_CA_VERSION 0x20131115
|
||||
|
||||
#include <acpi/acconfig.h>
|
||||
#include <acpi/actypes.h>
|
||||
@@ -54,6 +54,7 @@
|
||||
#include <acpi/acbuffer.h>
|
||||
|
||||
extern u8 acpi_gbl_permanent_mmap;
|
||||
extern u32 acpi_rsdt_forced;
|
||||
|
||||
/*
|
||||
* Globals that are publically available
|
||||
@@ -106,39 +107,41 @@ extern u8 acpi_gbl_disable_ssdt_table_load;
|
||||
static ACPI_INLINE prototype {return(AE_OK);}
|
||||
|
||||
#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
|
||||
static ACPI_INLINE prototype {}
|
||||
static ACPI_INLINE prototype {return;}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
extern u32 acpi_rsdt_forced;
|
||||
/*
|
||||
* Initialization
|
||||
*/
|
||||
acpi_status
|
||||
acpi_status __init
|
||||
acpi_initialize_tables(struct acpi_table_desc *initial_storage,
|
||||
u32 initial_table_count, u8 allow_resize);
|
||||
|
||||
acpi_status __init acpi_initialize_subsystem(void);
|
||||
|
||||
acpi_status acpi_enable_subsystem(u32 flags);
|
||||
acpi_status __init acpi_enable_subsystem(u32 flags);
|
||||
|
||||
acpi_status acpi_initialize_objects(u32 flags);
|
||||
acpi_status __init acpi_initialize_objects(u32 flags);
|
||||
|
||||
acpi_status acpi_terminate(void);
|
||||
acpi_status __init acpi_terminate(void);
|
||||
|
||||
/*
|
||||
* Miscellaneous global interfaces
|
||||
*/
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
acpi_status acpi_subsystem_status(void);
|
||||
acpi_status acpi_subsystem_status(void);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_FUTURE_USAGE
|
||||
acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
|
||||
#endif
|
||||
|
||||
acpi_status acpi_get_statistics(struct acpi_statistics *stats);
|
||||
|
||||
const char *acpi_format_exception(acpi_status exception);
|
||||
|
||||
acpi_status acpi_purge_cached_objects(void);
|
||||
@@ -158,15 +161,6 @@ acpi_status
|
||||
acpi_decode_pld_buffer(u8 *in_buffer,
|
||||
acpi_size length, struct acpi_pld_info **return_buffer);
|
||||
|
||||
/*
|
||||
* ACPI Memory management
|
||||
*/
|
||||
void *acpi_allocate(u32 size);
|
||||
|
||||
void *acpi_callocate(u32 size);
|
||||
|
||||
void acpi_free(void *address);
|
||||
|
||||
/*
|
||||
* ACPI table load/unload interfaces
|
||||
*/
|
||||
@@ -174,14 +168,14 @@ acpi_status acpi_load_table(struct acpi_table_header *table);
|
||||
|
||||
acpi_status acpi_unload_parent_table(acpi_handle object);
|
||||
|
||||
acpi_status acpi_load_tables(void);
|
||||
acpi_status __init acpi_load_tables(void);
|
||||
|
||||
/*
|
||||
* ACPI table manipulation interfaces
|
||||
*/
|
||||
acpi_status acpi_reallocate_root_table(void);
|
||||
acpi_status __init acpi_reallocate_root_table(void);
|
||||
|
||||
acpi_status acpi_find_root_pointer(acpi_size *rsdp_address);
|
||||
acpi_status __init acpi_find_root_pointer(acpi_size *rsdp_address);
|
||||
|
||||
acpi_status acpi_unload_table_id(acpi_owner_id id);
|
||||
|
||||
@@ -193,6 +187,7 @@ acpi_status
|
||||
acpi_get_table_with_size(acpi_string signature,
|
||||
u32 instance, struct acpi_table_header **out_table,
|
||||
acpi_size *tbl_size);
|
||||
|
||||
acpi_status
|
||||
acpi_get_table(acpi_string signature,
|
||||
u32 instance, struct acpi_table_header **out_table);
|
||||
@@ -280,8 +275,18 @@ acpi_status
|
||||
acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_install_global_event_handler
|
||||
(acpi_gbl_event_handler handler, void *context))
|
||||
acpi_install_sci_handler(acpi_sci_handler
|
||||
address,
|
||||
void *context))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_remove_sci_handler(acpi_sci_handler
|
||||
address))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_install_global_event_handler
|
||||
(acpi_gbl_event_handler handler,
|
||||
void *context))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_install_fixed_event_handler(u32
|
||||
@@ -290,10 +295,12 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
handler,
|
||||
void
|
||||
*context))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_remove_fixed_event_handler(u32 acpi_event,
|
||||
acpi_event_handler
|
||||
handler))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_install_gpe_handler(acpi_handle
|
||||
gpe_device,
|
||||
@@ -302,6 +309,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_gpe_handler
|
||||
address,
|
||||
void *context))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_remove_gpe_handler(acpi_handle gpe_device,
|
||||
u32 gpe_number,
|
||||
@@ -338,6 +346,7 @@ acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_acquire_global_lock(u16 timeout,
|
||||
u32 *handle))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_release_global_lock(u32 handle))
|
||||
|
||||
@@ -364,6 +373,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_get_event_status(u32 event,
|
||||
acpi_event_status
|
||||
*event_status))
|
||||
|
||||
/*
|
||||
* General Purpose Event (GPE) Interfaces
|
||||
*/
|
||||
@@ -394,10 +404,12 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
parent_device,
|
||||
acpi_handle gpe_device,
|
||||
u32 gpe_number))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_set_gpe_wake_mask(acpi_handle gpe_device,
|
||||
u32 gpe_number,
|
||||
u8 action))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_get_gpe_status(acpi_handle gpe_device,
|
||||
u32 gpe_number,
|
||||
@@ -419,6 +431,7 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
*gpe_block_address,
|
||||
u32 register_count,
|
||||
u32 interrupt_number))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_remove_gpe_block(acpi_handle gpe_device))
|
||||
|
||||
@@ -493,13 +506,13 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
* Sleep/Wake interfaces
|
||||
*/
|
||||
acpi_status
|
||||
acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
|
||||
acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);
|
||||
|
||||
acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
|
||||
|
||||
acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
|
||||
acpi_status acpi_enter_sleep_state(u8 sleep_state);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void))
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
|
||||
|
||||
acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
|
||||
|
||||
@@ -508,7 +521,6 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state);
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_set_firmware_waking_vector(u32
|
||||
physical_address))
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
acpi_set_firmware_waking_vector64(u64
|
||||
@@ -532,50 +544,53 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
|
||||
/*
|
||||
* Error/Warning output
|
||||
*/
|
||||
ACPI_PRINTF_LIKE(3)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_error(const char *module_name,
|
||||
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
|
||||
acpi_error(const char *module_name, u32 line_number, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(4)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_exception(const char *module_name,
|
||||
u32 line_number,
|
||||
acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
|
||||
u32 line_number, acpi_status status, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(3)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_warning(const char *module_name,
|
||||
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
|
||||
acpi_warning(const char *module_name, u32 line_number, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(3)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_info(const char *module_name,
|
||||
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
|
||||
acpi_info(const char *module_name, u32 line_number, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(3)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_bios_error(const char *module_name,
|
||||
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
|
||||
u32 line_number, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(3)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_bios_warning(const char *module_name,
|
||||
u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
|
||||
u32 line_number, const char *format, ...);
|
||||
|
||||
/*
|
||||
* Debug output
|
||||
*/
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
||||
ACPI_PRINTF_LIKE(6)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_debug_print(u32 requested_debug_level,
|
||||
u32 line_number,
|
||||
const char *function_name,
|
||||
const char *module_name,
|
||||
u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6);
|
||||
u32 component_id, const char *format, ...);
|
||||
|
||||
ACPI_PRINTF_LIKE(6)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
acpi_debug_print_raw(u32 requested_debug_level,
|
||||
u32 line_number,
|
||||
const char *function_name,
|
||||
const char *module_name,
|
||||
u32 component_id,
|
||||
const char *format, ...) ACPI_PRINTF_LIKE(6);
|
||||
u32 component_id, const char *format, ...);
|
||||
#endif
|
||||
|
||||
#endif /* __ACXFACE_H__ */
|
||||
|
||||
@@ -146,7 +146,24 @@ struct acpi_table_rsdp {
|
||||
u8 reserved[3]; /* Reserved, must be zero */
|
||||
};
|
||||
|
||||
#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */
|
||||
/* Standalone struct for the ACPI 1.0 RSDP */
|
||||
|
||||
struct acpi_rsdp_common {
|
||||
char signature[8];
|
||||
u8 checksum;
|
||||
char oem_id[ACPI_OEM_ID_SIZE];
|
||||
u8 revision;
|
||||
u32 rsdt_physical_address;
|
||||
};
|
||||
|
||||
/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
|
||||
|
||||
struct acpi_rsdp_extension {
|
||||
u32 length;
|
||||
u64 xsdt_physical_address;
|
||||
u8 extended_checksum;
|
||||
u8 reserved[3];
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
||||
@@ -596,7 +596,7 @@ struct acpi_hest_generic {
|
||||
|
||||
/* Generic Error Status block */
|
||||
|
||||
struct acpi_hest_generic_status {
|
||||
struct acpi_generic_status {
|
||||
u32 block_status;
|
||||
u32 raw_data_offset;
|
||||
u32 raw_data_length;
|
||||
@@ -606,15 +606,15 @@ struct acpi_hest_generic_status {
|
||||
|
||||
/* Values for block_status flags above */
|
||||
|
||||
#define ACPI_HEST_UNCORRECTABLE (1)
|
||||
#define ACPI_HEST_CORRECTABLE (1<<1)
|
||||
#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
|
||||
#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
|
||||
#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
|
||||
#define ACPI_GEN_ERR_UC BIT(0)
|
||||
#define ACPI_GEN_ERR_CE BIT(1)
|
||||
#define ACPI_GEN_ERR_MULTI_UC BIT(2)
|
||||
#define ACPI_GEN_ERR_MULTI_CE BIT(3)
|
||||
#define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */
|
||||
|
||||
/* Generic Error Data entry */
|
||||
|
||||
struct acpi_hest_generic_data {
|
||||
struct acpi_generic_data {
|
||||
u8 section_type[16];
|
||||
u32 error_severity;
|
||||
u16 revision;
|
||||
|
||||
@@ -444,8 +444,8 @@ enum acpi_dmar_scope_type {
|
||||
};
|
||||
|
||||
struct acpi_dmar_pci_path {
|
||||
u8 dev;
|
||||
u8 fn;
|
||||
u8 device;
|
||||
u8 function;
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -299,13 +299,57 @@ typedef u32 acpi_physical_address;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All ACPICA functions that are available to the rest of the kernel are
|
||||
* tagged with this macro which can be defined as appropriate for the host.
|
||||
* All ACPICA external functions that are available to the rest of the kernel
|
||||
* are tagged with thes macros which can be defined as appropriate for the host.
|
||||
*
|
||||
* Notes:
|
||||
* ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
|
||||
* interfaces that may need special processing.
|
||||
* ACPI_EXPORT_SYMBOL is used for all other public external functions.
|
||||
*/
|
||||
#ifndef ACPI_EXPORT_SYMBOL_INIT
|
||||
#define ACPI_EXPORT_SYMBOL_INIT(symbol)
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_EXPORT_SYMBOL
|
||||
#define ACPI_EXPORT_SYMBOL(symbol)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compiler/Clibrary-dependent debug initialization. Used for ACPICA
|
||||
* utilities only.
|
||||
*/
|
||||
#ifndef ACPI_DEBUG_INITIALIZE
|
||||
#define ACPI_DEBUG_INITIALIZE()
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Configuration
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
/*
|
||||
* Memory allocation tracking (used by acpi_exec to detect memory leaks)
|
||||
*/
|
||||
#define ACPI_MEM_PARAMETERS _COMPONENT, _acpi_module_name, __LINE__
|
||||
#define ACPI_ALLOCATE(a) acpi_ut_allocate_and_track ((acpi_size) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_ALLOCATE_ZEROED(a) acpi_ut_allocate_zeroed_and_track ((acpi_size) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_FREE(a) acpi_ut_free_and_track (a, ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_MEM_TRACKING(a) a
|
||||
|
||||
#else
|
||||
/*
|
||||
* Normal memory allocation directly via the OS services layer
|
||||
*/
|
||||
#define ACPI_ALLOCATE(a) acpi_os_allocate ((acpi_size) (a))
|
||||
#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed ((acpi_size) (a))
|
||||
#define ACPI_FREE(a) acpi_os_free (a)
|
||||
#define ACPI_MEM_TRACKING(a)
|
||||
|
||||
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* ACPI Specification constants (Do not change unless the specification changes)
|
||||
@@ -322,6 +366,7 @@ typedef u32 acpi_physical_address;
|
||||
#define ACPI_PM1_REGISTER_WIDTH 16
|
||||
#define ACPI_PM2_REGISTER_WIDTH 8
|
||||
#define ACPI_PM_TIMER_WIDTH 32
|
||||
#define ACPI_RESET_REGISTER_WIDTH 8
|
||||
|
||||
/* Names within the namespace are 4 bytes long */
|
||||
|
||||
@@ -474,6 +519,11 @@ typedef u64 acpi_integer;
|
||||
#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
|
||||
#endif
|
||||
|
||||
/* Support for the special RSDP signature (8 characters) */
|
||||
|
||||
#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
|
||||
#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Miscellaneous constants
|
||||
@@ -886,9 +936,13 @@ struct acpi_buffer {
|
||||
void *pointer; /* pointer to buffer */
|
||||
};
|
||||
|
||||
/* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */
|
||||
|
||||
#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer)
|
||||
/*
|
||||
* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER.
|
||||
* Note: We use acpi_os_free here because acpi_os_allocate was used to allocate
|
||||
* the buffer. This purposefully bypasses the internal allocation tracking
|
||||
* mechanism (if it is enabled).
|
||||
*/
|
||||
#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer)
|
||||
|
||||
/*
|
||||
* name_type for acpi_get_name
|
||||
@@ -927,6 +981,16 @@ struct acpi_system_info {
|
||||
u32 debug_layer;
|
||||
};
|
||||
|
||||
/*
|
||||
* System statistics returned by acpi_get_statistics()
|
||||
*/
|
||||
struct acpi_statistics {
|
||||
u32 sci_count;
|
||||
u32 gpe_count;
|
||||
u32 fixed_event_count[ACPI_NUM_FIXED_EVENTS];
|
||||
u32 method_count;
|
||||
};
|
||||
|
||||
/* Table Event Types */
|
||||
|
||||
#define ACPI_TABLE_EVENT_LOAD 0x0
|
||||
@@ -945,6 +1009,9 @@ typedef void
|
||||
/*
|
||||
* Various handlers and callback procedures
|
||||
*/
|
||||
typedef
|
||||
u32 (*acpi_sci_handler) (void *context);
|
||||
|
||||
typedef
|
||||
void (*acpi_gbl_event_handler) (u32 event_type,
|
||||
acpi_handle device,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
struct ghes {
|
||||
struct acpi_hest_generic *generic;
|
||||
struct acpi_hest_generic_status *estatus;
|
||||
struct acpi_generic_status *estatus;
|
||||
u64 buffer_paddr;
|
||||
unsigned long flags;
|
||||
union {
|
||||
|
||||
@@ -96,10 +96,11 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* acpi_bin/acpi_help/acpi_src configuration. All single threaded, with
|
||||
* no debug output.
|
||||
* acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single
|
||||
* threaded, with no debug output.
|
||||
*/
|
||||
#if (defined ACPI_BIN_APP) || \
|
||||
(defined ACPI_DUMP_APP) || \
|
||||
(defined ACPI_SRC_APP) || \
|
||||
(defined ACPI_XTRACT_APP)
|
||||
#define ACPI_APPLICATION
|
||||
@@ -147,6 +148,9 @@
|
||||
#if defined(_LINUX) || defined(__linux__)
|
||||
#include <acpi/platform/aclinux.h>
|
||||
|
||||
#elif defined(_APPLE) || defined(__APPLE__)
|
||||
#include "acmacosx.h"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include "acfreebsd.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#define ACPI_USE_DO_WHILE_0
|
||||
#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
|
||||
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/string.h>
|
||||
@@ -58,11 +57,13 @@
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <linux/math64.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock_types.h>
|
||||
#include <asm/current.h>
|
||||
#ifdef EXPORT_ACPI_INTERFACES
|
||||
#include <linux/export.h>
|
||||
#endif
|
||||
#include <asm/acpi.h>
|
||||
|
||||
/* Host-dependent types and defines for in-kernel ACPICA */
|
||||
|
||||
@@ -74,7 +75,7 @@
|
||||
#define acpi_spinlock spinlock_t *
|
||||
#define acpi_cpu_flags unsigned long
|
||||
|
||||
#else /* !__KERNEL__ */
|
||||
#else /* !__KERNEL__ */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
@@ -87,7 +88,7 @@
|
||||
#define ACPI_FLUSH_CPU_CACHE()
|
||||
#define ACPI_CAST_PTHREAD_T(pthread) ((acpi_thread_id) (pthread))
|
||||
|
||||
#if defined(__ia64__) || defined(__x86_64__)
|
||||
#if defined(__ia64__) || defined(__x86_64__) || defined(__aarch64__)
|
||||
#define ACPI_MACHINE_WIDTH 64
|
||||
#define COMPILER_DEPENDENT_INT64 long
|
||||
#define COMPILER_DEPENDENT_UINT64 unsigned long
|
||||
@@ -102,21 +103,35 @@
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/* Linux uses GCC */
|
||||
|
||||
#include <acpi/platform/acgcc.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* FIXME: Inclusion of actypes.h
|
||||
* Linux kernel need this before defining inline OSL interfaces as
|
||||
* actypes.h need to be included to find ACPICA type definitions.
|
||||
* Since from ACPICA's perspective, the actypes.h should be included after
|
||||
* acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue.
|
||||
*/
|
||||
#include <acpi/actypes.h>
|
||||
|
||||
/*
|
||||
* Overrides for in-kernel ACPICA
|
||||
*/
|
||||
static inline acpi_thread_id acpi_os_get_thread_id(void)
|
||||
{
|
||||
return (acpi_thread_id)(unsigned long)current;
|
||||
}
|
||||
acpi_status __init acpi_os_initialize(void);
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize
|
||||
|
||||
acpi_status acpi_os_terminate(void);
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate
|
||||
|
||||
/*
|
||||
* Memory allocation/deallocation
|
||||
*/
|
||||
|
||||
/*
|
||||
* The irqs_disabled() check is for resume from RAM.
|
||||
@@ -126,25 +141,45 @@ static inline acpi_thread_id acpi_os_get_thread_id(void)
|
||||
*/
|
||||
static inline void *acpi_os_allocate(acpi_size size)
|
||||
{
|
||||
return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
return kmalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
|
||||
}
|
||||
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate
|
||||
|
||||
/* Use native linux version of acpi_os_allocate_zeroed */
|
||||
|
||||
static inline void *acpi_os_allocate_zeroed(acpi_size size)
|
||||
{
|
||||
return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
return kzalloc(size, irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
|
||||
}
|
||||
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed
|
||||
#define USE_NATIVE_ALLOCATE_ZEROED
|
||||
|
||||
static inline void acpi_os_free(void *memory)
|
||||
{
|
||||
kfree(memory);
|
||||
}
|
||||
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free
|
||||
|
||||
static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
|
||||
{
|
||||
return kmem_cache_zalloc(cache,
|
||||
irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
irqs_disabled()? GFP_ATOMIC : GFP_KERNEL);
|
||||
}
|
||||
|
||||
#define ACPI_ALLOCATE(a) acpi_os_allocate(a)
|
||||
#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a)
|
||||
#define ACPI_FREE(a) kfree(a)
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object
|
||||
|
||||
static inline acpi_thread_id acpi_os_get_thread_id(void)
|
||||
{
|
||||
return (acpi_thread_id) (unsigned long)current;
|
||||
}
|
||||
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id
|
||||
|
||||
#ifndef CONFIG_PREEMPT
|
||||
|
||||
/*
|
||||
* Used within ACPICA to show where it is safe to preempt execution
|
||||
* when CONFIG_PREEMPT=n
|
||||
@@ -154,6 +189,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
|
||||
if (!irqs_disabled()) \
|
||||
cond_resched(); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -163,17 +199,50 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
|
||||
* all locks to the name of the argument of acpi_os_create_lock(), which
|
||||
* prevents lockdep from reporting false positives for ACPICA locks.
|
||||
*/
|
||||
#define acpi_os_create_lock(__handle) \
|
||||
({ \
|
||||
spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
|
||||
\
|
||||
if (lock) { \
|
||||
*(__handle) = lock; \
|
||||
spin_lock_init(*(__handle)); \
|
||||
} \
|
||||
lock ? AE_OK : AE_NO_MEMORY; \
|
||||
})
|
||||
#define acpi_os_create_lock(__handle) \
|
||||
({ \
|
||||
spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
|
||||
if (lock) { \
|
||||
*(__handle) = lock; \
|
||||
spin_lock_init(*(__handle)); \
|
||||
} \
|
||||
lock ? AE_OK : AE_NO_MEMORY; \
|
||||
})
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_size length);
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory
|
||||
|
||||
#endif /* __ACLINUX_H__ */
|
||||
void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory
|
||||
|
||||
/*
|
||||
* OSL interfaces used by debugger/disassembler
|
||||
*/
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable
|
||||
|
||||
/*
|
||||
* OSL interfaces used by utilities
|
||||
*/
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory
|
||||
|
||||
/*
|
||||
* OSL interfaces added by Linux
|
||||
*/
|
||||
void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size);
|
||||
|
||||
void acpi_os_gpe_count(u32 gpe_number);
|
||||
|
||||
void acpi_os_fixed_event_count(u32 fixed_event_number);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* __ACLINUX_H__ */
|
||||
|
||||
@@ -199,6 +199,7 @@ struct acpi_processor_flags {
|
||||
struct acpi_processor {
|
||||
acpi_handle handle;
|
||||
u32 acpi_id;
|
||||
u32 apic_id;
|
||||
u32 id;
|
||||
u32 pblk;
|
||||
int performance_platform_limit;
|
||||
@@ -224,7 +225,6 @@ struct acpi_processor_errata {
|
||||
} piix4;
|
||||
};
|
||||
|
||||
extern void acpi_processor_load_module(struct acpi_processor *pr);
|
||||
extern int acpi_processor_preregister_performance(struct
|
||||
acpi_processor_performance
|
||||
__percpu *performance);
|
||||
@@ -314,6 +314,8 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
|
||||
|
||||
/* in processor_core.c */
|
||||
void acpi_processor_set_pdc(acpi_handle handle);
|
||||
int acpi_get_apicid(acpi_handle, int type, u32 acpi_id);
|
||||
int acpi_map_cpuid(int apic_id, u32 acpi_id);
|
||||
int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);
|
||||
|
||||
/* in processor_throttling.c */
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
* @addr: The address to base the search on
|
||||
* @offset: The bitnumber to start searching at
|
||||
* @size: The bitmap size in bits
|
||||
*
|
||||
* Returns the bit number for the next set bit
|
||||
* If no bits are set, returns @size.
|
||||
*/
|
||||
extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
|
||||
size, unsigned long offset);
|
||||
@@ -18,6 +21,9 @@ extern unsigned long find_next_bit(const unsigned long *addr, unsigned long
|
||||
* @addr: The address to base the search on
|
||||
* @offset: The bitnumber to start searching at
|
||||
* @size: The bitmap size in bits
|
||||
*
|
||||
* Returns the bit number of the next zero bit
|
||||
* If no bits are zero, returns @size.
|
||||
*/
|
||||
extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
|
||||
long size, unsigned long offset);
|
||||
@@ -28,9 +34,10 @@ extern unsigned long find_next_zero_bit(const unsigned long *addr, unsigned
|
||||
/**
|
||||
* find_first_bit - find the first set bit in a memory region
|
||||
* @addr: The address to start the search at
|
||||
* @size: The maximum size to search
|
||||
* @size: The maximum number of bits to search
|
||||
*
|
||||
* Returns the bit number of the first set bit.
|
||||
* If no bits are set, returns @size.
|
||||
*/
|
||||
extern unsigned long find_first_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
@@ -38,9 +45,10 @@ extern unsigned long find_first_bit(const unsigned long *addr,
|
||||
/**
|
||||
* find_first_zero_bit - find the first cleared bit in a memory region
|
||||
* @addr: The address to start the search at
|
||||
* @size: The maximum size to search
|
||||
* @size: The maximum number of bits to search
|
||||
*
|
||||
* Returns the bit number of the first cleared bit.
|
||||
* If no bits are zero, returns @size.
|
||||
*/
|
||||
extern unsigned long find_first_zero_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#ifndef ASM_DMA_CONTIGUOUS_H
|
||||
#define ASM_DMA_CONTIGUOUS_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_CMA
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/dma-contiguous.h>
|
||||
|
||||
static inline struct cma *dev_get_cma_area(struct device *dev)
|
||||
{
|
||||
if (dev && dev->cma_area)
|
||||
return dev->cma_area;
|
||||
return dma_contiguous_default_area;
|
||||
}
|
||||
|
||||
static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
|
||||
{
|
||||
if (dev)
|
||||
dev->cma_area = cma;
|
||||
if (!dev && !dma_contiguous_default_area)
|
||||
dma_contiguous_default_area = cma;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -10,6 +10,8 @@
|
||||
#ifdef CONFIG_GPIOLIB
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
||||
/* Platforms may implement their GPIO interface with library code,
|
||||
* at a small performance cost for non-inlined operations and some
|
||||
@@ -49,122 +51,11 @@ struct module;
|
||||
struct device_node;
|
||||
struct gpio_desc;
|
||||
|
||||
/**
|
||||
* struct gpio_chip - abstract a GPIO controller
|
||||
* @label: for diagnostics
|
||||
* @dev: optional device providing the GPIOs
|
||||
* @owner: helps prevent removal of modules exporting active GPIOs
|
||||
* @list: links gpio_chips together for traversal
|
||||
* @request: optional hook for chip-specific activation, such as
|
||||
* enabling module power and clock; may sleep
|
||||
* @free: optional hook for chip-specific deactivation, such as
|
||||
* disabling module power and clock; may sleep
|
||||
* @get_direction: returns direction for signal "offset", 0=out, 1=in,
|
||||
* (same as GPIOF_DIR_XXX), or negative error
|
||||
* @direction_input: configures signal "offset" as input, or returns error
|
||||
* @get: returns value for signal "offset"; for output signals this
|
||||
* returns either the value actually sensed, or zero
|
||||
* @direction_output: configures signal "offset" as output, or returns error
|
||||
* @set_debounce: optional hook for setting debounce time for specified gpio in
|
||||
* interrupt triggered gpio chips
|
||||
* @set: assigns output value for signal "offset"
|
||||
* @to_irq: optional hook supporting non-static gpio_to_irq() mappings;
|
||||
* implementation may not sleep
|
||||
* @dbg_show: optional routine to show contents in debugfs; default code
|
||||
* will be used when this is omitted, but custom code can show extra
|
||||
* state (such as pullup/pulldown configuration).
|
||||
* @base: identifies the first GPIO number handled by this chip; or, if
|
||||
* negative during registration, requests dynamic ID allocation.
|
||||
* @ngpio: the number of GPIOs handled by this controller; the last GPIO
|
||||
* handled is (base + ngpio - 1).
|
||||
* @desc: array of ngpio descriptors. Private.
|
||||
* @can_sleep: flag must be set iff get()/set() methods sleep, as they
|
||||
* must while accessing GPIO expander chips over I2C or SPI
|
||||
* @names: if set, must be an array of strings to use as alternative
|
||||
* names for the GPIOs in this chip. Any entry in the array
|
||||
* may be NULL if there is no alias for the GPIO, however the
|
||||
* array must be @ngpio entries long. A name can include a single printk
|
||||
* format specifier for an unsigned int. It is substituted by the actual
|
||||
* number of the gpio.
|
||||
*
|
||||
* A gpio_chip can help platforms abstract various sources of GPIOs so
|
||||
* they can all be accessed through a common programing interface.
|
||||
* Example sources would be SOC controllers, FPGAs, multifunction
|
||||
* chips, dedicated GPIO expanders, and so on.
|
||||
*
|
||||
* Each chip controls a number of signals, identified in method calls
|
||||
* by "offset" values in the range 0..(@ngpio - 1). When those signals
|
||||
* are referenced through calls like gpio_get_value(gpio), the offset
|
||||
* is calculated by subtracting @base from the gpio number.
|
||||
*/
|
||||
struct gpio_chip {
|
||||
const char *label;
|
||||
struct device *dev;
|
||||
struct module *owner;
|
||||
struct list_head list;
|
||||
|
||||
int (*request)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
void (*free)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
int (*get_direction)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
int (*direction_input)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
int (*get)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
int (*direction_output)(struct gpio_chip *chip,
|
||||
unsigned offset, int value);
|
||||
int (*set_debounce)(struct gpio_chip *chip,
|
||||
unsigned offset, unsigned debounce);
|
||||
|
||||
void (*set)(struct gpio_chip *chip,
|
||||
unsigned offset, int value);
|
||||
|
||||
int (*to_irq)(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
|
||||
void (*dbg_show)(struct seq_file *s,
|
||||
struct gpio_chip *chip);
|
||||
int base;
|
||||
u16 ngpio;
|
||||
struct gpio_desc *desc;
|
||||
const char *const *names;
|
||||
unsigned can_sleep:1;
|
||||
unsigned exported:1;
|
||||
|
||||
#if defined(CONFIG_OF_GPIO)
|
||||
/*
|
||||
* If CONFIG_OF is enabled, then all GPIO controllers described in the
|
||||
* device tree automatically may have an OF translation
|
||||
*/
|
||||
struct device_node *of_node;
|
||||
int of_gpio_n_cells;
|
||||
int (*of_xlate)(struct gpio_chip *gc,
|
||||
const struct of_phandle_args *gpiospec, u32 *flags);
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL
|
||||
/*
|
||||
* If CONFIG_PINCTRL is enabled, then gpio controllers can optionally
|
||||
* describe the actual pin range which they serve in an SoC. This
|
||||
* information would be used by pinctrl subsystem to configure
|
||||
* corresponding pins for gpio usage.
|
||||
*/
|
||||
struct list_head pin_ranges;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern const char *gpiochip_is_requested(struct gpio_chip *chip,
|
||||
unsigned offset);
|
||||
extern struct gpio_chip *gpio_to_chip(unsigned gpio);
|
||||
|
||||
/* add/remove chips */
|
||||
extern int gpiochip_add(struct gpio_chip *chip);
|
||||
extern int __must_check gpiochip_remove(struct gpio_chip *chip);
|
||||
extern struct gpio_chip *gpiochip_find(void *data,
|
||||
int (*match)(struct gpio_chip *chip,
|
||||
void *data));
|
||||
|
||||
/* caller holds gpio_lock *OR* gpio is marked as requested */
|
||||
static inline struct gpio_chip *gpio_to_chip(unsigned gpio)
|
||||
{
|
||||
return gpiod_to_chip(gpio_to_desc(gpio));
|
||||
}
|
||||
|
||||
/* Always use the library code for GPIO management calls,
|
||||
* or when sleeping may be involved.
|
||||
@@ -172,43 +63,84 @@ extern struct gpio_chip *gpiochip_find(void *data,
|
||||
extern int gpio_request(unsigned gpio, const char *label);
|
||||
extern void gpio_free(unsigned gpio);
|
||||
|
||||
extern int gpio_direction_input(unsigned gpio);
|
||||
extern int gpio_direction_output(unsigned gpio, int value);
|
||||
static inline int gpio_direction_input(unsigned gpio)
|
||||
{
|
||||
return gpiod_direction_input(gpio_to_desc(gpio));
|
||||
}
|
||||
static inline int gpio_direction_output(unsigned gpio, int value)
|
||||
{
|
||||
return gpiod_direction_output(gpio_to_desc(gpio), value);
|
||||
}
|
||||
|
||||
extern int gpio_set_debounce(unsigned gpio, unsigned debounce);
|
||||
static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
|
||||
{
|
||||
return gpiod_set_debounce(gpio_to_desc(gpio), debounce);
|
||||
}
|
||||
|
||||
extern int gpio_get_value_cansleep(unsigned gpio);
|
||||
extern void gpio_set_value_cansleep(unsigned gpio, int value);
|
||||
static inline int gpio_get_value_cansleep(unsigned gpio)
|
||||
{
|
||||
return gpiod_get_raw_value_cansleep(gpio_to_desc(gpio));
|
||||
}
|
||||
static inline void gpio_set_value_cansleep(unsigned gpio, int value)
|
||||
{
|
||||
return gpiod_set_raw_value_cansleep(gpio_to_desc(gpio), value);
|
||||
}
|
||||
|
||||
|
||||
/* A platform's <asm/gpio.h> code may want to inline the I/O calls when
|
||||
* the GPIO is constant and refers to some always-present controller,
|
||||
* giving direct access to chip registers and tight bitbanging loops.
|
||||
*/
|
||||
extern int __gpio_get_value(unsigned gpio);
|
||||
extern void __gpio_set_value(unsigned gpio, int value);
|
||||
static inline int __gpio_get_value(unsigned gpio)
|
||||
{
|
||||
return gpiod_get_raw_value(gpio_to_desc(gpio));
|
||||
}
|
||||
static inline void __gpio_set_value(unsigned gpio, int value)
|
||||
{
|
||||
return gpiod_set_raw_value(gpio_to_desc(gpio), value);
|
||||
}
|
||||
|
||||
extern int __gpio_cansleep(unsigned gpio);
|
||||
static inline int __gpio_cansleep(unsigned gpio)
|
||||
{
|
||||
return gpiod_cansleep(gpio_to_desc(gpio));
|
||||
}
|
||||
|
||||
extern int __gpio_to_irq(unsigned gpio);
|
||||
static inline int __gpio_to_irq(unsigned gpio)
|
||||
{
|
||||
return gpiod_to_irq(gpio_to_desc(gpio));
|
||||
}
|
||||
|
||||
extern int gpio_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
|
||||
extern void gpio_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
|
||||
|
||||
extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
|
||||
extern int gpio_request_array(const struct gpio *array, size_t num);
|
||||
extern void gpio_free_array(const struct gpio *array, size_t num);
|
||||
|
||||
#ifdef CONFIG_GPIO_SYSFS
|
||||
|
||||
/*
|
||||
* A sysfs interface can be exported by individual drivers if they want,
|
||||
* but more typically is configured entirely from userspace.
|
||||
*/
|
||||
extern int gpio_export(unsigned gpio, bool direction_may_change);
|
||||
extern int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio);
|
||||
extern int gpio_sysfs_set_active_low(unsigned gpio, int value);
|
||||
extern void gpio_unexport(unsigned gpio);
|
||||
static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
||||
{
|
||||
return gpiod_export(gpio_to_desc(gpio), direction_may_change);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GPIO_SYSFS */
|
||||
static inline int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio)
|
||||
{
|
||||
return gpiod_export_link(dev, name, gpio_to_desc(gpio));
|
||||
}
|
||||
|
||||
static inline int gpio_sysfs_set_active_low(unsigned gpio, int value)
|
||||
{
|
||||
return gpiod_sysfs_set_active_low(gpio_to_desc(gpio), value);
|
||||
}
|
||||
|
||||
static inline void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
gpiod_unexport(gpio_to_desc(gpio));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PINCTRL
|
||||
|
||||
@@ -228,6 +160,9 @@ struct gpio_pin_range {
|
||||
int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
|
||||
unsigned int gpio_offset, unsigned int pin_offset,
|
||||
unsigned int npins);
|
||||
int gpiochip_add_pingroup_range(struct gpio_chip *chip,
|
||||
struct pinctrl_dev *pctldev,
|
||||
unsigned int gpio_offset, const char *pin_group);
|
||||
void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
|
||||
|
||||
#else
|
||||
@@ -239,6 +174,13 @@ gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int
|
||||
gpiochip_add_pingroup_range(struct gpio_chip *chip,
|
||||
struct pinctrl_dev *pctldev,
|
||||
unsigned int gpio_offset, const char *pin_group)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
gpiochip_remove_pin_ranges(struct gpio_chip *chip)
|
||||
@@ -278,31 +220,4 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value)
|
||||
|
||||
#endif /* !CONFIG_GPIOLIB */
|
||||
|
||||
#ifndef CONFIG_GPIO_SYSFS
|
||||
|
||||
struct device;
|
||||
|
||||
/* sysfs support is only available with gpiolib, where it's optional */
|
||||
|
||||
static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline int gpio_sysfs_set_active_low(unsigned gpio, int value)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
static inline void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_GPIO_SYSFS */
|
||||
|
||||
#endif /* _ASM_GENERIC_GPIO_H */
|
||||
|
||||
@@ -6,12 +6,12 @@ static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot)
|
||||
return mk_pte(page, pgprot);
|
||||
}
|
||||
|
||||
static inline int huge_pte_write(pte_t pte)
|
||||
static inline unsigned long huge_pte_write(pte_t pte)
|
||||
{
|
||||
return pte_write(pte);
|
||||
}
|
||||
|
||||
static inline int huge_pte_dirty(pte_t pte)
|
||||
static inline unsigned long huge_pte_dirty(pte_t pte)
|
||||
{
|
||||
return pte_dirty(pte);
|
||||
}
|
||||
|
||||
105
include/asm-generic/preempt.h
Normal file
105
include/asm-generic/preempt.h
Normal file
@@ -0,0 +1,105 @@
|
||||
#ifndef __ASM_PREEMPT_H
|
||||
#define __ASM_PREEMPT_H
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
/*
|
||||
* We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users
|
||||
* that think a non-zero value indicates we cannot preempt.
|
||||
*/
|
||||
static __always_inline int preempt_count(void)
|
||||
{
|
||||
return current_thread_info()->preempt_count & ~PREEMPT_NEED_RESCHED;
|
||||
}
|
||||
|
||||
static __always_inline int *preempt_count_ptr(void)
|
||||
{
|
||||
return ¤t_thread_info()->preempt_count;
|
||||
}
|
||||
|
||||
/*
|
||||
* We now loose PREEMPT_NEED_RESCHED and cause an extra reschedule; however the
|
||||
* alternative is loosing a reschedule. Better schedule too often -- also this
|
||||
* should be a very rare operation.
|
||||
*/
|
||||
static __always_inline void preempt_count_set(int pc)
|
||||
{
|
||||
*preempt_count_ptr() = pc;
|
||||
}
|
||||
|
||||
/*
|
||||
* must be macros to avoid header recursion hell
|
||||
*/
|
||||
#define task_preempt_count(p) \
|
||||
(task_thread_info(p)->preempt_count & ~PREEMPT_NEED_RESCHED)
|
||||
|
||||
#define init_task_preempt_count(p) do { \
|
||||
task_thread_info(p)->preempt_count = PREEMPT_DISABLED; \
|
||||
} while (0)
|
||||
|
||||
#define init_idle_preempt_count(p, cpu) do { \
|
||||
task_thread_info(p)->preempt_count = PREEMPT_ENABLED; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* We fold the NEED_RESCHED bit into the preempt count such that
|
||||
* preempt_enable() can decrement and test for needing to reschedule with a
|
||||
* single instruction.
|
||||
*
|
||||
* We invert the actual bit, so that when the decrement hits 0 we know we both
|
||||
* need to resched (the bit is cleared) and can resched (no preempt count).
|
||||
*/
|
||||
|
||||
static __always_inline void set_preempt_need_resched(void)
|
||||
{
|
||||
*preempt_count_ptr() &= ~PREEMPT_NEED_RESCHED;
|
||||
}
|
||||
|
||||
static __always_inline void clear_preempt_need_resched(void)
|
||||
{
|
||||
*preempt_count_ptr() |= PREEMPT_NEED_RESCHED;
|
||||
}
|
||||
|
||||
static __always_inline bool test_preempt_need_resched(void)
|
||||
{
|
||||
return !(*preempt_count_ptr() & PREEMPT_NEED_RESCHED);
|
||||
}
|
||||
|
||||
/*
|
||||
* The various preempt_count add/sub methods
|
||||
*/
|
||||
|
||||
static __always_inline void __preempt_count_add(int val)
|
||||
{
|
||||
*preempt_count_ptr() += val;
|
||||
}
|
||||
|
||||
static __always_inline void __preempt_count_sub(int val)
|
||||
{
|
||||
*preempt_count_ptr() -= val;
|
||||
}
|
||||
|
||||
static __always_inline bool __preempt_count_dec_and_test(void)
|
||||
{
|
||||
return !--*preempt_count_ptr();
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true when we need to resched and can (barring IRQ state).
|
||||
*/
|
||||
static __always_inline bool should_resched(void)
|
||||
{
|
||||
return unlikely(!*preempt_count_ptr());
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PREEMPT
|
||||
extern asmlinkage void preempt_schedule(void);
|
||||
#define __preempt_schedule() preempt_schedule()
|
||||
|
||||
#ifdef CONFIG_CONTEXT_TRACKING
|
||||
extern asmlinkage void preempt_schedule_context(void);
|
||||
#define __preempt_schedule_context() preempt_schedule_context()
|
||||
#endif
|
||||
#endif /* CONFIG_PREEMPT */
|
||||
|
||||
#endif /* __ASM_PREEMPT_H */
|
||||
@@ -32,6 +32,6 @@ static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
|
||||
|
||||
#endif
|
||||
|
||||
extern int copy_siginfo_to_user(struct siginfo __user *to, struct siginfo *from);
|
||||
extern int copy_siginfo_to_user(struct siginfo __user *to, const struct siginfo *from);
|
||||
|
||||
#endif
|
||||
|
||||
14
include/asm-generic/simd.h
Normal file
14
include/asm-generic/simd.h
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
/*
|
||||
* may_use_simd - whether it is allowable at this time to issue SIMD
|
||||
* instructions or access the SIMD register file
|
||||
*
|
||||
* As architectures typically don't preserve the SIMD register file when
|
||||
* taking an interrupt, !in_interrupt() should be a reasonable default.
|
||||
*/
|
||||
static __must_check inline bool may_use_simd(void)
|
||||
{
|
||||
return !in_interrupt();
|
||||
}
|
||||
@@ -473,6 +473,7 @@
|
||||
#define KERNEL_CTORS() . = ALIGN(8); \
|
||||
VMLINUX_SYMBOL(__ctors_start) = .; \
|
||||
*(.ctors) \
|
||||
*(.init_array) \
|
||||
VMLINUX_SYMBOL(__ctors_end) = .;
|
||||
#else
|
||||
#define KERNEL_CTORS()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/* no content, but patch(1) dislikes empty files */
|
||||
|
||||
@@ -49,4 +49,12 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
|
||||
return (val + c->high_bits) & ~rhs;
|
||||
}
|
||||
|
||||
#ifndef zero_bytemask
|
||||
#ifdef CONFIG_64BIT
|
||||
#define zero_bytemask(mask) (~0ul << fls64(mask))
|
||||
#else
|
||||
#define zero_bytemask(mask) (~0ul << fls(mask))
|
||||
#endif /* CONFIG_64BIT */
|
||||
#endif /* zero_bytemask */
|
||||
|
||||
#endif /* _ASM_WORD_AT_A_TIME_H */
|
||||
|
||||
@@ -33,6 +33,16 @@ enum arch_timer_reg {
|
||||
#define ARCH_TIMER_MEM_PHYS_ACCESS 2
|
||||
#define ARCH_TIMER_MEM_VIRT_ACCESS 3
|
||||
|
||||
#define ARCH_TIMER_USR_PCT_ACCESS_EN (1 << 0) /* physical counter */
|
||||
#define ARCH_TIMER_USR_VCT_ACCESS_EN (1 << 1) /* virtual counter */
|
||||
#define ARCH_TIMER_VIRT_EVT_EN (1 << 2)
|
||||
#define ARCH_TIMER_EVT_TRIGGER_SHIFT (4)
|
||||
#define ARCH_TIMER_EVT_TRIGGER_MASK (0xF << ARCH_TIMER_EVT_TRIGGER_SHIFT)
|
||||
#define ARCH_TIMER_USR_VT_ACCESS_EN (1 << 8) /* virtual timer registers */
|
||||
#define ARCH_TIMER_USR_PT_ACCESS_EN (1 << 9) /* physical timer registers */
|
||||
|
||||
#define ARCH_TIMER_EVT_STREAM_FREQ 10000 /* 100us */
|
||||
|
||||
#ifdef CONFIG_ARM_ARCH_TIMER
|
||||
|
||||
extern u32 arch_timer_get_rate(void);
|
||||
|
||||
@@ -20,7 +20,14 @@
|
||||
|
||||
#define SAMSUNG_PWM_NUM 5
|
||||
|
||||
/*
|
||||
* Following declaration must be in an ifdef due to this symbol being static
|
||||
* in pwm-samsung driver if the clocksource driver is not compiled in and the
|
||||
* spinlock is not shared between both drivers.
|
||||
*/
|
||||
#ifdef CONFIG_CLKSRC_SAMSUNG_PWM
|
||||
extern spinlock_t samsung_pwm_lock;
|
||||
#endif
|
||||
|
||||
struct samsung_pwm_variant {
|
||||
u8 bits;
|
||||
|
||||
31
include/crypto/ablk_helper.h
Normal file
31
include/crypto/ablk_helper.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Shared async block cipher helpers
|
||||
*/
|
||||
|
||||
#ifndef _CRYPTO_ABLK_HELPER_H
|
||||
#define _CRYPTO_ABLK_HELPER_H
|
||||
|
||||
#include <linux/crypto.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <crypto/cryptd.h>
|
||||
|
||||
struct async_helper_ctx {
|
||||
struct cryptd_ablkcipher *cryptd_tfm;
|
||||
};
|
||||
|
||||
extern int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
|
||||
unsigned int key_len);
|
||||
|
||||
extern int __ablk_encrypt(struct ablkcipher_request *req);
|
||||
|
||||
extern int ablk_encrypt(struct ablkcipher_request *req);
|
||||
|
||||
extern int ablk_decrypt(struct ablkcipher_request *req);
|
||||
|
||||
extern void ablk_exit(struct crypto_tfm *tfm);
|
||||
|
||||
extern int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name);
|
||||
|
||||
extern int ablk_init(struct crypto_tfm *tfm);
|
||||
|
||||
#endif /* _CRYPTO_ABLK_HELPER_H */
|
||||
@@ -386,5 +386,21 @@ static inline int crypto_requires_sync(u32 type, u32 mask)
|
||||
return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC;
|
||||
}
|
||||
|
||||
#endif /* _CRYPTO_ALGAPI_H */
|
||||
noinline unsigned long __crypto_memneq(const void *a, const void *b, size_t size);
|
||||
|
||||
/**
|
||||
* crypto_memneq - Compare two areas of memory without leaking
|
||||
* timing information.
|
||||
*
|
||||
* @a: One area of memory
|
||||
* @b: Another area of memory
|
||||
* @size: The size of the area.
|
||||
*
|
||||
* Returns 0 when data is equal, 1 otherwise.
|
||||
*/
|
||||
static inline int crypto_memneq(const void *a, const void *b, size_t size)
|
||||
{
|
||||
return __crypto_memneq(a, b, size) != 0UL ? 1 : 0;
|
||||
}
|
||||
|
||||
#endif /* _CRYPTO_ALGAPI_H */
|
||||
|
||||
@@ -23,5 +23,15 @@ struct crypto_authenc_key_param {
|
||||
__be32 enckeylen;
|
||||
};
|
||||
|
||||
#endif /* _CRYPTO_AUTHENC_H */
|
||||
struct crypto_authenc_keys {
|
||||
const u8 *authkey;
|
||||
const u8 *enckey;
|
||||
|
||||
unsigned int authkeylen;
|
||||
unsigned int enckeylen;
|
||||
};
|
||||
|
||||
int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key,
|
||||
unsigned int keylen);
|
||||
|
||||
#endif /* _CRYPTO_AUTHENC_H */
|
||||
|
||||
40
include/crypto/hash_info.h
Normal file
40
include/crypto/hash_info.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Hash Info: Hash algorithms information
|
||||
*
|
||||
* Copyright (c) 2013 Dmitry Kasatkin <d.kasatkin@samsung.com>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CRYPTO_HASH_INFO_H
|
||||
#define _CRYPTO_HASH_INFO_H
|
||||
|
||||
#include <crypto/sha.h>
|
||||
#include <crypto/md5.h>
|
||||
|
||||
#include <uapi/linux/hash_info.h>
|
||||
|
||||
/* not defined in include/crypto/ */
|
||||
#define RMD128_DIGEST_SIZE 16
|
||||
#define RMD160_DIGEST_SIZE 20
|
||||
#define RMD256_DIGEST_SIZE 32
|
||||
#define RMD320_DIGEST_SIZE 40
|
||||
|
||||
/* not defined in include/crypto/ */
|
||||
#define WP512_DIGEST_SIZE 64
|
||||
#define WP384_DIGEST_SIZE 48
|
||||
#define WP256_DIGEST_SIZE 32
|
||||
|
||||
/* not defined in include/crypto/ */
|
||||
#define TGR128_DIGEST_SIZE 16
|
||||
#define TGR160_DIGEST_SIZE 20
|
||||
#define TGR192_DIGEST_SIZE 24
|
||||
|
||||
extern const char *const hash_algo_name[HASH_ALGO__LAST];
|
||||
extern const int hash_digest_size[HASH_ALGO__LAST];
|
||||
|
||||
#endif /* _CRYPTO_HASH_INFO_H */
|
||||
@@ -15,6 +15,7 @@
|
||||
#define _LINUX_PUBLIC_KEY_H
|
||||
|
||||
#include <linux/mpi.h>
|
||||
#include <crypto/hash_info.h>
|
||||
|
||||
enum pkey_algo {
|
||||
PKEY_ALGO_DSA,
|
||||
@@ -22,21 +23,11 @@ enum pkey_algo {
|
||||
PKEY_ALGO__LAST
|
||||
};
|
||||
|
||||
extern const char *const pkey_algo[PKEY_ALGO__LAST];
|
||||
extern const char *const pkey_algo_name[PKEY_ALGO__LAST];
|
||||
extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST];
|
||||
|
||||
enum pkey_hash_algo {
|
||||
PKEY_HASH_MD4,
|
||||
PKEY_HASH_MD5,
|
||||
PKEY_HASH_SHA1,
|
||||
PKEY_HASH_RIPE_MD_160,
|
||||
PKEY_HASH_SHA256,
|
||||
PKEY_HASH_SHA384,
|
||||
PKEY_HASH_SHA512,
|
||||
PKEY_HASH_SHA224,
|
||||
PKEY_HASH__LAST
|
||||
};
|
||||
|
||||
extern const char *const pkey_hash_algo[PKEY_HASH__LAST];
|
||||
/* asymmetric key implementation supports only up to SHA224 */
|
||||
#define PKEY_HASH__LAST (HASH_ALGO_SHA224 + 1)
|
||||
|
||||
enum pkey_id_type {
|
||||
PKEY_ID_PGP, /* OpenPGP generated key ID */
|
||||
@@ -44,7 +35,7 @@ enum pkey_id_type {
|
||||
PKEY_ID_TYPE__LAST
|
||||
};
|
||||
|
||||
extern const char *const pkey_id_type[PKEY_ID_TYPE__LAST];
|
||||
extern const char *const pkey_id_type_name[PKEY_ID_TYPE__LAST];
|
||||
|
||||
/*
|
||||
* Cryptographic data for the public-key subtype of the asymmetric key type.
|
||||
@@ -59,6 +50,7 @@ struct public_key {
|
||||
#define PKEY_CAN_DECRYPT 0x02
|
||||
#define PKEY_CAN_SIGN 0x04
|
||||
#define PKEY_CAN_VERIFY 0x08
|
||||
enum pkey_algo pkey_algo : 8;
|
||||
enum pkey_id_type id_type : 8;
|
||||
union {
|
||||
MPI mpi[5];
|
||||
@@ -88,7 +80,8 @@ struct public_key_signature {
|
||||
u8 *digest;
|
||||
u8 digest_size; /* Number of bytes in digest */
|
||||
u8 nr_mpi; /* Occupancy of mpi[] */
|
||||
enum pkey_hash_algo pkey_hash_algo : 8;
|
||||
enum pkey_algo pkey_algo : 8;
|
||||
enum hash_algo pkey_hash_algo : 8;
|
||||
union {
|
||||
MPI mpi[2];
|
||||
struct {
|
||||
|
||||
@@ -36,6 +36,7 @@ static inline void scatterwalk_sg_chain(struct scatterlist *sg1, int num,
|
||||
{
|
||||
sg_set_page(&sg1[num - 1], (void *)sg2, 0, 0);
|
||||
sg1[num - 1].page_link &= ~0x02;
|
||||
sg1[num - 1].page_link |= 0x01;
|
||||
}
|
||||
|
||||
static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
|
||||
@@ -43,7 +44,7 @@ static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
|
||||
if (sg_is_last(sg))
|
||||
return NULL;
|
||||
|
||||
return (++sg)->length ? sg : (void *)sg_page(sg);
|
||||
return (++sg)->length ? sg : sg_chain_ptr(sg);
|
||||
}
|
||||
|
||||
static inline void scatterwalk_crypto_chain(struct scatterlist *head,
|
||||
@@ -113,4 +114,6 @@ void scatterwalk_done(struct scatter_walk *walk, int out, int more);
|
||||
void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
|
||||
unsigned int start, unsigned int nbytes, int out);
|
||||
|
||||
int scatterwalk_bytes_sglen(struct scatterlist *sg, int num_bytes);
|
||||
|
||||
#endif /* _CRYPTO_SCATTERWALK_H */
|
||||
|
||||
@@ -150,6 +150,7 @@ int drm_err(const char *func, const char *format, ...);
|
||||
#define DRIVER_BUS_PCI 0x1
|
||||
#define DRIVER_BUS_PLATFORM 0x2
|
||||
#define DRIVER_BUS_USB 0x3
|
||||
#define DRIVER_BUS_HOST1X 0x4
|
||||
|
||||
/***********************************************************************/
|
||||
/** \name Begin the DRM... */
|
||||
@@ -412,7 +413,12 @@ struct drm_prime_file_private {
|
||||
|
||||
/** File private data */
|
||||
struct drm_file {
|
||||
int authenticated;
|
||||
unsigned always_authenticated :1;
|
||||
unsigned authenticated :1;
|
||||
unsigned is_master :1; /* this file private is a master for a minor */
|
||||
/* true when the client has asked us to expose stereo 3D mode flags */
|
||||
unsigned stereo_allowed :1;
|
||||
|
||||
struct pid *pid;
|
||||
kuid_t uid;
|
||||
drm_magic_t magic;
|
||||
@@ -429,10 +435,8 @@ struct drm_file {
|
||||
struct file *filp;
|
||||
void *driver_priv;
|
||||
|
||||
int is_master; /* this file private is a master for a minor */
|
||||
struct drm_master *master; /* master this node is currently associated with
|
||||
N.B. not always minor->master */
|
||||
|
||||
/**
|
||||
* fbs - List of framebuffers associated with this file.
|
||||
*
|
||||
@@ -667,8 +671,6 @@ struct drm_gem_object {
|
||||
uint32_t pending_read_domains;
|
||||
uint32_t pending_write_domain;
|
||||
|
||||
void *driver_private;
|
||||
|
||||
/**
|
||||
* dma_buf - dma buf associated with this GEM object
|
||||
*
|
||||
@@ -834,12 +836,17 @@ struct drm_driver {
|
||||
/**
|
||||
* Called by vblank timestamping code.
|
||||
*
|
||||
* Return the current display scanout position from a crtc.
|
||||
* Return the current display scanout position from a crtc, and an
|
||||
* optional accurate ktime_get timestamp of when position was measured.
|
||||
*
|
||||
* \param dev DRM device.
|
||||
* \param crtc Id of the crtc to query.
|
||||
* \param *vpos Target location for current vertical scanout position.
|
||||
* \param *hpos Target location for current horizontal scanout position.
|
||||
* \param *stime Target location for timestamp taken immediately before
|
||||
* scanout position query. Can be NULL to skip timestamp.
|
||||
* \param *etime Target location for timestamp taken immediately after
|
||||
* scanout position query. Can be NULL to skip timestamp.
|
||||
*
|
||||
* Returns vpos as a positive number while in active scanout area.
|
||||
* Returns vpos as a negative number inside vblank, counting the number
|
||||
@@ -856,7 +863,8 @@ struct drm_driver {
|
||||
*
|
||||
*/
|
||||
int (*get_scanout_position) (struct drm_device *dev, int crtc,
|
||||
int *vpos, int *hpos);
|
||||
int *vpos, int *hpos, ktime_t *stime,
|
||||
ktime_t *etime);
|
||||
|
||||
/**
|
||||
* Called by \c drm_get_last_vbltimestamp. Should return a precise
|
||||
@@ -922,7 +930,6 @@ struct drm_driver {
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int (*gem_init_object) (struct drm_gem_object *obj);
|
||||
void (*gem_free_object) (struct drm_gem_object *obj);
|
||||
int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
|
||||
void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
|
||||
@@ -997,27 +1004,6 @@ struct drm_driver {
|
||||
#define DRM_MINOR_CONTROL 2
|
||||
#define DRM_MINOR_RENDER 3
|
||||
|
||||
|
||||
/**
|
||||
* debugfs node list. This structure represents a debugfs file to
|
||||
* be created by the drm core
|
||||
*/
|
||||
struct drm_debugfs_list {
|
||||
const char *name; /** file name */
|
||||
int (*show)(struct seq_file*, void*); /** show callback */
|
||||
u32 driver_features; /**< Required driver features for this entry */
|
||||
};
|
||||
|
||||
/**
|
||||
* debugfs node structure. This structure represents a debugfs file.
|
||||
*/
|
||||
struct drm_debugfs_node {
|
||||
struct list_head list;
|
||||
struct drm_minor *minor;
|
||||
struct drm_debugfs_list *debugfs_ent;
|
||||
struct dentry *dent;
|
||||
};
|
||||
|
||||
/**
|
||||
* Info file list entry. This structure represents a debugfs or proc file to
|
||||
* be created by the drm core
|
||||
@@ -1046,7 +1032,7 @@ struct drm_minor {
|
||||
int index; /**< Minor device number */
|
||||
int type; /**< Control or render */
|
||||
dev_t device; /**< Device number for mknod */
|
||||
struct device kdev; /**< Linux device */
|
||||
struct device *kdev; /**< Linux device */
|
||||
struct drm_device *dev;
|
||||
|
||||
struct dentry *debugfs_root;
|
||||
@@ -1081,6 +1067,19 @@ struct drm_pending_vblank_event {
|
||||
struct drm_event_vblank event;
|
||||
};
|
||||
|
||||
struct drm_vblank_crtc {
|
||||
wait_queue_head_t queue; /**< VBLANK wait queue */
|
||||
struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */
|
||||
atomic_t count; /**< number of VBLANK interrupts */
|
||||
atomic_t refcount; /* number of users of vblank interruptsper crtc */
|
||||
u32 last; /* protected by dev->vbl_lock, used */
|
||||
/* for wraparound handling */
|
||||
u32 last_wait; /* Last vblank seqno waited per CRTC */
|
||||
unsigned int inmodeset; /* Display driver is setting mode */
|
||||
bool enabled; /* so we don't call enable more than
|
||||
once per disable */
|
||||
};
|
||||
|
||||
/**
|
||||
* DRM device structure. This structure represent a complete card that
|
||||
* may contain multiple heads.
|
||||
@@ -1105,25 +1104,16 @@ struct drm_device {
|
||||
atomic_t buf_alloc; /**< Buffer allocation in progress */
|
||||
/*@} */
|
||||
|
||||
/** \name Performance counters */
|
||||
/*@{ */
|
||||
unsigned long counters;
|
||||
enum drm_stat_type types[15];
|
||||
atomic_t counts[15];
|
||||
/*@} */
|
||||
|
||||
struct list_head filelist;
|
||||
|
||||
/** \name Memory management */
|
||||
/*@{ */
|
||||
struct list_head maplist; /**< Linked list of regions */
|
||||
int map_count; /**< Number of mappable regions */
|
||||
struct drm_open_hash map_hash; /**< User token hash table for maps */
|
||||
|
||||
/** \name Context handle management */
|
||||
/*@{ */
|
||||
struct list_head ctxlist; /**< Linked list of context handles */
|
||||
int ctx_count; /**< Number of context handles */
|
||||
struct mutex ctxlist_mutex; /**< For ctxlist */
|
||||
|
||||
struct idr ctx_idr;
|
||||
@@ -1139,12 +1129,11 @@ struct drm_device {
|
||||
|
||||
/** \name Context support */
|
||||
/*@{ */
|
||||
int irq_enabled; /**< True if irq handler is enabled */
|
||||
bool irq_enabled; /**< True if irq handler is enabled */
|
||||
__volatile__ long context_flag; /**< Context swapping flag */
|
||||
int last_context; /**< Last current context */
|
||||
/*@} */
|
||||
|
||||
struct work_struct work;
|
||||
/** \name VBLANK IRQ support */
|
||||
/*@{ */
|
||||
|
||||
@@ -1154,20 +1143,13 @@ struct drm_device {
|
||||
* Once the modeset ioctl *has* been called though, we can safely
|
||||
* disable them when unused.
|
||||
*/
|
||||
int vblank_disable_allowed;
|
||||
bool vblank_disable_allowed;
|
||||
|
||||
/* array of size num_crtcs */
|
||||
struct drm_vblank_crtc *vblank;
|
||||
|
||||
wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */
|
||||
atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */
|
||||
struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */
|
||||
spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */
|
||||
spinlock_t vbl_lock;
|
||||
atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */
|
||||
u32 *last_vblank; /* protected by dev->vbl_lock, used */
|
||||
/* for wraparound handling */
|
||||
int *vblank_enabled; /* so we don't call enable more than
|
||||
once per disable */
|
||||
int *vblank_inmodeset; /* Display driver is setting mode */
|
||||
u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */
|
||||
struct timer_list vblank_disable_timer;
|
||||
|
||||
u32 max_vblank_count; /**< size of vblank counter register */
|
||||
@@ -1184,8 +1166,6 @@ struct drm_device {
|
||||
|
||||
struct device *dev; /**< Device structure */
|
||||
struct pci_dev *pdev; /**< PCI device structure */
|
||||
int pci_vendor; /**< PCI vendor id */
|
||||
int pci_device; /**< PCI device id */
|
||||
#ifdef __alpha__
|
||||
struct pci_controller *hose;
|
||||
#endif
|
||||
@@ -1303,6 +1283,8 @@ extern int drm_getstats(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
extern int drm_getcap(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
extern int drm_setclientcap(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
extern int drm_setversion(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
extern int drm_noop(struct drm_device *dev, void *data,
|
||||
@@ -1322,10 +1304,9 @@ extern int drm_newctx(struct drm_device *dev, void *data,
|
||||
extern int drm_rmctx(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
|
||||
extern void drm_legacy_ctxbitmap_init(struct drm_device *dev);
|
||||
extern void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
|
||||
extern void drm_legacy_ctxbitmap_release(struct drm_device *dev,
|
||||
struct drm_file *file_priv);
|
||||
extern int drm_ctxbitmap_init(struct drm_device *dev);
|
||||
extern void drm_ctxbitmap_cleanup(struct drm_device *dev);
|
||||
extern void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
|
||||
|
||||
extern int drm_setsareactx(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
@@ -1455,7 +1436,6 @@ extern struct drm_master *drm_master_get(struct drm_master *master);
|
||||
extern void drm_master_put(struct drm_master **master);
|
||||
|
||||
extern void drm_put_dev(struct drm_device *dev);
|
||||
extern int drm_put_minor(struct drm_minor **minor);
|
||||
extern void drm_unplug_dev(struct drm_device *dev);
|
||||
extern unsigned int drm_debug;
|
||||
extern unsigned int drm_rnodes;
|
||||
@@ -1475,10 +1455,11 @@ extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
|
||||
#if defined(CONFIG_DEBUG_FS)
|
||||
extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
|
||||
struct dentry *root);
|
||||
extern int drm_debugfs_create_files(struct drm_info_list *files, int count,
|
||||
struct dentry *root, struct drm_minor *minor);
|
||||
extern int drm_debugfs_remove_files(struct drm_info_list *files, int count,
|
||||
struct drm_minor *minor);
|
||||
extern int drm_debugfs_create_files(const struct drm_info_list *files,
|
||||
int count, struct dentry *root,
|
||||
struct drm_minor *minor);
|
||||
extern int drm_debugfs_remove_files(const struct drm_info_list *files,
|
||||
int count, struct drm_minor *minor);
|
||||
extern int drm_debugfs_cleanup(struct drm_minor *minor);
|
||||
#endif
|
||||
|
||||
@@ -1557,8 +1538,6 @@ int drm_gem_init(struct drm_device *dev);
|
||||
void drm_gem_destroy(struct drm_device *dev);
|
||||
void drm_gem_object_release(struct drm_gem_object *obj);
|
||||
void drm_gem_object_free(struct kref *kref);
|
||||
struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
|
||||
size_t size);
|
||||
int drm_gem_object_init(struct drm_device *dev,
|
||||
struct drm_gem_object *obj, size_t size);
|
||||
void drm_gem_private_object_init(struct drm_device *dev,
|
||||
@@ -1646,10 +1625,11 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
|
||||
|
||||
#include <drm/drm_mem_util.h>
|
||||
|
||||
extern int drm_fill_in_dev(struct drm_device *dev,
|
||||
const struct pci_device_id *ent,
|
||||
struct drm_driver *driver);
|
||||
int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type);
|
||||
struct drm_device *drm_dev_alloc(struct drm_driver *driver,
|
||||
struct device *parent);
|
||||
void drm_dev_free(struct drm_device *dev);
|
||||
int drm_dev_register(struct drm_device *dev, unsigned long flags);
|
||||
void drm_dev_unregister(struct drm_device *dev);
|
||||
/*@}*/
|
||||
|
||||
/* PCI section */
|
||||
|
||||
@@ -108,6 +108,7 @@ enum drm_mode_status {
|
||||
MODE_ONE_HEIGHT, /* only one height is supported */
|
||||
MODE_ONE_SIZE, /* only one resolution is supported */
|
||||
MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
|
||||
MODE_NO_STEREO, /* stereo modes not supported */
|
||||
MODE_UNVERIFIED = -3, /* mode needs to reverified */
|
||||
MODE_BAD = -2, /* unspecified reason */
|
||||
MODE_ERROR = -1 /* error condition */
|
||||
@@ -124,7 +125,10 @@ enum drm_mode_status {
|
||||
.vscan = (vs), .flags = (f), \
|
||||
.base.type = DRM_MODE_OBJECT_MODE
|
||||
|
||||
#define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
|
||||
#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
|
||||
#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
|
||||
|
||||
#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
|
||||
|
||||
struct drm_display_mode {
|
||||
/* Header */
|
||||
@@ -155,8 +159,7 @@ struct drm_display_mode {
|
||||
int height_mm;
|
||||
|
||||
/* Actual mode we give to hw */
|
||||
int clock_index;
|
||||
int synth_clock;
|
||||
int crtc_clock; /* in KHz */
|
||||
int crtc_hdisplay;
|
||||
int crtc_hblank_start;
|
||||
int crtc_hblank_end;
|
||||
@@ -180,6 +183,11 @@ struct drm_display_mode {
|
||||
int hsync; /* in kHz */
|
||||
};
|
||||
|
||||
static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
|
||||
{
|
||||
return mode->flags & DRM_MODE_FLAG_3D_MASK;
|
||||
}
|
||||
|
||||
enum drm_connector_status {
|
||||
connector_status_connected = 1,
|
||||
connector_status_disconnected = 2,
|
||||
@@ -587,7 +595,7 @@ enum drm_connector_force {
|
||||
*/
|
||||
struct drm_connector {
|
||||
struct drm_device *dev;
|
||||
struct device kdev;
|
||||
struct device *kdev;
|
||||
struct device_attribute *attr;
|
||||
struct list_head head;
|
||||
|
||||
@@ -597,6 +605,7 @@ struct drm_connector {
|
||||
int connector_type_id;
|
||||
bool interlace_allowed;
|
||||
bool doublescan_allowed;
|
||||
bool stereo_allowed;
|
||||
struct list_head modes; /* list of modes on this connector */
|
||||
|
||||
enum drm_connector_status status;
|
||||
@@ -964,6 +973,7 @@ extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_m
|
||||
extern bool drm_probe_ddc(struct i2c_adapter *adapter);
|
||||
extern struct edid *drm_get_edid(struct drm_connector *connector,
|
||||
struct i2c_adapter *adapter);
|
||||
extern struct edid *drm_edid_duplicate(const struct edid *edid);
|
||||
extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
|
||||
extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
|
||||
extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
|
||||
@@ -975,7 +985,7 @@ extern void drm_mode_config_reset(struct drm_device *dev);
|
||||
extern void drm_mode_config_cleanup(struct drm_device *dev);
|
||||
extern void drm_mode_set_name(struct drm_display_mode *mode);
|
||||
extern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
|
||||
extern bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
|
||||
extern bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
|
||||
extern int drm_mode_width(const struct drm_display_mode *mode);
|
||||
extern int drm_mode_height(const struct drm_display_mode *mode);
|
||||
|
||||
@@ -1108,6 +1118,8 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
|
||||
int GTF_2C, int GTF_K, int GTF_2J);
|
||||
extern int drm_add_modes_noedid(struct drm_connector *connector,
|
||||
int hdisplay, int vdisplay);
|
||||
extern void drm_set_preferred_mode(struct drm_connector *connector,
|
||||
int hpref, int vpref);
|
||||
|
||||
extern int drm_edid_header_is_valid(const u8 *raw_edid);
|
||||
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
|
||||
@@ -1135,4 +1147,21 @@ extern int drm_format_horz_chroma_subsampling(uint32_t format);
|
||||
extern int drm_format_vert_chroma_subsampling(uint32_t format);
|
||||
extern const char *drm_get_format_name(uint32_t format);
|
||||
|
||||
/* Helpers */
|
||||
static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_CRTC);
|
||||
return mo ? obj_to_crtc(mo) : NULL;
|
||||
}
|
||||
|
||||
static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_ENCODER);
|
||||
return mo ? obj_to_encoder(mo) : NULL;
|
||||
}
|
||||
|
||||
#endif /* __DRM_CRTC_H__ */
|
||||
|
||||
@@ -163,7 +163,7 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
|
||||
extern int drm_helper_resume_force_mode(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_init(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_fini(struct drm_device *dev);
|
||||
extern void drm_helper_hpd_irq_event(struct drm_device *dev);
|
||||
extern bool drm_helper_hpd_irq_event(struct drm_device *dev);
|
||||
extern void drm_kms_helper_hotplug_event(struct drm_device *dev);
|
||||
|
||||
extern void drm_kms_helper_poll_disable(struct drm_device *dev);
|
||||
|
||||
@@ -77,10 +77,10 @@
|
||||
#define DP_DOWNSTREAMPORT_PRESENT 0x005
|
||||
# define DP_DWN_STRM_PORT_PRESENT (1 << 0)
|
||||
# define DP_DWN_STRM_PORT_TYPE_MASK 0x06
|
||||
/* 00b = DisplayPort */
|
||||
/* 01b = Analog */
|
||||
/* 10b = TMDS or HDMI */
|
||||
/* 11b = Other */
|
||||
# define DP_DWN_STRM_PORT_TYPE_DP (0 << 1)
|
||||
# define DP_DWN_STRM_PORT_TYPE_ANALOG (1 << 1)
|
||||
# define DP_DWN_STRM_PORT_TYPE_TMDS (2 << 1)
|
||||
# define DP_DWN_STRM_PORT_TYPE_OTHER (3 << 1)
|
||||
# define DP_FORMAT_CONVERSION (1 << 3)
|
||||
# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */
|
||||
|
||||
@@ -333,20 +333,20 @@ i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
|
||||
|
||||
|
||||
#define DP_LINK_STATUS_SIZE 6
|
||||
bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count);
|
||||
bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
bool drm_dp_clock_recovery_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane_count);
|
||||
u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
u8 drm_dp_get_adjust_request_voltage(const u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane);
|
||||
u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
u8 drm_dp_get_adjust_request_pre_emphasis(const u8 link_status[DP_LINK_STATUS_SIZE],
|
||||
int lane);
|
||||
|
||||
#define DP_RECEIVER_CAP_SIZE 0xf
|
||||
#define EDP_PSR_RECEIVER_CAP_SIZE 2
|
||||
|
||||
void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
void drm_dp_link_train_clock_recovery_delay(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
void drm_dp_link_train_channel_eq_delay(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
|
||||
u8 drm_dp_link_rate_to_bw_code(int link_rate);
|
||||
int drm_dp_bw_code_to_link_rate(u8 link_bw);
|
||||
@@ -379,15 +379,22 @@ struct edp_vsc_psr {
|
||||
#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2)
|
||||
|
||||
static inline int
|
||||
drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
|
||||
drm_dp_max_link_rate(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
|
||||
{
|
||||
return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]);
|
||||
}
|
||||
|
||||
static inline u8
|
||||
drm_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE])
|
||||
drm_dp_max_lane_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
|
||||
{
|
||||
return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
|
||||
{
|
||||
return dpcd[DP_DPCD_REV] >= 0x11 &&
|
||||
(dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
|
||||
}
|
||||
|
||||
#endif /* _DRM_DP_HELPER_H_ */
|
||||
|
||||
@@ -12,11 +12,14 @@
|
||||
{0x1002, 0x130F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1310, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1313, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1316, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x1317, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x131D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
|
||||
{0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
|
||||
{0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
@@ -258,6 +261,18 @@
|
||||
{0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67A8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67A9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67AA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67B0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67B8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67BA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x67BE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAWAII|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x6801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
{0x1002, 0x6802, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#ifndef _I915_DRM_H_
|
||||
#define _I915_DRM_H_
|
||||
|
||||
#include <drm/i915_pciids.h>
|
||||
#include <uapi/drm/i915_drm.h>
|
||||
|
||||
/* For use by IPS driver */
|
||||
@@ -34,4 +35,41 @@ extern bool i915_gpu_raise(void);
|
||||
extern bool i915_gpu_lower(void);
|
||||
extern bool i915_gpu_busy(void);
|
||||
extern bool i915_gpu_turbo_disable(void);
|
||||
|
||||
/*
|
||||
* The Bridge device's PCI config space has information about the
|
||||
* fb aperture size and the amount of pre-reserved memory.
|
||||
* This is all handled in the intel-gtt.ko module. i915.ko only
|
||||
* cares about the vga bit for the vga rbiter.
|
||||
*/
|
||||
#define INTEL_GMCH_CTRL 0x52
|
||||
#define INTEL_GMCH_VGA_DISABLE (1 << 1)
|
||||
#define SNB_GMCH_CTRL 0x50
|
||||
#define SNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */
|
||||
#define SNB_GMCH_GGMS_MASK 0x3
|
||||
#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */
|
||||
#define SNB_GMCH_GMS_MASK 0x1f
|
||||
#define BDW_GMCH_GGMS_SHIFT 6
|
||||
#define BDW_GMCH_GGMS_MASK 0x3
|
||||
#define BDW_GMCH_GMS_SHIFT 8
|
||||
#define BDW_GMCH_GMS_MASK 0xff
|
||||
|
||||
#define I830_GMCH_CTRL 0x52
|
||||
|
||||
#define I855_GMCH_GMS_MASK 0xF0
|
||||
#define I855_GMCH_GMS_STOLEN_0M 0x0
|
||||
#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
|
||||
#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
|
||||
#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
|
||||
#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
|
||||
#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
|
||||
#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4)
|
||||
#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4)
|
||||
#define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
|
||||
#define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
|
||||
#define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4)
|
||||
#define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4)
|
||||
#define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4)
|
||||
#define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4)
|
||||
|
||||
#endif /* _I915_DRM_H_ */
|
||||
|
||||
236
include/drm/i915_pciids.h
Normal file
236
include/drm/i915_pciids.h
Normal file
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* Copyright 2013 Intel Corporation
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _I915_PCIIDS_H
|
||||
#define _I915_PCIIDS_H
|
||||
|
||||
/*
|
||||
* A pci_device_id struct {
|
||||
* __u32 vendor, device;
|
||||
* __u32 subvendor, subdevice;
|
||||
* __u32 class, class_mask;
|
||||
* kernel_ulong_t driver_data;
|
||||
* };
|
||||
* Don't use C99 here because "class" is reserved and we want to
|
||||
* give userspace flexibility.
|
||||
*/
|
||||
#define INTEL_VGA_DEVICE(id, info) { \
|
||||
0x8086, id, \
|
||||
~0, ~0, \
|
||||
0x030000, 0xff0000, \
|
||||
(unsigned long) info }
|
||||
|
||||
#define INTEL_QUANTA_VGA_DEVICE(info) { \
|
||||
0x8086, 0x16a, \
|
||||
0x152d, 0x8990, \
|
||||
0x030000, 0xff0000, \
|
||||
(unsigned long) info }
|
||||
|
||||
#define INTEL_I830_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3577, info)
|
||||
|
||||
#define INTEL_I845G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2562, info)
|
||||
|
||||
#define INTEL_I85X_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \
|
||||
INTEL_VGA_DEVICE(0x358e, info)
|
||||
|
||||
#define INTEL_I865G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2572, info) /* I865_G */
|
||||
|
||||
#define INTEL_I915G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \
|
||||
INTEL_VGA_DEVICE(0x258a, info) /* E7221_G */
|
||||
|
||||
#define INTEL_I915GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */
|
||||
|
||||
#define INTEL_I945G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2772, info) /* I945_G */
|
||||
|
||||
#define INTEL_I945GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \
|
||||
INTEL_VGA_DEVICE(0x27ae, info) /* I945_GME */
|
||||
|
||||
#define INTEL_I965G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2972, info), /* I946_GZ */ \
|
||||
INTEL_VGA_DEVICE(0x2982, info), /* G35_G */ \
|
||||
INTEL_VGA_DEVICE(0x2992, info), /* I965_Q */ \
|
||||
INTEL_VGA_DEVICE(0x29a2, info) /* I965_G */
|
||||
|
||||
#define INTEL_G33_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x29b2, info), /* Q35_G */ \
|
||||
INTEL_VGA_DEVICE(0x29c2, info), /* G33_G */ \
|
||||
INTEL_VGA_DEVICE(0x29d2, info) /* Q33_G */
|
||||
|
||||
#define INTEL_I965GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2a02, info), /* I965_GM */ \
|
||||
INTEL_VGA_DEVICE(0x2a12, info) /* I965_GME */
|
||||
|
||||
#define INTEL_GM45_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2a42, info) /* GM45_G */
|
||||
|
||||
#define INTEL_G45_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2e02, info), /* IGD_E_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e12, info), /* Q45_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e22, info), /* G45_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e32, info), /* G41_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e92, info) /* B43_G.1 */
|
||||
|
||||
#define INTEL_PINEVIEW_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0xa001, info), \
|
||||
INTEL_VGA_DEVICE(0xa011, info)
|
||||
|
||||
#define INTEL_IRONLAKE_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0042, info)
|
||||
|
||||
#define INTEL_IRONLAKE_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0046, info)
|
||||
|
||||
#define INTEL_SNB_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0102, info), \
|
||||
INTEL_VGA_DEVICE(0x0112, info), \
|
||||
INTEL_VGA_DEVICE(0x0122, info), \
|
||||
INTEL_VGA_DEVICE(0x010A, info)
|
||||
|
||||
#define INTEL_SNB_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0106, info), \
|
||||
INTEL_VGA_DEVICE(0x0116, info), \
|
||||
INTEL_VGA_DEVICE(0x0126, info)
|
||||
|
||||
#define INTEL_IVB_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0156, info), /* GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0166, info) /* GT2 mobile */
|
||||
|
||||
#define INTEL_IVB_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0152, info), /* GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0162, info), /* GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x015a, info), /* GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x016a, info) /* GT2 server */
|
||||
|
||||
#define INTEL_IVB_Q_IDS(info) \
|
||||
INTEL_QUANTA_VGA_DEVICE(info) /* Quanta transcode */
|
||||
|
||||
#define INTEL_HSW_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0402, info), /* GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0412, info), /* GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0422, info), /* GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x040a, info), /* GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x041a, info), /* GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x042a, info), /* GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x040B, info), /* GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x041B, info), /* GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x042B, info), /* GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x040E, info), /* GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x042E, info), /* GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C02, info), /* SDV GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C12, info), /* SDV GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C22, info), /* SDV GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C0A, info), /* SDV GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C1A, info), /* SDV GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C2A, info), /* SDV GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C0B, info), /* SDV GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C1B, info), /* SDV GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C2B, info), /* SDV GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C0E, info), /* SDV GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C1E, info), /* SDV GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C2E, info), /* SDV GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A02, info), /* ULT GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A12, info), /* ULT GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A22, info), /* ULT GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A0A, info), /* ULT GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A1A, info), /* ULT GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A2A, info), /* ULT GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A0B, info), /* ULT GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A1B, info), /* ULT GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A2B, info), /* ULT GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D02, info), /* CRW GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D12, info), /* CRW GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D22, info), /* CRW GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D0A, info), /* CRW GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D1A, info), /* CRW GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D2A, info), /* CRW GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D0B, info), /* CRW GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D1B, info), /* CRW GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D2B, info), /* CRW GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D0E, info), /* CRW GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D1E, info), /* CRW GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D2E, info) /* CRW GT3 reserved */ \
|
||||
|
||||
#define INTEL_HSW_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0406, info), /* GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0416, info), /* GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0426, info), /* GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C06, info), /* SDV GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C16, info), /* SDV GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C26, info), /* SDV GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A0E, info), /* ULT GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A1E, info), /* ULT GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0D26, info) /* CRW GT3 mobile */
|
||||
|
||||
#define INTEL_VLV_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0f30, info), \
|
||||
INTEL_VGA_DEVICE(0x0f31, info), \
|
||||
INTEL_VGA_DEVICE(0x0f32, info), \
|
||||
INTEL_VGA_DEVICE(0x0f33, info), \
|
||||
INTEL_VGA_DEVICE(0x0157, info)
|
||||
|
||||
#define INTEL_VLV_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0155, info)
|
||||
|
||||
#define _INTEL_BDW_M(gt, id, info) \
|
||||
INTEL_VGA_DEVICE((((gt) - 1) << 4) | (id), info)
|
||||
#define _INTEL_BDW_D(gt, id, info) \
|
||||
INTEL_VGA_DEVICE((((gt) - 1) << 4) | (id), info)
|
||||
|
||||
#define _INTEL_BDW_M_IDS(gt, info) \
|
||||
_INTEL_BDW_M(gt, 0x1602, info), /* ULT */ \
|
||||
_INTEL_BDW_M(gt, 0x1606, info), /* ULT */ \
|
||||
_INTEL_BDW_M(gt, 0x160B, info), /* Iris */ \
|
||||
_INTEL_BDW_M(gt, 0x160E, info) /* ULX */
|
||||
|
||||
#define _INTEL_BDW_D_IDS(gt, info) \
|
||||
_INTEL_BDW_D(gt, 0x160A, info), /* Server */ \
|
||||
_INTEL_BDW_D(gt, 0x160D, info) /* Workstation */
|
||||
|
||||
#define INTEL_BDW_M_IDS(info) \
|
||||
_INTEL_BDW_M_IDS(1, info), \
|
||||
_INTEL_BDW_M_IDS(2, info), \
|
||||
_INTEL_BDW_M_IDS(3, info)
|
||||
|
||||
#define INTEL_BDW_D_IDS(info) \
|
||||
_INTEL_BDW_D_IDS(1, info), \
|
||||
_INTEL_BDW_D_IDS(2, info), \
|
||||
_INTEL_BDW_D_IDS(3, info)
|
||||
|
||||
#endif /* _I915_PCIIDS_H */
|
||||
@@ -169,6 +169,7 @@ struct ttm_tt;
|
||||
* @offset: The current GPU offset, which can have different meanings
|
||||
* depending on the memory type. For SYSTEM type memory, it should be 0.
|
||||
* @cur_placement: Hint of current placement.
|
||||
* @wu_mutex: Wait unreserved mutex.
|
||||
*
|
||||
* Base class for TTM buffer object, that deals with data placement and CPU
|
||||
* mappings. GPU mappings are really up to the driver, but for simpler GPUs
|
||||
@@ -250,6 +251,7 @@ struct ttm_buffer_object {
|
||||
|
||||
struct reservation_object *resv;
|
||||
struct reservation_object ttm_resv;
|
||||
struct mutex wu_mutex;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -702,5 +704,5 @@ extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
|
||||
size_t count, loff_t *f_pos, bool write);
|
||||
|
||||
extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
|
||||
|
||||
extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo);
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,8 @@ extern void ttm_eu_backoff_reservation(struct ww_acquire_ctx *ticket,
|
||||
/**
|
||||
* function ttm_eu_reserve_buffers
|
||||
*
|
||||
* @ticket: [out] ww_acquire_ctx returned by call.
|
||||
* @ticket: [out] ww_acquire_ctx filled in by call, or NULL if only
|
||||
* non-blocking reserves should be tried.
|
||||
* @list: thread private list of ttm_validate_buffer structs.
|
||||
*
|
||||
* Tries to reserve bos pointed to by the list entries for validation.
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include <drm/drm_hashtab.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#include <ttm/ttm_memory.h>
|
||||
|
||||
/**
|
||||
@@ -77,6 +78,7 @@ enum ttm_object_type {
|
||||
ttm_fence_type,
|
||||
ttm_buffer_type,
|
||||
ttm_lock_type,
|
||||
ttm_prime_type,
|
||||
ttm_driver_type0 = 256,
|
||||
ttm_driver_type1,
|
||||
ttm_driver_type2,
|
||||
@@ -132,6 +134,30 @@ struct ttm_base_object {
|
||||
enum ttm_ref_type ref_type);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* struct ttm_prime_object - Modified base object that is prime-aware
|
||||
*
|
||||
* @base: struct ttm_base_object that we derive from
|
||||
* @mutex: Mutex protecting the @dma_buf member.
|
||||
* @size: Size of the dma_buf associated with this object
|
||||
* @real_type: Type of the underlying object. Needed since we're setting
|
||||
* the value of @base::object_type to ttm_prime_type
|
||||
* @dma_buf: Non ref-coutned pointer to a struct dma_buf created from this
|
||||
* object.
|
||||
* @refcount_release: The underlying object's release method. Needed since
|
||||
* we set @base::refcount_release to our own release method.
|
||||
*/
|
||||
|
||||
struct ttm_prime_object {
|
||||
struct ttm_base_object base;
|
||||
struct mutex mutex;
|
||||
size_t size;
|
||||
enum ttm_object_type real_type;
|
||||
struct dma_buf *dma_buf;
|
||||
void (*refcount_release) (struct ttm_base_object **);
|
||||
};
|
||||
|
||||
/**
|
||||
* ttm_base_object_init
|
||||
*
|
||||
@@ -248,14 +274,18 @@ extern void ttm_object_file_release(struct ttm_object_file **p_tfile);
|
||||
/**
|
||||
* ttm_object device init - initialize a struct ttm_object_device
|
||||
*
|
||||
* @mem_glob: struct ttm_mem_global for memory accounting.
|
||||
* @hash_order: Order of hash table used to hash the base objects.
|
||||
* @ops: DMA buf ops for prime objects of this device.
|
||||
*
|
||||
* This function is typically called on device initialization to prepare
|
||||
* data structures needed for ttm base and ref objects.
|
||||
*/
|
||||
|
||||
extern struct ttm_object_device *ttm_object_device_init
|
||||
(struct ttm_mem_global *mem_glob, unsigned int hash_order);
|
||||
extern struct ttm_object_device *
|
||||
ttm_object_device_init(struct ttm_mem_global *mem_glob,
|
||||
unsigned int hash_order,
|
||||
const struct dma_buf_ops *ops);
|
||||
|
||||
/**
|
||||
* ttm_object_device_release - release data held by a ttm_object_device
|
||||
@@ -272,4 +302,31 @@ extern void ttm_object_device_release(struct ttm_object_device **p_tdev);
|
||||
|
||||
#define ttm_base_object_kfree(__object, __base)\
|
||||
kfree_rcu(__object, __base.rhead)
|
||||
|
||||
extern int ttm_prime_object_init(struct ttm_object_file *tfile,
|
||||
size_t size,
|
||||
struct ttm_prime_object *prime,
|
||||
bool shareable,
|
||||
enum ttm_object_type type,
|
||||
void (*refcount_release)
|
||||
(struct ttm_base_object **),
|
||||
void (*ref_obj_release)
|
||||
(struct ttm_base_object *,
|
||||
enum ttm_ref_type ref_type));
|
||||
|
||||
static inline enum ttm_object_type
|
||||
ttm_base_object_type(struct ttm_base_object *base)
|
||||
{
|
||||
return (base->object_type == ttm_prime_type) ?
|
||||
container_of(base, struct ttm_prime_object, base)->real_type :
|
||||
base->object_type;
|
||||
}
|
||||
extern int ttm_prime_fd_to_handle(struct ttm_object_file *tfile,
|
||||
int fd, u32 *handle);
|
||||
extern int ttm_prime_handle_to_fd(struct ttm_object_file *tfile,
|
||||
uint32_t handle, uint32_t flags,
|
||||
int *prime_fd);
|
||||
|
||||
#define ttm_prime_object_kfree(__obj, __prime) \
|
||||
kfree_rcu(__obj, __prime.base.rhead)
|
||||
#endif
|
||||
|
||||
@@ -62,7 +62,7 @@ extern void ttm_pool_unpopulate(struct ttm_tt *ttm);
|
||||
extern int ttm_page_alloc_debugfs(struct seq_file *m, void *data);
|
||||
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU)
|
||||
/**
|
||||
* Initialize pool allocator.
|
||||
*/
|
||||
@@ -94,6 +94,15 @@ static inline int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int ttm_dma_populate(struct ttm_dma_tt *ttm_dma,
|
||||
struct device *dev)
|
||||
{
|
||||
return -ENOMEM;
|
||||
}
|
||||
static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma,
|
||||
struct device *dev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
42
include/dt-bindings/clock/efm32-cmu.h
Normal file
42
include/dt-bindings/clock/efm32-cmu.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef __DT_BINDINGS_CLOCK_EFM32_CMU_H
|
||||
#define __DT_BINDINGS_CLOCK_EFM32_CMU_H
|
||||
|
||||
#define clk_HFXO 0
|
||||
#define clk_HFRCO 1
|
||||
#define clk_LFXO 2
|
||||
#define clk_LFRCO 3
|
||||
#define clk_ULFRCO 4
|
||||
#define clk_AUXHFRCO 5
|
||||
#define clk_HFCLKNODIV 6
|
||||
#define clk_HFCLK 7
|
||||
#define clk_HFPERCLK 8
|
||||
#define clk_HFCORECLK 9
|
||||
#define clk_LFACLK 10
|
||||
#define clk_LFBCLK 11
|
||||
#define clk_WDOGCLK 12
|
||||
#define clk_HFCORECLKDMA 13
|
||||
#define clk_HFCORECLKAES 14
|
||||
#define clk_HFCORECLKUSBC 15
|
||||
#define clk_HFCORECLKUSB 16
|
||||
#define clk_HFCORECLKLE 17
|
||||
#define clk_HFCORECLKEBI 18
|
||||
#define clk_HFPERCLKUSART0 19
|
||||
#define clk_HFPERCLKUSART1 20
|
||||
#define clk_HFPERCLKUSART2 21
|
||||
#define clk_HFPERCLKUART0 22
|
||||
#define clk_HFPERCLKUART1 23
|
||||
#define clk_HFPERCLKTIMER0 24
|
||||
#define clk_HFPERCLKTIMER1 25
|
||||
#define clk_HFPERCLKTIMER2 26
|
||||
#define clk_HFPERCLKTIMER3 27
|
||||
#define clk_HFPERCLKACMP0 28
|
||||
#define clk_HFPERCLKACMP1 29
|
||||
#define clk_HFPERCLKI2C0 30
|
||||
#define clk_HFPERCLKI2C1 31
|
||||
#define clk_HFPERCLKGPIO 32
|
||||
#define clk_HFPERCLKVCMP 33
|
||||
#define clk_HFPERCLKPRS 34
|
||||
#define clk_HFPERCLKADC0 35
|
||||
#define clk_HFPERCLKDAC0 36
|
||||
|
||||
#endif /* __DT_BINDINGS_CLOCK_EFM32_CMU_H */
|
||||
178
include/dt-bindings/clock/samsung,s3c64xx-clock.h
Normal file
178
include/dt-bindings/clock/samsung,s3c64xx-clock.h
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Tomasz Figa <tomasz.figa at gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Device Tree binding constants for Samsung S3C64xx clock controller.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
|
||||
#define _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
|
||||
|
||||
/*
|
||||
* Let each exported clock get a unique index, which is used on DT-enabled
|
||||
* platforms to lookup the clock from a clock specifier. These indices are
|
||||
* therefore considered an ABI and so must not be changed. This implies
|
||||
* that new clocks should be added either in free spaces between clock groups
|
||||
* or at the end.
|
||||
*/
|
||||
|
||||
/* Core clocks. */
|
||||
#define CLK27M 1
|
||||
#define CLK48M 2
|
||||
#define FOUT_APLL 3
|
||||
#define FOUT_MPLL 4
|
||||
#define FOUT_EPLL 5
|
||||
#define ARMCLK 6
|
||||
#define HCLKX2 7
|
||||
#define HCLK 8
|
||||
#define PCLK 9
|
||||
|
||||
/* HCLK bus clocks. */
|
||||
#define HCLK_3DSE 16
|
||||
#define HCLK_UHOST 17
|
||||
#define HCLK_SECUR 18
|
||||
#define HCLK_SDMA1 19
|
||||
#define HCLK_SDMA0 20
|
||||
#define HCLK_IROM 21
|
||||
#define HCLK_DDR1 22
|
||||
#define HCLK_MEM1 23
|
||||
#define HCLK_MEM0 24
|
||||
#define HCLK_USB 25
|
||||
#define HCLK_HSMMC2 26
|
||||
#define HCLK_HSMMC1 27
|
||||
#define HCLK_HSMMC0 28
|
||||
#define HCLK_MDP 29
|
||||
#define HCLK_DHOST 30
|
||||
#define HCLK_IHOST 31
|
||||
#define HCLK_DMA1 32
|
||||
#define HCLK_DMA0 33
|
||||
#define HCLK_JPEG 34
|
||||
#define HCLK_CAMIF 35
|
||||
#define HCLK_SCALER 36
|
||||
#define HCLK_2D 37
|
||||
#define HCLK_TV 38
|
||||
#define HCLK_POST0 39
|
||||
#define HCLK_ROT 40
|
||||
#define HCLK_LCD 41
|
||||
#define HCLK_TZIC 42
|
||||
#define HCLK_INTC 43
|
||||
#define HCLK_MFC 44
|
||||
#define HCLK_DDR0 45
|
||||
|
||||
/* PCLK bus clocks. */
|
||||
#define PCLK_IIC1 48
|
||||
#define PCLK_IIS2 49
|
||||
#define PCLK_SKEY 50
|
||||
#define PCLK_CHIPID 51
|
||||
#define PCLK_SPI1 52
|
||||
#define PCLK_SPI0 53
|
||||
#define PCLK_HSIRX 54
|
||||
#define PCLK_HSITX 55
|
||||
#define PCLK_GPIO 56
|
||||
#define PCLK_IIC0 57
|
||||
#define PCLK_IIS1 58
|
||||
#define PCLK_IIS0 59
|
||||
#define PCLK_AC97 60
|
||||
#define PCLK_TZPC 61
|
||||
#define PCLK_TSADC 62
|
||||
#define PCLK_KEYPAD 63
|
||||
#define PCLK_IRDA 64
|
||||
#define PCLK_PCM1 65
|
||||
#define PCLK_PCM0 66
|
||||
#define PCLK_PWM 67
|
||||
#define PCLK_RTC 68
|
||||
#define PCLK_WDT 69
|
||||
#define PCLK_UART3 70
|
||||
#define PCLK_UART2 71
|
||||
#define PCLK_UART1 72
|
||||
#define PCLK_UART0 73
|
||||
#define PCLK_MFC 74
|
||||
|
||||
/* Special clocks. */
|
||||
#define SCLK_UHOST 80
|
||||
#define SCLK_MMC2_48 81
|
||||
#define SCLK_MMC1_48 82
|
||||
#define SCLK_MMC0_48 83
|
||||
#define SCLK_MMC2 84
|
||||
#define SCLK_MMC1 85
|
||||
#define SCLK_MMC0 86
|
||||
#define SCLK_SPI1_48 87
|
||||
#define SCLK_SPI0_48 88
|
||||
#define SCLK_SPI1 89
|
||||
#define SCLK_SPI0 90
|
||||
#define SCLK_DAC27 91
|
||||
#define SCLK_TV27 92
|
||||
#define SCLK_SCALER27 93
|
||||
#define SCLK_SCALER 94
|
||||
#define SCLK_LCD27 95
|
||||
#define SCLK_LCD 96
|
||||
#define SCLK_FIMC 97
|
||||
#define SCLK_POST0_27 98
|
||||
#define SCLK_AUDIO2 99
|
||||
#define SCLK_POST0 100
|
||||
#define SCLK_AUDIO1 101
|
||||
#define SCLK_AUDIO0 102
|
||||
#define SCLK_SECUR 103
|
||||
#define SCLK_IRDA 104
|
||||
#define SCLK_UART 105
|
||||
#define SCLK_MFC 106
|
||||
#define SCLK_CAM 107
|
||||
#define SCLK_JPEG 108
|
||||
#define SCLK_ONENAND 109
|
||||
|
||||
/* MEM0 bus clocks - S3C6410-specific. */
|
||||
#define MEM0_CFCON 112
|
||||
#define MEM0_ONENAND1 113
|
||||
#define MEM0_ONENAND0 114
|
||||
#define MEM0_NFCON 115
|
||||
#define MEM0_SROM 116
|
||||
|
||||
/* Muxes. */
|
||||
#define MOUT_APLL 128
|
||||
#define MOUT_MPLL 129
|
||||
#define MOUT_EPLL 130
|
||||
#define MOUT_MFC 131
|
||||
#define MOUT_AUDIO0 132
|
||||
#define MOUT_AUDIO1 133
|
||||
#define MOUT_UART 134
|
||||
#define MOUT_SPI0 135
|
||||
#define MOUT_SPI1 136
|
||||
#define MOUT_MMC0 137
|
||||
#define MOUT_MMC1 138
|
||||
#define MOUT_MMC2 139
|
||||
#define MOUT_UHOST 140
|
||||
#define MOUT_IRDA 141
|
||||
#define MOUT_LCD 142
|
||||
#define MOUT_SCALER 143
|
||||
#define MOUT_DAC27 144
|
||||
#define MOUT_TV27 145
|
||||
#define MOUT_AUDIO2 146
|
||||
|
||||
/* Dividers. */
|
||||
#define DOUT_MPLL 160
|
||||
#define DOUT_SECUR 161
|
||||
#define DOUT_CAM 162
|
||||
#define DOUT_JPEG 163
|
||||
#define DOUT_MFC 164
|
||||
#define DOUT_MMC0 165
|
||||
#define DOUT_MMC1 166
|
||||
#define DOUT_MMC2 167
|
||||
#define DOUT_LCD 168
|
||||
#define DOUT_SCALER 169
|
||||
#define DOUT_UHOST 170
|
||||
#define DOUT_SPI0 171
|
||||
#define DOUT_SPI1 172
|
||||
#define DOUT_AUDIO0 173
|
||||
#define DOUT_AUDIO1 174
|
||||
#define DOUT_UART 175
|
||||
#define DOUT_IRDA 176
|
||||
#define DOUT_FIMC 177
|
||||
#define DOUT_AUDIO2 178
|
||||
|
||||
/* Total number of clocks. */
|
||||
#define NR_CLKS (DOUT_AUDIO2 + 1)
|
||||
|
||||
#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H */
|
||||
525
include/dt-bindings/input/input.h
Normal file
525
include/dt-bindings/input/input.h
Normal file
@@ -0,0 +1,525 @@
|
||||
/*
|
||||
* This header provides constants for most input bindings.
|
||||
*
|
||||
* Most input bindings include key code, matrix key code format.
|
||||
* In most cases, key code and matrix key code format uses
|
||||
* the standard values/macro defined in this header.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_INPUT_INPUT_H
|
||||
#define _DT_BINDINGS_INPUT_INPUT_H
|
||||
|
||||
#define KEY_RESERVED 0
|
||||
#define KEY_ESC 1
|
||||
#define KEY_1 2
|
||||
#define KEY_2 3
|
||||
#define KEY_3 4
|
||||
#define KEY_4 5
|
||||
#define KEY_5 6
|
||||
#define KEY_6 7
|
||||
#define KEY_7 8
|
||||
#define KEY_8 9
|
||||
#define KEY_9 10
|
||||
#define KEY_0 11
|
||||
#define KEY_MINUS 12
|
||||
#define KEY_EQUAL 13
|
||||
#define KEY_BACKSPACE 14
|
||||
#define KEY_TAB 15
|
||||
#define KEY_Q 16
|
||||
#define KEY_W 17
|
||||
#define KEY_E 18
|
||||
#define KEY_R 19
|
||||
#define KEY_T 20
|
||||
#define KEY_Y 21
|
||||
#define KEY_U 22
|
||||
#define KEY_I 23
|
||||
#define KEY_O 24
|
||||
#define KEY_P 25
|
||||
#define KEY_LEFTBRACE 26
|
||||
#define KEY_RIGHTBRACE 27
|
||||
#define KEY_ENTER 28
|
||||
#define KEY_LEFTCTRL 29
|
||||
#define KEY_A 30
|
||||
#define KEY_S 31
|
||||
#define KEY_D 32
|
||||
#define KEY_F 33
|
||||
#define KEY_G 34
|
||||
#define KEY_H 35
|
||||
#define KEY_J 36
|
||||
#define KEY_K 37
|
||||
#define KEY_L 38
|
||||
#define KEY_SEMICOLON 39
|
||||
#define KEY_APOSTROPHE 40
|
||||
#define KEY_GRAVE 41
|
||||
#define KEY_LEFTSHIFT 42
|
||||
#define KEY_BACKSLASH 43
|
||||
#define KEY_Z 44
|
||||
#define KEY_X 45
|
||||
#define KEY_C 46
|
||||
#define KEY_V 47
|
||||
#define KEY_B 48
|
||||
#define KEY_N 49
|
||||
#define KEY_M 50
|
||||
#define KEY_COMMA 51
|
||||
#define KEY_DOT 52
|
||||
#define KEY_SLASH 53
|
||||
#define KEY_RIGHTSHIFT 54
|
||||
#define KEY_KPASTERISK 55
|
||||
#define KEY_LEFTALT 56
|
||||
#define KEY_SPACE 57
|
||||
#define KEY_CAPSLOCK 58
|
||||
#define KEY_F1 59
|
||||
#define KEY_F2 60
|
||||
#define KEY_F3 61
|
||||
#define KEY_F4 62
|
||||
#define KEY_F5 63
|
||||
#define KEY_F6 64
|
||||
#define KEY_F7 65
|
||||
#define KEY_F8 66
|
||||
#define KEY_F9 67
|
||||
#define KEY_F10 68
|
||||
#define KEY_NUMLOCK 69
|
||||
#define KEY_SCROLLLOCK 70
|
||||
#define KEY_KP7 71
|
||||
#define KEY_KP8 72
|
||||
#define KEY_KP9 73
|
||||
#define KEY_KPMINUS 74
|
||||
#define KEY_KP4 75
|
||||
#define KEY_KP5 76
|
||||
#define KEY_KP6 77
|
||||
#define KEY_KPPLUS 78
|
||||
#define KEY_KP1 79
|
||||
#define KEY_KP2 80
|
||||
#define KEY_KP3 81
|
||||
#define KEY_KP0 82
|
||||
#define KEY_KPDOT 83
|
||||
|
||||
#define KEY_ZENKAKUHANKAKU 85
|
||||
#define KEY_102ND 86
|
||||
#define KEY_F11 87
|
||||
#define KEY_F12 88
|
||||
#define KEY_RO 89
|
||||
#define KEY_KATAKANA 90
|
||||
#define KEY_HIRAGANA 91
|
||||
#define KEY_HENKAN 92
|
||||
#define KEY_KATAKANAHIRAGANA 93
|
||||
#define KEY_MUHENKAN 94
|
||||
#define KEY_KPJPCOMMA 95
|
||||
#define KEY_KPENTER 96
|
||||
#define KEY_RIGHTCTRL 97
|
||||
#define KEY_KPSLASH 98
|
||||
#define KEY_SYSRQ 99
|
||||
#define KEY_RIGHTALT 100
|
||||
#define KEY_LINEFEED 101
|
||||
#define KEY_HOME 102
|
||||
#define KEY_UP 103
|
||||
#define KEY_PAGEUP 104
|
||||
#define KEY_LEFT 105
|
||||
#define KEY_RIGHT 106
|
||||
#define KEY_END 107
|
||||
#define KEY_DOWN 108
|
||||
#define KEY_PAGEDOWN 109
|
||||
#define KEY_INSERT 110
|
||||
#define KEY_DELETE 111
|
||||
#define KEY_MACRO 112
|
||||
#define KEY_MUTE 113
|
||||
#define KEY_VOLUMEDOWN 114
|
||||
#define KEY_VOLUMEUP 115
|
||||
#define KEY_POWER 116 /* SC System Power Down */
|
||||
#define KEY_KPEQUAL 117
|
||||
#define KEY_KPPLUSMINUS 118
|
||||
#define KEY_PAUSE 119
|
||||
#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
|
||||
|
||||
#define KEY_KPCOMMA 121
|
||||
#define KEY_HANGEUL 122
|
||||
#define KEY_HANGUEL KEY_HANGEUL
|
||||
#define KEY_HANJA 123
|
||||
#define KEY_YEN 124
|
||||
#define KEY_LEFTMETA 125
|
||||
#define KEY_RIGHTMETA 126
|
||||
#define KEY_COMPOSE 127
|
||||
|
||||
#define KEY_STOP 128 /* AC Stop */
|
||||
#define KEY_AGAIN 129
|
||||
#define KEY_PROPS 130 /* AC Properties */
|
||||
#define KEY_UNDO 131 /* AC Undo */
|
||||
#define KEY_FRONT 132
|
||||
#define KEY_COPY 133 /* AC Copy */
|
||||
#define KEY_OPEN 134 /* AC Open */
|
||||
#define KEY_PASTE 135 /* AC Paste */
|
||||
#define KEY_FIND 136 /* AC Search */
|
||||
#define KEY_CUT 137 /* AC Cut */
|
||||
#define KEY_HELP 138 /* AL Integrated Help Center */
|
||||
#define KEY_MENU 139 /* Menu (show menu) */
|
||||
#define KEY_CALC 140 /* AL Calculator */
|
||||
#define KEY_SETUP 141
|
||||
#define KEY_SLEEP 142 /* SC System Sleep */
|
||||
#define KEY_WAKEUP 143 /* System Wake Up */
|
||||
#define KEY_FILE 144 /* AL Local Machine Browser */
|
||||
#define KEY_SENDFILE 145
|
||||
#define KEY_DELETEFILE 146
|
||||
#define KEY_XFER 147
|
||||
#define KEY_PROG1 148
|
||||
#define KEY_PROG2 149
|
||||
#define KEY_WWW 150 /* AL Internet Browser */
|
||||
#define KEY_MSDOS 151
|
||||
#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
|
||||
#define KEY_SCREENLOCK KEY_COFFEE
|
||||
#define KEY_DIRECTION 153
|
||||
#define KEY_CYCLEWINDOWS 154
|
||||
#define KEY_MAIL 155
|
||||
#define KEY_BOOKMARKS 156 /* AC Bookmarks */
|
||||
#define KEY_COMPUTER 157
|
||||
#define KEY_BACK 158 /* AC Back */
|
||||
#define KEY_FORWARD 159 /* AC Forward */
|
||||
#define KEY_CLOSECD 160
|
||||
#define KEY_EJECTCD 161
|
||||
#define KEY_EJECTCLOSECD 162
|
||||
#define KEY_NEXTSONG 163
|
||||
#define KEY_PLAYPAUSE 164
|
||||
#define KEY_PREVIOUSSONG 165
|
||||
#define KEY_STOPCD 166
|
||||
#define KEY_RECORD 167
|
||||
#define KEY_REWIND 168
|
||||
#define KEY_PHONE 169 /* Media Select Telephone */
|
||||
#define KEY_ISO 170
|
||||
#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
|
||||
#define KEY_HOMEPAGE 172 /* AC Home */
|
||||
#define KEY_REFRESH 173 /* AC Refresh */
|
||||
#define KEY_EXIT 174 /* AC Exit */
|
||||
#define KEY_MOVE 175
|
||||
#define KEY_EDIT 176
|
||||
#define KEY_SCROLLUP 177
|
||||
#define KEY_SCROLLDOWN 178
|
||||
#define KEY_KPLEFTPAREN 179
|
||||
#define KEY_KPRIGHTPAREN 180
|
||||
#define KEY_NEW 181 /* AC New */
|
||||
#define KEY_REDO 182 /* AC Redo/Repeat */
|
||||
|
||||
#define KEY_F13 183
|
||||
#define KEY_F14 184
|
||||
#define KEY_F15 185
|
||||
#define KEY_F16 186
|
||||
#define KEY_F17 187
|
||||
#define KEY_F18 188
|
||||
#define KEY_F19 189
|
||||
#define KEY_F20 190
|
||||
#define KEY_F21 191
|
||||
#define KEY_F22 192
|
||||
#define KEY_F23 193
|
||||
#define KEY_F24 194
|
||||
|
||||
#define KEY_PLAYCD 200
|
||||
#define KEY_PAUSECD 201
|
||||
#define KEY_PROG3 202
|
||||
#define KEY_PROG4 203
|
||||
#define KEY_DASHBOARD 204 /* AL Dashboard */
|
||||
#define KEY_SUSPEND 205
|
||||
#define KEY_CLOSE 206 /* AC Close */
|
||||
#define KEY_PLAY 207
|
||||
#define KEY_FASTFORWARD 208
|
||||
#define KEY_BASSBOOST 209
|
||||
#define KEY_PRINT 210 /* AC Print */
|
||||
#define KEY_HP 211
|
||||
#define KEY_CAMERA 212
|
||||
#define KEY_SOUND 213
|
||||
#define KEY_QUESTION 214
|
||||
#define KEY_EMAIL 215
|
||||
#define KEY_CHAT 216
|
||||
#define KEY_SEARCH 217
|
||||
#define KEY_CONNECT 218
|
||||
#define KEY_FINANCE 219 /* AL Checkbook/Finance */
|
||||
#define KEY_SPORT 220
|
||||
#define KEY_SHOP 221
|
||||
#define KEY_ALTERASE 222
|
||||
#define KEY_CANCEL 223 /* AC Cancel */
|
||||
#define KEY_BRIGHTNESSDOWN 224
|
||||
#define KEY_BRIGHTNESSUP 225
|
||||
#define KEY_MEDIA 226
|
||||
|
||||
#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
|
||||
outputs (Monitor/LCD/TV-out/etc) */
|
||||
#define KEY_KBDILLUMTOGGLE 228
|
||||
#define KEY_KBDILLUMDOWN 229
|
||||
#define KEY_KBDILLUMUP 230
|
||||
|
||||
#define KEY_SEND 231 /* AC Send */
|
||||
#define KEY_REPLY 232 /* AC Reply */
|
||||
#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
|
||||
#define KEY_SAVE 234 /* AC Save */
|
||||
#define KEY_DOCUMENTS 235
|
||||
|
||||
#define KEY_BATTERY 236
|
||||
|
||||
#define KEY_BLUETOOTH 237
|
||||
#define KEY_WLAN 238
|
||||
#define KEY_UWB 239
|
||||
|
||||
#define KEY_UNKNOWN 240
|
||||
|
||||
#define KEY_VIDEO_NEXT 241 /* drive next video source */
|
||||
#define KEY_VIDEO_PREV 242 /* drive previous video source */
|
||||
#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
|
||||
#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
|
||||
#define KEY_DISPLAY_OFF 245 /* display device to off state */
|
||||
|
||||
#define KEY_WIMAX 246
|
||||
#define KEY_RFKILL 247 /* Key that controls all radios */
|
||||
|
||||
#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
|
||||
|
||||
/* Code 255 is reserved for special needs of AT keyboard driver */
|
||||
|
||||
#define BTN_MISC 0x100
|
||||
#define BTN_0 0x100
|
||||
#define BTN_1 0x101
|
||||
#define BTN_2 0x102
|
||||
#define BTN_3 0x103
|
||||
#define BTN_4 0x104
|
||||
#define BTN_5 0x105
|
||||
#define BTN_6 0x106
|
||||
#define BTN_7 0x107
|
||||
#define BTN_8 0x108
|
||||
#define BTN_9 0x109
|
||||
|
||||
#define BTN_MOUSE 0x110
|
||||
#define BTN_LEFT 0x110
|
||||
#define BTN_RIGHT 0x111
|
||||
#define BTN_MIDDLE 0x112
|
||||
#define BTN_SIDE 0x113
|
||||
#define BTN_EXTRA 0x114
|
||||
#define BTN_FORWARD 0x115
|
||||
#define BTN_BACK 0x116
|
||||
#define BTN_TASK 0x117
|
||||
|
||||
#define BTN_JOYSTICK 0x120
|
||||
#define BTN_TRIGGER 0x120
|
||||
#define BTN_THUMB 0x121
|
||||
#define BTN_THUMB2 0x122
|
||||
#define BTN_TOP 0x123
|
||||
#define BTN_TOP2 0x124
|
||||
#define BTN_PINKIE 0x125
|
||||
#define BTN_BASE 0x126
|
||||
#define BTN_BASE2 0x127
|
||||
#define BTN_BASE3 0x128
|
||||
#define BTN_BASE4 0x129
|
||||
#define BTN_BASE5 0x12a
|
||||
#define BTN_BASE6 0x12b
|
||||
#define BTN_DEAD 0x12f
|
||||
|
||||
#define BTN_GAMEPAD 0x130
|
||||
#define BTN_SOUTH 0x130
|
||||
#define BTN_A BTN_SOUTH
|
||||
#define BTN_EAST 0x131
|
||||
#define BTN_B BTN_EAST
|
||||
#define BTN_C 0x132
|
||||
#define BTN_NORTH 0x133
|
||||
#define BTN_X BTN_NORTH
|
||||
#define BTN_WEST 0x134
|
||||
#define BTN_Y BTN_WEST
|
||||
#define BTN_Z 0x135
|
||||
#define BTN_TL 0x136
|
||||
#define BTN_TR 0x137
|
||||
#define BTN_TL2 0x138
|
||||
#define BTN_TR2 0x139
|
||||
#define BTN_SELECT 0x13a
|
||||
#define BTN_START 0x13b
|
||||
#define BTN_MODE 0x13c
|
||||
#define BTN_THUMBL 0x13d
|
||||
#define BTN_THUMBR 0x13e
|
||||
|
||||
#define BTN_DIGI 0x140
|
||||
#define BTN_TOOL_PEN 0x140
|
||||
#define BTN_TOOL_RUBBER 0x141
|
||||
#define BTN_TOOL_BRUSH 0x142
|
||||
#define BTN_TOOL_PENCIL 0x143
|
||||
#define BTN_TOOL_AIRBRUSH 0x144
|
||||
#define BTN_TOOL_FINGER 0x145
|
||||
#define BTN_TOOL_MOUSE 0x146
|
||||
#define BTN_TOOL_LENS 0x147
|
||||
#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
|
||||
#define BTN_TOUCH 0x14a
|
||||
#define BTN_STYLUS 0x14b
|
||||
#define BTN_STYLUS2 0x14c
|
||||
#define BTN_TOOL_DOUBLETAP 0x14d
|
||||
#define BTN_TOOL_TRIPLETAP 0x14e
|
||||
#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
|
||||
|
||||
#define BTN_WHEEL 0x150
|
||||
#define BTN_GEAR_DOWN 0x150
|
||||
#define BTN_GEAR_UP 0x151
|
||||
|
||||
#define KEY_OK 0x160
|
||||
#define KEY_SELECT 0x161
|
||||
#define KEY_GOTO 0x162
|
||||
#define KEY_CLEAR 0x163
|
||||
#define KEY_POWER2 0x164
|
||||
#define KEY_OPTION 0x165
|
||||
#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
|
||||
#define KEY_TIME 0x167
|
||||
#define KEY_VENDOR 0x168
|
||||
#define KEY_ARCHIVE 0x169
|
||||
#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
|
||||
#define KEY_CHANNEL 0x16b
|
||||
#define KEY_FAVORITES 0x16c
|
||||
#define KEY_EPG 0x16d
|
||||
#define KEY_PVR 0x16e /* Media Select Home */
|
||||
#define KEY_MHP 0x16f
|
||||
#define KEY_LANGUAGE 0x170
|
||||
#define KEY_TITLE 0x171
|
||||
#define KEY_SUBTITLE 0x172
|
||||
#define KEY_ANGLE 0x173
|
||||
#define KEY_ZOOM 0x174
|
||||
#define KEY_MODE 0x175
|
||||
#define KEY_KEYBOARD 0x176
|
||||
#define KEY_SCREEN 0x177
|
||||
#define KEY_PC 0x178 /* Media Select Computer */
|
||||
#define KEY_TV 0x179 /* Media Select TV */
|
||||
#define KEY_TV2 0x17a /* Media Select Cable */
|
||||
#define KEY_VCR 0x17b /* Media Select VCR */
|
||||
#define KEY_VCR2 0x17c /* VCR Plus */
|
||||
#define KEY_SAT 0x17d /* Media Select Satellite */
|
||||
#define KEY_SAT2 0x17e
|
||||
#define KEY_CD 0x17f /* Media Select CD */
|
||||
#define KEY_TAPE 0x180 /* Media Select Tape */
|
||||
#define KEY_RADIO 0x181
|
||||
#define KEY_TUNER 0x182 /* Media Select Tuner */
|
||||
#define KEY_PLAYER 0x183
|
||||
#define KEY_TEXT 0x184
|
||||
#define KEY_DVD 0x185 /* Media Select DVD */
|
||||
#define KEY_AUX 0x186
|
||||
#define KEY_MP3 0x187
|
||||
#define KEY_AUDIO 0x188 /* AL Audio Browser */
|
||||
#define KEY_VIDEO 0x189 /* AL Movie Browser */
|
||||
#define KEY_DIRECTORY 0x18a
|
||||
#define KEY_LIST 0x18b
|
||||
#define KEY_MEMO 0x18c /* Media Select Messages */
|
||||
#define KEY_CALENDAR 0x18d
|
||||
#define KEY_RED 0x18e
|
||||
#define KEY_GREEN 0x18f
|
||||
#define KEY_YELLOW 0x190
|
||||
#define KEY_BLUE 0x191
|
||||
#define KEY_CHANNELUP 0x192 /* Channel Increment */
|
||||
#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
|
||||
#define KEY_FIRST 0x194
|
||||
#define KEY_LAST 0x195 /* Recall Last */
|
||||
#define KEY_AB 0x196
|
||||
#define KEY_NEXT 0x197
|
||||
#define KEY_RESTART 0x198
|
||||
#define KEY_SLOW 0x199
|
||||
#define KEY_SHUFFLE 0x19a
|
||||
#define KEY_BREAK 0x19b
|
||||
#define KEY_PREVIOUS 0x19c
|
||||
#define KEY_DIGITS 0x19d
|
||||
#define KEY_TEEN 0x19e
|
||||
#define KEY_TWEN 0x19f
|
||||
#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
|
||||
#define KEY_GAMES 0x1a1 /* Media Select Games */
|
||||
#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
|
||||
#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
|
||||
#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
|
||||
#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
|
||||
#define KEY_EDITOR 0x1a6 /* AL Text Editor */
|
||||
#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
|
||||
#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
|
||||
#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
|
||||
#define KEY_DATABASE 0x1aa /* AL Database App */
|
||||
#define KEY_NEWS 0x1ab /* AL Newsreader */
|
||||
#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
|
||||
#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
|
||||
#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
|
||||
#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
|
||||
#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
|
||||
#define KEY_LOGOFF 0x1b1 /* AL Logoff */
|
||||
|
||||
#define KEY_DOLLAR 0x1b2
|
||||
#define KEY_EURO 0x1b3
|
||||
|
||||
#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
|
||||
#define KEY_FRAMEFORWARD 0x1b5
|
||||
#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
|
||||
#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
|
||||
#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
|
||||
#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
|
||||
#define KEY_IMAGES 0x1ba /* AL Image Browser */
|
||||
|
||||
#define KEY_DEL_EOL 0x1c0
|
||||
#define KEY_DEL_EOS 0x1c1
|
||||
#define KEY_INS_LINE 0x1c2
|
||||
#define KEY_DEL_LINE 0x1c3
|
||||
|
||||
#define KEY_FN 0x1d0
|
||||
#define KEY_FN_ESC 0x1d1
|
||||
#define KEY_FN_F1 0x1d2
|
||||
#define KEY_FN_F2 0x1d3
|
||||
#define KEY_FN_F3 0x1d4
|
||||
#define KEY_FN_F4 0x1d5
|
||||
#define KEY_FN_F5 0x1d6
|
||||
#define KEY_FN_F6 0x1d7
|
||||
#define KEY_FN_F7 0x1d8
|
||||
#define KEY_FN_F8 0x1d9
|
||||
#define KEY_FN_F9 0x1da
|
||||
#define KEY_FN_F10 0x1db
|
||||
#define KEY_FN_F11 0x1dc
|
||||
#define KEY_FN_F12 0x1dd
|
||||
#define KEY_FN_1 0x1de
|
||||
#define KEY_FN_2 0x1df
|
||||
#define KEY_FN_D 0x1e0
|
||||
#define KEY_FN_E 0x1e1
|
||||
#define KEY_FN_F 0x1e2
|
||||
#define KEY_FN_S 0x1e3
|
||||
#define KEY_FN_B 0x1e4
|
||||
|
||||
#define KEY_BRL_DOT1 0x1f1
|
||||
#define KEY_BRL_DOT2 0x1f2
|
||||
#define KEY_BRL_DOT3 0x1f3
|
||||
#define KEY_BRL_DOT4 0x1f4
|
||||
#define KEY_BRL_DOT5 0x1f5
|
||||
#define KEY_BRL_DOT6 0x1f6
|
||||
#define KEY_BRL_DOT7 0x1f7
|
||||
#define KEY_BRL_DOT8 0x1f8
|
||||
#define KEY_BRL_DOT9 0x1f9
|
||||
#define KEY_BRL_DOT10 0x1fa
|
||||
|
||||
#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
|
||||
#define KEY_NUMERIC_1 0x201 /* and other keypads */
|
||||
#define KEY_NUMERIC_2 0x202
|
||||
#define KEY_NUMERIC_3 0x203
|
||||
#define KEY_NUMERIC_4 0x204
|
||||
#define KEY_NUMERIC_5 0x205
|
||||
#define KEY_NUMERIC_6 0x206
|
||||
#define KEY_NUMERIC_7 0x207
|
||||
#define KEY_NUMERIC_8 0x208
|
||||
#define KEY_NUMERIC_9 0x209
|
||||
#define KEY_NUMERIC_STAR 0x20a
|
||||
#define KEY_NUMERIC_POUND 0x20b
|
||||
|
||||
#define KEY_CAMERA_FOCUS 0x210
|
||||
#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
|
||||
|
||||
#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */
|
||||
#define KEY_TOUCHPAD_ON 0x213
|
||||
#define KEY_TOUCHPAD_OFF 0x214
|
||||
|
||||
#define KEY_CAMERA_ZOOMIN 0x215
|
||||
#define KEY_CAMERA_ZOOMOUT 0x216
|
||||
#define KEY_CAMERA_UP 0x217
|
||||
#define KEY_CAMERA_DOWN 0x218
|
||||
#define KEY_CAMERA_LEFT 0x219
|
||||
#define KEY_CAMERA_RIGHT 0x21a
|
||||
|
||||
#define KEY_ATTENDANT_ON 0x21b
|
||||
#define KEY_ATTENDANT_OFF 0x21c
|
||||
#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */
|
||||
#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */
|
||||
|
||||
#define BTN_DPAD_UP 0x220
|
||||
#define BTN_DPAD_DOWN 0x221
|
||||
#define BTN_DPAD_LEFT 0x222
|
||||
#define BTN_DPAD_RIGHT 0x223
|
||||
|
||||
#define MATRIX_KEY(row, col, code) \
|
||||
((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF))
|
||||
|
||||
#endif /* _DT_BINDINGS_INPUT_INPUT_H */
|
||||
52
include/dt-bindings/mfd/as3722.h
Normal file
52
include/dt-bindings/mfd/as3722.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* This header provides macros for ams AS3722 device bindings.
|
||||
*
|
||||
* Copyright (c) 2013, NVIDIA Corporation.
|
||||
*
|
||||
* Author: Laxman Dewangan <ldewangan@nvidia.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __DT_BINDINGS_AS3722_H__
|
||||
#define __DT_BINDINGS_AS3722_H__
|
||||
|
||||
/* External control pins */
|
||||
#define AS3722_EXT_CONTROL_PIN_ENABLE1 1
|
||||
#define AS3722_EXT_CONTROL_PIN_ENABLE2 2
|
||||
#define AS3722_EXT_CONTROL_PIN_ENABLE2 3
|
||||
|
||||
/* Interrupt numbers for AS3722 */
|
||||
#define AS3722_IRQ_LID 0
|
||||
#define AS3722_IRQ_ACOK 1
|
||||
#define AS3722_IRQ_ENABLE1 2
|
||||
#define AS3722_IRQ_OCCUR_ALARM_SD0 3
|
||||
#define AS3722_IRQ_ONKEY_LONG_PRESS 4
|
||||
#define AS3722_IRQ_ONKEY 5
|
||||
#define AS3722_IRQ_OVTMP 6
|
||||
#define AS3722_IRQ_LOWBAT 7
|
||||
#define AS3722_IRQ_SD0_LV 8
|
||||
#define AS3722_IRQ_SD1_LV 9
|
||||
#define AS3722_IRQ_SD2_LV 10
|
||||
#define AS3722_IRQ_PWM1_OV_PROT 11
|
||||
#define AS3722_IRQ_PWM2_OV_PROT 12
|
||||
#define AS3722_IRQ_ENABLE2 13
|
||||
#define AS3722_IRQ_SD6_LV 14
|
||||
#define AS3722_IRQ_RTC_REP 15
|
||||
#define AS3722_IRQ_RTC_ALARM 16
|
||||
#define AS3722_IRQ_GPIO1 17
|
||||
#define AS3722_IRQ_GPIO2 18
|
||||
#define AS3722_IRQ_GPIO3 19
|
||||
#define AS3722_IRQ_GPIO4 20
|
||||
#define AS3722_IRQ_GPIO5 21
|
||||
#define AS3722_IRQ_WATCHDOG 22
|
||||
#define AS3722_IRQ_ENABLE3 23
|
||||
#define AS3722_IRQ_TEMP_SD0_SHUTDOWN 24
|
||||
#define AS3722_IRQ_TEMP_SD1_SHUTDOWN 25
|
||||
#define AS3722_IRQ_TEMP_SD2_SHUTDOWN 26
|
||||
#define AS3722_IRQ_TEMP_SD0_ALARM 27
|
||||
#define AS3722_IRQ_TEMP_SD1_ALARM 28
|
||||
#define AS3722_IRQ_TEMP_SD6_ALARM 29
|
||||
#define AS3722_IRQ_OCCUR_ALARM_SD6 30
|
||||
#define AS3722_IRQ_ADC 31
|
||||
|
||||
#endif /* __DT_BINDINGS_AS3722_H__ */
|
||||
83
include/dt-bindings/mfd/dbx500-prcmu.h
Normal file
83
include/dt-bindings/mfd/dbx500-prcmu.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* This header provides constants for the PRCMU bindings.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_MFD_PRCMU_H
|
||||
#define _DT_BINDINGS_MFD_PRCMU_H
|
||||
|
||||
/*
|
||||
* Clock identifiers.
|
||||
*/
|
||||
#define ARMCLK 0
|
||||
#define PRCMU_ACLK 1
|
||||
#define PRCMU_SVAMMCSPCLK 2
|
||||
#define PRCMU_SDMMCHCLK 2 /* DBx540 only. */
|
||||
#define PRCMU_SIACLK 3
|
||||
#define PRCMU_SIAMMDSPCLK 3 /* DBx540 only. */
|
||||
#define PRCMU_SGACLK 4
|
||||
#define PRCMU_UARTCLK 5
|
||||
#define PRCMU_MSP02CLK 6
|
||||
#define PRCMU_MSP1CLK 7
|
||||
#define PRCMU_I2CCLK 8
|
||||
#define PRCMU_SDMMCCLK 9
|
||||
#define PRCMU_SLIMCLK 10
|
||||
#define PRCMU_CAMCLK 10 /* DBx540 only. */
|
||||
#define PRCMU_PER1CLK 11
|
||||
#define PRCMU_PER2CLK 12
|
||||
#define PRCMU_PER3CLK 13
|
||||
#define PRCMU_PER5CLK 14
|
||||
#define PRCMU_PER6CLK 15
|
||||
#define PRCMU_PER7CLK 16
|
||||
#define PRCMU_LCDCLK 17
|
||||
#define PRCMU_BMLCLK 18
|
||||
#define PRCMU_HSITXCLK 19
|
||||
#define PRCMU_HSIRXCLK 20
|
||||
#define PRCMU_HDMICLK 21
|
||||
#define PRCMU_APEATCLK 22
|
||||
#define PRCMU_APETRACECLK 23
|
||||
#define PRCMU_MCDECLK 24
|
||||
#define PRCMU_IPI2CCLK 25
|
||||
#define PRCMU_DSIALTCLK 26
|
||||
#define PRCMU_DMACLK 27
|
||||
#define PRCMU_B2R2CLK 28
|
||||
#define PRCMU_TVCLK 29
|
||||
#define SPARE_UNIPROCLK 30
|
||||
#define PRCMU_SSPCLK 31
|
||||
#define PRCMU_RNGCLK 32
|
||||
#define PRCMU_UICCCLK 33
|
||||
#define PRCMU_G1CLK 34 /* DBx540 only. */
|
||||
#define PRCMU_HVACLK 35 /* DBx540 only. */
|
||||
#define PRCMU_SPARE1CLK 36
|
||||
#define PRCMU_SPARE2CLK 37
|
||||
|
||||
#define PRCMU_NUM_REG_CLOCKS 38
|
||||
|
||||
#define PRCMU_RTCCLK PRCMU_NUM_REG_CLOCKS
|
||||
#define PRCMU_SYSCLK 39
|
||||
#define PRCMU_CDCLK 40
|
||||
#define PRCMU_TIMCLK 41
|
||||
#define PRCMU_PLLSOC0 42
|
||||
#define PRCMU_PLLSOC1 43
|
||||
#define PRCMU_ARMSS 44
|
||||
#define PRCMU_PLLDDR 45
|
||||
|
||||
/* DSI Clocks */
|
||||
#define PRCMU_PLLDSI 46
|
||||
#define PRCMU_DSI0CLK 47
|
||||
#define PRCMU_DSI1CLK 48
|
||||
#define PRCMU_DSI0ESCCLK 49
|
||||
#define PRCMU_DSI1ESCCLK 50
|
||||
#define PRCMU_DSI2ESCCLK 51
|
||||
|
||||
/* LCD DSI PLL - Ux540 only */
|
||||
#define PRCMU_PLLDSI_LCD 52
|
||||
#define PRCMU_DSI0CLK_LCD 53
|
||||
#define PRCMU_DSI1CLK_LCD 54
|
||||
#define PRCMU_DSI0ESCCLK_LCD 55
|
||||
#define PRCMU_DSI1ESCCLK_LCD 56
|
||||
#define PRCMU_DSI2ESCCLK_LCD 57
|
||||
|
||||
#define PRCMU_NUM_CLKS 58
|
||||
|
||||
#endif
|
||||
31
include/dt-bindings/pinctrl/am43xx.h
Normal file
31
include/dt-bindings/pinctrl/am43xx.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* This header provides constants specific to AM43XX pinctrl bindings.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_PINCTRL_AM43XX_H
|
||||
#define _DT_BINDINGS_PINCTRL_AM43XX_H
|
||||
|
||||
#define MUX_MODE0 0
|
||||
#define MUX_MODE1 1
|
||||
#define MUX_MODE2 2
|
||||
#define MUX_MODE3 3
|
||||
#define MUX_MODE4 4
|
||||
#define MUX_MODE5 5
|
||||
#define MUX_MODE6 6
|
||||
#define MUX_MODE7 7
|
||||
|
||||
#define PULL_DISABLE (1 << 16)
|
||||
#define PULL_UP (1 << 17)
|
||||
#define INPUT_EN (1 << 18)
|
||||
#define SLEWCTRL_FAST (1 << 19)
|
||||
#define DS0_PULL_UP_DOWN_EN (1 << 27)
|
||||
|
||||
#define PIN_OUTPUT (PULL_DISABLE)
|
||||
#define PIN_OUTPUT_PULLUP (PULL_UP)
|
||||
#define PIN_OUTPUT_PULLDOWN 0
|
||||
#define PIN_INPUT (INPUT_EN | PULL_DISABLE)
|
||||
#define PIN_INPUT_PULLUP (INPUT_EN | PULL_UP)
|
||||
#define PIN_INPUT_PULLDOWN (INPUT_EN)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define AT91_PINCTRL_PULL_DOWN (1 << 3)
|
||||
#define AT91_PINCTRL_DIS_SCHMIT (1 << 4)
|
||||
#define AT91_PINCTRL_DEBOUNCE (1 << 16)
|
||||
#define AT91_PINCTRL_DEBOUNCE_VA(x) (x << 17)
|
||||
#define AT91_PINCTRL_DEBOUNCE_VAL(x) (x << 17)
|
||||
|
||||
#define AT91_PINCTRL_PULL_UP_DEGLITCH (AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DEGLITCH)
|
||||
|
||||
|
||||
50
include/dt-bindings/pinctrl/dra.h
Normal file
50
include/dt-bindings/pinctrl/dra.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This header provides constants for DRA pinctrl bindings.
|
||||
*
|
||||
* Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
|
||||
* Author: Rajendra Nayak <rnayak@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef _DT_BINDINGS_PINCTRL_DRA_H
|
||||
#define _DT_BINDINGS_PINCTRL_DRA_H
|
||||
|
||||
/* DRA7 mux mode options for each pin. See TRM for options */
|
||||
#define MUX_MODE0 0x0
|
||||
#define MUX_MODE1 0x1
|
||||
#define MUX_MODE2 0x2
|
||||
#define MUX_MODE3 0x3
|
||||
#define MUX_MODE4 0x4
|
||||
#define MUX_MODE5 0x5
|
||||
#define MUX_MODE6 0x6
|
||||
#define MUX_MODE7 0x7
|
||||
#define MUX_MODE8 0x8
|
||||
#define MUX_MODE9 0x9
|
||||
#define MUX_MODE10 0xa
|
||||
#define MUX_MODE11 0xb
|
||||
#define MUX_MODE12 0xc
|
||||
#define MUX_MODE13 0xd
|
||||
#define MUX_MODE14 0xe
|
||||
#define MUX_MODE15 0xf
|
||||
|
||||
#define PULL_ENA (1 << 16)
|
||||
#define PULL_UP (1 << 17)
|
||||
#define INPUT_EN (1 << 18)
|
||||
#define SLEWCONTROL (1 << 19)
|
||||
#define WAKEUP_EN (1 << 24)
|
||||
#define WAKEUP_EVENT (1 << 25)
|
||||
|
||||
/* Active pin states */
|
||||
#define PIN_OUTPUT 0
|
||||
#define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP)
|
||||
#define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA)
|
||||
#define PIN_INPUT INPUT_EN
|
||||
#define PIN_INPUT_SLEW (INPUT_EN | SLEWCONTROL)
|
||||
#define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP)
|
||||
#define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN)
|
||||
|
||||
#endif
|
||||
|
||||
36
include/dt-bindings/pinctrl/nomadik.h
Normal file
36
include/dt-bindings/pinctrl/nomadik.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* nomadik.h
|
||||
*
|
||||
* Copyright (C) ST-Ericsson SA 2013
|
||||
* Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
|
||||
* License terms: GNU General Public License (GPL), version 2
|
||||
*/
|
||||
|
||||
#define INPUT_NOPULL 0
|
||||
#define INPUT_PULLUP 1
|
||||
#define INPUT_PULLDOWN 2
|
||||
|
||||
#define OUTPUT_LOW 0
|
||||
#define OUTPUT_HIGH 1
|
||||
#define DIR_OUTPUT 2
|
||||
|
||||
#define SLPM_DISABLED 0
|
||||
#define SLPM_ENABLED 1
|
||||
|
||||
#define SLPM_INPUT_NOPULL 0
|
||||
#define SLPM_INPUT_PULLUP 1
|
||||
#define SLPM_INPUT_PULLDOWN 2
|
||||
#define SLPM_DIR_INPUT 3
|
||||
|
||||
#define SLPM_OUTPUT_LOW 0
|
||||
#define SLPM_OUTPUT_HIGH 1
|
||||
#define SLPM_DIR_OUTPUT 2
|
||||
|
||||
#define SLPM_WAKEUP_DISABLE 0
|
||||
#define SLPM_WAKEUP_ENABLE 1
|
||||
|
||||
#define GPIOMODE_DISABLED 0
|
||||
#define GPIOMODE_ENABLED 1
|
||||
|
||||
#define SLPM_PDIS_DISABLED 0
|
||||
#define SLPM_PDIS_ENABLED 1
|
||||
@@ -23,7 +23,7 @@
|
||||
#define PULL_UP (1 << 4)
|
||||
#define ALTELECTRICALSEL (1 << 5)
|
||||
|
||||
/* 34xx specific mux bit defines */
|
||||
/* omap3/4/5 specific mux bit defines */
|
||||
#define INPUT_EN (1 << 8)
|
||||
#define OFF_EN (1 << 9)
|
||||
#define OFFOUT_EN (1 << 10)
|
||||
@@ -31,8 +31,6 @@
|
||||
#define OFF_PULL_EN (1 << 12)
|
||||
#define OFF_PULL_UP (1 << 13)
|
||||
#define WAKEUP_EN (1 << 14)
|
||||
|
||||
/* 44xx specific mux bit defines */
|
||||
#define WAKEUP_EVENT (1 << 15)
|
||||
|
||||
/* Active pin states */
|
||||
|
||||
25
include/keys/big_key-type.h
Normal file
25
include/keys/big_key-type.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Big capacity key type.
|
||||
*
|
||||
* Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _KEYS_BIG_KEY_TYPE_H
|
||||
#define _KEYS_BIG_KEY_TYPE_H
|
||||
|
||||
#include <linux/key-type.h>
|
||||
|
||||
extern struct key_type key_type_big_key;
|
||||
|
||||
extern int big_key_instantiate(struct key *key, struct key_preparsed_payload *prep);
|
||||
extern void big_key_revoke(struct key *key);
|
||||
extern void big_key_destroy(struct key *key);
|
||||
extern void big_key_describe(const struct key *big_key, struct seq_file *m);
|
||||
extern long big_key_read(const struct key *key, char __user *buffer, size_t buflen);
|
||||
|
||||
#endif /* _KEYS_BIG_KEY_TYPE_H */
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Keyring key type
|
||||
*
|
||||
* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
|
||||
* Copyright (C) 2008, 2013 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -13,19 +13,6 @@
|
||||
#define _KEYS_KEYRING_TYPE_H
|
||||
|
||||
#include <linux/key.h>
|
||||
#include <linux/rcupdate.h>
|
||||
|
||||
/*
|
||||
* the keyring payload contains a list of the keys to which the keyring is
|
||||
* subscribed
|
||||
*/
|
||||
struct keyring_list {
|
||||
struct rcu_head rcu; /* RCU deletion hook */
|
||||
unsigned short maxkeys; /* max keys this list can hold */
|
||||
unsigned short nkeys; /* number of keys currently held */
|
||||
unsigned short delkey; /* key to be unlinked by RCU */
|
||||
struct key __rcu *keys[0];
|
||||
};
|
||||
|
||||
#include <linux/assoc_array.h>
|
||||
|
||||
#endif /* _KEYS_KEYRING_TYPE_H */
|
||||
|
||||
23
include/keys/system_keyring.h
Normal file
23
include/keys/system_keyring.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* System keyring containing trusted public keys.
|
||||
*
|
||||
* Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _KEYS_SYSTEM_KEYRING_H
|
||||
#define _KEYS_SYSTEM_KEYRING_H
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
|
||||
|
||||
#include <linux/key.h>
|
||||
|
||||
extern struct key *system_trusted_keyring;
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _KEYS_SYSTEM_KEYRING_H */
|
||||
@@ -44,6 +44,20 @@
|
||||
#include <acpi/acpi_numa.h>
|
||||
#include <asm/acpi.h>
|
||||
|
||||
static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
|
||||
{
|
||||
return adev ? adev->handle : NULL;
|
||||
}
|
||||
|
||||
#define ACPI_COMPANION(dev) ((dev)->acpi_node.companion)
|
||||
#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev)
|
||||
#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
|
||||
|
||||
static inline const char *acpi_dev_name(struct acpi_device *adev)
|
||||
{
|
||||
return dev_name(&adev->dev);
|
||||
}
|
||||
|
||||
enum acpi_irq_model_id {
|
||||
ACPI_IRQ_MODEL_PIC = 0,
|
||||
ACPI_IRQ_MODEL_IOAPIC,
|
||||
@@ -116,7 +130,7 @@ void acpi_numa_arch_fixup(void);
|
||||
|
||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||
/* Arch dependent functions for cpu hotplug support */
|
||||
int acpi_map_lsapic(acpi_handle handle, int *pcpu);
|
||||
int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);
|
||||
int acpi_unmap_lsapic(int cpu);
|
||||
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
|
||||
|
||||
@@ -294,58 +308,52 @@ void __init acpi_nvs_nosave_s3(void);
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
struct acpi_osc_context {
|
||||
char *uuid_str; /* uuid string */
|
||||
char *uuid_str; /* UUID string */
|
||||
int rev;
|
||||
struct acpi_buffer cap; /* arg2/arg3 */
|
||||
struct acpi_buffer ret; /* free by caller if success */
|
||||
struct acpi_buffer cap; /* list of DWORD capabilities */
|
||||
struct acpi_buffer ret; /* free by caller if success */
|
||||
};
|
||||
|
||||
#define OSC_QUERY_TYPE 0
|
||||
#define OSC_SUPPORT_TYPE 1
|
||||
#define OSC_CONTROL_TYPE 2
|
||||
|
||||
/* _OSC DW0 Definition */
|
||||
#define OSC_QUERY_ENABLE 1
|
||||
#define OSC_REQUEST_ERROR 2
|
||||
#define OSC_INVALID_UUID_ERROR 4
|
||||
#define OSC_INVALID_REVISION_ERROR 8
|
||||
#define OSC_CAPABILITIES_MASK_ERROR 16
|
||||
|
||||
acpi_status acpi_str_to_uuid(char *str, u8 *uuid);
|
||||
acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
||||
|
||||
/* platform-wide _OSC bits */
|
||||
#define OSC_SB_PAD_SUPPORT 1
|
||||
#define OSC_SB_PPC_OST_SUPPORT 2
|
||||
#define OSC_SB_PR3_SUPPORT 4
|
||||
#define OSC_SB_HOTPLUG_OST_SUPPORT 8
|
||||
#define OSC_SB_APEI_SUPPORT 16
|
||||
/* Indexes into _OSC Capabilities Buffer (DWORDs 2 & 3 are device-specific) */
|
||||
#define OSC_QUERY_DWORD 0 /* DWORD 1 */
|
||||
#define OSC_SUPPORT_DWORD 1 /* DWORD 2 */
|
||||
#define OSC_CONTROL_DWORD 2 /* DWORD 3 */
|
||||
|
||||
/* _OSC Capabilities DWORD 1: Query/Control and Error Returns (generic) */
|
||||
#define OSC_QUERY_ENABLE 0x00000001 /* input */
|
||||
#define OSC_REQUEST_ERROR 0x00000002 /* return */
|
||||
#define OSC_INVALID_UUID_ERROR 0x00000004 /* return */
|
||||
#define OSC_INVALID_REVISION_ERROR 0x00000008 /* return */
|
||||
#define OSC_CAPABILITIES_MASK_ERROR 0x00000010 /* return */
|
||||
|
||||
/* Platform-Wide Capabilities _OSC: Capabilities DWORD 2: Support Field */
|
||||
#define OSC_SB_PAD_SUPPORT 0x00000001
|
||||
#define OSC_SB_PPC_OST_SUPPORT 0x00000002
|
||||
#define OSC_SB_PR3_SUPPORT 0x00000004
|
||||
#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008
|
||||
#define OSC_SB_APEI_SUPPORT 0x00000010
|
||||
#define OSC_SB_CPC_SUPPORT 0x00000020
|
||||
|
||||
extern bool osc_sb_apei_support_acked;
|
||||
|
||||
/* PCI defined _OSC bits */
|
||||
/* _OSC DW1 Definition (OS Support Fields) */
|
||||
#define OSC_EXT_PCI_CONFIG_SUPPORT 1
|
||||
#define OSC_ACTIVE_STATE_PWR_SUPPORT 2
|
||||
#define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4
|
||||
#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8
|
||||
#define OSC_MSI_SUPPORT 16
|
||||
#define OSC_PCI_SUPPORT_MASKS 0x1f
|
||||
/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */
|
||||
#define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001
|
||||
#define OSC_PCI_ASPM_SUPPORT 0x00000002
|
||||
#define OSC_PCI_CLOCK_PM_SUPPORT 0x00000004
|
||||
#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 0x00000008
|
||||
#define OSC_PCI_MSI_SUPPORT 0x00000010
|
||||
#define OSC_PCI_SUPPORT_MASKS 0x0000001f
|
||||
|
||||
/* _OSC DW1 Definition (OS Control Fields) */
|
||||
#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1
|
||||
#define OSC_SHPC_NATIVE_HP_CONTROL 2
|
||||
#define OSC_PCI_EXPRESS_PME_CONTROL 4
|
||||
#define OSC_PCI_EXPRESS_AER_CONTROL 8
|
||||
#define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16
|
||||
|
||||
#define OSC_PCI_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \
|
||||
OSC_SHPC_NATIVE_HP_CONTROL | \
|
||||
OSC_PCI_EXPRESS_PME_CONTROL | \
|
||||
OSC_PCI_EXPRESS_AER_CONTROL | \
|
||||
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
|
||||
|
||||
#define OSC_PCI_NATIVE_HOTPLUG (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \
|
||||
OSC_SHPC_NATIVE_HP_CONTROL)
|
||||
/* PCI Host Bridge _OSC: Capabilities DWORD 3: Control Field */
|
||||
#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 0x00000001
|
||||
#define OSC_PCI_SHPC_NATIVE_HP_CONTROL 0x00000002
|
||||
#define OSC_PCI_EXPRESS_PME_CONTROL 0x00000004
|
||||
#define OSC_PCI_EXPRESS_AER_CONTROL 0x00000008
|
||||
#define OSC_PCI_EXPRESS_CAPABILITY_CONTROL 0x00000010
|
||||
#define OSC_PCI_CONTROL_MASKS 0x0000001f
|
||||
|
||||
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
|
||||
u32 *mask, u32 req);
|
||||
@@ -407,6 +415,15 @@ static inline bool acpi_driver_match_device(struct device *dev,
|
||||
|
||||
#define acpi_disabled 1
|
||||
|
||||
#define ACPI_COMPANION(dev) (NULL)
|
||||
#define ACPI_COMPANION_SET(dev, adev) do { } while (0)
|
||||
#define ACPI_HANDLE(dev) (NULL)
|
||||
|
||||
static inline const char *acpi_dev_name(struct acpi_device *adev)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void acpi_early_init(void) { }
|
||||
|
||||
static inline int early_acpi_boot_init(void)
|
||||
|
||||
@@ -2,36 +2,35 @@
|
||||
#define _LINUX_ACPI_GPIO_H_
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
||||
/**
|
||||
* struct acpi_gpio_info - ACPI GPIO specific information
|
||||
* @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
|
||||
* @active_low: in case of @gpioint, the pin is active low
|
||||
*/
|
||||
struct acpi_gpio_info {
|
||||
bool gpioint;
|
||||
bool active_low;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_GPIO_ACPI
|
||||
|
||||
int acpi_get_gpio(char *path, int pin);
|
||||
int acpi_get_gpio_by_index(struct device *dev, int index,
|
||||
struct acpi_gpio_info *info);
|
||||
struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
|
||||
struct acpi_gpio_info *info);
|
||||
void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
|
||||
void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
|
||||
|
||||
#else /* CONFIG_GPIO_ACPI */
|
||||
|
||||
static inline int acpi_get_gpio(char *path, int pin)
|
||||
static inline struct gpio_desc *
|
||||
acpi_get_gpiod_by_index(struct device *dev, int index,
|
||||
struct acpi_gpio_info *info)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int acpi_get_gpio_by_index(struct device *dev, int index,
|
||||
struct acpi_gpio_info *info)
|
||||
{
|
||||
return -ENODEV;
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
|
||||
@@ -39,4 +38,14 @@ static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
|
||||
|
||||
#endif /* CONFIG_GPIO_ACPI */
|
||||
|
||||
static inline int acpi_get_gpio_by_index(struct device *dev, int index,
|
||||
struct acpi_gpio_info *info)
|
||||
{
|
||||
struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info);
|
||||
|
||||
if (IS_ERR(desc))
|
||||
return PTR_ERR(desc);
|
||||
return desc_to_gpio(desc);
|
||||
}
|
||||
|
||||
#endif /* _LINUX_ACPI_GPIO_H_ */
|
||||
|
||||
@@ -27,15 +27,13 @@ struct kiocb;
|
||||
*/
|
||||
#define KIOCB_CANCELLED ((void *) (~0ULL))
|
||||
|
||||
typedef int (kiocb_cancel_fn)(struct kiocb *, struct io_event *);
|
||||
typedef int (kiocb_cancel_fn)(struct kiocb *);
|
||||
|
||||
struct kiocb {
|
||||
atomic_t ki_users;
|
||||
|
||||
struct file *ki_filp;
|
||||
struct kioctx *ki_ctx; /* NULL for sync ops */
|
||||
kiocb_cancel_fn *ki_cancel;
|
||||
void (*ki_dtor)(struct kiocb *);
|
||||
void *private;
|
||||
|
||||
union {
|
||||
void __user *user;
|
||||
@@ -44,17 +42,7 @@ struct kiocb {
|
||||
|
||||
__u64 ki_user_data; /* user's data for completion */
|
||||
loff_t ki_pos;
|
||||
|
||||
void *private;
|
||||
/* State that we remember to be able to restart/retry */
|
||||
unsigned short ki_opcode;
|
||||
size_t ki_nbytes; /* copy of iocb->aio_nbytes */
|
||||
char __user *ki_buf; /* remaining iocb->aio_buf */
|
||||
size_t ki_left; /* remaining bytes */
|
||||
struct iovec ki_inline_vec; /* inline vector */
|
||||
struct iovec *ki_iovec;
|
||||
unsigned long ki_nr_segs;
|
||||
unsigned long ki_cur_seg;
|
||||
size_t ki_nbytes; /* copy of iocb->aio_nbytes */
|
||||
|
||||
struct list_head ki_list; /* the aio core uses this
|
||||
* for cancellation */
|
||||
@@ -74,7 +62,6 @@ static inline bool is_sync_kiocb(struct kiocb *kiocb)
|
||||
static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
|
||||
{
|
||||
*kiocb = (struct kiocb) {
|
||||
.ki_users = ATOMIC_INIT(1),
|
||||
.ki_ctx = NULL,
|
||||
.ki_filp = filp,
|
||||
.ki_obj.tsk = current,
|
||||
@@ -84,7 +71,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
|
||||
/* prototypes */
|
||||
#ifdef CONFIG_AIO
|
||||
extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
|
||||
extern void aio_put_req(struct kiocb *iocb);
|
||||
extern void aio_complete(struct kiocb *iocb, long res, long res2);
|
||||
struct mm_struct;
|
||||
extern void exit_aio(struct mm_struct *mm);
|
||||
@@ -93,7 +79,6 @@ extern long do_io_submit(aio_context_t ctx_id, long nr,
|
||||
void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
|
||||
#else
|
||||
static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
|
||||
static inline void aio_put_req(struct kiocb *iocb) { }
|
||||
static inline void aio_complete(struct kiocb *iocb, long res, long res2) { }
|
||||
struct mm_struct;
|
||||
static inline void exit_aio(struct mm_struct *mm) { }
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <linux/resource.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
|
||||
#define AMBA_NR_IRQS 2
|
||||
#define AMBA_NR_IRQS 9
|
||||
#define AMBA_CID 0xb105f00d
|
||||
|
||||
struct clk;
|
||||
@@ -30,7 +30,6 @@ struct amba_device {
|
||||
struct device dev;
|
||||
struct resource res;
|
||||
struct clk *pclk;
|
||||
u64 dma_mask;
|
||||
unsigned int periphid;
|
||||
unsigned int irq[AMBA_NR_IRQS];
|
||||
};
|
||||
@@ -131,7 +130,6 @@ struct amba_device name##_device = { \
|
||||
struct amba_device name##_device = { \
|
||||
.dev = __AMBA_DEV(busid, data, ~0ULL), \
|
||||
.res = DEFINE_RES_MEM(base, SZ_4K), \
|
||||
.dma_mask = ~0ULL, \
|
||||
.irq = irqs, \
|
||||
.periphid = id, \
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12)
|
||||
#define PL080_CONTROL_SB_SIZE_SHIFT (12)
|
||||
#define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0)
|
||||
#define PL080S_CONTROL_TRANSFER_SIZE_MASK (0x1ffffff << 0)
|
||||
#define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0)
|
||||
|
||||
#define PL080_BSIZE_1 (0x0)
|
||||
|
||||
92
include/linux/assoc_array.h
Normal file
92
include/linux/assoc_array.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/* Generic associative array implementation.
|
||||
*
|
||||
* See Documentation/assoc_array.txt for information.
|
||||
*
|
||||
* Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ASSOC_ARRAY_H
|
||||
#define _LINUX_ASSOC_ARRAY_H
|
||||
|
||||
#ifdef CONFIG_ASSOCIATIVE_ARRAY
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define ASSOC_ARRAY_KEY_CHUNK_SIZE BITS_PER_LONG /* Key data retrieved in chunks of this size */
|
||||
|
||||
/*
|
||||
* Generic associative array.
|
||||
*/
|
||||
struct assoc_array {
|
||||
struct assoc_array_ptr *root; /* The node at the root of the tree */
|
||||
unsigned long nr_leaves_on_tree;
|
||||
};
|
||||
|
||||
/*
|
||||
* Operations on objects and index keys for use by array manipulation routines.
|
||||
*/
|
||||
struct assoc_array_ops {
|
||||
/* Method to get a chunk of an index key from caller-supplied data */
|
||||
unsigned long (*get_key_chunk)(const void *index_key, int level);
|
||||
|
||||
/* Method to get a piece of an object's index key */
|
||||
unsigned long (*get_object_key_chunk)(const void *object, int level);
|
||||
|
||||
/* Is this the object we're looking for? */
|
||||
bool (*compare_object)(const void *object, const void *index_key);
|
||||
|
||||
/* How different is an object from an index key, to a bit position in
|
||||
* their keys? (or -1 if they're the same)
|
||||
*/
|
||||
int (*diff_objects)(const void *object, const void *index_key);
|
||||
|
||||
/* Method to free an object. */
|
||||
void (*free_object)(void *object);
|
||||
};
|
||||
|
||||
/*
|
||||
* Access and manipulation functions.
|
||||
*/
|
||||
struct assoc_array_edit;
|
||||
|
||||
static inline void assoc_array_init(struct assoc_array *array)
|
||||
{
|
||||
array->root = NULL;
|
||||
array->nr_leaves_on_tree = 0;
|
||||
}
|
||||
|
||||
extern int assoc_array_iterate(const struct assoc_array *array,
|
||||
int (*iterator)(const void *object,
|
||||
void *iterator_data),
|
||||
void *iterator_data);
|
||||
extern void *assoc_array_find(const struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops,
|
||||
const void *index_key);
|
||||
extern void assoc_array_destroy(struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops);
|
||||
extern struct assoc_array_edit *assoc_array_insert(struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops,
|
||||
const void *index_key,
|
||||
void *object);
|
||||
extern void assoc_array_insert_set_object(struct assoc_array_edit *edit,
|
||||
void *object);
|
||||
extern struct assoc_array_edit *assoc_array_delete(struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops,
|
||||
const void *index_key);
|
||||
extern struct assoc_array_edit *assoc_array_clear(struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops);
|
||||
extern void assoc_array_apply_edit(struct assoc_array_edit *edit);
|
||||
extern void assoc_array_cancel_edit(struct assoc_array_edit *edit);
|
||||
extern int assoc_array_gc(struct assoc_array *array,
|
||||
const struct assoc_array_ops *ops,
|
||||
bool (*iterator)(void *object, void *iterator_data),
|
||||
void *iterator_data);
|
||||
|
||||
#endif /* CONFIG_ASSOCIATIVE_ARRAY */
|
||||
#endif /* _LINUX_ASSOC_ARRAY_H */
|
||||
182
include/linux/assoc_array_priv.h
Normal file
182
include/linux/assoc_array_priv.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/* Private definitions for the generic associative array implementation.
|
||||
*
|
||||
* See Documentation/assoc_array.txt for information.
|
||||
*
|
||||
* Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
|
||||
* Written by David Howells (dhowells@redhat.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public Licence
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the Licence, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_ASSOC_ARRAY_PRIV_H
|
||||
#define _LINUX_ASSOC_ARRAY_PRIV_H
|
||||
|
||||
#ifdef CONFIG_ASSOCIATIVE_ARRAY
|
||||
|
||||
#include <linux/assoc_array.h>
|
||||
|
||||
#define ASSOC_ARRAY_FAN_OUT 16 /* Number of slots per node */
|
||||
#define ASSOC_ARRAY_FAN_MASK (ASSOC_ARRAY_FAN_OUT - 1)
|
||||
#define ASSOC_ARRAY_LEVEL_STEP (ilog2(ASSOC_ARRAY_FAN_OUT))
|
||||
#define ASSOC_ARRAY_LEVEL_STEP_MASK (ASSOC_ARRAY_LEVEL_STEP - 1)
|
||||
#define ASSOC_ARRAY_KEY_CHUNK_MASK (ASSOC_ARRAY_KEY_CHUNK_SIZE - 1)
|
||||
#define ASSOC_ARRAY_KEY_CHUNK_SHIFT (ilog2(BITS_PER_LONG))
|
||||
|
||||
/*
|
||||
* Undefined type representing a pointer with type information in the bottom
|
||||
* two bits.
|
||||
*/
|
||||
struct assoc_array_ptr;
|
||||
|
||||
/*
|
||||
* An N-way node in the tree.
|
||||
*
|
||||
* Each slot contains one of four things:
|
||||
*
|
||||
* (1) Nothing (NULL).
|
||||
*
|
||||
* (2) A leaf object (pointer types 0).
|
||||
*
|
||||
* (3) A next-level node (pointer type 1, subtype 0).
|
||||
*
|
||||
* (4) A shortcut (pointer type 1, subtype 1).
|
||||
*
|
||||
* The tree is optimised for search-by-ID, but permits reasonable iteration
|
||||
* also.
|
||||
*
|
||||
* The tree is navigated by constructing an index key consisting of an array of
|
||||
* segments, where each segment is ilog2(ASSOC_ARRAY_FAN_OUT) bits in size.
|
||||
*
|
||||
* The segments correspond to levels of the tree (the first segment is used at
|
||||
* level 0, the second at level 1, etc.).
|
||||
*/
|
||||
struct assoc_array_node {
|
||||
struct assoc_array_ptr *back_pointer;
|
||||
u8 parent_slot;
|
||||
struct assoc_array_ptr *slots[ASSOC_ARRAY_FAN_OUT];
|
||||
unsigned long nr_leaves_on_branch;
|
||||
};
|
||||
|
||||
/*
|
||||
* A shortcut through the index space out to where a collection of nodes/leaves
|
||||
* with the same IDs live.
|
||||
*/
|
||||
struct assoc_array_shortcut {
|
||||
struct assoc_array_ptr *back_pointer;
|
||||
int parent_slot;
|
||||
int skip_to_level;
|
||||
struct assoc_array_ptr *next_node;
|
||||
unsigned long index_key[];
|
||||
};
|
||||
|
||||
/*
|
||||
* Preallocation cache.
|
||||
*/
|
||||
struct assoc_array_edit {
|
||||
struct rcu_head rcu;
|
||||
struct assoc_array *array;
|
||||
const struct assoc_array_ops *ops;
|
||||
const struct assoc_array_ops *ops_for_excised_subtree;
|
||||
struct assoc_array_ptr *leaf;
|
||||
struct assoc_array_ptr **leaf_p;
|
||||
struct assoc_array_ptr *dead_leaf;
|
||||
struct assoc_array_ptr *new_meta[3];
|
||||
struct assoc_array_ptr *excised_meta[1];
|
||||
struct assoc_array_ptr *excised_subtree;
|
||||
struct assoc_array_ptr **set_backpointers[ASSOC_ARRAY_FAN_OUT];
|
||||
struct assoc_array_ptr *set_backpointers_to;
|
||||
struct assoc_array_node *adjust_count_on;
|
||||
long adjust_count_by;
|
||||
struct {
|
||||
struct assoc_array_ptr **ptr;
|
||||
struct assoc_array_ptr *to;
|
||||
} set[2];
|
||||
struct {
|
||||
u8 *p;
|
||||
u8 to;
|
||||
} set_parent_slot[1];
|
||||
u8 segment_cache[ASSOC_ARRAY_FAN_OUT + 1];
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal tree member pointers are marked in the bottom one or two bits to
|
||||
* indicate what type they are so that we don't have to look behind every
|
||||
* pointer to see what it points to.
|
||||
*
|
||||
* We provide functions to test type annotations and to create and translate
|
||||
* the annotated pointers.
|
||||
*/
|
||||
#define ASSOC_ARRAY_PTR_TYPE_MASK 0x1UL
|
||||
#define ASSOC_ARRAY_PTR_LEAF_TYPE 0x0UL /* Points to leaf (or nowhere) */
|
||||
#define ASSOC_ARRAY_PTR_META_TYPE 0x1UL /* Points to node or shortcut */
|
||||
#define ASSOC_ARRAY_PTR_SUBTYPE_MASK 0x2UL
|
||||
#define ASSOC_ARRAY_PTR_NODE_SUBTYPE 0x0UL
|
||||
#define ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE 0x2UL
|
||||
|
||||
static inline bool assoc_array_ptr_is_meta(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (unsigned long)x & ASSOC_ARRAY_PTR_TYPE_MASK;
|
||||
}
|
||||
static inline bool assoc_array_ptr_is_leaf(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return !assoc_array_ptr_is_meta(x);
|
||||
}
|
||||
static inline bool assoc_array_ptr_is_shortcut(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (unsigned long)x & ASSOC_ARRAY_PTR_SUBTYPE_MASK;
|
||||
}
|
||||
static inline bool assoc_array_ptr_is_node(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return !assoc_array_ptr_is_shortcut(x);
|
||||
}
|
||||
|
||||
static inline void *assoc_array_ptr_to_leaf(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (void *)((unsigned long)x & ~ASSOC_ARRAY_PTR_TYPE_MASK);
|
||||
}
|
||||
|
||||
static inline
|
||||
unsigned long __assoc_array_ptr_to_meta(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (unsigned long)x &
|
||||
~(ASSOC_ARRAY_PTR_SUBTYPE_MASK | ASSOC_ARRAY_PTR_TYPE_MASK);
|
||||
}
|
||||
static inline
|
||||
struct assoc_array_node *assoc_array_ptr_to_node(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (struct assoc_array_node *)__assoc_array_ptr_to_meta(x);
|
||||
}
|
||||
static inline
|
||||
struct assoc_array_shortcut *assoc_array_ptr_to_shortcut(const struct assoc_array_ptr *x)
|
||||
{
|
||||
return (struct assoc_array_shortcut *)__assoc_array_ptr_to_meta(x);
|
||||
}
|
||||
|
||||
static inline
|
||||
struct assoc_array_ptr *__assoc_array_x_to_ptr(const void *p, unsigned long t)
|
||||
{
|
||||
return (struct assoc_array_ptr *)((unsigned long)p | t);
|
||||
}
|
||||
static inline
|
||||
struct assoc_array_ptr *assoc_array_leaf_to_ptr(const void *p)
|
||||
{
|
||||
return __assoc_array_x_to_ptr(p, ASSOC_ARRAY_PTR_LEAF_TYPE);
|
||||
}
|
||||
static inline
|
||||
struct assoc_array_ptr *assoc_array_node_to_ptr(const struct assoc_array_node *p)
|
||||
{
|
||||
return __assoc_array_x_to_ptr(
|
||||
p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_NODE_SUBTYPE);
|
||||
}
|
||||
static inline
|
||||
struct assoc_array_ptr *assoc_array_shortcut_to_ptr(const struct assoc_array_shortcut *p)
|
||||
{
|
||||
return __assoc_array_x_to_ptr(
|
||||
p, ASSOC_ARRAY_PTR_META_TYPE | ASSOC_ARRAY_PTR_SHORTCUT_SUBTYPE);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ASSOCIATIVE_ARRAY */
|
||||
#endif /* _LINUX_ASSOC_ARRAY_PRIV_H */
|
||||
@@ -219,6 +219,7 @@ enum {
|
||||
ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
|
||||
ATA_CMD_EDD = 0x90, /* execute device diagnostic */
|
||||
ATA_CMD_DOWNLOAD_MICRO = 0x92,
|
||||
ATA_CMD_DOWNLOAD_MICRO_DMA = 0x93,
|
||||
ATA_CMD_NOP = 0x00,
|
||||
ATA_CMD_FLUSH = 0xE7,
|
||||
ATA_CMD_FLUSH_EXT = 0xEA,
|
||||
@@ -268,12 +269,15 @@ enum {
|
||||
ATA_CMD_WRITE_LOG_EXT = 0x3F,
|
||||
ATA_CMD_READ_LOG_DMA_EXT = 0x47,
|
||||
ATA_CMD_WRITE_LOG_DMA_EXT = 0x57,
|
||||
ATA_CMD_TRUSTED_NONDATA = 0x5B,
|
||||
ATA_CMD_TRUSTED_RCV = 0x5C,
|
||||
ATA_CMD_TRUSTED_RCV_DMA = 0x5D,
|
||||
ATA_CMD_TRUSTED_SND = 0x5E,
|
||||
ATA_CMD_TRUSTED_SND_DMA = 0x5F,
|
||||
ATA_CMD_PMP_READ = 0xE4,
|
||||
ATA_CMD_PMP_READ_DMA = 0xE9,
|
||||
ATA_CMD_PMP_WRITE = 0xE8,
|
||||
ATA_CMD_PMP_WRITE_DMA = 0xEB,
|
||||
ATA_CMD_CONF_OVERLAY = 0xB1,
|
||||
ATA_CMD_SEC_SET_PASS = 0xF1,
|
||||
ATA_CMD_SEC_UNLOCK = 0xF2,
|
||||
@@ -292,6 +296,9 @@ enum {
|
||||
ATA_CMD_CFA_TRANS_SECT = 0x87,
|
||||
ATA_CMD_CFA_ERASE = 0xC0,
|
||||
ATA_CMD_CFA_WRITE_MULT_NE = 0xCD,
|
||||
ATA_CMD_REQ_SENSE_DATA = 0x0B,
|
||||
ATA_CMD_SANITIZE_DEVICE = 0xB4,
|
||||
|
||||
/* marked obsolete in the ATA/ATAPI-7 spec */
|
||||
ATA_CMD_RESTORE = 0x10,
|
||||
|
||||
|
||||
@@ -125,5 +125,6 @@
|
||||
#define ATMEL_US_IF 0x4c /* IrDA Filter Register */
|
||||
|
||||
#define ATMEL_US_NAME 0xf0 /* Ip Name */
|
||||
#define ATMEL_US_VERSION 0xfc /* Ip Version */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -73,6 +73,8 @@ struct audit_field {
|
||||
void *lsm_rule;
|
||||
};
|
||||
|
||||
extern int is_audit_feature_set(int which);
|
||||
|
||||
extern int __init audit_register_class(int class, unsigned *list);
|
||||
extern int audit_classify_syscall(int abi, unsigned syscall);
|
||||
extern int audit_classify_arch(int arch);
|
||||
@@ -207,7 +209,7 @@ static inline int audit_get_sessionid(struct task_struct *tsk)
|
||||
|
||||
extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
|
||||
extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
|
||||
extern int __audit_bprm(struct linux_binprm *bprm);
|
||||
extern void __audit_bprm(struct linux_binprm *bprm);
|
||||
extern int __audit_socketcall(int nargs, unsigned long *args);
|
||||
extern int __audit_sockaddr(int len, void *addr);
|
||||
extern void __audit_fd_pair(int fd1, int fd2);
|
||||
@@ -236,11 +238,10 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_ipc_set_perm(qbytes, uid, gid, mode);
|
||||
}
|
||||
static inline int audit_bprm(struct linux_binprm *bprm)
|
||||
static inline void audit_bprm(struct linux_binprm *bprm)
|
||||
{
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_bprm(bprm);
|
||||
return 0;
|
||||
__audit_bprm(bprm);
|
||||
}
|
||||
static inline int audit_socketcall(int nargs, unsigned long *args)
|
||||
{
|
||||
@@ -367,10 +368,8 @@ static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid,
|
||||
gid_t gid, umode_t mode)
|
||||
{ }
|
||||
static inline int audit_bprm(struct linux_binprm *bprm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void audit_bprm(struct linux_binprm *bprm)
|
||||
{ }
|
||||
static inline int audit_socketcall(int nargs, unsigned long *args)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -109,7 +109,7 @@ struct backing_dev_info {
|
||||
#endif
|
||||
};
|
||||
|
||||
int bdi_init(struct backing_dev_info *bdi);
|
||||
int __must_check bdi_init(struct backing_dev_info *bdi);
|
||||
void bdi_destroy(struct backing_dev_info *bdi);
|
||||
|
||||
__printf(3, 4)
|
||||
@@ -117,7 +117,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
|
||||
const char *fmt, ...);
|
||||
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
|
||||
void bdi_unregister(struct backing_dev_info *bdi);
|
||||
int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
|
||||
int __must_check bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
|
||||
void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
|
||||
enum wb_reason reason);
|
||||
void bdi_start_background_writeback(struct backing_dev_info *bdi);
|
||||
@@ -243,6 +243,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
|
||||
* BDI_CAP_EXEC_MAP: Can be mapped for execution
|
||||
*
|
||||
* BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed.
|
||||
*
|
||||
* BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold.
|
||||
*/
|
||||
#define BDI_CAP_NO_ACCT_DIRTY 0x00000001
|
||||
#define BDI_CAP_NO_WRITEBACK 0x00000002
|
||||
@@ -254,6 +256,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
|
||||
#define BDI_CAP_NO_ACCT_WB 0x00000080
|
||||
#define BDI_CAP_SWAP_BACKED 0x00000100
|
||||
#define BDI_CAP_STABLE_WRITES 0x00000200
|
||||
#define BDI_CAP_STRICTLIMIT 0x00000400
|
||||
|
||||
#define BDI_CAP_VMFLAGS \
|
||||
(BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP)
|
||||
|
||||
@@ -100,6 +100,9 @@ struct backlight_device {
|
||||
/* The framebuffer notifier block */
|
||||
struct notifier_block fb_notif;
|
||||
|
||||
/* list entry of all registered backlight devices */
|
||||
struct list_head entry;
|
||||
|
||||
struct device dev;
|
||||
};
|
||||
|
||||
@@ -123,6 +126,7 @@ extern void devm_backlight_device_unregister(struct device *dev,
|
||||
struct backlight_device *bd);
|
||||
extern void backlight_force_update(struct backlight_device *bd,
|
||||
enum backlight_update_reason reason);
|
||||
extern bool backlight_device_registered(enum backlight_type type);
|
||||
|
||||
#define to_backlight_device(obj) container_of(obj, struct backlight_device, dev)
|
||||
|
||||
|
||||
@@ -158,6 +158,26 @@ static inline bool balloon_page_movable(struct page *page)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* isolated_balloon_page - identify an isolated balloon page on private
|
||||
* compaction/migration page lists.
|
||||
*
|
||||
* After a compaction thread isolates a balloon page for migration, it raises
|
||||
* the page refcount to prevent concurrent compaction threads from re-isolating
|
||||
* the same page. For that reason putback_movable_pages(), or other routines
|
||||
* that need to identify isolated balloon pages on private pagelists, cannot
|
||||
* rely on balloon_page_movable() to accomplish the task.
|
||||
*/
|
||||
static inline bool isolated_balloon_page(struct page *page)
|
||||
{
|
||||
/* Already isolated balloon pages, by default, have a raised refcount */
|
||||
if (page_flags_cleared(page) && !page_mapped(page) &&
|
||||
page_count(page) >= 2)
|
||||
return __is_movable_balloon_page(page);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* balloon_page_insert - insert a page into the balloon's page list and make
|
||||
* the page->mapping assignment accordingly.
|
||||
@@ -243,6 +263,11 @@ static inline bool balloon_page_movable(struct page *page)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool isolated_balloon_page(struct page *page)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool balloon_page_isolate(struct page *page)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -242,6 +242,7 @@ extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
|
||||
struct bcma_device *core, bool enable);
|
||||
extern void bcma_core_pci_up(struct bcma_bus *bus);
|
||||
extern void bcma_core_pci_down(struct bcma_bus *bus);
|
||||
extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
|
||||
|
||||
extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
|
||||
extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
|
||||
|
||||
@@ -31,7 +31,7 @@ struct linux_binprm {
|
||||
#ifdef __alpha__
|
||||
unsigned int taso:1;
|
||||
#endif
|
||||
unsigned int recursion_depth;
|
||||
unsigned int recursion_depth; /* only for search_binary_handler() */
|
||||
struct file * file;
|
||||
struct cred *cred; /* new credentials */
|
||||
int unsafe; /* how unsafe this exec is (mask of LSM_UNSAFE_*) */
|
||||
@@ -56,11 +56,12 @@ struct linux_binprm {
|
||||
|
||||
/* Function parameter for binfmt->coredump */
|
||||
struct coredump_params {
|
||||
siginfo_t *siginfo;
|
||||
const siginfo_t *siginfo;
|
||||
struct pt_regs *regs;
|
||||
struct file *file;
|
||||
unsigned long limit;
|
||||
unsigned long mm_flags;
|
||||
loff_t written;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -99,9 +100,6 @@ extern void setup_new_exec(struct linux_binprm * bprm);
|
||||
extern void would_dump(struct linux_binprm *, struct file *);
|
||||
|
||||
extern int suid_dumpable;
|
||||
#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
|
||||
#define SUID_DUMP_USER 1 /* Dump as user of process */
|
||||
#define SUID_DUMP_ROOT 2 /* Dump as root */
|
||||
|
||||
/* Stack area protections */
|
||||
#define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */
|
||||
|
||||
@@ -218,6 +218,7 @@ struct bio_pair {
|
||||
};
|
||||
extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
|
||||
extern void bio_pair_release(struct bio_pair *dbio);
|
||||
extern void bio_trim(struct bio *bio, int offset, int size);
|
||||
|
||||
extern struct bio_set *bioset_create(unsigned int, unsigned int);
|
||||
extern void bioset_free(struct bio_set *);
|
||||
@@ -419,6 +420,8 @@ static inline void bio_list_init(struct bio_list *bl)
|
||||
bl->head = bl->tail = NULL;
|
||||
}
|
||||
|
||||
#define BIO_EMPTY_LIST { NULL, NULL }
|
||||
|
||||
#define bio_list_for_each(bio, bl) \
|
||||
for (bio = (bl)->head; bio; bio = bio->bi_next)
|
||||
|
||||
|
||||
@@ -4,12 +4,23 @@
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define BIT(nr) (1UL << (nr))
|
||||
#define BIT_ULL(nr) (1ULL << (nr))
|
||||
#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
|
||||
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
|
||||
#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
|
||||
#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
|
||||
#define BITS_PER_BYTE 8
|
||||
#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Create a contiguous bitmask starting at bit position @l and ending at
|
||||
* position @h. For example
|
||||
* GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
|
||||
*/
|
||||
#define GENMASK(h, l) (((U32_C(1) << ((h) - (l) + 1)) - 1) << (l))
|
||||
#define GENMASK_ULL(h, l) (((U64_C(1) << ((h) - (l) + 1)) - 1) << (l))
|
||||
|
||||
extern unsigned int __sw_hweight8(unsigned int w);
|
||||
extern unsigned int __sw_hweight16(unsigned int w);
|
||||
extern unsigned int __sw_hweight32(unsigned int w);
|
||||
|
||||
183
include/linux/blk-mq.h
Normal file
183
include/linux/blk-mq.h
Normal file
@@ -0,0 +1,183 @@
|
||||
#ifndef BLK_MQ_H
|
||||
#define BLK_MQ_H
|
||||
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
struct blk_mq_tags;
|
||||
|
||||
struct blk_mq_cpu_notifier {
|
||||
struct list_head list;
|
||||
void *data;
|
||||
void (*notify)(void *data, unsigned long action, unsigned int cpu);
|
||||
};
|
||||
|
||||
struct blk_mq_hw_ctx {
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
struct list_head dispatch;
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
unsigned long state; /* BLK_MQ_S_* flags */
|
||||
struct delayed_work delayed_work;
|
||||
|
||||
unsigned long flags; /* BLK_MQ_F_* flags */
|
||||
|
||||
struct request_queue *queue;
|
||||
unsigned int queue_num;
|
||||
|
||||
void *driver_data;
|
||||
|
||||
unsigned int nr_ctx;
|
||||
struct blk_mq_ctx **ctxs;
|
||||
unsigned int nr_ctx_map;
|
||||
unsigned long *ctx_map;
|
||||
|
||||
struct request **rqs;
|
||||
struct list_head page_list;
|
||||
struct blk_mq_tags *tags;
|
||||
|
||||
unsigned long queued;
|
||||
unsigned long run;
|
||||
#define BLK_MQ_MAX_DISPATCH_ORDER 10
|
||||
unsigned long dispatched[BLK_MQ_MAX_DISPATCH_ORDER];
|
||||
|
||||
unsigned int queue_depth;
|
||||
unsigned int numa_node;
|
||||
unsigned int cmd_size; /* per-request extra data */
|
||||
|
||||
struct blk_mq_cpu_notifier cpu_notifier;
|
||||
struct kobject kobj;
|
||||
};
|
||||
|
||||
struct blk_mq_reg {
|
||||
struct blk_mq_ops *ops;
|
||||
unsigned int nr_hw_queues;
|
||||
unsigned int queue_depth;
|
||||
unsigned int reserved_tags;
|
||||
unsigned int cmd_size; /* per-request extra data */
|
||||
int numa_node;
|
||||
unsigned int timeout;
|
||||
unsigned int flags; /* BLK_MQ_F_* */
|
||||
};
|
||||
|
||||
typedef int (queue_rq_fn)(struct blk_mq_hw_ctx *, struct request *);
|
||||
typedef struct blk_mq_hw_ctx *(map_queue_fn)(struct request_queue *, const int);
|
||||
typedef struct blk_mq_hw_ctx *(alloc_hctx_fn)(struct blk_mq_reg *,unsigned int);
|
||||
typedef void (free_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int);
|
||||
typedef int (init_hctx_fn)(struct blk_mq_hw_ctx *, void *, unsigned int);
|
||||
typedef void (exit_hctx_fn)(struct blk_mq_hw_ctx *, unsigned int);
|
||||
|
||||
struct blk_mq_ops {
|
||||
/*
|
||||
* Queue request
|
||||
*/
|
||||
queue_rq_fn *queue_rq;
|
||||
|
||||
/*
|
||||
* Map to specific hardware queue
|
||||
*/
|
||||
map_queue_fn *map_queue;
|
||||
|
||||
/*
|
||||
* Called on request timeout
|
||||
*/
|
||||
rq_timed_out_fn *timeout;
|
||||
|
||||
/*
|
||||
* Override for hctx allocations (should probably go)
|
||||
*/
|
||||
alloc_hctx_fn *alloc_hctx;
|
||||
free_hctx_fn *free_hctx;
|
||||
|
||||
/*
|
||||
* Called when the block layer side of a hardware queue has been
|
||||
* set up, allowing the driver to allocate/init matching structures.
|
||||
* Ditto for exit/teardown.
|
||||
*/
|
||||
init_hctx_fn *init_hctx;
|
||||
exit_hctx_fn *exit_hctx;
|
||||
};
|
||||
|
||||
enum {
|
||||
BLK_MQ_RQ_QUEUE_OK = 0, /* queued fine */
|
||||
BLK_MQ_RQ_QUEUE_BUSY = 1, /* requeue IO for later */
|
||||
BLK_MQ_RQ_QUEUE_ERROR = 2, /* end IO with error */
|
||||
|
||||
BLK_MQ_F_SHOULD_MERGE = 1 << 0,
|
||||
BLK_MQ_F_SHOULD_SORT = 1 << 1,
|
||||
BLK_MQ_F_SHOULD_IPI = 1 << 2,
|
||||
|
||||
BLK_MQ_S_STOPPED = 1 << 0,
|
||||
|
||||
BLK_MQ_MAX_DEPTH = 2048,
|
||||
};
|
||||
|
||||
struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
|
||||
void blk_mq_free_queue(struct request_queue *);
|
||||
int blk_mq_register_disk(struct gendisk *);
|
||||
void blk_mq_unregister_disk(struct gendisk *);
|
||||
void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data);
|
||||
|
||||
void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule);
|
||||
|
||||
void blk_mq_insert_request(struct request_queue *, struct request *, bool);
|
||||
void blk_mq_run_queues(struct request_queue *q, bool async);
|
||||
void blk_mq_free_request(struct request *rq);
|
||||
bool blk_mq_can_queue(struct blk_mq_hw_ctx *);
|
||||
struct request *blk_mq_alloc_request(struct request_queue *q, int rw, gfp_t gfp, bool reserved);
|
||||
struct request *blk_mq_alloc_reserved_request(struct request_queue *q, int rw, gfp_t gfp);
|
||||
struct request *blk_mq_rq_from_tag(struct request_queue *q, unsigned int tag);
|
||||
|
||||
struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *, const int ctx_index);
|
||||
struct blk_mq_hw_ctx *blk_mq_alloc_single_hw_queue(struct blk_mq_reg *, unsigned int);
|
||||
void blk_mq_free_single_hw_queue(struct blk_mq_hw_ctx *, unsigned int);
|
||||
|
||||
void blk_mq_end_io(struct request *rq, int error);
|
||||
|
||||
void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
|
||||
void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
|
||||
void blk_mq_stop_hw_queues(struct request_queue *q);
|
||||
void blk_mq_start_stopped_hw_queues(struct request_queue *q);
|
||||
|
||||
/*
|
||||
* Driver command data is immediately after the request. So subtract request
|
||||
* size to get back to the original request.
|
||||
*/
|
||||
static inline struct request *blk_mq_rq_from_pdu(void *pdu)
|
||||
{
|
||||
return pdu - sizeof(struct request);
|
||||
}
|
||||
static inline void *blk_mq_rq_to_pdu(struct request *rq)
|
||||
{
|
||||
return (void *) rq + sizeof(*rq);
|
||||
}
|
||||
|
||||
static inline struct request *blk_mq_tag_to_rq(struct blk_mq_hw_ctx *hctx,
|
||||
unsigned int tag)
|
||||
{
|
||||
return hctx->rqs[tag];
|
||||
}
|
||||
|
||||
#define queue_for_each_hw_ctx(q, hctx, i) \
|
||||
for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \
|
||||
(i) < (q)->nr_hw_queues; (i)++, hctx = (q)->queue_hw_ctx[i])
|
||||
|
||||
#define queue_for_each_ctx(q, ctx, i) \
|
||||
for ((i) = 0, ctx = per_cpu_ptr((q)->queue_ctx, 0); \
|
||||
(i) < (q)->nr_queues; (i)++, ctx = per_cpu_ptr(q->queue_ctx, (i)))
|
||||
|
||||
#define hctx_for_each_ctx(hctx, ctx, i) \
|
||||
for ((i) = 0, ctx = (hctx)->ctxs[0]; \
|
||||
(i) < (hctx)->nr_ctx; (i)++, ctx = (hctx)->ctxs[(i)])
|
||||
|
||||
#define blk_ctx_sum(q, sum) \
|
||||
({ \
|
||||
struct blk_mq_ctx *__x; \
|
||||
unsigned int __ret = 0, __i; \
|
||||
\
|
||||
queue_for_each_ctx((q), __x, __i) \
|
||||
__ret += sum; \
|
||||
__ret; \
|
||||
})
|
||||
|
||||
#endif
|
||||
@@ -178,19 +178,20 @@ enum rq_flag_bits {
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_KERNEL, /* direct IO to kernel pages */
|
||||
__REQ_PM, /* runtime pm request */
|
||||
__REQ_END, /* last of chain of requests */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
#define REQ_WRITE (1 << __REQ_WRITE)
|
||||
#define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV)
|
||||
#define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT)
|
||||
#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER)
|
||||
#define REQ_SYNC (1 << __REQ_SYNC)
|
||||
#define REQ_META (1 << __REQ_META)
|
||||
#define REQ_PRIO (1 << __REQ_PRIO)
|
||||
#define REQ_DISCARD (1 << __REQ_DISCARD)
|
||||
#define REQ_WRITE_SAME (1 << __REQ_WRITE_SAME)
|
||||
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
|
||||
#define REQ_WRITE (1ULL << __REQ_WRITE)
|
||||
#define REQ_FAILFAST_DEV (1ULL << __REQ_FAILFAST_DEV)
|
||||
#define REQ_FAILFAST_TRANSPORT (1ULL << __REQ_FAILFAST_TRANSPORT)
|
||||
#define REQ_FAILFAST_DRIVER (1ULL << __REQ_FAILFAST_DRIVER)
|
||||
#define REQ_SYNC (1ULL << __REQ_SYNC)
|
||||
#define REQ_META (1ULL << __REQ_META)
|
||||
#define REQ_PRIO (1ULL << __REQ_PRIO)
|
||||
#define REQ_DISCARD (1ULL << __REQ_DISCARD)
|
||||
#define REQ_WRITE_SAME (1ULL << __REQ_WRITE_SAME)
|
||||
#define REQ_NOIDLE (1ULL << __REQ_NOIDLE)
|
||||
|
||||
#define REQ_FAILFAST_MASK \
|
||||
(REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
|
||||
@@ -206,28 +207,29 @@ enum rq_flag_bits {
|
||||
#define REQ_NOMERGE_FLAGS \
|
||||
(REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
|
||||
|
||||
#define REQ_RAHEAD (1 << __REQ_RAHEAD)
|
||||
#define REQ_THROTTLED (1 << __REQ_THROTTLED)
|
||||
#define REQ_RAHEAD (1ULL << __REQ_RAHEAD)
|
||||
#define REQ_THROTTLED (1ULL << __REQ_THROTTLED)
|
||||
|
||||
#define REQ_SORTED (1 << __REQ_SORTED)
|
||||
#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
|
||||
#define REQ_FUA (1 << __REQ_FUA)
|
||||
#define REQ_NOMERGE (1 << __REQ_NOMERGE)
|
||||
#define REQ_STARTED (1 << __REQ_STARTED)
|
||||
#define REQ_DONTPREP (1 << __REQ_DONTPREP)
|
||||
#define REQ_QUEUED (1 << __REQ_QUEUED)
|
||||
#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
|
||||
#define REQ_FAILED (1 << __REQ_FAILED)
|
||||
#define REQ_QUIET (1 << __REQ_QUIET)
|
||||
#define REQ_PREEMPT (1 << __REQ_PREEMPT)
|
||||
#define REQ_ALLOCED (1 << __REQ_ALLOCED)
|
||||
#define REQ_COPY_USER (1 << __REQ_COPY_USER)
|
||||
#define REQ_FLUSH (1 << __REQ_FLUSH)
|
||||
#define REQ_FLUSH_SEQ (1 << __REQ_FLUSH_SEQ)
|
||||
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
|
||||
#define REQ_SECURE (1 << __REQ_SECURE)
|
||||
#define REQ_KERNEL (1 << __REQ_KERNEL)
|
||||
#define REQ_PM (1 << __REQ_PM)
|
||||
#define REQ_SORTED (1ULL << __REQ_SORTED)
|
||||
#define REQ_SOFTBARRIER (1ULL << __REQ_SOFTBARRIER)
|
||||
#define REQ_FUA (1ULL << __REQ_FUA)
|
||||
#define REQ_NOMERGE (1ULL << __REQ_NOMERGE)
|
||||
#define REQ_STARTED (1ULL << __REQ_STARTED)
|
||||
#define REQ_DONTPREP (1ULL << __REQ_DONTPREP)
|
||||
#define REQ_QUEUED (1ULL << __REQ_QUEUED)
|
||||
#define REQ_ELVPRIV (1ULL << __REQ_ELVPRIV)
|
||||
#define REQ_FAILED (1ULL << __REQ_FAILED)
|
||||
#define REQ_QUIET (1ULL << __REQ_QUIET)
|
||||
#define REQ_PREEMPT (1ULL << __REQ_PREEMPT)
|
||||
#define REQ_ALLOCED (1ULL << __REQ_ALLOCED)
|
||||
#define REQ_COPY_USER (1ULL << __REQ_COPY_USER)
|
||||
#define REQ_FLUSH (1ULL << __REQ_FLUSH)
|
||||
#define REQ_FLUSH_SEQ (1ULL << __REQ_FLUSH_SEQ)
|
||||
#define REQ_IO_STAT (1ULL << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1ULL << __REQ_MIXED_MERGE)
|
||||
#define REQ_SECURE (1ULL << __REQ_SECURE)
|
||||
#define REQ_KERNEL (1ULL << __REQ_KERNEL)
|
||||
#define REQ_PM (1ULL << __REQ_PM)
|
||||
#define REQ_END (1ULL << __REQ_END)
|
||||
|
||||
#endif /* __LINUX_BLK_TYPES_H */
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/major.h>
|
||||
#include <linux/genhd.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/llist.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/pagemap.h>
|
||||
@@ -94,12 +95,19 @@ enum rq_cmd_type_bits {
|
||||
* as well!
|
||||
*/
|
||||
struct request {
|
||||
struct list_head queuelist;
|
||||
struct call_single_data csd;
|
||||
union {
|
||||
struct list_head queuelist;
|
||||
struct llist_node ll_list;
|
||||
};
|
||||
union {
|
||||
struct call_single_data csd;
|
||||
struct work_struct mq_flush_data;
|
||||
};
|
||||
|
||||
struct request_queue *q;
|
||||
struct blk_mq_ctx *mq_ctx;
|
||||
|
||||
unsigned int cmd_flags;
|
||||
u64 cmd_flags;
|
||||
enum rq_cmd_type_bits cmd_type;
|
||||
unsigned long atomic_flags;
|
||||
|
||||
@@ -160,8 +168,6 @@ struct request {
|
||||
|
||||
unsigned short ioprio;
|
||||
|
||||
int ref_count;
|
||||
|
||||
void *special; /* opaque pointer available for LLD use */
|
||||
char *buffer; /* kaddr of the current segment if available */
|
||||
|
||||
@@ -215,6 +221,8 @@ struct request_pm_state
|
||||
|
||||
#include <linux/elevator.h>
|
||||
|
||||
struct blk_queue_ctx;
|
||||
|
||||
typedef void (request_fn_proc) (struct request_queue *q);
|
||||
typedef void (make_request_fn) (struct request_queue *q, struct bio *bio);
|
||||
typedef int (prep_rq_fn) (struct request_queue *, struct request *);
|
||||
@@ -313,6 +321,18 @@ struct request_queue {
|
||||
dma_drain_needed_fn *dma_drain_needed;
|
||||
lld_busy_fn *lld_busy_fn;
|
||||
|
||||
struct blk_mq_ops *mq_ops;
|
||||
|
||||
unsigned int *mq_map;
|
||||
|
||||
/* sw queues */
|
||||
struct blk_mq_ctx *queue_ctx;
|
||||
unsigned int nr_queues;
|
||||
|
||||
/* hw dispatch queues */
|
||||
struct blk_mq_hw_ctx **queue_hw_ctx;
|
||||
unsigned int nr_hw_queues;
|
||||
|
||||
/*
|
||||
* Dispatch queue sorting
|
||||
*/
|
||||
@@ -361,6 +381,11 @@ struct request_queue {
|
||||
*/
|
||||
struct kobject kobj;
|
||||
|
||||
/*
|
||||
* mq queue kobject
|
||||
*/
|
||||
struct kobject mq_kobj;
|
||||
|
||||
#ifdef CONFIG_PM_RUNTIME
|
||||
struct device *dev;
|
||||
int rpm_status;
|
||||
@@ -425,7 +450,13 @@ struct request_queue {
|
||||
unsigned long flush_pending_since;
|
||||
struct list_head flush_queue[2];
|
||||
struct list_head flush_data_in_flight;
|
||||
struct request flush_rq;
|
||||
union {
|
||||
struct request flush_rq;
|
||||
struct {
|
||||
spinlock_t mq_flush_lock;
|
||||
struct work_struct mq_flush_work;
|
||||
};
|
||||
};
|
||||
|
||||
struct mutex sysfs_lock;
|
||||
|
||||
@@ -437,14 +468,14 @@ struct request_queue {
|
||||
struct bsg_class_device bsg_dev;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
struct list_head all_q_node;
|
||||
#endif
|
||||
#ifdef CONFIG_BLK_DEV_THROTTLING
|
||||
/* Throttle data */
|
||||
struct throtl_data *td;
|
||||
#endif
|
||||
struct rcu_head rcu_head;
|
||||
wait_queue_head_t mq_freeze_wq;
|
||||
struct percpu_counter mq_usage_counter;
|
||||
struct list_head all_q_node;
|
||||
};
|
||||
|
||||
#define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
|
||||
@@ -467,12 +498,16 @@ struct request_queue {
|
||||
#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */
|
||||
#define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */
|
||||
#define QUEUE_FLAG_DEAD 19 /* queue tear-down finished */
|
||||
#define QUEUE_FLAG_INIT_DONE 20 /* queue is initialized */
|
||||
|
||||
#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_STACKABLE) | \
|
||||
(1 << QUEUE_FLAG_SAME_COMP) | \
|
||||
(1 << QUEUE_FLAG_ADD_RANDOM))
|
||||
|
||||
#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_SAME_COMP))
|
||||
|
||||
static inline void queue_lockdep_assert_held(struct request_queue *q)
|
||||
{
|
||||
if (q->queue_lock)
|
||||
@@ -539,6 +574,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
#define blk_queue_dying(q) test_bit(QUEUE_FLAG_DYING, &(q)->queue_flags)
|
||||
#define blk_queue_dead(q) test_bit(QUEUE_FLAG_DEAD, &(q)->queue_flags)
|
||||
#define blk_queue_bypass(q) test_bit(QUEUE_FLAG_BYPASS, &(q)->queue_flags)
|
||||
#define blk_queue_init_done(q) test_bit(QUEUE_FLAG_INIT_DONE, &(q)->queue_flags)
|
||||
#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
|
||||
#define blk_queue_noxmerges(q) \
|
||||
test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags)
|
||||
@@ -570,7 +606,7 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q)
|
||||
|
||||
#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
|
||||
|
||||
#define rq_data_dir(rq) ((rq)->cmd_flags & 1)
|
||||
#define rq_data_dir(rq) (((rq)->cmd_flags & 1) != 0)
|
||||
|
||||
static inline unsigned int blk_queue_cluster(struct request_queue *q)
|
||||
{
|
||||
@@ -862,6 +898,17 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
|
||||
return blk_queue_get_max_sectors(q, rq->cmd_flags);
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_count_bios(struct request *rq)
|
||||
{
|
||||
unsigned int nr_bios = 0;
|
||||
struct bio *bio;
|
||||
|
||||
__rq_for_each_bio(bio, rq)
|
||||
nr_bios++;
|
||||
|
||||
return nr_bios;
|
||||
}
|
||||
|
||||
/*
|
||||
* Request issue related functions.
|
||||
*/
|
||||
@@ -1002,6 +1049,7 @@ static inline void blk_post_runtime_resume(struct request_queue *q, int err) {}
|
||||
struct blk_plug {
|
||||
unsigned long magic; /* detect uninitialized use-cases */
|
||||
struct list_head list; /* requests */
|
||||
struct list_head mq_list; /* blk-mq requests */
|
||||
struct list_head cb_list; /* md requires an unplug callback */
|
||||
};
|
||||
#define BLK_MAX_REQUEST_COUNT 16
|
||||
@@ -1039,7 +1087,10 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
|
||||
{
|
||||
struct blk_plug *plug = tsk->plug;
|
||||
|
||||
return plug && (!list_empty(&plug->list) || !list_empty(&plug->cb_list));
|
||||
return plug &&
|
||||
(!list_empty(&plug->list) ||
|
||||
!list_empty(&plug->mq_list) ||
|
||||
!list_empty(&plug->cb_list));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1314,6 +1365,7 @@ static inline void put_dev_sector(Sector p)
|
||||
|
||||
struct work_struct;
|
||||
int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
|
||||
int kblockd_schedule_delayed_work(struct request_queue *q, struct delayed_work *dwork, unsigned long delay);
|
||||
|
||||
#ifdef CONFIG_BLK_CGROUP
|
||||
/*
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <linux/relay.h>
|
||||
#include <linux/compat.h>
|
||||
#include <uapi/linux/blktrace_api.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
#if defined(CONFIG_BLK_DEV_IO_TRACE)
|
||||
|
||||
@@ -23,6 +24,7 @@ struct blk_trace {
|
||||
struct dentry *dir;
|
||||
struct dentry *dropped_file;
|
||||
struct dentry *msg_file;
|
||||
struct list_head running_list;
|
||||
atomic_t dropped;
|
||||
};
|
||||
|
||||
@@ -87,7 +89,7 @@ static inline int blk_trace_init_sysfs(struct device *dev)
|
||||
#ifdef CONFIG_COMPAT
|
||||
|
||||
struct compat_blk_user_trace_setup {
|
||||
char name[32];
|
||||
char name[BLKTRACE_BDEV_SIZE];
|
||||
u16 act_mask;
|
||||
u32 buf_size;
|
||||
u32 buf_nr;
|
||||
|
||||
@@ -210,7 +210,6 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
|
||||
struct user_namespace *ns, int cap);
|
||||
extern bool capable(int cap);
|
||||
extern bool ns_capable(struct user_namespace *ns, int cap);
|
||||
extern bool nsown_capable(int cap);
|
||||
extern bool inode_capable(const struct inode *inode, int cap);
|
||||
extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
|
||||
|
||||
|
||||
@@ -335,6 +335,8 @@ extern int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
|
||||
struct ceph_osd_request *req);
|
||||
extern void ceph_osdc_sync(struct ceph_osd_client *osdc);
|
||||
|
||||
extern void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc);
|
||||
|
||||
extern int ceph_osdc_readpages(struct ceph_osd_client *osdc,
|
||||
struct ceph_vino vino,
|
||||
struct ceph_file_layout *layout,
|
||||
|
||||
@@ -612,11 +612,6 @@ struct cgroup_subsys {
|
||||
int subsys_id;
|
||||
int disabled;
|
||||
int early_init;
|
||||
/*
|
||||
* True if this subsys uses ID. ID is not available before cgroup_init()
|
||||
* (not available in early_init time.)
|
||||
*/
|
||||
bool use_id;
|
||||
|
||||
/*
|
||||
* If %false, this subsystem is properly hierarchical -
|
||||
@@ -642,9 +637,6 @@ struct cgroup_subsys {
|
||||
*/
|
||||
struct cgroupfs_root *root;
|
||||
struct list_head sibling;
|
||||
/* used when use_id == true */
|
||||
struct idr idr;
|
||||
spinlock_t id_lock;
|
||||
|
||||
/* list of cftype_sets */
|
||||
struct list_head cftsets;
|
||||
@@ -875,35 +867,6 @@ int css_scan_tasks(struct cgroup_subsys_state *css,
|
||||
int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
|
||||
int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
|
||||
|
||||
/*
|
||||
* CSS ID is ID for cgroup_subsys_state structs under subsys. This only works
|
||||
* if cgroup_subsys.use_id == true. It can be used for looking up and scanning.
|
||||
* CSS ID is assigned at cgroup allocation (create) automatically
|
||||
* and removed when subsys calls free_css_id() function. This is because
|
||||
* the lifetime of cgroup_subsys_state is subsys's matter.
|
||||
*
|
||||
* Looking up and scanning function should be called under rcu_read_lock().
|
||||
* Taking cgroup_mutex is not necessary for following calls.
|
||||
* But the css returned by this routine can be "not populated yet" or "being
|
||||
* destroyed". The caller should check css and cgroup's status.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Typically Called at ->destroy(), or somewhere the subsys frees
|
||||
* cgroup_subsys_state.
|
||||
*/
|
||||
void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css);
|
||||
|
||||
/* Find a cgroup_subsys_state which has given ID */
|
||||
|
||||
struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id);
|
||||
|
||||
/* Returns true if root is ancestor of cg */
|
||||
bool css_is_ancestor(struct cgroup_subsys_state *cg,
|
||||
const struct cgroup_subsys_state *root);
|
||||
|
||||
/* Get id and depth of css */
|
||||
unsigned short css_id(struct cgroup_subsys_state *css);
|
||||
struct cgroup_subsys_state *css_from_dir(struct dentry *dentry,
|
||||
struct cgroup_subsys *ss);
|
||||
|
||||
|
||||
@@ -33,8 +33,11 @@ struct clk {
|
||||
const char **parent_names;
|
||||
struct clk **parents;
|
||||
u8 num_parents;
|
||||
u8 new_parent_index;
|
||||
unsigned long rate;
|
||||
unsigned long new_rate;
|
||||
struct clk *new_parent;
|
||||
struct clk *new_child;
|
||||
unsigned long flags;
|
||||
unsigned int enable_count;
|
||||
unsigned int prepare_count;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define __LINUX_CLK_PROVIDER_H
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#ifdef CONFIG_COMMON_CLK
|
||||
|
||||
@@ -27,6 +28,7 @@
|
||||
#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
|
||||
#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
|
||||
#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
|
||||
#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
|
||||
|
||||
struct clk_hw;
|
||||
|
||||
@@ -79,6 +81,10 @@ struct clk_hw;
|
||||
* @round_rate: Given a target rate as input, returns the closest rate actually
|
||||
* supported by the clock.
|
||||
*
|
||||
* @determine_rate: Given a target rate as input, returns the closest rate
|
||||
* actually supported by the clock, and optionally the parent clock
|
||||
* that should be used to provide the clock rate.
|
||||
*
|
||||
* @get_parent: Queries the hardware to determine the parent of a clock. The
|
||||
* return value is a u8 which specifies the index corresponding to
|
||||
* the parent clock. This index can be applied to either the
|
||||
@@ -126,6 +132,9 @@ struct clk_ops {
|
||||
unsigned long parent_rate);
|
||||
long (*round_rate)(struct clk_hw *hw, unsigned long,
|
||||
unsigned long *);
|
||||
long (*determine_rate)(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *best_parent_rate,
|
||||
struct clk **best_parent_clk);
|
||||
int (*set_parent)(struct clk_hw *hw, u8 index);
|
||||
u8 (*get_parent)(struct clk_hw *hw);
|
||||
int (*set_rate)(struct clk_hw *hw, unsigned long,
|
||||
@@ -327,8 +336,10 @@ struct clk_mux {
|
||||
#define CLK_MUX_INDEX_ONE BIT(0)
|
||||
#define CLK_MUX_INDEX_BIT BIT(1)
|
||||
#define CLK_MUX_HIWORD_MASK BIT(2)
|
||||
#define CLK_MUX_READ_ONLY BIT(3) /* mux setting cannot be changed */
|
||||
|
||||
extern const struct clk_ops clk_mux_ops;
|
||||
extern const struct clk_ops clk_mux_ro_ops;
|
||||
|
||||
struct clk *clk_register_mux(struct device *dev, const char *name,
|
||||
const char **parent_names, u8 num_parents, unsigned long flags,
|
||||
@@ -418,6 +429,7 @@ const char *__clk_get_name(struct clk *clk);
|
||||
struct clk_hw *__clk_get_hw(struct clk *clk);
|
||||
u8 __clk_get_num_parents(struct clk *clk);
|
||||
struct clk *__clk_get_parent(struct clk *clk);
|
||||
struct clk *clk_get_parent_by_index(struct clk *clk, u8 index);
|
||||
unsigned int __clk_get_enable_count(struct clk *clk);
|
||||
unsigned int __clk_get_prepare_count(struct clk *clk);
|
||||
unsigned long __clk_get_rate(struct clk *clk);
|
||||
@@ -425,6 +437,9 @@ unsigned long __clk_get_flags(struct clk *clk);
|
||||
bool __clk_is_prepared(struct clk *clk);
|
||||
bool __clk_is_enabled(struct clk *clk);
|
||||
struct clk *__clk_lookup(const char *name);
|
||||
long __clk_mux_determine_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *best_parent_rate,
|
||||
struct clk **best_parent_p);
|
||||
|
||||
/*
|
||||
* FIXME clock api without lock protection
|
||||
@@ -457,6 +472,7 @@ void of_clk_del_provider(struct device_node *np);
|
||||
struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
|
||||
void *data);
|
||||
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
|
||||
int of_clk_get_parent_count(struct device_node *np);
|
||||
const char *of_clk_get_parent_name(struct device_node *np, int index);
|
||||
|
||||
void of_clk_init(const struct of_device_id *matches);
|
||||
@@ -490,5 +506,21 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
|
||||
#define of_clk_init(matches) \
|
||||
{ while (0); }
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
/*
|
||||
* wrap access to peripherals in accessor routines
|
||||
* for improved portability across platforms
|
||||
*/
|
||||
|
||||
static inline u32 clk_readl(u32 __iomem *reg)
|
||||
{
|
||||
return readl(reg);
|
||||
}
|
||||
|
||||
static inline void clk_writel(u32 val, u32 __iomem *reg)
|
||||
{
|
||||
writel(val, reg);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_COMMON_CLK */
|
||||
#endif /* CLK_PROVIDER_H */
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#ifndef __LINUX_CLK_MXS_H
|
||||
#define __LINUX_CLK_MXS_H
|
||||
|
||||
int mx23_clocks_init(void);
|
||||
int mx28_clocks_init(void);
|
||||
int mxs_saif_clkmux_select(unsigned int clkmux);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 Maxime Ripard
|
||||
*
|
||||
* Maxime Ripard <maxime.ripard@free-electrons.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_CLK_SUNXI_H_
|
||||
#define __LINUX_CLK_SUNXI_H_
|
||||
|
||||
void __init sunxi_init_clocks(void);
|
||||
|
||||
#endif
|
||||
@@ -60,6 +60,7 @@ enum clock_event_mode {
|
||||
* Core shall set the interrupt affinity dynamically in broadcast mode
|
||||
*/
|
||||
#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
|
||||
#define CLOCK_EVT_FEAT_PERCPU 0x000040
|
||||
|
||||
/**
|
||||
* struct clock_event_device - clock event device descriptor
|
||||
|
||||
@@ -292,6 +292,8 @@ extern void clocksource_resume(void);
|
||||
extern struct clocksource * __init __weak clocksource_default_clock(void);
|
||||
extern void clocksource_mark_unstable(struct clocksource *cs);
|
||||
|
||||
extern u64
|
||||
clocks_calc_max_nsecs(u32 mult, u32 shift, u32 maxadj, u64 mask);
|
||||
extern void
|
||||
clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
|
||||
|
||||
|
||||
45
include/linux/cmdline-parser.h
Normal file
45
include/linux/cmdline-parser.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Parsing command line, get the partitions information.
|
||||
*
|
||||
* Written by Cai Zhiyong <caizhiyong@huawei.com>
|
||||
*
|
||||
*/
|
||||
#ifndef CMDLINEPARSEH
|
||||
#define CMDLINEPARSEH
|
||||
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/* partition flags */
|
||||
#define PF_RDONLY 0x01 /* Device is read only */
|
||||
#define PF_POWERUP_LOCK 0x02 /* Always locked after reset */
|
||||
|
||||
struct cmdline_subpart {
|
||||
char name[BDEVNAME_SIZE]; /* partition name, such as 'rootfs' */
|
||||
sector_t from;
|
||||
sector_t size;
|
||||
int flags;
|
||||
struct cmdline_subpart *next_subpart;
|
||||
};
|
||||
|
||||
struct cmdline_parts {
|
||||
char name[BDEVNAME_SIZE]; /* block device, such as 'mmcblk0' */
|
||||
unsigned int nr_subparts;
|
||||
struct cmdline_subpart *subpart;
|
||||
struct cmdline_parts *next_parts;
|
||||
};
|
||||
|
||||
void cmdline_parts_free(struct cmdline_parts **parts);
|
||||
|
||||
int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
|
||||
|
||||
struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
|
||||
const char *bdev);
|
||||
|
||||
void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
|
||||
int slot,
|
||||
int (*add_part)(int, struct cmdline_subpart *, void *),
|
||||
void *param);
|
||||
|
||||
#endif /* CMDLINEPARSEH */
|
||||
@@ -41,13 +41,14 @@
|
||||
COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
|
||||
|
||||
#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
|
||||
asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
|
||||
asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\
|
||||
__attribute__((alias(__stringify(compat_SyS##name)))); \
|
||||
static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
|
||||
asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\
|
||||
asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\
|
||||
{ \
|
||||
return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
|
||||
} \
|
||||
SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \
|
||||
static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
|
||||
|
||||
#ifndef compat_user_stack_pointer
|
||||
@@ -361,7 +362,7 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
|
||||
long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
|
||||
unsigned long bitmap_size);
|
||||
int copy_siginfo_from_user32(siginfo_t *to, struct compat_siginfo __user *from);
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *to, siginfo_t *from);
|
||||
int copy_siginfo_to_user32(struct compat_siginfo __user *to, const siginfo_t *from);
|
||||
int get_compat_sigevent(struct sigevent *event,
|
||||
const struct compat_sigevent __user *u_event);
|
||||
long compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
|
||||
|
||||
@@ -65,6 +65,21 @@
|
||||
#define __visible __attribute__((externally_visible))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GCC 'asm goto' miscompiles certain code sequences:
|
||||
*
|
||||
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
|
||||
*
|
||||
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
|
||||
* Fixed in GCC 4.8.2 and later versions.
|
||||
*
|
||||
* (asm goto is automatically volatile - the naming reflects this.)
|
||||
*/
|
||||
#if GCC_VERSION <= 40801
|
||||
# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
|
||||
#else
|
||||
# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
|
||||
#if GCC_VERSION >= 40400
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
|
||||
#endif
|
||||
|
||||
#define uninitialized_var(x) x
|
||||
|
||||
#ifndef __HAVE_BUILTIN_BSWAP16__
|
||||
/* icc has this, but it's called _bswap16 */
|
||||
#define __HAVE_BUILTIN_BSWAP16__
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* (C) Copyright 2001 Linus Torvalds
|
||||
*
|
||||
* Atomic wait-for-completion handler data structures.
|
||||
* See kernel/sched/core.c for details.
|
||||
* See kernel/sched/completion.c for details.
|
||||
*/
|
||||
|
||||
#include <linux/wait.h>
|
||||
@@ -19,8 +19,8 @@
|
||||
*
|
||||
* See also: complete(), wait_for_completion() (and friends _timeout,
|
||||
* _interruptible, _interruptible_timeout, and _killable), init_completion(),
|
||||
* and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and
|
||||
* INIT_COMPLETION().
|
||||
* reinit_completion(), and macros DECLARE_COMPLETION(),
|
||||
* DECLARE_COMPLETION_ONSTACK().
|
||||
*/
|
||||
struct completion {
|
||||
unsigned int done;
|
||||
@@ -65,7 +65,7 @@ struct completion {
|
||||
|
||||
/**
|
||||
* init_completion - Initialize a dynamically allocated completion
|
||||
* @x: completion structure that is to be initialized
|
||||
* @x: pointer to completion structure that is to be initialized
|
||||
*
|
||||
* This inline function will initialize a dynamically created completion
|
||||
* structure.
|
||||
@@ -76,6 +76,18 @@ static inline void init_completion(struct completion *x)
|
||||
init_waitqueue_head(&x->wait);
|
||||
}
|
||||
|
||||
/**
|
||||
* reinit_completion - reinitialize a completion structure
|
||||
* @x: pointer to completion structure that is to be reinitialized
|
||||
*
|
||||
* This inline function should be used to reinitialize a completion structure so it can
|
||||
* be reused. This is especially important after complete_all() is used.
|
||||
*/
|
||||
static inline void reinit_completion(struct completion *x)
|
||||
{
|
||||
x->done = 0;
|
||||
}
|
||||
|
||||
extern void wait_for_completion(struct completion *);
|
||||
extern void wait_for_completion_io(struct completion *);
|
||||
extern int wait_for_completion_interruptible(struct completion *x);
|
||||
@@ -94,14 +106,4 @@ extern bool completion_done(struct completion *x);
|
||||
extern void complete(struct completion *);
|
||||
extern void complete_all(struct completion *);
|
||||
|
||||
/**
|
||||
* INIT_COMPLETION - reinitialize a completion structure
|
||||
* @x: completion structure to be reinitialized
|
||||
*
|
||||
* This macro should be used to reinitialize a completion structure so it can
|
||||
* be reused. This is especially important after complete_all() is used.
|
||||
*/
|
||||
#define INIT_COMPLETION(x) ((x).done = 0)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
* These are the only things you should do on a core-file: use only these
|
||||
* functions to write out all the necessary info.
|
||||
*/
|
||||
extern int dump_write(struct file *file, const void *addr, int nr);
|
||||
extern int dump_seek(struct file *file, loff_t off);
|
||||
struct coredump_params;
|
||||
extern int dump_skip(struct coredump_params *cprm, size_t nr);
|
||||
extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
|
||||
extern int dump_align(struct coredump_params *cprm, int align);
|
||||
#ifdef CONFIG_COREDUMP
|
||||
extern void do_coredump(siginfo_t *siginfo);
|
||||
extern void do_coredump(const siginfo_t *siginfo);
|
||||
#else
|
||||
static inline void do_coredump(siginfo_t *siginfo) {}
|
||||
static inline void do_coredump(const siginfo_t *siginfo) {}
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_COREDUMP_H */
|
||||
|
||||
@@ -218,8 +218,8 @@ enum {
|
||||
#define CPER_PROC_VALID_IP 0x1000
|
||||
|
||||
#define CPER_MEM_VALID_ERROR_STATUS 0x0001
|
||||
#define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002
|
||||
#define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004
|
||||
#define CPER_MEM_VALID_PA 0x0002
|
||||
#define CPER_MEM_VALID_PA_MASK 0x0004
|
||||
#define CPER_MEM_VALID_NODE 0x0008
|
||||
#define CPER_MEM_VALID_CARD 0x0010
|
||||
#define CPER_MEM_VALID_MODULE 0x0020
|
||||
@@ -232,6 +232,9 @@ enum {
|
||||
#define CPER_MEM_VALID_RESPONDER_ID 0x1000
|
||||
#define CPER_MEM_VALID_TARGET_ID 0x2000
|
||||
#define CPER_MEM_VALID_ERROR_TYPE 0x4000
|
||||
#define CPER_MEM_VALID_RANK_NUMBER 0x8000
|
||||
#define CPER_MEM_VALID_CARD_HANDLE 0x10000
|
||||
#define CPER_MEM_VALID_MODULE_HANDLE 0x20000
|
||||
|
||||
#define CPER_PCIE_VALID_PORT_TYPE 0x0001
|
||||
#define CPER_PCIE_VALID_VERSION 0x0002
|
||||
@@ -347,6 +350,10 @@ struct cper_sec_mem_err {
|
||||
__u64 responder_id;
|
||||
__u64 target_id;
|
||||
__u8 error_type;
|
||||
__u8 reserved;
|
||||
__u16 rank;
|
||||
__u16 mem_array_handle; /* card handle in UEFI 2.4 */
|
||||
__u16 mem_dev_handle; /* module handle in UEFI 2.4 */
|
||||
};
|
||||
|
||||
struct cper_sec_pcie {
|
||||
@@ -389,6 +396,6 @@ struct cper_sec_pcie {
|
||||
|
||||
u64 cper_next_record_id(void);
|
||||
void cper_print_bits(const char *prefix, unsigned int bits,
|
||||
const char *strs[], unsigned int strs_size);
|
||||
const char * const strs[], unsigned int strs_size);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <linux/cpumask.h>
|
||||
|
||||
struct device;
|
||||
struct device_node;
|
||||
|
||||
struct cpu {
|
||||
int node_id; /* The node which contains the CPU */
|
||||
@@ -29,6 +30,8 @@ extern int register_cpu(struct cpu *cpu, int num);
|
||||
extern struct device *get_cpu_device(unsigned cpu);
|
||||
extern bool cpu_is_hotpluggable(unsigned cpu);
|
||||
extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
|
||||
extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun,
|
||||
int cpu, unsigned int *thread);
|
||||
|
||||
extern int cpu_add_dev_attr(struct device_attribute *attr);
|
||||
extern void cpu_remove_dev_attr(struct device_attribute *attr);
|
||||
@@ -185,19 +188,6 @@ extern void cpu_hotplug_enable(void);
|
||||
void clear_tasks_mm_cpumask(int cpu);
|
||||
int cpu_down(unsigned int cpu);
|
||||
|
||||
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
|
||||
extern void cpu_hotplug_driver_lock(void);
|
||||
extern void cpu_hotplug_driver_unlock(void);
|
||||
#else
|
||||
static inline void cpu_hotplug_driver_lock(void)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void cpu_hotplug_driver_unlock(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#else /* CONFIG_HOTPLUG_CPU */
|
||||
|
||||
static inline void cpu_hotplug_begin(void) {}
|
||||
|
||||
@@ -52,8 +52,6 @@ static inline void *cpu_rmap_lookup_obj(struct cpu_rmap *rmap, unsigned int cpu)
|
||||
return rmap->obj[rmap->near[cpu].index];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
|
||||
/**
|
||||
* alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs
|
||||
* @size: Number of objects to be mapped
|
||||
@@ -68,5 +66,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
|
||||
|
||||
extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
|
||||
|
||||
#endif
|
||||
#endif /* __LINUX_CPU_RMAP_H */
|
||||
|
||||
@@ -85,7 +85,20 @@ struct cpufreq_policy {
|
||||
struct list_head policy_list;
|
||||
struct kobject kobj;
|
||||
struct completion kobj_unregister;
|
||||
int transition_ongoing; /* Tracks transition status */
|
||||
|
||||
/*
|
||||
* The rules for this semaphore:
|
||||
* - Any routine that wants to read from the policy structure will
|
||||
* do a down_read on this semaphore.
|
||||
* - Any routine that will write to the policy structure and/or may take away
|
||||
* the policy altogether (eg. CPU hotplug), will hold this lock in write
|
||||
* mode before doing so.
|
||||
*
|
||||
* Additional rules:
|
||||
* - Lock should not be held across
|
||||
* __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
|
||||
*/
|
||||
struct rw_semaphore rwsem;
|
||||
};
|
||||
|
||||
/* Only for ACPI */
|
||||
@@ -94,8 +107,16 @@ struct cpufreq_policy {
|
||||
#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
|
||||
#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
|
||||
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
|
||||
void cpufreq_cpu_put(struct cpufreq_policy *policy);
|
||||
#else
|
||||
static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
|
||||
#endif
|
||||
|
||||
static inline bool policy_is_shared(struct cpufreq_policy *policy)
|
||||
{
|
||||
@@ -181,13 +202,6 @@ __ATTR(_name, 0644, show_##_name, store_##_name)
|
||||
struct cpufreq_driver {
|
||||
char name[CPUFREQ_NAME_LEN];
|
||||
u8 flags;
|
||||
/*
|
||||
* This should be set by platforms having multiple clock-domains, i.e.
|
||||
* supporting multiple policies. With this sysfs directories of governor
|
||||
* would be created in cpu/cpu<num>/cpufreq/ directory and so they can
|
||||
* use the same governor with different tunables for different clusters.
|
||||
*/
|
||||
bool have_governor_per_policy;
|
||||
|
||||
/* needed by all drivers */
|
||||
int (*init) (struct cpufreq_policy *policy);
|
||||
@@ -195,9 +209,11 @@ struct cpufreq_driver {
|
||||
|
||||
/* define one out of two */
|
||||
int (*setpolicy) (struct cpufreq_policy *policy);
|
||||
int (*target) (struct cpufreq_policy *policy,
|
||||
int (*target) (struct cpufreq_policy *policy, /* Deprecated */
|
||||
unsigned int target_freq,
|
||||
unsigned int relation);
|
||||
int (*target_index) (struct cpufreq_policy *policy,
|
||||
unsigned int index);
|
||||
|
||||
/* should be defined, if possible */
|
||||
unsigned int (*get) (unsigned int cpu);
|
||||
@@ -212,13 +228,29 @@ struct cpufreq_driver {
|
||||
};
|
||||
|
||||
/* flags */
|
||||
#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if
|
||||
* all ->init() calls failed */
|
||||
#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel
|
||||
* "constants" aren't affected by
|
||||
* frequency transitions */
|
||||
#define CPUFREQ_PM_NO_WARN 0x04 /* don't warn on suspend/resume speed
|
||||
* mismatches */
|
||||
#define CPUFREQ_STICKY (1 << 0) /* driver isn't removed even if
|
||||
all ->init() calls failed */
|
||||
#define CPUFREQ_CONST_LOOPS (1 << 1) /* loops_per_jiffy or other
|
||||
kernel "constants" aren't
|
||||
affected by frequency
|
||||
transitions */
|
||||
#define CPUFREQ_PM_NO_WARN (1 << 2) /* don't warn on suspend/resume
|
||||
speed mismatches */
|
||||
|
||||
/*
|
||||
* This should be set by platforms having multiple clock-domains, i.e.
|
||||
* supporting multiple policies. With this sysfs directories of governor would
|
||||
* be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same
|
||||
* governor with different tunables for different clusters.
|
||||
*/
|
||||
#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3)
|
||||
|
||||
/*
|
||||
* Driver will do POSTCHANGE notifications from outside of their ->target()
|
||||
* routine and so must set cpufreq_driver->flags with this flag, so that core
|
||||
* can handle them specially.
|
||||
*/
|
||||
#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4)
|
||||
|
||||
int cpufreq_register_driver(struct cpufreq_driver *driver_data);
|
||||
int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
|
||||
@@ -241,6 +273,13 @@ static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void
|
||||
cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
|
||||
{
|
||||
cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
|
||||
policy->cpuinfo.max_freq);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* CPUFREQ NOTIFIER INTERFACE *
|
||||
*********************************************************************/
|
||||
@@ -393,6 +432,7 @@ int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,
|
||||
|
||||
int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table);
|
||||
int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
|
||||
|
||||
int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table,
|
||||
@@ -408,8 +448,20 @@ struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
|
||||
|
||||
/* the following are really really optional */
|
||||
extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
|
||||
extern struct freq_attr *cpufreq_generic_attr[];
|
||||
void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
|
||||
unsigned int cpu);
|
||||
void cpufreq_frequency_table_put_attr(unsigned int cpu);
|
||||
int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table);
|
||||
|
||||
int cpufreq_generic_init(struct cpufreq_policy *policy,
|
||||
struct cpufreq_frequency_table *table,
|
||||
unsigned int transition_latency);
|
||||
static inline int cpufreq_generic_exit(struct cpufreq_policy *policy)
|
||||
{
|
||||
cpufreq_frequency_table_put_attr(policy->cpu);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _LINUX_CPUFREQ_H */
|
||||
|
||||
@@ -114,7 +114,7 @@ struct cpuidle_driver {
|
||||
int safe_state_index;
|
||||
|
||||
/* the driver handles the cpus in cpumask */
|
||||
struct cpumask *cpumask;
|
||||
struct cpumask *cpumask;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE
|
||||
@@ -195,16 +195,10 @@ struct cpuidle_governor {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_CPU_IDLE
|
||||
|
||||
extern int cpuidle_register_governor(struct cpuidle_governor *gov);
|
||||
extern void cpuidle_unregister_governor(struct cpuidle_governor *gov);
|
||||
|
||||
#else
|
||||
|
||||
static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
|
||||
{return 0;}
|
||||
static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { }
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_CPU_RELAX
|
||||
|
||||
@@ -110,10 +110,14 @@ static inline bool put_mems_allowed(unsigned int seq)
|
||||
|
||||
static inline void set_mems_allowed(nodemask_t nodemask)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
task_lock(current);
|
||||
local_irq_save(flags);
|
||||
write_seqcount_begin(¤t->mems_allowed_seq);
|
||||
current->mems_allowed = nodemask;
|
||||
write_seqcount_end(¤t->mems_allowed_seq);
|
||||
local_irq_restore(flags);
|
||||
task_unlock(current);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
extern unsigned long long elfcorehdr_addr;
|
||||
extern unsigned long long elfcorehdr_size;
|
||||
|
||||
extern int __weak elfcorehdr_alloc(unsigned long long *addr,
|
||||
unsigned long long *size);
|
||||
extern void __weak elfcorehdr_free(unsigned long long addr);
|
||||
extern ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos);
|
||||
extern ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos);
|
||||
extern int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma,
|
||||
unsigned long from, unsigned long pfn,
|
||||
unsigned long size, pgprot_t prot);
|
||||
|
||||
extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
|
||||
unsigned long, int);
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define CRC_T10DIF_DIGEST_SIZE 2
|
||||
#define CRC_T10DIF_BLOCK_SIZE 1
|
||||
|
||||
__u16 crc_t10dif_generic(__u16 crc, const unsigned char *buffer, size_t len);
|
||||
__u16 crc_t10dif(unsigned char const *, size_t);
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user