Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/staging/Kconfig drivers/staging/Makefile drivers/staging/cpc-usb/TODO drivers/staging/cpc-usb/cpc-usb_drv.c drivers/staging/cpc-usb/cpc.h drivers/staging/cpc-usb/cpc_int.h drivers/staging/cpc-usb/cpcusb.h
This commit is contained in:
@@ -30,8 +30,6 @@
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
|
||||
#define PREFIX "ACPI: "
|
||||
|
||||
/* TBD: Make dynamic */
|
||||
#define ACPI_MAX_HANDLES 10
|
||||
struct acpi_handle_list {
|
||||
@@ -89,7 +87,6 @@ struct acpi_device;
|
||||
typedef int (*acpi_op_add) (struct acpi_device * device);
|
||||
typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
|
||||
typedef int (*acpi_op_start) (struct acpi_device * device);
|
||||
typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
|
||||
typedef int (*acpi_op_suspend) (struct acpi_device * device,
|
||||
pm_message_t state);
|
||||
typedef int (*acpi_op_resume) (struct acpi_device * device);
|
||||
@@ -106,7 +103,6 @@ struct acpi_device_ops {
|
||||
acpi_op_add add;
|
||||
acpi_op_remove remove;
|
||||
acpi_op_start start;
|
||||
acpi_op_stop stop;
|
||||
acpi_op_suspend suspend;
|
||||
acpi_op_resume resume;
|
||||
acpi_op_bind bind;
|
||||
@@ -173,17 +169,15 @@ struct acpi_device_dir {
|
||||
|
||||
typedef char acpi_bus_id[8];
|
||||
typedef unsigned long acpi_bus_address;
|
||||
typedef char acpi_hardware_id[15];
|
||||
typedef char acpi_unique_id[9];
|
||||
typedef char acpi_device_name[40];
|
||||
typedef char acpi_device_class[20];
|
||||
|
||||
struct acpi_device_pnp {
|
||||
acpi_bus_id bus_id; /* Object name */
|
||||
acpi_bus_address bus_address; /* _ADR */
|
||||
acpi_hardware_id hardware_id; /* _HID */
|
||||
struct acpi_compatible_id_list *cid_list; /* _CIDs */
|
||||
acpi_unique_id unique_id; /* _UID */
|
||||
char *hardware_id; /* _HID */
|
||||
struct acpica_device_id_list *cid_list; /* _CIDs */
|
||||
char *unique_id; /* _UID */
|
||||
acpi_device_name device_name; /* Driver-determined */
|
||||
acpi_device_class device_class; /* " */
|
||||
};
|
||||
@@ -248,7 +242,6 @@ struct acpi_device_perf {
|
||||
/* Wakeup Management */
|
||||
struct acpi_device_wakeup_flags {
|
||||
u8 valid:1; /* Can successfully enable wakeup? */
|
||||
u8 prepared:1; /* Has the wake-up capability been enabled? */
|
||||
u8 run_wake:1; /* Run-Wake GPE devices */
|
||||
};
|
||||
|
||||
@@ -263,6 +256,7 @@ struct acpi_device_wakeup {
|
||||
struct acpi_handle_list resources;
|
||||
struct acpi_device_wakeup_state state;
|
||||
struct acpi_device_wakeup_flags flags;
|
||||
int prepare_count;
|
||||
};
|
||||
|
||||
/* Device */
|
||||
@@ -314,7 +308,7 @@ struct acpi_bus_event {
|
||||
|
||||
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, u32, void *);
|
||||
void acpi_bus_private_data_handler(acpi_handle, void *);
|
||||
int acpi_bus_get_private_data(acpi_handle, void **);
|
||||
extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
|
||||
extern int register_acpi_notifier(struct notifier_block *);
|
||||
@@ -327,7 +321,7 @@ extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
|
||||
*/
|
||||
|
||||
int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
|
||||
void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
|
||||
void acpi_bus_data_handler(acpi_handle handle, void *context);
|
||||
int acpi_bus_get_status(struct acpi_device *device);
|
||||
int acpi_bus_get_power(acpi_handle handle, int *state);
|
||||
int acpi_bus_set_power(acpi_handle handle, int state);
|
||||
@@ -356,7 +350,6 @@ void acpi_remove_dir(struct acpi_device *);
|
||||
/*
|
||||
* Bind physical devices with ACPI devices
|
||||
*/
|
||||
#include <linux/device.h>
|
||||
struct acpi_bus_type {
|
||||
struct list_head list;
|
||||
struct bus_type *bus;
|
||||
@@ -369,10 +362,26 @@ int register_acpi_bus_type(struct acpi_bus_type *);
|
||||
int unregister_acpi_bus_type(struct acpi_bus_type *);
|
||||
struct device *acpi_get_physical_device(acpi_handle);
|
||||
|
||||
struct acpi_pci_root {
|
||||
struct list_head node;
|
||||
struct acpi_device * device;
|
||||
struct acpi_pci_id id;
|
||||
struct pci_bus *bus;
|
||||
u16 segment;
|
||||
u8 bus_nr;
|
||||
|
||||
u32 osc_support_set; /* _OSC state of support bits */
|
||||
u32 osc_control_set; /* _OSC state of control bits */
|
||||
u32 osc_control_qry; /* the latest _OSC query result */
|
||||
|
||||
u32 osc_queried:1; /* has _OSC control been queried? */
|
||||
};
|
||||
|
||||
/* helper */
|
||||
acpi_handle acpi_get_child(acpi_handle, acpi_integer);
|
||||
int acpi_is_root_bridge(acpi_handle);
|
||||
acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
|
||||
struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
|
||||
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@@ -245,6 +245,9 @@ acpi_status acpi_osi_invalidate(char* interface);
|
||||
acpi_status
|
||||
acpi_os_validate_address(u8 space_id, acpi_physical_address address,
|
||||
acpi_size length, char *name);
|
||||
acpi_status
|
||||
acpi_os_invalidate_address(u8 space_id, acpi_physical_address address,
|
||||
acpi_size length);
|
||||
|
||||
u64 acpi_os_get_timer(void);
|
||||
|
||||
|
@@ -47,7 +47,7 @@
|
||||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20090521
|
||||
#define ACPI_CA_VERSION 0x20090903
|
||||
|
||||
#include "actypes.h"
|
||||
#include "actbl.h"
|
||||
@@ -64,6 +64,7 @@ extern u8 acpi_gbl_enable_interpreter_slack;
|
||||
extern u8 acpi_gbl_all_methods_serialized;
|
||||
extern u8 acpi_gbl_create_osi_method;
|
||||
extern u8 acpi_gbl_leave_wake_gpes_disabled;
|
||||
extern u8 acpi_gbl_use_default_register_widths;
|
||||
extern acpi_name acpi_gbl_trace_method_name;
|
||||
extern u32 acpi_gbl_trace_flags;
|
||||
|
||||
@@ -199,7 +200,8 @@ acpi_evaluate_object_typed(acpi_handle object,
|
||||
acpi_object_type return_type);
|
||||
|
||||
acpi_status
|
||||
acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer);
|
||||
acpi_get_object_info(acpi_handle handle,
|
||||
struct acpi_device_info **return_buffer);
|
||||
|
||||
acpi_status acpi_install_method(u8 *buffer);
|
||||
|
||||
@@ -359,9 +361,9 @@ acpi_status acpi_set_firmware_waking_vector(u32 physical_address);
|
||||
acpi_status acpi_set_firmware_waking_vector64(u64 physical_address);
|
||||
#endif
|
||||
|
||||
acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg);
|
||||
acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
|
||||
|
||||
acpi_status acpi_write(u32 value, struct acpi_generic_address *reg);
|
||||
acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
|
||||
|
||||
acpi_status
|
||||
acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
|
||||
|
@@ -44,9 +44,23 @@
|
||||
#ifndef __ACTBL_H__
|
||||
#define __ACTBL_H__
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Fundamental ACPI tables
|
||||
*
|
||||
* This file contains definitions for the ACPI tables that are directly consumed
|
||||
* by ACPICA. All other tables are consumed by the OS-dependent ACPI-related
|
||||
* device drivers and other OS support code.
|
||||
*
|
||||
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
|
||||
* tables use the header.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Values for description table header signatures. Useful because they make
|
||||
* it more difficult to inadvertently type in the wrong signature.
|
||||
* Values for description table header signatures for tables defined in this
|
||||
* file. Useful because they make it more difficult to inadvertently type in
|
||||
* the wrong signature.
|
||||
*/
|
||||
#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
|
||||
#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
|
||||
@@ -65,11 +79,6 @@
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* These are the ACPI tables that are directly consumed by the subsystem.
|
||||
*
|
||||
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
|
||||
* tables use the header.
|
||||
*
|
||||
* Note about bitfields: The u8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
@@ -77,9 +86,8 @@
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ACPI Table Header. This common header is used by all tables except the
|
||||
* RSDP and FACS. The define is used for direct inclusion of header into
|
||||
* other ACPI tables
|
||||
* Master ACPI Table Header. This common header is used by all ACPI tables
|
||||
* except the RSDP and FACS.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -95,13 +103,16 @@ struct acpi_table_header {
|
||||
u32 asl_compiler_revision; /* ASL compiler version */
|
||||
};
|
||||
|
||||
/*
|
||||
/*******************************************************************************
|
||||
*
|
||||
* GAS - Generic Address Structure (ACPI 2.0+)
|
||||
*
|
||||
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
|
||||
* If misalignment is not supported, access to the Address field must be
|
||||
* performed with care.
|
||||
*/
|
||||
* If misaliged access is not supported by the hardware, accesses to the
|
||||
* 64-bit Address field must be performed with care.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_generic_address {
|
||||
u8 space_id; /* Address space where struct or register exists */
|
||||
u8 bit_width; /* Size in bits of given register */
|
||||
@@ -113,6 +124,7 @@ struct acpi_generic_address {
|
||||
/*******************************************************************************
|
||||
*
|
||||
* RSDP - Root System Description Pointer (Signature is "RSD PTR ")
|
||||
* Version 2
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -133,6 +145,7 @@ struct acpi_table_rsdp {
|
||||
/*******************************************************************************
|
||||
*
|
||||
* RSDT/XSDT - Root System Description Tables
|
||||
* Version 1 (both)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -161,21 +174,29 @@ struct acpi_table_facs {
|
||||
u32 flags;
|
||||
u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
|
||||
u8 version; /* Version of this table (ACPI 2.0+) */
|
||||
u8 reserved[31]; /* Reserved, must be zero */
|
||||
u8 reserved[3]; /* Reserved, must be zero */
|
||||
u32 ospm_flags; /* Flags to be set by OSPM (ACPI 4.0) */
|
||||
u8 reserved1[24]; /* Reserved, must be zero */
|
||||
};
|
||||
|
||||
/* Flag macros */
|
||||
/* Masks for global_lock flag field above */
|
||||
|
||||
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
|
||||
#define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */
|
||||
#define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */
|
||||
|
||||
/* Global lock flags */
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
|
||||
#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
|
||||
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
|
||||
#define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */
|
||||
|
||||
/* Masks for ospm_flags field above */
|
||||
|
||||
#define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FADT - Fixed ACPI Description Table (Signature "FACP")
|
||||
* Version 4
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -236,7 +257,7 @@ struct acpi_table_fadt {
|
||||
struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
|
||||
};
|
||||
|
||||
/* FADT Boot Architecture Flags (boot_flags) */
|
||||
/* Masks for FADT Boot Architecture Flags (boot_flags) */
|
||||
|
||||
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
|
||||
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
|
||||
@@ -246,7 +267,7 @@ struct acpi_table_fadt {
|
||||
|
||||
#define FADT2_REVISION_ID 3
|
||||
|
||||
/* FADT flags */
|
||||
/* Masks for FADT flags */
|
||||
|
||||
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */
|
||||
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */
|
||||
@@ -269,7 +290,7 @@ struct acpi_table_fadt {
|
||||
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
|
||||
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local x_aPICs must use physical dest mode (ACPI 3.0) */
|
||||
|
||||
/* FADT Prefered Power Management Profiles */
|
||||
/* Values for preferred_profile (Prefered Power Management Profiles) */
|
||||
|
||||
enum acpi_prefered_pm_profiles {
|
||||
PM_UNSPECIFIED = 0,
|
||||
@@ -287,14 +308,16 @@ enum acpi_prefered_pm_profiles {
|
||||
|
||||
#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
|
||||
|
||||
/*
|
||||
* Internal table-related structures
|
||||
*/
|
||||
union acpi_name_union {
|
||||
u32 integer;
|
||||
char ascii[4];
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal ACPI Table Descriptor. One per ACPI table
|
||||
*/
|
||||
/* Internal ACPI Table Descriptor. One per ACPI table. */
|
||||
|
||||
struct acpi_table_desc {
|
||||
acpi_physical_address address;
|
||||
struct acpi_table_header *pointer;
|
||||
@@ -304,7 +327,7 @@ struct acpi_table_desc {
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
/* Flags for above */
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
|
||||
#define ACPI_TABLE_ORIGIN_MAPPED (1)
|
||||
@@ -318,5 +341,6 @@ struct acpi_table_desc {
|
||||
*/
|
||||
|
||||
#include <acpi/actbl1.h>
|
||||
#include <acpi/actbl2.h>
|
||||
|
||||
#endif /* __ACTBL_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
868
include/acpi/actbl2.h
Normal file
868
include/acpi/actbl2.h
Normal file
@@ -0,0 +1,868 @@
|
||||
#ifndef __ACTBL2_H__
|
||||
#define __ACTBL2_H__
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Additional ACPI Tables (2)
|
||||
*
|
||||
* These tables are not consumed directly by the ACPICA subsystem, but are
|
||||
* included here to support device drivers and the AML disassembler.
|
||||
*
|
||||
* The tables in this file are defined by third-party specifications, and are
|
||||
* not defined directly by the ACPI specification itself.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Values for description table header signatures for tables defined in this
|
||||
* file. Useful because they make it more difficult to inadvertently type in
|
||||
* the wrong signature.
|
||||
*/
|
||||
#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
|
||||
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
|
||||
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
|
||||
#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
|
||||
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
|
||||
#define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */
|
||||
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
|
||||
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
|
||||
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
|
||||
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
|
||||
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
|
||||
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
|
||||
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
|
||||
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
|
||||
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
|
||||
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
|
||||
|
||||
/*
|
||||
* All tables must be byte-packed to match the ACPI specification, since
|
||||
* the tables are provided by the system BIOS.
|
||||
*/
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Note about bitfields: The u8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ASF - Alert Standard Format table (Signature "ASF!")
|
||||
* Revision 0x10
|
||||
*
|
||||
* Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_asf {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
};
|
||||
|
||||
/* ASF subtable header */
|
||||
|
||||
struct acpi_asf_header {
|
||||
u8 type;
|
||||
u8 reserved;
|
||||
u16 length;
|
||||
};
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
enum acpi_asf_type {
|
||||
ACPI_ASF_TYPE_INFO = 0,
|
||||
ACPI_ASF_TYPE_ALERT = 1,
|
||||
ACPI_ASF_TYPE_CONTROL = 2,
|
||||
ACPI_ASF_TYPE_BOOT = 3,
|
||||
ACPI_ASF_TYPE_ADDRESS = 4,
|
||||
ACPI_ASF_TYPE_RESERVED = 5
|
||||
};
|
||||
|
||||
/*
|
||||
* ASF subtables
|
||||
*/
|
||||
|
||||
/* 0: ASF Information */
|
||||
|
||||
struct acpi_asf_info {
|
||||
struct acpi_asf_header header;
|
||||
u8 min_reset_value;
|
||||
u8 min_poll_interval;
|
||||
u16 system_id;
|
||||
u32 mfg_id;
|
||||
u8 flags;
|
||||
u8 reserved2[3];
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_ASF_SMBUS_PROTOCOLS (1)
|
||||
|
||||
/* 1: ASF Alerts */
|
||||
|
||||
struct acpi_asf_alert {
|
||||
struct acpi_asf_header header;
|
||||
u8 assert_mask;
|
||||
u8 deassert_mask;
|
||||
u8 alerts;
|
||||
u8 data_length;
|
||||
};
|
||||
|
||||
struct acpi_asf_alert_data {
|
||||
u8 address;
|
||||
u8 command;
|
||||
u8 mask;
|
||||
u8 value;
|
||||
u8 sensor_type;
|
||||
u8 type;
|
||||
u8 offset;
|
||||
u8 source_type;
|
||||
u8 severity;
|
||||
u8 sensor_number;
|
||||
u8 entity;
|
||||
u8 instance;
|
||||
};
|
||||
|
||||
/* 2: ASF Remote Control */
|
||||
|
||||
struct acpi_asf_remote {
|
||||
struct acpi_asf_header header;
|
||||
u8 controls;
|
||||
u8 data_length;
|
||||
u16 reserved2;
|
||||
};
|
||||
|
||||
struct acpi_asf_control_data {
|
||||
u8 function;
|
||||
u8 address;
|
||||
u8 command;
|
||||
u8 value;
|
||||
};
|
||||
|
||||
/* 3: ASF RMCP Boot Options */
|
||||
|
||||
struct acpi_asf_rmcp {
|
||||
struct acpi_asf_header header;
|
||||
u8 capabilities[7];
|
||||
u8 completion_code;
|
||||
u32 enterprise_id;
|
||||
u8 command;
|
||||
u16 parameter;
|
||||
u16 boot_options;
|
||||
u16 oem_parameters;
|
||||
};
|
||||
|
||||
/* 4: ASF Address */
|
||||
|
||||
struct acpi_asf_address {
|
||||
struct acpi_asf_header header;
|
||||
u8 eprom_address;
|
||||
u8 devices;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* BOOT - Simple Boot Flag Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to the "Simple Boot Flag Specification", Version 2.1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_boot {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 cmos_index; /* Index in CMOS RAM for the boot register */
|
||||
u8 reserved[3];
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DBGP - Debug Port table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_dbgp {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 type; /* 0=full 16550, 1=subset of 16550 */
|
||||
u8 reserved[3];
|
||||
struct acpi_generic_address debug_port;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DMAR - DMA Remapping table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Intel Virtualization Technology for Directed I/O",
|
||||
* Version 1.2, Sept. 2008
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_dmar {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 width; /* Host Address Width */
|
||||
u8 flags;
|
||||
u8 reserved[10];
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_DMAR_INTR_REMAP (1)
|
||||
|
||||
/* DMAR subtable header */
|
||||
|
||||
struct acpi_dmar_header {
|
||||
u16 type;
|
||||
u16 length;
|
||||
};
|
||||
|
||||
/* Values for subtable type in struct acpi_dmar_header */
|
||||
|
||||
enum acpi_dmar_type {
|
||||
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
|
||||
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
|
||||
ACPI_DMAR_TYPE_ATSR = 2,
|
||||
ACPI_DMAR_HARDWARE_AFFINITY = 3,
|
||||
ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
|
||||
};
|
||||
|
||||
/* DMAR Device Scope structure */
|
||||
|
||||
struct acpi_dmar_device_scope {
|
||||
u8 entry_type;
|
||||
u8 length;
|
||||
u16 reserved;
|
||||
u8 enumeration_id;
|
||||
u8 bus;
|
||||
};
|
||||
|
||||
/* Values for entry_type in struct acpi_dmar_device_scope */
|
||||
|
||||
enum acpi_dmar_scope_type {
|
||||
ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
|
||||
ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
|
||||
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
|
||||
ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
|
||||
ACPI_DMAR_SCOPE_TYPE_HPET = 4,
|
||||
ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
|
||||
};
|
||||
|
||||
struct acpi_dmar_pci_path {
|
||||
u8 dev;
|
||||
u8 fn;
|
||||
};
|
||||
|
||||
/*
|
||||
* DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
|
||||
*/
|
||||
|
||||
/* 0: Hardware Unit Definition */
|
||||
|
||||
struct acpi_dmar_hardware_unit {
|
||||
struct acpi_dmar_header header;
|
||||
u8 flags;
|
||||
u8 reserved;
|
||||
u16 segment;
|
||||
u64 address; /* Register Base Address */
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_DMAR_INCLUDE_ALL (1)
|
||||
|
||||
/* 1: Reserved Memory Defininition */
|
||||
|
||||
struct acpi_dmar_reserved_memory {
|
||||
struct acpi_dmar_header header;
|
||||
u16 reserved;
|
||||
u16 segment;
|
||||
u64 base_address; /* 4_k aligned base address */
|
||||
u64 end_address; /* 4_k aligned limit address */
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_DMAR_ALLOW_ALL (1)
|
||||
|
||||
/* 2: Root Port ATS Capability Reporting Structure */
|
||||
|
||||
struct acpi_dmar_atsr {
|
||||
struct acpi_dmar_header header;
|
||||
u8 flags;
|
||||
u8 reserved;
|
||||
u16 segment;
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_DMAR_ALL_PORTS (1)
|
||||
|
||||
/* 3: Remapping Hardware Static Affinity Structure */
|
||||
|
||||
struct acpi_dmar_rhsa {
|
||||
struct acpi_dmar_header header;
|
||||
u32 reserved;
|
||||
u64 base_address;
|
||||
u32 proximity_domain;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* HPET - High Precision Event Timer table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
|
||||
* Version 1.0a, October 2004
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_hpet {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u32 id; /* Hardware ID of event timer block */
|
||||
struct acpi_generic_address address; /* Address of event timer block */
|
||||
u8 sequence; /* HPET sequence number */
|
||||
u16 minimum_tick; /* Main counter min tick, periodic mode */
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_HPET_PAGE_PROTECT_MASK (3)
|
||||
|
||||
/* Values for Page Protect flags */
|
||||
|
||||
enum acpi_hpet_page_protect {
|
||||
ACPI_HPET_NO_PAGE_PROTECT = 0,
|
||||
ACPI_HPET_PAGE_PROTECT4 = 1,
|
||||
ACPI_HPET_PAGE_PROTECT64 = 2
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* IBFT - Boot Firmware Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
|
||||
* Specification", Version 1.01, March 1, 2007
|
||||
*
|
||||
* Note: It appears that this table is not intended to appear in the RSDT/XSDT.
|
||||
* Therefore, it is not currently supported by the disassembler.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_ibft {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 reserved[12];
|
||||
};
|
||||
|
||||
/* IBFT common subtable header */
|
||||
|
||||
struct acpi_ibft_header {
|
||||
u8 type;
|
||||
u8 version;
|
||||
u16 length;
|
||||
u8 index;
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
enum acpi_ibft_type {
|
||||
ACPI_IBFT_TYPE_NOT_USED = 0,
|
||||
ACPI_IBFT_TYPE_CONTROL = 1,
|
||||
ACPI_IBFT_TYPE_INITIATOR = 2,
|
||||
ACPI_IBFT_TYPE_NIC = 3,
|
||||
ACPI_IBFT_TYPE_TARGET = 4,
|
||||
ACPI_IBFT_TYPE_EXTENSIONS = 5,
|
||||
ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
|
||||
};
|
||||
|
||||
/* IBFT subtables */
|
||||
|
||||
struct acpi_ibft_control {
|
||||
struct acpi_ibft_header header;
|
||||
u16 extensions;
|
||||
u16 initiator_offset;
|
||||
u16 nic0_offset;
|
||||
u16 target0_offset;
|
||||
u16 nic1_offset;
|
||||
u16 target1_offset;
|
||||
};
|
||||
|
||||
struct acpi_ibft_initiator {
|
||||
struct acpi_ibft_header header;
|
||||
u8 sns_server[16];
|
||||
u8 slp_server[16];
|
||||
u8 primary_server[16];
|
||||
u8 secondary_server[16];
|
||||
u16 name_length;
|
||||
u16 name_offset;
|
||||
};
|
||||
|
||||
struct acpi_ibft_nic {
|
||||
struct acpi_ibft_header header;
|
||||
u8 ip_address[16];
|
||||
u8 subnet_mask_prefix;
|
||||
u8 origin;
|
||||
u8 gateway[16];
|
||||
u8 primary_dns[16];
|
||||
u8 secondary_dns[16];
|
||||
u8 dhcp[16];
|
||||
u16 vlan;
|
||||
u8 mac_address[6];
|
||||
u16 pci_address;
|
||||
u16 name_length;
|
||||
u16 name_offset;
|
||||
};
|
||||
|
||||
struct acpi_ibft_target {
|
||||
struct acpi_ibft_header header;
|
||||
u8 target_ip_address[16];
|
||||
u16 target_ip_socket;
|
||||
u8 target_boot_lun[8];
|
||||
u8 chap_type;
|
||||
u8 nic_association;
|
||||
u16 target_name_length;
|
||||
u16 target_name_offset;
|
||||
u16 chap_name_length;
|
||||
u16 chap_name_offset;
|
||||
u16 chap_secret_length;
|
||||
u16 chap_secret_offset;
|
||||
u16 reverse_chap_name_length;
|
||||
u16 reverse_chap_name_offset;
|
||||
u16 reverse_chap_secret_length;
|
||||
u16 reverse_chap_secret_offset;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* IVRS - I/O Virtualization Reporting Structure
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
|
||||
* Revision 1.26, February 2009.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_ivrs {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u32 info; /* Common virtualization info */
|
||||
u64 reserved;
|
||||
};
|
||||
|
||||
/* Values for Info field above */
|
||||
|
||||
#define ACPI_IVRS_PHYSICAL_SIZE 0x00007F00 /* 7 bits, physical address size */
|
||||
#define ACPI_IVRS_VIRTUAL_SIZE 0x003F8000 /* 7 bits, virtual address size */
|
||||
#define ACPI_IVRS_ATS_RESERVED 0x00400000 /* ATS address translation range reserved */
|
||||
|
||||
/* IVRS subtable header */
|
||||
|
||||
struct acpi_ivrs_header {
|
||||
u8 type; /* Subtable type */
|
||||
u8 flags;
|
||||
u16 length; /* Subtable length */
|
||||
u16 device_id; /* ID of IOMMU */
|
||||
};
|
||||
|
||||
/* Values for subtable Type above */
|
||||
|
||||
enum acpi_ivrs_type {
|
||||
ACPI_IVRS_TYPE_HARDWARE = 0x10,
|
||||
ACPI_IVRS_TYPE_MEMORY1 = 0x20,
|
||||
ACPI_IVRS_TYPE_MEMORY2 = 0x21,
|
||||
ACPI_IVRS_TYPE_MEMORY3 = 0x22
|
||||
};
|
||||
|
||||
/* Masks for Flags field above for IVHD subtable */
|
||||
|
||||
#define ACPI_IVHD_TT_ENABLE (1)
|
||||
#define ACPI_IVHD_PASS_PW (1<<1)
|
||||
#define ACPI_IVHD_RES_PASS_PW (1<<2)
|
||||
#define ACPI_IVHD_ISOC (1<<3)
|
||||
#define ACPI_IVHD_IOTLB (1<<4)
|
||||
|
||||
/* Masks for Flags field above for IVMD subtable */
|
||||
|
||||
#define ACPI_IVMD_UNITY (1)
|
||||
#define ACPI_IVMD_READ (1<<1)
|
||||
#define ACPI_IVMD_WRITE (1<<2)
|
||||
#define ACPI_IVMD_EXCLUSION_RANGE (1<<3)
|
||||
|
||||
/*
|
||||
* IVRS subtables, correspond to Type in struct acpi_ivrs_header
|
||||
*/
|
||||
|
||||
/* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
|
||||
|
||||
struct acpi_ivrs_hardware {
|
||||
struct acpi_ivrs_header header;
|
||||
u16 capability_offset; /* Offset for IOMMU control fields */
|
||||
u64 base_address; /* IOMMU control registers */
|
||||
u16 pci_segment_group;
|
||||
u16 info; /* MSI number and unit ID */
|
||||
u32 reserved;
|
||||
};
|
||||
|
||||
/* Masks for Info field above */
|
||||
|
||||
#define ACPI_IVHD_MSI_NUMBER_MASK 0x001F /* 5 bits, MSI message number */
|
||||
#define ACPI_IVHD_UNIT_ID_MASK 0x1F00 /* 5 bits, unit_iD */
|
||||
|
||||
/*
|
||||
* Device Entries for IVHD subtable, appear after struct acpi_ivrs_hardware structure.
|
||||
* Upper two bits of the Type field are the (encoded) length of the structure.
|
||||
* Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
|
||||
* are reserved for future use but not defined.
|
||||
*/
|
||||
struct acpi_ivrs_de_header {
|
||||
u8 type;
|
||||
u16 id;
|
||||
u8 data_setting;
|
||||
};
|
||||
|
||||
/* Length of device entry is in the top two bits of Type field above */
|
||||
|
||||
#define ACPI_IVHD_ENTRY_LENGTH 0xC0
|
||||
|
||||
/* Values for device entry Type field above */
|
||||
|
||||
enum acpi_ivrs_device_entry_type {
|
||||
/* 4-byte device entries, all use struct acpi_ivrs_device4 */
|
||||
|
||||
ACPI_IVRS_TYPE_PAD4 = 0,
|
||||
ACPI_IVRS_TYPE_ALL = 1,
|
||||
ACPI_IVRS_TYPE_SELECT = 2,
|
||||
ACPI_IVRS_TYPE_START = 3,
|
||||
ACPI_IVRS_TYPE_END = 4,
|
||||
|
||||
/* 8-byte device entries */
|
||||
|
||||
ACPI_IVRS_TYPE_PAD8 = 64,
|
||||
ACPI_IVRS_TYPE_NOT_USED = 65,
|
||||
ACPI_IVRS_TYPE_ALIAS_SELECT = 66, /* Uses struct acpi_ivrs_device8a */
|
||||
ACPI_IVRS_TYPE_ALIAS_START = 67, /* Uses struct acpi_ivrs_device8a */
|
||||
ACPI_IVRS_TYPE_EXT_SELECT = 70, /* Uses struct acpi_ivrs_device8b */
|
||||
ACPI_IVRS_TYPE_EXT_START = 71, /* Uses struct acpi_ivrs_device8b */
|
||||
ACPI_IVRS_TYPE_SPECIAL = 72 /* Uses struct acpi_ivrs_device8c */
|
||||
};
|
||||
|
||||
/* Values for Data field above */
|
||||
|
||||
#define ACPI_IVHD_INIT_PASS (1)
|
||||
#define ACPI_IVHD_EINT_PASS (1<<1)
|
||||
#define ACPI_IVHD_NMI_PASS (1<<2)
|
||||
#define ACPI_IVHD_SYSTEM_MGMT (3<<4)
|
||||
#define ACPI_IVHD_LINT0_PASS (1<<6)
|
||||
#define ACPI_IVHD_LINT1_PASS (1<<7)
|
||||
|
||||
/* Types 0-4: 4-byte device entry */
|
||||
|
||||
struct acpi_ivrs_device4 {
|
||||
struct acpi_ivrs_de_header header;
|
||||
};
|
||||
|
||||
/* Types 66-67: 8-byte device entry */
|
||||
|
||||
struct acpi_ivrs_device8a {
|
||||
struct acpi_ivrs_de_header header;
|
||||
u8 reserved1;
|
||||
u16 used_id;
|
||||
u8 reserved2;
|
||||
};
|
||||
|
||||
/* Types 70-71: 8-byte device entry */
|
||||
|
||||
struct acpi_ivrs_device8b {
|
||||
struct acpi_ivrs_de_header header;
|
||||
u32 extended_data;
|
||||
};
|
||||
|
||||
/* Values for extended_data above */
|
||||
|
||||
#define ACPI_IVHD_ATS_DISABLED (1<<31)
|
||||
|
||||
/* Type 72: 8-byte device entry */
|
||||
|
||||
struct acpi_ivrs_device8c {
|
||||
struct acpi_ivrs_de_header header;
|
||||
u8 handle;
|
||||
u16 used_id;
|
||||
u8 variety;
|
||||
};
|
||||
|
||||
/* Values for Variety field above */
|
||||
|
||||
#define ACPI_IVHD_IOAPIC 1
|
||||
#define ACPI_IVHD_HPET 2
|
||||
|
||||
/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
|
||||
|
||||
struct acpi_ivrs_memory {
|
||||
struct acpi_ivrs_header header;
|
||||
u16 aux_data;
|
||||
u64 reserved;
|
||||
u64 start_address;
|
||||
u64 memory_length;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MCFG - PCI Memory Mapped Configuration table and sub-table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_mcfg {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
/* Subtable */
|
||||
|
||||
struct acpi_mcfg_allocation {
|
||||
u64 address; /* Base address, processor-relative */
|
||||
u16 pci_segment; /* PCI segment group number */
|
||||
u8 start_bus_number; /* Starting PCI Bus number */
|
||||
u8 end_bus_number; /* Final PCI Bus number */
|
||||
u32 reserved;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SPCR - Serial Port Console Redirection table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Serial Port Console Redirection Table",
|
||||
* Version 1.00, January 11, 2002
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_spcr {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
|
||||
u8 reserved[3];
|
||||
struct acpi_generic_address serial_port;
|
||||
u8 interrupt_type;
|
||||
u8 pc_interrupt;
|
||||
u32 interrupt;
|
||||
u8 baud_rate;
|
||||
u8 parity;
|
||||
u8 stop_bits;
|
||||
u8 flow_control;
|
||||
u8 terminal_type;
|
||||
u8 reserved1;
|
||||
u16 pci_device_id;
|
||||
u16 pci_vendor_id;
|
||||
u8 pci_bus;
|
||||
u8 pci_device;
|
||||
u8 pci_function;
|
||||
u32 pci_flags;
|
||||
u8 pci_segment;
|
||||
u32 reserved2;
|
||||
};
|
||||
|
||||
/* Masks for pci_flags field above */
|
||||
|
||||
#define ACPI_SPCR_DO_NOT_DISABLE (1)
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SPMI - Server Platform Management Interface table
|
||||
* Version 5
|
||||
*
|
||||
* Conforms to "Intelligent Platform Management Interface Specification
|
||||
* Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
|
||||
* June 12, 2009 markup.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_spmi {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 interface_type;
|
||||
u8 reserved; /* Must be 1 */
|
||||
u16 spec_revision; /* Version of IPMI */
|
||||
u8 interrupt_type;
|
||||
u8 gpe_number; /* GPE assigned */
|
||||
u8 reserved1;
|
||||
u8 pci_device_flag;
|
||||
u32 interrupt;
|
||||
struct acpi_generic_address ipmi_register;
|
||||
u8 pci_segment;
|
||||
u8 pci_bus;
|
||||
u8 pci_device;
|
||||
u8 pci_function;
|
||||
u8 reserved2;
|
||||
};
|
||||
|
||||
/* Values for interface_type above */
|
||||
|
||||
enum acpi_spmi_interface_types {
|
||||
ACPI_SPMI_NOT_USED = 0,
|
||||
ACPI_SPMI_KEYBOARD = 1,
|
||||
ACPI_SPMI_SMI = 2,
|
||||
ACPI_SPMI_BLOCK_TRANSFER = 3,
|
||||
ACPI_SPMI_SMBUS = 4,
|
||||
ACPI_SPMI_RESERVED = 5 /* 5 and above are reserved */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* TCPA - Trusted Computing Platform Alliance table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "TCG PC Specific Implementation Specification",
|
||||
* Version 1.1, August 18, 2003
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_tcpa {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u16 reserved;
|
||||
u32 max_log_length; /* Maximum length for the event log area */
|
||||
u64 log_address; /* Address of the event log area */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* UEFI - UEFI Boot optimization Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Unified Extensible Firmware Interface Specification",
|
||||
* Version 2.3, May 8, 2009
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_uefi {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u8 identifier[16]; /* UUID identifier */
|
||||
u16 data_offset; /* Offset of remaining data in table */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WAET - Windows ACPI Emulated devices Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_waet {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u32 flags;
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_WAET_RTC_NO_ACK (1) /* RTC requires no int acknowledge */
|
||||
#define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDAT - Watchdog Action Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Hardware Watchdog Timers Design Specification",
|
||||
* Copyright 2006 Microsoft Corporation.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_wdat {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
u32 header_length; /* Watchdog Header Length */
|
||||
u16 pci_segment; /* PCI Segment number */
|
||||
u8 pci_bus; /* PCI Bus number */
|
||||
u8 pci_device; /* PCI Device number */
|
||||
u8 pci_function; /* PCI Function number */
|
||||
u8 reserved[3];
|
||||
u32 timer_period; /* Period of one timer count (msec) */
|
||||
u32 max_count; /* Maximum counter value supported */
|
||||
u32 min_count; /* Minimum counter value */
|
||||
u8 flags;
|
||||
u8 reserved2[3];
|
||||
u32 entries; /* Number of watchdog entries that follow */
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_WDAT_ENABLED (1)
|
||||
#define ACPI_WDAT_STOPPED 0x80
|
||||
|
||||
/* WDAT Instruction Entries (actions) */
|
||||
|
||||
struct acpi_wdat_entry {
|
||||
u8 action;
|
||||
u8 instruction;
|
||||
u16 reserved;
|
||||
struct acpi_generic_address register_region;
|
||||
u32 value; /* Value used with Read/Write register */
|
||||
u32 mask; /* Bitmask required for this register instruction */
|
||||
};
|
||||
|
||||
/* Values for Action field above */
|
||||
|
||||
enum acpi_wdat_actions {
|
||||
ACPI_WDAT_RESET = 1,
|
||||
ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
|
||||
ACPI_WDAT_GET_COUNTDOWN = 5,
|
||||
ACPI_WDAT_SET_COUNTDOWN = 6,
|
||||
ACPI_WDAT_GET_RUNNING_STATE = 8,
|
||||
ACPI_WDAT_SET_RUNNING_STATE = 9,
|
||||
ACPI_WDAT_GET_STOPPED_STATE = 10,
|
||||
ACPI_WDAT_SET_STOPPED_STATE = 11,
|
||||
ACPI_WDAT_GET_REBOOT = 16,
|
||||
ACPI_WDAT_SET_REBOOT = 17,
|
||||
ACPI_WDAT_GET_SHUTDOWN = 18,
|
||||
ACPI_WDAT_SET_SHUTDOWN = 19,
|
||||
ACPI_WDAT_GET_STATUS = 32,
|
||||
ACPI_WDAT_SET_STATUS = 33,
|
||||
ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
|
||||
};
|
||||
|
||||
/* Values for Instruction field above */
|
||||
|
||||
enum acpi_wdat_instructions {
|
||||
ACPI_WDAT_READ_VALUE = 0,
|
||||
ACPI_WDAT_READ_COUNTDOWN = 1,
|
||||
ACPI_WDAT_WRITE_VALUE = 2,
|
||||
ACPI_WDAT_WRITE_COUNTDOWN = 3,
|
||||
ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
|
||||
ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WDRT - Watchdog Resource Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
|
||||
* Version 1.01, August 28, 2006
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct acpi_table_wdrt {
|
||||
struct acpi_table_header header; /* Common ACPI table header */
|
||||
struct acpi_generic_address control_register;
|
||||
struct acpi_generic_address count_register;
|
||||
u16 pci_device_id;
|
||||
u16 pci_vendor_id;
|
||||
u8 pci_bus; /* PCI Bus number */
|
||||
u8 pci_device; /* PCI Device number */
|
||||
u8 pci_function; /* PCI Function number */
|
||||
u8 pci_segment; /* PCI Segment number */
|
||||
u16 max_count; /* Maximum counter value supported */
|
||||
u8 units;
|
||||
};
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __ACTBL2_H__ */
|
@@ -288,7 +288,7 @@ typedef u32 acpi_physical_address;
|
||||
/*
|
||||
* Some compilers complain about unused variables. Sometimes we don't want to
|
||||
* use all the variables (for example, _acpi_module_name). This allows us
|
||||
* to to tell the compiler in a per-variable manner that a variable
|
||||
* to tell the compiler in a per-variable manner that a variable
|
||||
* is unused
|
||||
*/
|
||||
#ifndef ACPI_UNUSED_VAR
|
||||
@@ -338,7 +338,7 @@ typedef u32 acpi_physical_address;
|
||||
|
||||
/* PM Timer ticks per second (HZ) */
|
||||
|
||||
#define PM_TIMER_FREQUENCY 3579545
|
||||
#define PM_TIMER_FREQUENCY 3579545
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -732,7 +732,8 @@ typedef u8 acpi_adr_space_type;
|
||||
#define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4
|
||||
#define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5
|
||||
#define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7
|
||||
#define ACPI_ADR_SPACE_IPMI (acpi_adr_space_type) 7
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 8
|
||||
#define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127
|
||||
|
||||
/*
|
||||
@@ -921,7 +922,7 @@ typedef
|
||||
void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context);
|
||||
|
||||
typedef
|
||||
void (*acpi_object_handler) (acpi_handle object, u32 function, void *data);
|
||||
void (*acpi_object_handler) (acpi_handle object, void *data);
|
||||
|
||||
typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function);
|
||||
|
||||
@@ -969,38 +970,60 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
|
||||
#define ACPI_INTERRUPT_NOT_HANDLED 0x00
|
||||
#define ACPI_INTERRUPT_HANDLED 0x01
|
||||
|
||||
/* Length of _HID, _UID, _CID, and UUID values */
|
||||
/* Length of 32-bit EISAID values when converted back to a string */
|
||||
|
||||
#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */
|
||||
|
||||
/* Length of UUID (string) values */
|
||||
|
||||
#define ACPI_DEVICE_ID_LENGTH 0x09
|
||||
#define ACPI_MAX_CID_LENGTH 48
|
||||
#define ACPI_UUID_LENGTH 16
|
||||
|
||||
/* Common string version of device HIDs and UIDs */
|
||||
/* Structures used for device/processor HID, UID, CID */
|
||||
|
||||
struct acpica_device_id {
|
||||
char value[ACPI_DEVICE_ID_LENGTH];
|
||||
u32 length; /* Length of string + null */
|
||||
char *string;
|
||||
};
|
||||
|
||||
/* Common string version of device CIDs */
|
||||
|
||||
struct acpi_compatible_id {
|
||||
char value[ACPI_MAX_CID_LENGTH];
|
||||
struct acpica_device_id_list {
|
||||
u32 count; /* Number of IDs in Ids array */
|
||||
u32 list_size; /* Size of list, including ID strings */
|
||||
struct acpica_device_id ids[1]; /* ID array */
|
||||
};
|
||||
|
||||
struct acpi_compatible_id_list {
|
||||
u32 count;
|
||||
u32 size;
|
||||
struct acpi_compatible_id id[1];
|
||||
/*
|
||||
* Structure returned from acpi_get_object_info.
|
||||
* Optimized for both 32- and 64-bit builds
|
||||
*/
|
||||
struct acpi_device_info {
|
||||
u32 info_size; /* Size of info, including ID strings */
|
||||
u32 name; /* ACPI object Name */
|
||||
acpi_object_type type; /* ACPI object Type */
|
||||
u8 param_count; /* If a method, required parameter count */
|
||||
u8 valid; /* Indicates which optional fields are valid */
|
||||
u8 flags; /* Miscellaneous info */
|
||||
u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
|
||||
u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */
|
||||
u32 current_status; /* _STA value */
|
||||
acpi_integer address; /* _ADR value */
|
||||
struct acpica_device_id hardware_id; /* _HID value */
|
||||
struct acpica_device_id unique_id; /* _UID value */
|
||||
struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */
|
||||
};
|
||||
|
||||
/* Structure and flags for acpi_get_object_info */
|
||||
/* Values for Flags field above (acpi_get_object_info) */
|
||||
|
||||
#define ACPI_VALID_STA 0x0001
|
||||
#define ACPI_VALID_ADR 0x0002
|
||||
#define ACPI_VALID_HID 0x0004
|
||||
#define ACPI_VALID_UID 0x0008
|
||||
#define ACPI_VALID_CID 0x0010
|
||||
#define ACPI_VALID_SXDS 0x0020
|
||||
#define ACPI_PCI_ROOT_BRIDGE 0x01
|
||||
|
||||
/* Flags for Valid field above (acpi_get_object_info) */
|
||||
|
||||
#define ACPI_VALID_STA 0x01
|
||||
#define ACPI_VALID_ADR 0x02
|
||||
#define ACPI_VALID_HID 0x04
|
||||
#define ACPI_VALID_UID 0x08
|
||||
#define ACPI_VALID_CID 0x10
|
||||
#define ACPI_VALID_SXDS 0x20
|
||||
#define ACPI_VALID_SXWS 0x40
|
||||
|
||||
/* Flags for _STA method */
|
||||
|
||||
@@ -1011,29 +1034,6 @@ struct acpi_compatible_id_list {
|
||||
#define ACPI_STA_DEVICE_OK 0x08 /* Synonym */
|
||||
#define ACPI_STA_BATTERY_PRESENT 0x10
|
||||
|
||||
#define ACPI_COMMON_OBJ_INFO \
|
||||
acpi_object_type type; /* ACPI object type */ \
|
||||
acpi_name name /* ACPI object Name */
|
||||
|
||||
struct acpi_obj_info_header {
|
||||
ACPI_COMMON_OBJ_INFO;
|
||||
};
|
||||
|
||||
/* Structure returned from Get Object Info */
|
||||
|
||||
struct acpi_device_info {
|
||||
ACPI_COMMON_OBJ_INFO;
|
||||
|
||||
u32 param_count; /* If a method, required parameter count */
|
||||
u32 valid; /* Indicates which fields below are valid */
|
||||
u32 current_status; /* _STA value */
|
||||
acpi_integer address; /* _ADR value if any */
|
||||
struct acpica_device_id hardware_id; /* _HID value if any */
|
||||
struct acpica_device_id unique_id; /* _UID value if any */
|
||||
u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
|
||||
struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
|
||||
};
|
||||
|
||||
/* Context structs for address space handlers */
|
||||
|
||||
struct acpi_pci_id {
|
||||
|
25
include/acpi/button.h
Normal file
25
include/acpi/button.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef ACPI_BUTTON_H
|
||||
#define ACPI_BUTTON_H
|
||||
|
||||
#include <linux/notifier.h>
|
||||
|
||||
#if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE)
|
||||
extern int acpi_lid_notifier_register(struct notifier_block *nb);
|
||||
extern int acpi_lid_notifier_unregister(struct notifier_block *nb);
|
||||
extern int acpi_lid_open(void);
|
||||
#else
|
||||
static inline int acpi_lid_notifier_register(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int acpi_lid_notifier_unregister(struct notifier_block *nb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int acpi_lid_open(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */
|
||||
|
||||
#endif /* ACPI_BUTTON_H */
|
@@ -57,7 +57,7 @@
|
||||
/*
|
||||
* Some compilers complain about unused variables. Sometimes we don't want to
|
||||
* use all the variables (for example, _acpi_module_name). This allows us
|
||||
* to to tell the compiler warning in a per-variable manner that a variable
|
||||
* to tell the compiler warning in a per-variable manner that a variable
|
||||
* is unused.
|
||||
*/
|
||||
#define ACPI_UNUSED_VAR __attribute__ ((unused))
|
||||
|
@@ -149,10 +149,10 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
|
||||
#define ACPI_FREE(a) kfree(a)
|
||||
|
||||
/* Used within ACPICA to show where it is safe to preempt execution */
|
||||
|
||||
#include <linux/hardirq.h>
|
||||
#define ACPI_PREEMPTION_POINT() \
|
||||
do { \
|
||||
if (!irqs_disabled()) \
|
||||
if (!in_atomic_preempt_off()) \
|
||||
cond_resched(); \
|
||||
} while (0)
|
||||
|
||||
|
@@ -3,6 +3,11 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
header-y += kvm.h
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
|
||||
header-y += kvm_para.h
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/a.out.h),)
|
||||
unifdef-y += a.out.h
|
||||
|
@@ -7,6 +7,7 @@
|
||||
typedef unsigned long cputime_t;
|
||||
|
||||
#define cputime_zero (0UL)
|
||||
#define cputime_one_jiffy jiffies_to_cputime(1)
|
||||
#define cputime_max ((~0UL >> 1) - 1)
|
||||
#define cputime_add(__a, __b) ((__a) + (__b))
|
||||
#define cputime_sub(__a, __b) ((__a) - (__b))
|
||||
|
@@ -9,4 +9,7 @@
|
||||
struct dev_archdata {
|
||||
};
|
||||
|
||||
struct pdev_archdata {
|
||||
};
|
||||
|
||||
#endif /* _ASM_GENERIC_DEVICE_H */
|
||||
|
@@ -73,6 +73,19 @@
|
||||
#define F_SETSIG 10 /* for sockets. */
|
||||
#define F_GETSIG 11 /* for sockets. */
|
||||
#endif
|
||||
#ifndef F_SETOWN_EX
|
||||
#define F_SETOWN_EX 12
|
||||
#define F_GETOWN_EX 13
|
||||
#endif
|
||||
|
||||
#define F_OWNER_TID 0
|
||||
#define F_OWNER_PID 1
|
||||
#define F_OWNER_GID 2
|
||||
|
||||
struct f_owner_ex {
|
||||
int type;
|
||||
pid_t pid;
|
||||
};
|
||||
|
||||
/* for F_[GET|SET]FL */
|
||||
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
|
||||
|
@@ -141,6 +141,8 @@ extern int __gpio_to_irq(unsigned gpio);
|
||||
* 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 void gpio_unexport(unsigned gpio);
|
||||
|
||||
#endif /* CONFIG_GPIO_SYSFS */
|
||||
@@ -185,6 +187,12 @@ 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 void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
}
|
||||
|
@@ -2,34 +2,35 @@
|
||||
#define _ASM_GENERIC_KMAP_TYPES_H
|
||||
|
||||
#ifdef __WITH_KM_FENCE
|
||||
# define D(n) __KM_FENCE_##n ,
|
||||
# define KMAP_D(n) __KM_FENCE_##n ,
|
||||
#else
|
||||
# define D(n)
|
||||
# define KMAP_D(n)
|
||||
#endif
|
||||
|
||||
enum km_type {
|
||||
D(0) KM_BOUNCE_READ,
|
||||
D(1) KM_SKB_SUNRPC_DATA,
|
||||
D(2) KM_SKB_DATA_SOFTIRQ,
|
||||
D(3) KM_USER0,
|
||||
D(4) KM_USER1,
|
||||
D(5) KM_BIO_SRC_IRQ,
|
||||
D(6) KM_BIO_DST_IRQ,
|
||||
D(7) KM_PTE0,
|
||||
D(8) KM_PTE1,
|
||||
D(9) KM_IRQ0,
|
||||
D(10) KM_IRQ1,
|
||||
D(11) KM_SOFTIRQ0,
|
||||
D(12) KM_SOFTIRQ1,
|
||||
D(13) KM_SYNC_ICACHE,
|
||||
D(14) KM_SYNC_DCACHE,
|
||||
D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */
|
||||
D(16) KM_IRQ_PTE,
|
||||
D(17) KM_NMI,
|
||||
D(18) KM_NMI_PTE,
|
||||
D(19) KM_TYPE_NR
|
||||
KMAP_D(0) KM_BOUNCE_READ,
|
||||
KMAP_D(1) KM_SKB_SUNRPC_DATA,
|
||||
KMAP_D(2) KM_SKB_DATA_SOFTIRQ,
|
||||
KMAP_D(3) KM_USER0,
|
||||
KMAP_D(4) KM_USER1,
|
||||
KMAP_D(5) KM_BIO_SRC_IRQ,
|
||||
KMAP_D(6) KM_BIO_DST_IRQ,
|
||||
KMAP_D(7) KM_PTE0,
|
||||
KMAP_D(8) KM_PTE1,
|
||||
KMAP_D(9) KM_IRQ0,
|
||||
KMAP_D(10) KM_IRQ1,
|
||||
KMAP_D(11) KM_SOFTIRQ0,
|
||||
KMAP_D(12) KM_SOFTIRQ1,
|
||||
KMAP_D(13) KM_SYNC_ICACHE,
|
||||
KMAP_D(14) KM_SYNC_DCACHE,
|
||||
/* UML specific, for copy_*_user - used in do_op_one_page */
|
||||
KMAP_D(15) KM_UML_USERCOPY,
|
||||
KMAP_D(16) KM_IRQ_PTE,
|
||||
KMAP_D(17) KM_NMI,
|
||||
KMAP_D(18) KM_NMI_PTE,
|
||||
KMAP_D(19) KM_TYPE_NR
|
||||
};
|
||||
|
||||
#undef D
|
||||
#undef KMAP_D
|
||||
|
||||
#endif
|
||||
|
@@ -34,6 +34,10 @@
|
||||
#define MADV_REMOVE 9 /* remove these pages & resources */
|
||||
#define MADV_DONTFORK 10 /* don't inherit across fork */
|
||||
#define MADV_DOFORK 11 /* do inherit across fork */
|
||||
#define MADV_HWPOISON 100 /* poison a page for testing */
|
||||
|
||||
#define MADV_MERGEABLE 12 /* KSM may merge identical pages */
|
||||
#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */
|
||||
|
||||
/* compatibility flags */
|
||||
#define MAP_FILE 0
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */
|
||||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
|
||||
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
|
||||
#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
|
||||
|
||||
#define MCL_CURRENT 1 /* lock all current mappings */
|
||||
#define MCL_FUTURE 2 /* lock all future mappings */
|
||||
|
@@ -30,7 +30,18 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
|
||||
res->end = region->end;
|
||||
}
|
||||
|
||||
#define pcibios_scan_all_fns(a, b) 0
|
||||
static inline struct resource *
|
||||
pcibios_select_root(struct pci_dev *pdev, struct resource *res)
|
||||
{
|
||||
struct resource *root = NULL;
|
||||
|
||||
if (res->flags & IORESOURCE_IO)
|
||||
root = &ioport_resource;
|
||||
if (res->flags & IORESOURCE_MEM)
|
||||
root = &iomem_resource;
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
|
||||
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
||||
|
@@ -23,4 +23,20 @@ extern char __ctors_start[], __ctors_end[];
|
||||
#define dereference_function_descriptor(p) (p)
|
||||
#endif
|
||||
|
||||
/* random extra sections (if any). Override
|
||||
* in asm/sections.h */
|
||||
#ifndef arch_is_kernel_text
|
||||
static inline int arch_is_kernel_text(unsigned long addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef arch_is_kernel_data
|
||||
static inline int arch_is_kernel_data(unsigned long addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_GENERIC_SECTIONS_H_ */
|
||||
|
@@ -82,6 +82,7 @@ typedef struct siginfo {
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
int _trapno; /* TRAP # which caused the signal */
|
||||
#endif
|
||||
short _addr_lsb; /* LSB of the reported address */
|
||||
} _sigfault;
|
||||
|
||||
/* SIGPOLL */
|
||||
@@ -112,6 +113,7 @@ typedef struct siginfo {
|
||||
#ifdef __ARCH_SI_TRAPNO
|
||||
#define si_trapno _sifields._sigfault._trapno
|
||||
#endif
|
||||
#define si_addr_lsb _sifields._sigfault._addr_lsb
|
||||
#define si_band _sifields._sigpoll._band
|
||||
#define si_fd _sifields._sigpoll._fd
|
||||
|
||||
@@ -192,7 +194,11 @@ typedef struct siginfo {
|
||||
#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */
|
||||
#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */
|
||||
#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */
|
||||
#define NSIGBUS 3
|
||||
/* hardware memory error consumed on a machine check: action required */
|
||||
#define BUS_MCEERR_AR (__SI_FAULT|4)
|
||||
/* hardware memory error detected in process but not consumed: action optional*/
|
||||
#define BUS_MCEERR_AO (__SI_FAULT|5)
|
||||
#define NSIGBUS 5
|
||||
|
||||
/*
|
||||
* SIGTRAP si_codes
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Access to user system call parameters and results
|
||||
*
|
||||
* Copyright (C) 2008 Red Hat, Inc. All rights reserved.
|
||||
* Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use,
|
||||
* modify, copy, or redistribute it subject to the terms and conditions
|
||||
@@ -32,9 +32,13 @@ struct pt_regs;
|
||||
* If @task is not executing a system call, i.e. it's blocked
|
||||
* inside the kernel for a fault or signal, returns -1.
|
||||
*
|
||||
* Note this returns int even on 64-bit machines. Only 32 bits of
|
||||
* system call number can be meaningful. If the actual arch value
|
||||
* is 64 bits, this truncates to 32 bits so 0xffffffff means -1.
|
||||
*
|
||||
* It's only valid to call this when @task is known to be blocked.
|
||||
*/
|
||||
long syscall_get_nr(struct task_struct *task, struct pt_regs *regs);
|
||||
int syscall_get_nr(struct task_struct *task, struct pt_regs *regs);
|
||||
|
||||
/**
|
||||
* syscall_rollback - roll back registers after an aborted system call
|
||||
|
@@ -37,9 +37,6 @@
|
||||
#ifndef parent_node
|
||||
#define parent_node(node) ((void)(node),0)
|
||||
#endif
|
||||
#ifndef node_to_cpumask
|
||||
#define node_to_cpumask(node) ((void)node, cpu_online_map)
|
||||
#endif
|
||||
#ifndef cpumask_of_node
|
||||
#define cpumask_of_node(node) ((void)node, cpu_online_mask)
|
||||
#endif
|
||||
@@ -55,18 +52,4 @@
|
||||
|
||||
#endif /* CONFIG_NUMA */
|
||||
|
||||
/*
|
||||
* returns pointer to cpumask for specified node
|
||||
* Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
|
||||
*/
|
||||
#ifndef node_to_cpumask_ptr
|
||||
|
||||
#define node_to_cpumask_ptr(v, node) \
|
||||
cpumask_t _##v = node_to_cpumask(node); \
|
||||
const cpumask_t *v = &_##v
|
||||
|
||||
#define node_to_cpumask_ptr_next(v, node) \
|
||||
_##v = node_to_cpumask(node)
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_GENERIC_TOPOLOGY_H */
|
||||
|
@@ -620,8 +620,8 @@ __SYSCALL(__NR_move_pages, sys_move_pages)
|
||||
|
||||
#define __NR_rt_tgsigqueueinfo 240
|
||||
__SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo)
|
||||
#define __NR_perf_counter_open 241
|
||||
__SYSCALL(__NR_perf_counter_open, sys_perf_counter_open)
|
||||
#define __NR_perf_event_open 241
|
||||
__SYSCALL(__NR_perf_event_open, sys_perf_event_open)
|
||||
|
||||
#undef __NR_syscalls
|
||||
#define __NR_syscalls 242
|
||||
|
@@ -33,13 +33,10 @@
|
||||
* BSS_SECTION(0, 0, 0)
|
||||
* _end = .;
|
||||
*
|
||||
* /DISCARD/ : {
|
||||
* EXIT_TEXT
|
||||
* EXIT_DATA
|
||||
* EXIT_CALL
|
||||
* }
|
||||
* STABS_DEBUG
|
||||
* DWARF_DEBUG
|
||||
*
|
||||
* DISCARDS // must be the last
|
||||
* }
|
||||
*
|
||||
* [__init_begin, __init_end] is the init section that may be freed after init
|
||||
@@ -91,7 +88,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FTRACE_MCOUNT_RECORD
|
||||
#define MCOUNT_REC() VMLINUX_SYMBOL(__start_mcount_loc) = .; \
|
||||
#define MCOUNT_REC() . = ALIGN(8); \
|
||||
VMLINUX_SYMBOL(__start_mcount_loc) = .; \
|
||||
*(__mcount_loc) \
|
||||
VMLINUX_SYMBOL(__stop_mcount_loc) = .;
|
||||
#else
|
||||
@@ -331,7 +329,6 @@
|
||||
/* __*init sections */ \
|
||||
__init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
|
||||
*(.ref.rodata) \
|
||||
MCOUNT_REC() \
|
||||
DEV_KEEP(init.rodata) \
|
||||
DEV_KEEP(exit.rodata) \
|
||||
CPU_KEEP(init.rodata) \
|
||||
@@ -455,6 +452,7 @@
|
||||
MEM_DISCARD(init.data) \
|
||||
KERNEL_CTORS() \
|
||||
*(.init.rodata) \
|
||||
MCOUNT_REC() \
|
||||
DEV_DISCARD(init.rodata) \
|
||||
CPU_DISCARD(init.rodata) \
|
||||
MEM_DISCARD(init.rodata)
|
||||
@@ -626,6 +624,23 @@
|
||||
#define INIT_RAM_FS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default discarded sections.
|
||||
*
|
||||
* Some archs want to discard exit text/data at runtime rather than
|
||||
* link time due to cross-section references such as alt instructions,
|
||||
* bug table, eh_frame, etc. DISCARDS must be the last of output
|
||||
* section definitions so that such archs put those in earlier section
|
||||
* definitions.
|
||||
*/
|
||||
#define DISCARDS \
|
||||
/DISCARD/ : { \
|
||||
EXIT_TEXT \
|
||||
EXIT_DATA \
|
||||
EXIT_CALL \
|
||||
*(.discard) \
|
||||
}
|
||||
|
||||
/**
|
||||
* PERCPU_VADDR - define output section for percpu area
|
||||
* @vaddr: explicit base address (optional)
|
||||
|
@@ -88,7 +88,37 @@ struct drm_device;
|
||||
#define DRM_UT_CORE 0x01
|
||||
#define DRM_UT_DRIVER 0x02
|
||||
#define DRM_UT_KMS 0x04
|
||||
#define DRM_UT_MODE 0x08
|
||||
/*
|
||||
* Three debug levels are defined.
|
||||
* drm_core, drm_driver, drm_kms
|
||||
* drm_core level can be used in the generic drm code. For example:
|
||||
* drm_ioctl, drm_mm, drm_memory
|
||||
* The macro definiton of DRM_DEBUG is used.
|
||||
* DRM_DEBUG(fmt, args...)
|
||||
* The debug info by using the DRM_DEBUG can be obtained by adding
|
||||
* the boot option of "drm.debug=1".
|
||||
*
|
||||
* drm_driver level can be used in the specific drm driver. It is used
|
||||
* to add the debug info related with the drm driver. For example:
|
||||
* i915_drv, i915_dma, i915_gem, radeon_drv,
|
||||
* The macro definition of DRM_DEBUG_DRIVER can be used.
|
||||
* DRM_DEBUG_DRIVER(fmt, args...)
|
||||
* The debug info by using the DRM_DEBUG_DRIVER can be obtained by
|
||||
* adding the boot option of "drm.debug=0x02"
|
||||
*
|
||||
* drm_kms level can be used in the KMS code related with specific drm driver.
|
||||
* It is used to add the debug info related with KMS mode. For example:
|
||||
* the connector/crtc ,
|
||||
* The macro definition of DRM_DEBUG_KMS can be used.
|
||||
* DRM_DEBUG_KMS(fmt, args...)
|
||||
* The debug info by using the DRM_DEBUG_KMS can be obtained by
|
||||
* adding the boot option of "drm.debug=0x04"
|
||||
*
|
||||
* If we add the boot option of "drm.debug=0x06", we can get the debug info by
|
||||
* using the DRM_DEBUG_KMS and DRM_DEBUG_DRIVER.
|
||||
* If we add the boot option of "drm.debug=0x05", we can get the debug info by
|
||||
* using the DRM_DEBUG_KMS and DRM_DEBUG.
|
||||
*/
|
||||
|
||||
extern void drm_ut_debug_printk(unsigned int request_level,
|
||||
const char *prefix,
|
||||
@@ -174,19 +204,14 @@ extern void drm_ut_debug_printk(unsigned int request_level,
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
|
||||
#define DRM_DEBUG_DRIVER(prefix, fmt, args...) \
|
||||
#define DRM_DEBUG_DRIVER(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_DRIVER, prefix, \
|
||||
drm_ut_debug_printk(DRM_UT_DRIVER, DRM_NAME, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_DEBUG_KMS(prefix, fmt, args...) \
|
||||
#define DRM_DEBUG_KMS(fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_KMS, prefix, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_DEBUG_MODE(prefix, fmt, args...) \
|
||||
do { \
|
||||
drm_ut_debug_printk(DRM_UT_MODE, prefix, \
|
||||
drm_ut_debug_printk(DRM_UT_KMS, DRM_NAME, \
|
||||
__func__, fmt, ##args); \
|
||||
} while (0)
|
||||
#define DRM_LOG(fmt, args...) \
|
||||
@@ -210,9 +235,8 @@ extern void drm_ut_debug_printk(unsigned int request_level,
|
||||
NULL, fmt, ##args); \
|
||||
} while (0)
|
||||
#else
|
||||
#define DRM_DEBUG_DRIVER(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_KMS(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_MODE(prefix, fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG_KMS(fmt, args...) do { } while (0)
|
||||
#define DRM_DEBUG(fmt, arg...) do { } while (0)
|
||||
#define DRM_LOG(fmt, arg...) do { } while (0)
|
||||
#define DRM_LOG_KMS(fmt, args...) do { } while (0)
|
||||
@@ -786,6 +810,9 @@ struct drm_driver {
|
||||
int (*gem_init_object) (struct drm_gem_object *obj);
|
||||
void (*gem_free_object) (struct drm_gem_object *obj);
|
||||
|
||||
/* vga arb irq handler */
|
||||
void (*vgaarb_irq)(struct drm_device *dev, bool state);
|
||||
|
||||
/* Driver private ops for this object */
|
||||
struct vm_operations_struct *gem_vm_ops;
|
||||
|
||||
@@ -1417,7 +1444,7 @@ drm_gem_object_unreference(struct drm_gem_object *obj)
|
||||
|
||||
int drm_gem_handle_create(struct drm_file *file_priv,
|
||||
struct drm_gem_object *obj,
|
||||
int *handlep);
|
||||
u32 *handlep);
|
||||
|
||||
static inline void
|
||||
drm_gem_object_handle_reference(struct drm_gem_object *obj)
|
||||
@@ -1443,7 +1470,7 @@ drm_gem_object_handle_unreference(struct drm_gem_object *obj)
|
||||
|
||||
struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
|
||||
struct drm_file *filp,
|
||||
int handle);
|
||||
u32 handle);
|
||||
int drm_gem_close_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
int drm_gem_flink_ioctl(struct drm_device *dev, void *data,
|
||||
|
38
include/drm/drm_cache.h
Normal file
38
include/drm/drm_cache.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2009 Red Hat Inc.
|
||||
* 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 NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
/*
|
||||
* Authors:
|
||||
* Dave Airlie <airlied@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef _DRM_CACHE_H_
|
||||
#define _DRM_CACHE_H_
|
||||
|
||||
void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
|
||||
|
||||
#endif
|
@@ -259,6 +259,8 @@ struct drm_framebuffer {
|
||||
void *fbdev;
|
||||
u32 pseudo_palette[17];
|
||||
struct list_head filp_head;
|
||||
/* if you are using the helper */
|
||||
void *helper_private;
|
||||
};
|
||||
|
||||
struct drm_property_blob {
|
||||
@@ -572,6 +574,12 @@ struct drm_mode_config {
|
||||
struct drm_property *tv_right_margin_property;
|
||||
struct drm_property *tv_top_margin_property;
|
||||
struct drm_property *tv_bottom_margin_property;
|
||||
struct drm_property *tv_brightness_property;
|
||||
struct drm_property *tv_contrast_property;
|
||||
struct drm_property *tv_flicker_reduction_property;
|
||||
struct drm_property *tv_overscan_property;
|
||||
struct drm_property *tv_saturation_property;
|
||||
struct drm_property *tv_hue_property;
|
||||
|
||||
/* Optional properties */
|
||||
struct drm_property *scaling_mode_property;
|
||||
@@ -736,4 +744,12 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
|
||||
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
|
||||
void *data, struct drm_file *file_priv);
|
||||
extern bool drm_detect_hdmi_monitor(struct edid *edid);
|
||||
extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
|
||||
int hdisplay, int vdisplay, int vrefresh,
|
||||
bool reduced, bool interlaced);
|
||||
extern struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
|
||||
int hdisplay, int vdisplay, int vrefresh,
|
||||
bool interlaced, int margins);
|
||||
extern int drm_add_modes_noedid(struct drm_connector *connector,
|
||||
int hdisplay, int vdisplay);
|
||||
#endif /* __DRM_CRTC_H__ */
|
||||
|
@@ -79,6 +79,8 @@ struct drm_encoder_helper_funcs {
|
||||
/* detect for DAC style encoders */
|
||||
enum drm_connector_status (*detect)(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
/* disable encoder when not in use - more explicit than dpms off */
|
||||
void (*disable)(struct drm_encoder *encoder);
|
||||
};
|
||||
|
||||
struct drm_connector_helper_funcs {
|
||||
@@ -98,6 +100,7 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
|
||||
int x, int y,
|
||||
struct drm_framebuffer *old_fb);
|
||||
extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
|
||||
extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
|
||||
|
||||
extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode);
|
||||
|
||||
|
162
include/drm/drm_encoder_slave.h
Normal file
162
include/drm/drm_encoder_slave.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Francisco Jerez.
|
||||
* 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, sublicense, 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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 __DRM_ENCODER_SLAVE_H__
|
||||
#define __DRM_ENCODER_SLAVE_H__
|
||||
|
||||
#include "drmP.h"
|
||||
#include "drm_crtc.h"
|
||||
|
||||
/**
|
||||
* struct drm_encoder_slave_funcs - Entry points exposed by a slave encoder driver
|
||||
* @set_config: Initialize any encoder-specific modesetting parameters.
|
||||
* The meaning of the @params parameter is implementation
|
||||
* dependent. It will usually be a structure with DVO port
|
||||
* data format settings or timings. It's not required for
|
||||
* the new parameters to take effect until the next mode
|
||||
* is set.
|
||||
*
|
||||
* Most of its members are analogous to the function pointers in
|
||||
* &drm_encoder_helper_funcs and they can optionally be used to
|
||||
* initialize the latter. Connector-like methods (e.g. @get_modes and
|
||||
* @set_property) will typically be wrapped around and only be called
|
||||
* if the encoder is the currently selected one for the connector.
|
||||
*/
|
||||
struct drm_encoder_slave_funcs {
|
||||
void (*set_config)(struct drm_encoder *encoder,
|
||||
void *params);
|
||||
|
||||
void (*destroy)(struct drm_encoder *encoder);
|
||||
void (*dpms)(struct drm_encoder *encoder, int mode);
|
||||
void (*save)(struct drm_encoder *encoder);
|
||||
void (*restore)(struct drm_encoder *encoder);
|
||||
bool (*mode_fixup)(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode);
|
||||
int (*mode_valid)(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *mode);
|
||||
void (*mode_set)(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adjusted_mode);
|
||||
|
||||
enum drm_connector_status (*detect)(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
int (*get_modes)(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
int (*create_resources)(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector);
|
||||
int (*set_property)(struct drm_encoder *encoder,
|
||||
struct drm_connector *connector,
|
||||
struct drm_property *property,
|
||||
uint64_t val);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_encoder_slave - Slave encoder struct
|
||||
* @base: DRM encoder object.
|
||||
* @slave_funcs: Slave encoder callbacks.
|
||||
* @slave_priv: Slave encoder private data.
|
||||
* @bus_priv: Bus specific data.
|
||||
*
|
||||
* A &drm_encoder_slave has two sets of callbacks, @slave_funcs and the
|
||||
* ones in @base. The former are never actually called by the common
|
||||
* CRTC code, it's just a convenience for splitting the encoder
|
||||
* functions in an upper, GPU-specific layer and a (hopefully)
|
||||
* GPU-agnostic lower layer: It's the GPU driver responsibility to
|
||||
* call the slave methods when appropriate.
|
||||
*
|
||||
* drm_i2c_encoder_init() provides a way to get an implementation of
|
||||
* this.
|
||||
*/
|
||||
struct drm_encoder_slave {
|
||||
struct drm_encoder base;
|
||||
|
||||
struct drm_encoder_slave_funcs *slave_funcs;
|
||||
void *slave_priv;
|
||||
void *bus_priv;
|
||||
};
|
||||
#define to_encoder_slave(x) container_of((x), struct drm_encoder_slave, base)
|
||||
|
||||
int drm_i2c_encoder_init(struct drm_device *dev,
|
||||
struct drm_encoder_slave *encoder,
|
||||
struct i2c_adapter *adap,
|
||||
const struct i2c_board_info *info);
|
||||
|
||||
|
||||
/**
|
||||
* struct drm_i2c_encoder_driver
|
||||
*
|
||||
* Describes a device driver for an encoder connected to the GPU
|
||||
* through an I2C bus. In addition to the entry points in @i2c_driver
|
||||
* an @encoder_init function should be provided. It will be called to
|
||||
* give the driver an opportunity to allocate any per-encoder data
|
||||
* structures and to initialize the @slave_funcs and (optionally)
|
||||
* @slave_priv members of @encoder.
|
||||
*/
|
||||
struct drm_i2c_encoder_driver {
|
||||
struct i2c_driver i2c_driver;
|
||||
|
||||
int (*encoder_init)(struct i2c_client *client,
|
||||
struct drm_device *dev,
|
||||
struct drm_encoder_slave *encoder);
|
||||
|
||||
};
|
||||
#define to_drm_i2c_encoder_driver(x) container_of((x), \
|
||||
struct drm_i2c_encoder_driver, \
|
||||
i2c_driver)
|
||||
|
||||
/**
|
||||
* drm_i2c_encoder_get_client - Get the I2C client corresponding to an encoder
|
||||
*/
|
||||
static inline struct i2c_client *drm_i2c_encoder_get_client(struct drm_encoder *encoder)
|
||||
{
|
||||
return (struct i2c_client *)to_encoder_slave(encoder)->bus_priv;
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_i2c_encoder_register - Register an I2C encoder driver
|
||||
* @owner: Module containing the driver.
|
||||
* @driver: Driver to be registered.
|
||||
*/
|
||||
static inline int drm_i2c_encoder_register(struct module *owner,
|
||||
struct drm_i2c_encoder_driver *driver)
|
||||
{
|
||||
return i2c_register_driver(owner, &driver->i2c_driver);
|
||||
}
|
||||
|
||||
/**
|
||||
* drm_i2c_encoder_unregister - Unregister an I2C encoder driver
|
||||
* @driver: Driver to be unregistered.
|
||||
*/
|
||||
static inline void drm_i2c_encoder_unregister(struct drm_i2c_encoder_driver *driver)
|
||||
{
|
||||
i2c_del_driver(&driver->i2c_driver);
|
||||
}
|
||||
|
||||
void drm_i2c_encoder_destroy(struct drm_encoder *encoder);
|
||||
|
||||
#endif
|
82
include/drm/drm_fb_helper.h
Normal file
82
include/drm/drm_fb_helper.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2009 Red Hat Inc.
|
||||
* Copyright (c) 2006-2008 Intel Corporation
|
||||
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
|
||||
*
|
||||
* DRM framebuffer helper functions
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that copyright
|
||||
* notice and this permission notice appear in supporting documentation, and
|
||||
* that the name of the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Dave Airlie <airlied@linux.ie>
|
||||
* Jesse Barnes <jesse.barnes@intel.com>
|
||||
*/
|
||||
#ifndef DRM_FB_HELPER_H
|
||||
#define DRM_FB_HELPER_H
|
||||
|
||||
struct drm_fb_helper_crtc {
|
||||
uint32_t crtc_id;
|
||||
struct drm_mode_set mode_set;
|
||||
};
|
||||
|
||||
struct drm_fb_helper_funcs {
|
||||
void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
|
||||
u16 blue, int regno);
|
||||
};
|
||||
|
||||
struct drm_fb_helper {
|
||||
struct drm_framebuffer *fb;
|
||||
struct drm_device *dev;
|
||||
struct drm_display_mode *mode;
|
||||
int crtc_count;
|
||||
struct drm_fb_helper_crtc *crtc_info;
|
||||
struct drm_fb_helper_funcs *funcs;
|
||||
int conn_limit;
|
||||
struct list_head kernel_fb_list;
|
||||
};
|
||||
|
||||
int drm_fb_helper_single_fb_probe(struct drm_device *dev,
|
||||
int (*fb_create)(struct drm_device *dev,
|
||||
uint32_t fb_width,
|
||||
uint32_t fb_height,
|
||||
uint32_t surface_width,
|
||||
uint32_t surface_height,
|
||||
struct drm_framebuffer **fb_ptr));
|
||||
int drm_fb_helper_init_crtc_count(struct drm_fb_helper *helper, int crtc_count,
|
||||
int max_conn);
|
||||
void drm_fb_helper_free(struct drm_fb_helper *helper);
|
||||
int drm_fb_helper_blank(int blank, struct fb_info *info);
|
||||
int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
|
||||
struct fb_info *info);
|
||||
int drm_fb_helper_set_par(struct fb_info *info);
|
||||
int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
||||
struct fb_info *info);
|
||||
int drm_fb_helper_setcolreg(unsigned regno,
|
||||
unsigned red,
|
||||
unsigned green,
|
||||
unsigned blue,
|
||||
unsigned transp,
|
||||
struct fb_info *info);
|
||||
|
||||
void drm_fb_helper_restore(void);
|
||||
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_framebuffer *fb,
|
||||
uint32_t fb_width, uint32_t fb_height);
|
||||
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch);
|
||||
|
||||
#endif
|
@@ -44,8 +44,6 @@
|
||||
|
||||
#if __OS_HAS_AGP
|
||||
|
||||
#include <linux/vmalloc.h>
|
||||
|
||||
#ifdef HAVE_PAGE_AGP
|
||||
#include <asm/agp.h>
|
||||
#else
|
||||
|
@@ -37,6 +37,9 @@
|
||||
* Generic range manager structs
|
||||
*/
|
||||
#include <linux/list.h>
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
#include <linux/seq_file.h>
|
||||
#endif
|
||||
|
||||
struct drm_mm_node {
|
||||
struct list_head fl_entry;
|
||||
@@ -96,4 +99,8 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block)
|
||||
return block->mm;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -68,10 +68,11 @@
|
||||
#define DRM_MODE_DPMS_OFF 3
|
||||
|
||||
/* Scaling mode options */
|
||||
#define DRM_MODE_SCALE_NON_GPU 0
|
||||
#define DRM_MODE_SCALE_FULLSCREEN 1
|
||||
#define DRM_MODE_SCALE_NO_SCALE 2
|
||||
#define DRM_MODE_SCALE_ASPECT 3
|
||||
#define DRM_MODE_SCALE_NONE 0 /* Unmodified timing (display or
|
||||
software can still scale) */
|
||||
#define DRM_MODE_SCALE_FULLSCREEN 1 /* Full screen, ignore aspect */
|
||||
#define DRM_MODE_SCALE_CENTER 2 /* Centered, no scaling */
|
||||
#define DRM_MODE_SCALE_ASPECT 3 /* Full screen, preserve aspect */
|
||||
|
||||
/* Dithering mode options */
|
||||
#define DRM_MODE_DITHERING_OFF 0
|
||||
@@ -141,6 +142,7 @@ struct drm_mode_get_encoder {
|
||||
#define DRM_MODE_SUBCONNECTOR_Composite 5
|
||||
#define DRM_MODE_SUBCONNECTOR_SVIDEO 6
|
||||
#define DRM_MODE_SUBCONNECTOR_Component 8
|
||||
#define DRM_MODE_SUBCONNECTOR_SCART 9
|
||||
|
||||
#define DRM_MODE_CONNECTOR_Unknown 0
|
||||
#define DRM_MODE_CONNECTOR_VGA 1
|
||||
@@ -155,6 +157,7 @@ struct drm_mode_get_encoder {
|
||||
#define DRM_MODE_CONNECTOR_DisplayPort 10
|
||||
#define DRM_MODE_CONNECTOR_HDMIA 11
|
||||
#define DRM_MODE_CONNECTOR_HDMIB 12
|
||||
#define DRM_MODE_CONNECTOR_TV 13
|
||||
|
||||
struct drm_mode_get_connector {
|
||||
|
||||
|
@@ -552,6 +552,7 @@
|
||||
{0x8086, 0x2e12, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x2e22, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x2e32, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x2e42, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0xa001, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0xa011, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
{0x8086, 0x35e8, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA << 8, 0xffff00, 0}, \
|
||||
|
12
include/drm/drm_sysfs.h
Normal file
12
include/drm/drm_sysfs.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef _DRM_SYSFS_H_
|
||||
#define _DRM_SYSFS_H_
|
||||
|
||||
/**
|
||||
* This minimalistic include file is intended for users (read TTM) that
|
||||
* don't want to include the full drmP.h file.
|
||||
*/
|
||||
|
||||
extern int drm_class_device_register(struct device *dev);
|
||||
extern void drm_class_device_unregister(struct device *dev);
|
||||
|
||||
#endif
|
@@ -185,6 +185,7 @@ typedef struct _drm_i915_sarea {
|
||||
#define DRM_I915_GEM_GET_APERTURE 0x23
|
||||
#define DRM_I915_GEM_MMAP_GTT 0x24
|
||||
#define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25
|
||||
#define DRM_I915_GEM_MADVISE 0x26
|
||||
|
||||
#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
|
||||
#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
|
||||
@@ -221,6 +222,7 @@ typedef struct _drm_i915_sarea {
|
||||
#define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling)
|
||||
#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
|
||||
#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id)
|
||||
#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
|
||||
|
||||
/* Allow drivers to submit batchbuffers directly to hardware, relying
|
||||
* on the security mechanisms provided by hardware.
|
||||
@@ -667,4 +669,21 @@ struct drm_i915_get_pipe_from_crtc_id {
|
||||
__u32 pipe;
|
||||
};
|
||||
|
||||
#define I915_MADV_WILLNEED 0
|
||||
#define I915_MADV_DONTNEED 1
|
||||
#define __I915_MADV_PURGED 2 /* internal state */
|
||||
|
||||
struct drm_i915_gem_madvise {
|
||||
/** Handle of the buffer to change the backing store advice */
|
||||
__u32 handle;
|
||||
|
||||
/* Advice: either the buffer will be needed again in the near future,
|
||||
* or wont be and could be discarded under memory pressure.
|
||||
*/
|
||||
__u32 madv;
|
||||
|
||||
/** Whether the backing store still exists. */
|
||||
__u32 retained;
|
||||
};
|
||||
|
||||
#endif /* _I915_DRM_H_ */
|
||||
|
@@ -802,11 +802,12 @@ struct drm_radeon_gem_create {
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
#define RADEON_TILING_MACRO 0x1
|
||||
#define RADEON_TILING_MICRO 0x2
|
||||
#define RADEON_TILING_SWAP 0x4
|
||||
#define RADEON_TILING_SURFACE 0x8 /* this object requires a surface
|
||||
* when mapped - i.e. front buffer */
|
||||
#define RADEON_TILING_MACRO 0x1
|
||||
#define RADEON_TILING_MICRO 0x2
|
||||
#define RADEON_TILING_SWAP_16BIT 0x4
|
||||
#define RADEON_TILING_SWAP_32BIT 0x8
|
||||
#define RADEON_TILING_SURFACE 0x10 /* this object requires a surface
|
||||
* when mapped - i.e. front buffer */
|
||||
|
||||
struct drm_radeon_gem_set_tiling {
|
||||
uint32_t handle;
|
||||
@@ -899,6 +900,7 @@ struct drm_radeon_cs {
|
||||
#define RADEON_INFO_DEVICE_ID 0x00
|
||||
#define RADEON_INFO_NUM_GB_PIPES 0x01
|
||||
#define RADEON_INFO_NUM_Z_PIPES 0x02
|
||||
#define RADEON_INFO_ACCEL_WORKING 0x03
|
||||
|
||||
struct drm_radeon_info {
|
||||
uint32_t request;
|
||||
|
@@ -155,6 +155,7 @@ struct ttm_buffer_object {
|
||||
* Members constant at init.
|
||||
*/
|
||||
|
||||
struct ttm_bo_global *glob;
|
||||
struct ttm_bo_device *bdev;
|
||||
unsigned long buffer_start;
|
||||
enum ttm_bo_type type;
|
||||
@@ -245,14 +246,15 @@ struct ttm_buffer_object {
|
||||
* premapped region.
|
||||
*/
|
||||
|
||||
#define TTM_BO_MAP_IOMEM_MASK 0x80
|
||||
struct ttm_bo_kmap_obj {
|
||||
void *virtual;
|
||||
struct page *page;
|
||||
enum {
|
||||
ttm_bo_map_iomap,
|
||||
ttm_bo_map_vmap,
|
||||
ttm_bo_map_kmap,
|
||||
ttm_bo_map_premapped,
|
||||
ttm_bo_map_iomap = 1 | TTM_BO_MAP_IOMEM_MASK,
|
||||
ttm_bo_map_vmap = 2,
|
||||
ttm_bo_map_kmap = 3,
|
||||
ttm_bo_map_premapped = 4 | TTM_BO_MAP_IOMEM_MASK,
|
||||
} bo_kmap_type;
|
||||
};
|
||||
|
||||
@@ -522,8 +524,7 @@ extern int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
||||
static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
|
||||
bool *is_iomem)
|
||||
{
|
||||
*is_iomem = (map->bo_kmap_type == ttm_bo_map_iomap ||
|
||||
map->bo_kmap_type == ttm_bo_map_premapped);
|
||||
*is_iomem = !!(map->bo_kmap_type & TTM_BO_MAP_IOMEM_MASK);
|
||||
return map->virtual;
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "ttm/ttm_bo_api.h"
|
||||
#include "ttm/ttm_memory.h"
|
||||
#include "ttm/ttm_module.h"
|
||||
#include "drm_mm.h"
|
||||
#include "linux/workqueue.h"
|
||||
#include "linux/fs.h"
|
||||
@@ -161,7 +162,7 @@ struct ttm_tt {
|
||||
long last_lomem_page;
|
||||
uint32_t page_flags;
|
||||
unsigned long num_pages;
|
||||
struct ttm_bo_device *bdev;
|
||||
struct ttm_bo_global *glob;
|
||||
struct ttm_backend *be;
|
||||
struct task_struct *tsk;
|
||||
unsigned long start;
|
||||
@@ -364,6 +365,64 @@ struct ttm_bo_driver {
|
||||
void (*fault_reserve_notify)(struct ttm_buffer_object *bo);
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ttm_bo_global_ref - Argument to initialize a struct ttm_bo_global.
|
||||
*/
|
||||
|
||||
struct ttm_bo_global_ref {
|
||||
struct ttm_global_reference ref;
|
||||
struct ttm_mem_global *mem_glob;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ttm_bo_global - Buffer object driver global data.
|
||||
*
|
||||
* @mem_glob: Pointer to a struct ttm_mem_global object for accounting.
|
||||
* @dummy_read_page: Pointer to a dummy page used for mapping requests
|
||||
* of unpopulated pages.
|
||||
* @shrink: A shrink callback object used for buffer object swap.
|
||||
* @ttm_bo_extra_size: Extra size (sizeof(struct ttm_buffer_object) excluded)
|
||||
* used by a buffer object. This is excluding page arrays and backing pages.
|
||||
* @ttm_bo_size: This is @ttm_bo_extra_size + sizeof(struct ttm_buffer_object).
|
||||
* @device_list_mutex: Mutex protecting the device list.
|
||||
* This mutex is held while traversing the device list for pm options.
|
||||
* @lru_lock: Spinlock protecting the bo subsystem lru lists.
|
||||
* @device_list: List of buffer object devices.
|
||||
* @swap_lru: Lru list of buffer objects used for swapping.
|
||||
*/
|
||||
|
||||
struct ttm_bo_global {
|
||||
|
||||
/**
|
||||
* Constant after init.
|
||||
*/
|
||||
|
||||
struct kobject kobj;
|
||||
struct ttm_mem_global *mem_glob;
|
||||
struct page *dummy_read_page;
|
||||
struct ttm_mem_shrink shrink;
|
||||
size_t ttm_bo_extra_size;
|
||||
size_t ttm_bo_size;
|
||||
struct mutex device_list_mutex;
|
||||
spinlock_t lru_lock;
|
||||
|
||||
/**
|
||||
* Protected by device_list_mutex.
|
||||
*/
|
||||
struct list_head device_list;
|
||||
|
||||
/**
|
||||
* Protected by the lru_lock.
|
||||
*/
|
||||
struct list_head swap_lru;
|
||||
|
||||
/**
|
||||
* Internal protection.
|
||||
*/
|
||||
atomic_t bo_count;
|
||||
};
|
||||
|
||||
|
||||
#define TTM_NUM_MEM_TYPES 8
|
||||
|
||||
#define TTM_BO_PRIV_FLAG_MOVING 0 /* Buffer object is moving and needs
|
||||
@@ -372,16 +431,7 @@ struct ttm_bo_driver {
|
||||
/**
|
||||
* struct ttm_bo_device - Buffer object driver device-specific data.
|
||||
*
|
||||
* @mem_glob: Pointer to a struct ttm_mem_global object for accounting.
|
||||
* @driver: Pointer to a struct ttm_bo_driver struct setup by the driver.
|
||||
* @count: Current number of buffer object.
|
||||
* @pages: Current number of pinned pages.
|
||||
* @dummy_read_page: Pointer to a dummy page used for mapping requests
|
||||
* of unpopulated pages.
|
||||
* @shrink: A shrink callback object used for buffre object swap.
|
||||
* @ttm_bo_extra_size: Extra size (sizeof(struct ttm_buffer_object) excluded)
|
||||
* used by a buffer object. This is excluding page arrays and backing pages.
|
||||
* @ttm_bo_size: This is @ttm_bo_extra_size + sizeof(struct ttm_buffer_object).
|
||||
* @man: An array of mem_type_managers.
|
||||
* @addr_space_mm: Range manager for the device address space.
|
||||
* lru_lock: Spinlock that protects the buffer+device lru lists and
|
||||
@@ -399,32 +449,21 @@ struct ttm_bo_device {
|
||||
/*
|
||||
* Constant after bo device init / atomic.
|
||||
*/
|
||||
|
||||
struct ttm_mem_global *mem_glob;
|
||||
struct list_head device_list;
|
||||
struct ttm_bo_global *glob;
|
||||
struct ttm_bo_driver *driver;
|
||||
struct page *dummy_read_page;
|
||||
struct ttm_mem_shrink shrink;
|
||||
|
||||
size_t ttm_bo_extra_size;
|
||||
size_t ttm_bo_size;
|
||||
|
||||
rwlock_t vm_lock;
|
||||
struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
|
||||
/*
|
||||
* Protected by the vm lock.
|
||||
*/
|
||||
struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
|
||||
struct rb_root addr_space_rb;
|
||||
struct drm_mm addr_space_mm;
|
||||
|
||||
/*
|
||||
* Might want to change this to one lock per manager.
|
||||
*/
|
||||
spinlock_t lru_lock;
|
||||
/*
|
||||
* Protected by the lru lock.
|
||||
* Protected by the global:lru lock.
|
||||
*/
|
||||
struct list_head ddestroy;
|
||||
struct list_head swap_lru;
|
||||
|
||||
/*
|
||||
* Protected by load / firstopen / lastclose /unload sync.
|
||||
@@ -640,6 +679,9 @@ extern int ttm_bo_pci_offset(struct ttm_bo_device *bdev,
|
||||
unsigned long *bus_offset,
|
||||
unsigned long *bus_size);
|
||||
|
||||
extern void ttm_bo_global_release(struct ttm_global_reference *ref);
|
||||
extern int ttm_bo_global_init(struct ttm_global_reference *ref);
|
||||
|
||||
extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
|
||||
|
||||
/**
|
||||
@@ -657,7 +699,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
|
||||
* !0: Failure.
|
||||
*/
|
||||
extern int ttm_bo_device_init(struct ttm_bo_device *bdev,
|
||||
struct ttm_mem_global *mem_glob,
|
||||
struct ttm_bo_global *glob,
|
||||
struct ttm_bo_driver *driver,
|
||||
uint64_t file_page_offset, bool need_dma32);
|
||||
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/wait.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/kobject.h>
|
||||
|
||||
/**
|
||||
* struct ttm_mem_shrink - callback to shrink TTM memory usage.
|
||||
@@ -60,34 +61,33 @@ struct ttm_mem_shrink {
|
||||
* @queue: Wait queue for processes suspended waiting for memory.
|
||||
* @lock: Lock to protect the @shrink - and the memory accounting members,
|
||||
* that is, essentially the whole structure with some exceptions.
|
||||
* @emer_memory: Lowmem memory limit available for root.
|
||||
* @max_memory: Lowmem memory limit available for non-root.
|
||||
* @swap_limit: Lowmem memory limit where the shrink workqueue kicks in.
|
||||
* @used_memory: Currently used lowmem memory.
|
||||
* @used_total_memory: Currently used total (lowmem + highmem) memory.
|
||||
* @total_memory_swap_limit: Total memory limit where the shrink workqueue
|
||||
* kicks in.
|
||||
* @max_total_memory: Total memory available to non-root processes.
|
||||
* @emer_total_memory: Total memory available to root processes.
|
||||
* @zones: Array of pointers to accounting zones.
|
||||
* @num_zones: Number of populated entries in the @zones array.
|
||||
* @zone_kernel: Pointer to the kernel zone.
|
||||
* @zone_highmem: Pointer to the highmem zone if there is one.
|
||||
* @zone_dma32: Pointer to the dma32 zone if there is one.
|
||||
*
|
||||
* Note that this structure is not per device. It should be global for all
|
||||
* graphics devices.
|
||||
*/
|
||||
|
||||
#define TTM_MEM_MAX_ZONES 2
|
||||
struct ttm_mem_zone;
|
||||
struct ttm_mem_global {
|
||||
struct kobject kobj;
|
||||
struct ttm_mem_shrink *shrink;
|
||||
struct workqueue_struct *swap_queue;
|
||||
struct work_struct work;
|
||||
wait_queue_head_t queue;
|
||||
spinlock_t lock;
|
||||
uint64_t emer_memory;
|
||||
uint64_t max_memory;
|
||||
uint64_t swap_limit;
|
||||
uint64_t used_memory;
|
||||
uint64_t used_total_memory;
|
||||
uint64_t total_memory_swap_limit;
|
||||
uint64_t max_total_memory;
|
||||
uint64_t emer_total_memory;
|
||||
struct ttm_mem_zone *zones[TTM_MEM_MAX_ZONES];
|
||||
unsigned int num_zones;
|
||||
struct ttm_mem_zone *zone_kernel;
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
struct ttm_mem_zone *zone_highmem;
|
||||
#else
|
||||
struct ttm_mem_zone *zone_dma32;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -146,8 +146,13 @@ static inline void ttm_mem_unregister_shrink(struct ttm_mem_global *glob,
|
||||
extern int ttm_mem_global_init(struct ttm_mem_global *glob);
|
||||
extern void ttm_mem_global_release(struct ttm_mem_global *glob);
|
||||
extern int ttm_mem_global_alloc(struct ttm_mem_global *glob, uint64_t memory,
|
||||
bool no_wait, bool interruptible, bool himem);
|
||||
bool no_wait, bool interruptible);
|
||||
extern void ttm_mem_global_free(struct ttm_mem_global *glob,
|
||||
uint64_t amount, bool himem);
|
||||
uint64_t amount);
|
||||
extern int ttm_mem_global_alloc_page(struct ttm_mem_global *glob,
|
||||
struct page *page,
|
||||
bool no_wait, bool interruptible);
|
||||
extern void ttm_mem_global_free_page(struct ttm_mem_global *glob,
|
||||
struct page *page);
|
||||
extern size_t ttm_round_pot(size_t size);
|
||||
#endif
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#define _TTM_MODULE_H_
|
||||
|
||||
#include <linux/kernel.h>
|
||||
struct kobject;
|
||||
|
||||
#define TTM_PFX "[TTM] "
|
||||
|
||||
@@ -54,5 +55,6 @@ extern void ttm_global_init(void);
|
||||
extern void ttm_global_release(void);
|
||||
extern int ttm_global_item_ref(struct ttm_global_reference *ref);
|
||||
extern void ttm_global_item_unref(struct ttm_global_reference *ref);
|
||||
extern struct kobject *ttm_get_kobj(void);
|
||||
|
||||
#endif /* _TTM_MODULE_H_ */
|
||||
|
@@ -268,6 +268,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm.h),)
|
||||
unifdef-y += kvm.h
|
||||
endif
|
||||
ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
|
||||
$(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
|
||||
unifdef-y += kvm_para.h
|
||||
endif
|
||||
unifdef-y += llc.h
|
||||
unifdef-y += loop.h
|
||||
unifdef-y += lp.h
|
||||
|
@@ -41,8 +41,6 @@
|
||||
#include <acpi/acpi_drivers.h>
|
||||
#include <acpi/acpi_numa.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
|
||||
enum acpi_irq_model_id {
|
||||
ACPI_IRQ_MODEL_PIC = 0,
|
||||
@@ -219,10 +217,8 @@ static inline int acpi_video_display_switch_support(void)
|
||||
#endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
|
||||
|
||||
extern int acpi_blacklisted(void);
|
||||
#ifdef CONFIG_DMI
|
||||
extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
|
||||
extern int acpi_osi_setup(char *str);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
int acpi_get_pxm(acpi_handle handle);
|
||||
@@ -292,7 +288,10 @@ void __init acpi_s4_no_nvs(void);
|
||||
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags);
|
||||
extern void acpi_early_init(void);
|
||||
|
||||
#else /* CONFIG_ACPI */
|
||||
#else /* !CONFIG_ACPI */
|
||||
|
||||
#define acpi_disabled 1
|
||||
|
||||
static inline void acpi_early_init(void) { }
|
||||
|
||||
static inline int early_acpi_boot_init(void)
|
||||
@@ -331,5 +330,11 @@ static inline int acpi_check_mem_region(resource_size_t start,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct acpi_table_header;
|
||||
static inline int acpi_table_parse(char *id,
|
||||
int (*handler)(struct acpi_table_header *))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif /* !CONFIG_ACPI */
|
||||
#endif /*_LINUX_ACPI_H*/
|
||||
|
@@ -79,9 +79,12 @@ struct agp_memory {
|
||||
u32 physical;
|
||||
bool is_bound;
|
||||
bool is_flushed;
|
||||
bool vmalloc_flag;
|
||||
bool vmalloc_flag;
|
||||
/* list of agp_memory mapped to the aperture */
|
||||
struct list_head mapped_list;
|
||||
/* DMA-mapped addresses */
|
||||
struct scatterlist *sg_list;
|
||||
int num_sg;
|
||||
};
|
||||
|
||||
#define AGP_NORMAL_MEMORY 0
|
||||
|
@@ -225,8 +225,6 @@ static inline void exit_aio(struct mm_struct *mm) { }
|
||||
|
||||
#define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait)
|
||||
|
||||
#include <linux/aio_abi.h>
|
||||
|
||||
static inline struct kiocb *list_kiocb(struct list_head *h)
|
||||
{
|
||||
return list_entry(h, struct kiocb, ki_list);
|
||||
|
@@ -36,6 +36,11 @@ struct amba_driver {
|
||||
struct amba_id *id_table;
|
||||
};
|
||||
|
||||
enum amba_vendor {
|
||||
AMBA_VENDOR_ARM = 0x41,
|
||||
AMBA_VENDOR_ST = 0x80,
|
||||
};
|
||||
|
||||
#define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
|
||||
#define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
|
||||
|
||||
|
80
include/linux/amba/pl093.h
Normal file
80
include/linux/amba/pl093.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* linux/amba/pl093.h
|
||||
*
|
||||
* Copyright (c) 2008 Simtec Electronics
|
||||
* http://armlinux.simtec.co.uk/
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* AMBA PL093 SSMC (synchronous static memory controller)
|
||||
* See DDI0236.pdf (r0p4) for more details
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */
|
||||
|
||||
/* Offsets for SMBxxxxRy registers */
|
||||
|
||||
#define SMBIDCYR (0x00)
|
||||
#define SMBWSTRDR (0x04)
|
||||
#define SMBWSTWRR (0x08)
|
||||
#define SMBWSTOENR (0x0C)
|
||||
#define SMBWSTWENR (0x10)
|
||||
#define SMBCR (0x14)
|
||||
#define SMBSR (0x18)
|
||||
#define SMBWSTBRDR (0x1C)
|
||||
|
||||
/* Masks for SMB registers */
|
||||
#define IDCY_MASK (0xf)
|
||||
#define WSTRD_MASK (0xf)
|
||||
#define WSTWR_MASK (0xf)
|
||||
#define WSTOEN_MASK (0xf)
|
||||
#define WSTWEN_MASK (0xf)
|
||||
|
||||
/* Notes from datasheet:
|
||||
* WSTOEN <= WSTRD
|
||||
* WSTWEN <= WSTWR
|
||||
*
|
||||
* WSTOEN is not used with nWAIT
|
||||
*/
|
||||
|
||||
/* SMBCR bit definitions */
|
||||
#define SMBCR_BIWRITEEN (1 << 21)
|
||||
#define SMBCR_ADDRVALIDWRITEEN (1 << 20)
|
||||
#define SMBCR_SYNCWRITE (1 << 17)
|
||||
#define SMBCR_BMWRITE (1 << 16)
|
||||
#define SMBCR_WRAPREAD (1 << 14)
|
||||
#define SMBCR_BIREADEN (1 << 13)
|
||||
#define SMBCR_ADDRVALIDREADEN (1 << 12)
|
||||
#define SMBCR_SYNCREAD (1 << 9)
|
||||
#define SMBCR_BMREAD (1 << 8)
|
||||
#define SMBCR_SMBLSPOL (1 << 6)
|
||||
#define SMBCR_WP (1 << 3)
|
||||
#define SMBCR_WAITEN (1 << 2)
|
||||
#define SMBCR_WAITPOL (1 << 1)
|
||||
#define SMBCR_RBLE (1 << 0)
|
||||
|
||||
#define SMBCR_BURSTLENWRITE_MASK (3 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_4 (0 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_8 (1 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_RESERVED (2 << 18)
|
||||
#define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18)
|
||||
|
||||
#define SMBCR_BURSTLENREAD_MASK (3 << 10)
|
||||
#define SMBCR_BURSTLENREAD_4 (0 << 10)
|
||||
#define SMBCR_BURSTLENREAD_8 (1 << 10)
|
||||
#define SMBCR_BURSTLENREAD_16 (2 << 10)
|
||||
#define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10)
|
||||
|
||||
#define SMBCR_MW_MASK (3 << 4)
|
||||
#define SMBCR_MW_8BIT (0 << 4)
|
||||
#define SMBCR_MW_16BIT (1 << 4)
|
||||
#define SMBCR_MW_M32BIT (2 << 4)
|
||||
|
||||
/* SSMC status registers */
|
||||
#define SSMCCSR (0x200)
|
||||
#define SSMCCR (0x204)
|
||||
#define SSMCITCR (0x208)
|
||||
#define SSMCITIP (0x20C)
|
||||
#define SSMCITIOP (0x210)
|
@@ -8,6 +8,9 @@
|
||||
#ifndef _LINUX_ANON_INODES_H
|
||||
#define _LINUX_ANON_INODES_H
|
||||
|
||||
struct file *anon_inode_getfile(const char *name,
|
||||
const struct file_operations *fops,
|
||||
void *priv, int flags);
|
||||
int anon_inode_getfd(const char *name, const struct file_operations *fops,
|
||||
void *priv, int flags);
|
||||
|
||||
|
@@ -58,25 +58,60 @@ struct dma_chan_ref {
|
||||
* array.
|
||||
* @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
|
||||
* dependency chain
|
||||
* @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
|
||||
* @ASYNC_TX_FENCE: specify that the next operation in the dependency
|
||||
* chain uses this operation's result as an input
|
||||
*/
|
||||
enum async_tx_flags {
|
||||
ASYNC_TX_XOR_ZERO_DST = (1 << 0),
|
||||
ASYNC_TX_XOR_DROP_DST = (1 << 1),
|
||||
ASYNC_TX_ACK = (1 << 3),
|
||||
ASYNC_TX_DEP_ACK = (1 << 4),
|
||||
ASYNC_TX_ACK = (1 << 2),
|
||||
ASYNC_TX_FENCE = (1 << 3),
|
||||
};
|
||||
|
||||
/**
|
||||
* struct async_submit_ctl - async_tx submission/completion modifiers
|
||||
* @flags: submission modifiers
|
||||
* @depend_tx: parent dependency of the current operation being submitted
|
||||
* @cb_fn: callback routine to run at operation completion
|
||||
* @cb_param: parameter for the callback routine
|
||||
* @scribble: caller provided space for dma/page address conversions
|
||||
*/
|
||||
struct async_submit_ctl {
|
||||
enum async_tx_flags flags;
|
||||
struct dma_async_tx_descriptor *depend_tx;
|
||||
dma_async_tx_callback cb_fn;
|
||||
void *cb_param;
|
||||
void *scribble;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
#define async_tx_issue_pending_all dma_issue_pending_all
|
||||
|
||||
/**
|
||||
* async_tx_issue_pending - send pending descriptor to the hardware channel
|
||||
* @tx: descriptor handle to retrieve hardware context
|
||||
*
|
||||
* Note: any dependent operations will have already been issued by
|
||||
* async_tx_channel_switch, or (in the case of no channel switch) will
|
||||
* be already pending on this channel.
|
||||
*/
|
||||
static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
if (likely(tx)) {
|
||||
struct dma_chan *chan = tx->chan;
|
||||
struct dma_device *dma = chan->device;
|
||||
|
||||
dma->device_issue_pending(chan);
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
|
||||
#include <asm/async_tx.h>
|
||||
#else
|
||||
#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \
|
||||
__async_tx_find_channel(dep, type)
|
||||
struct dma_chan *
|
||||
__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
enum dma_transaction_type tx_type);
|
||||
__async_tx_find_channel(struct async_submit_ctl *submit,
|
||||
enum dma_transaction_type tx_type);
|
||||
#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */
|
||||
#else
|
||||
static inline void async_tx_issue_pending_all(void)
|
||||
@@ -84,10 +119,16 @@ static inline void async_tx_issue_pending_all(void)
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline void async_tx_issue_pending(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
do { } while (0);
|
||||
}
|
||||
|
||||
static inline struct dma_chan *
|
||||
async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
enum dma_transaction_type tx_type, struct page **dst, int dst_count,
|
||||
struct page **src, int src_count, size_t len)
|
||||
async_tx_find_channel(struct async_submit_ctl *submit,
|
||||
enum dma_transaction_type tx_type, struct page **dst,
|
||||
int dst_count, struct page **src, int src_count,
|
||||
size_t len)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -99,46 +140,70 @@ async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
|
||||
* @cb_fn_param: parameter to pass to the callback routine
|
||||
*/
|
||||
static inline void
|
||||
async_tx_sync_epilog(dma_async_tx_callback cb_fn, void *cb_fn_param)
|
||||
async_tx_sync_epilog(struct async_submit_ctl *submit)
|
||||
{
|
||||
if (cb_fn)
|
||||
cb_fn(cb_fn_param);
|
||||
if (submit->cb_fn)
|
||||
submit->cb_fn(submit->cb_param);
|
||||
}
|
||||
|
||||
void
|
||||
async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
|
||||
enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
typedef union {
|
||||
unsigned long addr;
|
||||
struct page *page;
|
||||
dma_addr_t dma;
|
||||
} addr_conv_t;
|
||||
|
||||
static inline void
|
||||
init_async_submit(struct async_submit_ctl *args, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_param,
|
||||
addr_conv_t *scribble)
|
||||
{
|
||||
args->flags = flags;
|
||||
args->depend_tx = tx;
|
||||
args->cb_fn = cb_fn;
|
||||
args->cb_param = cb_param;
|
||||
args->scribble = scribble;
|
||||
}
|
||||
|
||||
void async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_xor(struct page *dest, struct page **src_list, unsigned int offset,
|
||||
int src_cnt, size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
int src_cnt, size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_xor_zero_sum(struct page *dest, struct page **src_list,
|
||||
unsigned int offset, int src_cnt, size_t len,
|
||||
u32 *result, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
async_xor_val(struct page *dest, struct page **src_list, unsigned int offset,
|
||||
int src_cnt, size_t len, enum sum_check_flags *result,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
|
||||
unsigned int src_offset, size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
unsigned int src_offset, size_t len,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_memset(struct page *dest, int val, unsigned int offset,
|
||||
size_t len, enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_trigger_callback(enum async_tx_flags flags,
|
||||
struct dma_async_tx_descriptor *depend_tx,
|
||||
dma_async_tx_callback cb_fn, void *cb_fn_param);
|
||||
async_gen_syndrome(struct page **blocks, unsigned int offset, int src_cnt,
|
||||
size_t len, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_syndrome_val(struct page **blocks, unsigned int offset, int src_cnt,
|
||||
size_t len, enum sum_check_flags *pqres, struct page *spare,
|
||||
struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_raid6_2data_recov(int src_num, size_t bytes, int faila, int failb,
|
||||
struct page **ptrs, struct async_submit_ctl *submit);
|
||||
|
||||
struct dma_async_tx_descriptor *
|
||||
async_raid6_datap_recov(int src_num, size_t bytes, int faila,
|
||||
struct page **ptrs, struct async_submit_ctl *submit);
|
||||
|
||||
void async_tx_quiesce(struct dma_async_tx_descriptor **tx);
|
||||
#endif /* _ASYNC_TX_H_ */
|
||||
|
@@ -17,7 +17,7 @@ struct attribute_container {
|
||||
struct list_head node;
|
||||
struct klist containers;
|
||||
struct class *class;
|
||||
struct attribute_group *grp;
|
||||
const struct attribute_group *grp;
|
||||
struct device_attribute **attrs;
|
||||
int (*match)(struct attribute_container *, struct device *);
|
||||
#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
|
||||
|
@@ -59,6 +59,7 @@ struct bdi_writeback {
|
||||
|
||||
struct backing_dev_info {
|
||||
struct list_head bdi_list;
|
||||
struct rcu_head rcu_head;
|
||||
unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
|
||||
unsigned long state; /* Always use atomic bitops on this */
|
||||
unsigned int capabilities; /* Device capabilities */
|
||||
@@ -100,7 +101,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);
|
||||
void bdi_start_writeback(struct writeback_control *wbc);
|
||||
void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages);
|
||||
int bdi_writeback_task(struct bdi_writeback *wb);
|
||||
int bdi_has_dirty_io(struct backing_dev_info *bdi);
|
||||
|
||||
|
@@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm);
|
||||
extern int prepare_bprm_creds(struct linux_binprm *bprm);
|
||||
extern void install_exec_creds(struct linux_binprm *bprm);
|
||||
extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
|
||||
extern int set_binfmt(struct linux_binfmt *new);
|
||||
extern void set_binfmt(struct linux_binfmt *new);
|
||||
extern void free_bprm(struct linux_binprm *);
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
@@ -142,56 +142,51 @@ struct bio {
|
||||
*
|
||||
* bit 0 -- data direction
|
||||
* If not set, bio is a read from device. If set, it's a write to device.
|
||||
* bit 1 -- rw-ahead when set
|
||||
* bit 2 -- barrier
|
||||
* bit 1 -- fail fast device errors
|
||||
* bit 2 -- fail fast transport errors
|
||||
* bit 3 -- fail fast driver errors
|
||||
* bit 4 -- rw-ahead when set
|
||||
* bit 5 -- barrier
|
||||
* Insert a serialization point in the IO queue, forcing previously
|
||||
* submitted IO to be completed before this one is issued.
|
||||
* bit 3 -- synchronous I/O hint.
|
||||
* bit 4 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 5 -- metadata request
|
||||
* bit 6 -- synchronous I/O hint.
|
||||
* bit 7 -- Unplug the device immediately after submitting this bio.
|
||||
* bit 8 -- metadata request
|
||||
* Used for tracing to differentiate metadata and data IO. May also
|
||||
* get some preferential treatment in the IO scheduler
|
||||
* bit 6 -- discard sectors
|
||||
* bit 9 -- discard sectors
|
||||
* Informs the lower level device that this range of sectors is no longer
|
||||
* used by the file system and may thus be freed by the device. Used
|
||||
* for flash based storage.
|
||||
* bit 7 -- fail fast device errors
|
||||
* bit 8 -- fail fast transport errors
|
||||
* bit 9 -- fail fast driver errors
|
||||
* Don't want driver retries for any fast fail whatever the reason.
|
||||
* bit 10 -- Tell the IO scheduler not to wait for more requests after this
|
||||
one has been submitted, even if it is a SYNC request.
|
||||
*/
|
||||
#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
|
||||
#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
|
||||
#define BIO_RW_BARRIER 2
|
||||
#define BIO_RW_SYNCIO 3
|
||||
#define BIO_RW_UNPLUG 4
|
||||
#define BIO_RW_META 5
|
||||
#define BIO_RW_DISCARD 6
|
||||
#define BIO_RW_FAILFAST_DEV 7
|
||||
#define BIO_RW_FAILFAST_TRANSPORT 8
|
||||
#define BIO_RW_FAILFAST_DRIVER 9
|
||||
#define BIO_RW_NOIDLE 10
|
||||
|
||||
#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
|
||||
enum bio_rw_flags {
|
||||
BIO_RW,
|
||||
BIO_RW_FAILFAST_DEV,
|
||||
BIO_RW_FAILFAST_TRANSPORT,
|
||||
BIO_RW_FAILFAST_DRIVER,
|
||||
/* above flags must match REQ_* */
|
||||
BIO_RW_AHEAD,
|
||||
BIO_RW_BARRIER,
|
||||
BIO_RW_SYNCIO,
|
||||
BIO_RW_UNPLUG,
|
||||
BIO_RW_META,
|
||||
BIO_RW_DISCARD,
|
||||
BIO_RW_NOIDLE,
|
||||
};
|
||||
|
||||
/*
|
||||
* Old defines, these should eventually be replaced by direct usage of
|
||||
* bio_rw_flagged()
|
||||
* First four bits must match between bio->bi_rw and rq->cmd_flags, make
|
||||
* that explicit here.
|
||||
*/
|
||||
#define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER)
|
||||
#define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO)
|
||||
#define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG)
|
||||
#define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV)
|
||||
#define bio_failfast_transport(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT)
|
||||
#define bio_failfast_driver(bio) \
|
||||
bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER)
|
||||
#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
|
||||
#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
|
||||
#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
|
||||
#define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE)
|
||||
#define BIO_RW_RQ_MASK 0xf
|
||||
|
||||
static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag)
|
||||
{
|
||||
return (bio->bi_rw & (1 << flag)) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* upper 16 bits of bi_rw define the io priority of this bio
|
||||
@@ -216,7 +211,7 @@ struct bio {
|
||||
#define bio_offset(bio) bio_iovec((bio))->bv_offset
|
||||
#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
|
||||
#define bio_sectors(bio) ((bio)->bi_size >> 9)
|
||||
#define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
|
||||
#define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD))
|
||||
|
||||
static inline unsigned int bio_cur_bytes(struct bio *bio)
|
||||
{
|
||||
|
48
include/linux/blk-iopoll.h
Normal file
48
include/linux/blk-iopoll.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef BLK_IOPOLL_H
|
||||
#define BLK_IOPOLL_H
|
||||
|
||||
struct blk_iopoll;
|
||||
typedef int (blk_iopoll_fn)(struct blk_iopoll *, int);
|
||||
|
||||
struct blk_iopoll {
|
||||
struct list_head list;
|
||||
unsigned long state;
|
||||
unsigned long data;
|
||||
int weight;
|
||||
int max;
|
||||
blk_iopoll_fn *poll;
|
||||
};
|
||||
|
||||
enum {
|
||||
IOPOLL_F_SCHED = 0,
|
||||
IOPOLL_F_DISABLE = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
* Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating
|
||||
* that we were the first to acquire this iop for scheduling. If this iop
|
||||
* is currently disabled, return "failure".
|
||||
*/
|
||||
static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop)
|
||||
{
|
||||
if (!test_bit(IOPOLL_F_DISABLE, &iop->state))
|
||||
return test_and_set_bit(IOPOLL_F_SCHED, &iop->state);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop)
|
||||
{
|
||||
return test_bit(IOPOLL_F_DISABLE, &iop->state);
|
||||
}
|
||||
|
||||
extern void blk_iopoll_sched(struct blk_iopoll *);
|
||||
extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *);
|
||||
extern void blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void __blk_iopoll_complete(struct blk_iopoll *);
|
||||
extern void blk_iopoll_enable(struct blk_iopoll *);
|
||||
extern void blk_iopoll_disable(struct blk_iopoll *);
|
||||
|
||||
extern int blk_iopoll_enabled;
|
||||
|
||||
#endif
|
@@ -86,13 +86,14 @@ enum {
|
||||
};
|
||||
|
||||
/*
|
||||
* request type modified bits. first two bits match BIO_RW* bits, important
|
||||
* request type modified bits. first four bits match BIO_RW* bits, important
|
||||
*/
|
||||
enum rq_flag_bits {
|
||||
__REQ_RW, /* not set, read. set, write */
|
||||
__REQ_FAILFAST_DEV, /* no driver retries of device errors */
|
||||
__REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
|
||||
__REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
|
||||
/* above flags must match BIO_RW_* */
|
||||
__REQ_DISCARD, /* request to discard sectors */
|
||||
__REQ_SORTED, /* elevator knows about this request */
|
||||
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
|
||||
@@ -114,6 +115,7 @@ enum rq_flag_bits {
|
||||
__REQ_INTEGRITY, /* integrity metadata has been remapped */
|
||||
__REQ_NOIDLE, /* Don't anticipate more IO after this one */
|
||||
__REQ_IO_STAT, /* account I/O stat */
|
||||
__REQ_MIXED_MERGE, /* merge of different types, fail separately */
|
||||
__REQ_NR_BITS, /* stops here */
|
||||
};
|
||||
|
||||
@@ -142,6 +144,10 @@ enum rq_flag_bits {
|
||||
#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
|
||||
#define REQ_NOIDLE (1 << __REQ_NOIDLE)
|
||||
#define REQ_IO_STAT (1 << __REQ_IO_STAT)
|
||||
#define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)
|
||||
|
||||
#define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \
|
||||
REQ_FAILFAST_DRIVER)
|
||||
|
||||
#define BLK_MAX_CDB 16
|
||||
|
||||
@@ -453,10 +459,12 @@ struct request_queue
|
||||
#define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
|
||||
#define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
|
||||
#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
|
||||
#define QUEUE_FLAG_CQ 16 /* hardware does queuing */
|
||||
|
||||
#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
|
||||
(1 << QUEUE_FLAG_CLUSTER) | \
|
||||
(1 << QUEUE_FLAG_STACKABLE))
|
||||
(1 << QUEUE_FLAG_STACKABLE) | \
|
||||
(1 << QUEUE_FLAG_SAME_COMP))
|
||||
|
||||
static inline int queue_is_locked(struct request_queue *q)
|
||||
{
|
||||
@@ -575,6 +583,7 @@ enum {
|
||||
|
||||
#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
|
||||
#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
|
||||
#define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags)
|
||||
#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
|
||||
#define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
|
||||
#define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
|
||||
@@ -828,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping)
|
||||
}
|
||||
|
||||
/*
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_pos() : the current sector
|
||||
* blk_rq_bytes() : bytes left in the entire request
|
||||
* blk_rq_cur_bytes() : bytes left in the current segment
|
||||
* blk_rq_err_bytes() : bytes left till the next error boundary
|
||||
* blk_rq_sectors() : sectors left in the entire request
|
||||
* blk_rq_cur_sectors() : sectors left in the current segment
|
||||
* blk_rq_err_sectors() : sectors left till the next error boundary
|
||||
*/
|
||||
static inline sector_t blk_rq_pos(const struct request *rq)
|
||||
{
|
||||
@@ -849,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq)
|
||||
return rq->bio ? bio_cur_bytes(rq->bio) : 0;
|
||||
}
|
||||
|
||||
extern unsigned int blk_rq_err_bytes(const struct request *rq);
|
||||
|
||||
static inline unsigned int blk_rq_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_bytes(rq) >> 9;
|
||||
@@ -859,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq)
|
||||
return blk_rq_cur_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
static inline unsigned int blk_rq_err_sectors(const struct request *rq)
|
||||
{
|
||||
return blk_rq_err_bytes(rq) >> 9;
|
||||
}
|
||||
|
||||
/*
|
||||
* Request issue related functions.
|
||||
*/
|
||||
@@ -885,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void blk_end_request_all(struct request *rq, int error);
|
||||
extern bool blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool blk_end_request_err(struct request *rq, int error);
|
||||
extern bool __blk_end_request(struct request *rq, int error,
|
||||
unsigned int nr_bytes);
|
||||
extern void __blk_end_request_all(struct request *rq, int error);
|
||||
extern bool __blk_end_request_cur(struct request *rq, int error);
|
||||
extern bool __blk_end_request_err(struct request *rq, int error);
|
||||
|
||||
extern void blk_complete_request(struct request *);
|
||||
extern void __blk_complete_request(struct request *);
|
||||
@@ -915,6 +935,7 @@ extern void blk_queue_alignment_offset(struct request_queue *q,
|
||||
unsigned int alignment);
|
||||
extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min);
|
||||
extern void blk_queue_io_min(struct request_queue *q, unsigned int min);
|
||||
extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt);
|
||||
extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt);
|
||||
extern void blk_set_default_limits(struct queue_limits *lim);
|
||||
extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
|
||||
@@ -977,15 +998,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
|
||||
}
|
||||
|
||||
extern int blkdev_issue_flush(struct block_device *, sector_t *);
|
||||
extern int blkdev_issue_discard(struct block_device *,
|
||||
sector_t sector, sector_t nr_sects, gfp_t);
|
||||
#define DISCARD_FL_WAIT 0x01 /* wait for completion */
|
||||
#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */
|
||||
extern int blkdev_issue_discard(struct block_device *, sector_t sector,
|
||||
sector_t nr_sects, gfp_t, int flags);
|
||||
|
||||
static inline int sb_issue_discard(struct super_block *sb,
|
||||
sector_t block, sector_t nr_blocks)
|
||||
{
|
||||
block <<= (sb->s_blocksize_bits - 9);
|
||||
nr_blocks <<= (sb->s_blocksize_bits - 9);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL);
|
||||
return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
|
||||
DISCARD_FL_BARRIER);
|
||||
}
|
||||
|
||||
extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
|
||||
|
@@ -132,9 +132,6 @@ static inline void *alloc_remap(int nid, unsigned long size)
|
||||
}
|
||||
#endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */
|
||||
|
||||
extern unsigned long __meminitdata nr_kernel_pages;
|
||||
extern unsigned long __meminitdata nr_all_pages;
|
||||
|
||||
extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long bucketsize,
|
||||
unsigned long numentries,
|
||||
@@ -145,6 +142,8 @@ extern void *alloc_large_system_hash(const char *tablename,
|
||||
unsigned long limit);
|
||||
|
||||
#define HASH_EARLY 0x00000001 /* Allocating during early boot? */
|
||||
#define HASH_SMALL 0x00000002 /* sub-page allocation allowed, min
|
||||
* shift passed via *_hash_shift */
|
||||
|
||||
/* Only NUMA needs hash distribution. 64bit NUMA architectures have
|
||||
* sufficient vmalloc space.
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* See here for the libcap library ("POSIX draft" compliance):
|
||||
*
|
||||
* ftp://linux.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
* ftp://www.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.6/
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_CAPABILITY_H
|
||||
|
@@ -141,6 +141,38 @@ enum {
|
||||
CGRP_WAIT_ON_RMDIR,
|
||||
};
|
||||
|
||||
/* which pidlist file are we talking about? */
|
||||
enum cgroup_filetype {
|
||||
CGROUP_FILE_PROCS,
|
||||
CGROUP_FILE_TASKS,
|
||||
};
|
||||
|
||||
/*
|
||||
* A pidlist is a list of pids that virtually represents the contents of one
|
||||
* of the cgroup files ("procs" or "tasks"). We keep a list of such pidlists,
|
||||
* a pair (one each for procs, tasks) for each pid namespace that's relevant
|
||||
* to the cgroup.
|
||||
*/
|
||||
struct cgroup_pidlist {
|
||||
/*
|
||||
* used to find which pidlist is wanted. doesn't change as long as
|
||||
* this particular list stays in the list.
|
||||
*/
|
||||
struct { enum cgroup_filetype type; struct pid_namespace *ns; } key;
|
||||
/* array of xids */
|
||||
pid_t *list;
|
||||
/* how many elements the above list has */
|
||||
int length;
|
||||
/* how many files are using the current array */
|
||||
int use_count;
|
||||
/* each of these stored in a list by its cgroup */
|
||||
struct list_head links;
|
||||
/* pointer to the cgroup we belong to, for list removal purposes */
|
||||
struct cgroup *owner;
|
||||
/* protects the other fields */
|
||||
struct rw_semaphore mutex;
|
||||
};
|
||||
|
||||
struct cgroup {
|
||||
unsigned long flags; /* "unsigned long" so bitops work */
|
||||
|
||||
@@ -179,11 +211,12 @@ struct cgroup {
|
||||
*/
|
||||
struct list_head release_list;
|
||||
|
||||
/* pids_mutex protects pids_list and cached pid arrays. */
|
||||
struct rw_semaphore pids_mutex;
|
||||
|
||||
/* Linked list of struct cgroup_pids */
|
||||
struct list_head pids_list;
|
||||
/*
|
||||
* list of pidlists, up to two for each namespace (one for procs, one
|
||||
* for tasks); created on demand.
|
||||
*/
|
||||
struct list_head pidlists;
|
||||
struct mutex pidlist_mutex;
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
@@ -227,6 +260,9 @@ struct css_set {
|
||||
* during subsystem registration (at boot time).
|
||||
*/
|
||||
struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
|
||||
|
||||
/* For RCU-protected deletion */
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -389,10 +425,11 @@ struct cgroup_subsys {
|
||||
struct cgroup *cgrp);
|
||||
int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
int (*can_attach)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cgrp, struct task_struct *tsk);
|
||||
int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct task_struct *tsk, bool threadgroup);
|
||||
void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk);
|
||||
struct cgroup *old_cgrp, struct task_struct *tsk,
|
||||
bool threadgroup);
|
||||
void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
void (*exit)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
int (*populate)(struct cgroup_subsys *ss,
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/cache.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
@@ -148,14 +149,11 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
|
||||
* @disable: optional function to disable the clocksource
|
||||
* @mask: bitmask for two's complement
|
||||
* subtraction of non 64 bit counters
|
||||
* @mult: cycle to nanosecond multiplier (adjusted by NTP)
|
||||
* @mult_orig: cycle to nanosecond multiplier (unadjusted by NTP)
|
||||
* @mult: cycle to nanosecond multiplier
|
||||
* @shift: cycle to nanosecond divisor (power of two)
|
||||
* @flags: flags describing special properties
|
||||
* @vread: vsyscall based read
|
||||
* @resume: resume function for the clocksource, if necessary
|
||||
* @cycle_interval: Used internally by timekeeping core, please ignore.
|
||||
* @xtime_interval: Used internally by timekeeping core, please ignore.
|
||||
*/
|
||||
struct clocksource {
|
||||
/*
|
||||
@@ -169,7 +167,6 @@ struct clocksource {
|
||||
void (*disable)(struct clocksource *cs);
|
||||
cycle_t mask;
|
||||
u32 mult;
|
||||
u32 mult_orig;
|
||||
u32 shift;
|
||||
unsigned long flags;
|
||||
cycle_t (*vread)(void);
|
||||
@@ -181,19 +178,12 @@ struct clocksource {
|
||||
#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
|
||||
#endif
|
||||
|
||||
/* timekeeping specific data, ignore */
|
||||
cycle_t cycle_interval;
|
||||
u64 xtime_interval;
|
||||
u32 raw_interval;
|
||||
/*
|
||||
* Second part is written at each timer interrupt
|
||||
* Keep it in a different cache line to dirty no
|
||||
* more than one cache line.
|
||||
*/
|
||||
cycle_t cycle_last ____cacheline_aligned_in_smp;
|
||||
u64 xtime_nsec;
|
||||
s64 error;
|
||||
struct timespec raw_time;
|
||||
|
||||
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
|
||||
/* Watchdog related data, used by the framework */
|
||||
@@ -202,8 +192,6 @@ struct clocksource {
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
/*
|
||||
* Clock source flags bits::
|
||||
*/
|
||||
@@ -212,6 +200,7 @@ extern struct clocksource *clock; /* current clocksource */
|
||||
|
||||
#define CLOCK_SOURCE_WATCHDOG 0x10
|
||||
#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
|
||||
#define CLOCK_SOURCE_UNSTABLE 0x40
|
||||
|
||||
/* simplify initialization of mask field */
|
||||
#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
|
||||
@@ -268,108 +257,15 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant)
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_read: - Access the clocksource's current cycle value
|
||||
* @cs: pointer to clocksource being read
|
||||
* clocksource_cyc2ns - converts clocksource cycles to nanoseconds
|
||||
*
|
||||
* Uses the clocksource to return the current cycle_t value
|
||||
*/
|
||||
static inline cycle_t clocksource_read(struct clocksource *cs)
|
||||
{
|
||||
return cs->read(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_enable: - enable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Enables the specified clocksource. The clocksource callback
|
||||
* function should start up the hardware and setup mult and field
|
||||
* members of struct clocksource to reflect hardware capabilities.
|
||||
*/
|
||||
static inline int clocksource_enable(struct clocksource *cs)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (cs->enable)
|
||||
ret = cs->enable(cs);
|
||||
|
||||
/*
|
||||
* The frequency may have changed while the clocksource
|
||||
* was disabled. If so the code in ->enable() must update
|
||||
* the mult value to reflect the new frequency. Make sure
|
||||
* mult_orig follows this change.
|
||||
*/
|
||||
cs->mult_orig = cs->mult;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_disable: - disable clocksource
|
||||
* @cs: pointer to clocksource
|
||||
*
|
||||
* Disables the specified clocksource. The clocksource callback
|
||||
* function should power down the now unused hardware block to
|
||||
* save power.
|
||||
*/
|
||||
static inline void clocksource_disable(struct clocksource *cs)
|
||||
{
|
||||
/*
|
||||
* Save mult_orig in mult so clocksource_enable() can
|
||||
* restore the value regardless if ->enable() updates
|
||||
* the value of mult or not.
|
||||
*/
|
||||
cs->mult = cs->mult_orig;
|
||||
|
||||
if (cs->disable)
|
||||
cs->disable(cs);
|
||||
}
|
||||
|
||||
/**
|
||||
* cyc2ns - converts clocksource cycles to nanoseconds
|
||||
* @cs: Pointer to clocksource
|
||||
* @cycles: Cycles
|
||||
*
|
||||
* Uses the clocksource and ntp ajdustment to convert cycle_ts to nanoseconds.
|
||||
* Converts cycles to nanoseconds, using the given mult and shift.
|
||||
*
|
||||
* XXX - This could use some mult_lxl_ll() asm optimization
|
||||
*/
|
||||
static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles)
|
||||
static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
|
||||
{
|
||||
u64 ret = (u64)cycles;
|
||||
ret = (ret * cs->mult) >> cs->shift;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clocksource_calculate_interval - Calculates a clocksource interval struct
|
||||
*
|
||||
* @c: Pointer to clocksource.
|
||||
* @length_nsec: Desired interval length in nanoseconds.
|
||||
*
|
||||
* Calculates a fixed cycle/nsec interval for a given clocksource/adjustment
|
||||
* pair and interval request.
|
||||
*
|
||||
* Unless you're the timekeeping code, you should not be using this!
|
||||
*/
|
||||
static inline void clocksource_calculate_interval(struct clocksource *c,
|
||||
unsigned long length_nsec)
|
||||
{
|
||||
u64 tmp;
|
||||
|
||||
/* Do the ns -> cycle conversion first, using original mult */
|
||||
tmp = length_nsec;
|
||||
tmp <<= c->shift;
|
||||
tmp += c->mult_orig/2;
|
||||
do_div(tmp, c->mult_orig);
|
||||
|
||||
c->cycle_interval = (cycle_t)tmp;
|
||||
if (c->cycle_interval == 0)
|
||||
c->cycle_interval = 1;
|
||||
|
||||
/* Go back from cycles -> shifted ns, this time use ntp adjused mult */
|
||||
c->xtime_interval = (u64)c->cycle_interval * c->mult;
|
||||
c->raw_interval = ((u64)c->cycle_interval * c->mult_orig) >> c->shift;
|
||||
return ((u64) cycles * mult) >> shift;
|
||||
}
|
||||
|
||||
|
||||
@@ -380,6 +276,8 @@ extern void clocksource_touch_watchdog(void);
|
||||
extern struct clocksource* clocksource_get_next(void);
|
||||
extern void clocksource_change_rating(struct clocksource *cs, int rating);
|
||||
extern void clocksource_resume(void);
|
||||
extern struct clocksource * __init __weak clocksource_default_clock(void);
|
||||
extern void clocksource_mark_unstable(struct clocksource *cs);
|
||||
|
||||
#ifdef CONFIG_GENERIC_TIME_VSYSCALL
|
||||
extern void update_vsyscall(struct timespec *ts, struct clocksource *c);
|
||||
@@ -394,4 +292,6 @@ static inline void update_vsyscall_tz(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
extern void timekeeping_notify(struct clocksource *clock);
|
||||
|
||||
#endif /* _LINUX_CLOCKSOURCE_H */
|
||||
|
@@ -52,6 +52,7 @@ struct proc_event {
|
||||
PROC_EVENT_EXEC = 0x00000002,
|
||||
PROC_EVENT_UID = 0x00000004,
|
||||
PROC_EVENT_GID = 0x00000040,
|
||||
PROC_EVENT_SID = 0x00000080,
|
||||
/* "next" should be 0x00000400 */
|
||||
/* "last" is the last process event: exit */
|
||||
PROC_EVENT_EXIT = 0x80000000
|
||||
@@ -89,6 +90,11 @@ struct proc_event {
|
||||
} e;
|
||||
} id;
|
||||
|
||||
struct sid_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
} sid;
|
||||
|
||||
struct exit_proc_event {
|
||||
__kernel_pid_t process_pid;
|
||||
__kernel_pid_t process_tgid;
|
||||
@@ -102,6 +108,7 @@ struct proc_event {
|
||||
void proc_fork_connector(struct task_struct *task);
|
||||
void proc_exec_connector(struct task_struct *task);
|
||||
void proc_id_connector(struct task_struct *task, int which_id);
|
||||
void proc_sid_connector(struct task_struct *task);
|
||||
void proc_exit_connector(struct task_struct *task);
|
||||
#else
|
||||
static inline void proc_fork_connector(struct task_struct *task)
|
||||
@@ -114,6 +121,9 @@ static inline void proc_id_connector(struct task_struct *task,
|
||||
int which_id)
|
||||
{}
|
||||
|
||||
static inline void proc_sid_connector(struct task_struct *task)
|
||||
{}
|
||||
|
||||
static inline void proc_exit_connector(struct task_struct *task)
|
||||
{}
|
||||
#endif /* CONFIG_PROC_EVENTS */
|
||||
|
@@ -27,8 +27,8 @@
|
||||
*
|
||||
* configfs Copyright (C) 2005 Oracle. All rights reserved.
|
||||
*
|
||||
* Please read Documentation/filesystems/configfs.txt before using the
|
||||
* configfs interface, ESPECIALLY the parts about reference counts and
|
||||
* Please read Documentation/filesystems/configfs/configfs.txt before using
|
||||
* the configfs interface, ESPECIALLY the parts about reference counts and
|
||||
* item destructors.
|
||||
*/
|
||||
|
||||
|
@@ -65,6 +65,9 @@ static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
|
||||
|
||||
struct cpufreq_governor;
|
||||
|
||||
/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
|
||||
extern struct kobject *cpufreq_global_kobject;
|
||||
|
||||
#define CPUFREQ_ETERNAL (-1)
|
||||
struct cpufreq_cpuinfo {
|
||||
unsigned int max_freq;
|
||||
@@ -274,6 +277,13 @@ struct freq_attr {
|
||||
ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
|
||||
};
|
||||
|
||||
struct global_attr {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct kobject *kobj,
|
||||
struct attribute *attr, char *buf);
|
||||
ssize_t (*store)(struct kobject *a, struct attribute *b,
|
||||
const char *c, size_t count);
|
||||
};
|
||||
|
||||
/*********************************************************************
|
||||
* CPUFREQ 2.6. INTERFACE *
|
||||
|
@@ -3,444 +3,37 @@
|
||||
|
||||
/*
|
||||
* Cpumasks provide a bitmap suitable for representing the
|
||||
* set of CPU's in a system, one bit position per CPU number.
|
||||
*
|
||||
* The new cpumask_ ops take a "struct cpumask *"; the old ones
|
||||
* use cpumask_t.
|
||||
*
|
||||
* See detailed comments in the file linux/bitmap.h describing the
|
||||
* data type on which these cpumasks are based.
|
||||
*
|
||||
* For details of cpumask_scnprintf() and cpumask_parse_user(),
|
||||
* see bitmap_scnprintf() and bitmap_parse_user() in lib/bitmap.c.
|
||||
* For details of cpulist_scnprintf() and cpulist_parse(), see
|
||||
* bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c.
|
||||
* For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c
|
||||
* For details of cpus_remap(), see bitmap_remap in lib/bitmap.c.
|
||||
* For details of cpus_onto(), see bitmap_onto in lib/bitmap.c.
|
||||
* For details of cpus_fold(), see bitmap_fold in lib/bitmap.c.
|
||||
*
|
||||
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
* Note: The alternate operations with the suffix "_nr" are used
|
||||
* to limit the range of the loop to nr_cpu_ids instead of
|
||||
* NR_CPUS when NR_CPUS > 64 for performance reasons.
|
||||
* If NR_CPUS is <= 64 then most assembler bitmask
|
||||
* operators execute faster with a constant range, so
|
||||
* the operator will continue to use NR_CPUS.
|
||||
*
|
||||
* Another consideration is that nr_cpu_ids is initialized
|
||||
* to NR_CPUS and isn't lowered until the possible cpus are
|
||||
* discovered (including any disabled cpus). So early uses
|
||||
* will span the entire range of NR_CPUS.
|
||||
* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
*
|
||||
* The obsolescent cpumask operations are:
|
||||
*
|
||||
* void cpu_set(cpu, mask) turn on bit 'cpu' in mask
|
||||
* void cpu_clear(cpu, mask) turn off bit 'cpu' in mask
|
||||
* void cpus_setall(mask) set all bits
|
||||
* void cpus_clear(mask) clear all bits
|
||||
* int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask
|
||||
* int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask
|
||||
*
|
||||
* int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection]
|
||||
* void cpus_or(dst, src1, src2) dst = src1 | src2 [union]
|
||||
* void cpus_xor(dst, src1, src2) dst = src1 ^ src2
|
||||
* int cpus_andnot(dst, src1, src2) dst = src1 & ~src2
|
||||
* void cpus_complement(dst, src) dst = ~src
|
||||
*
|
||||
* int cpus_equal(mask1, mask2) Does mask1 == mask2?
|
||||
* int cpus_intersects(mask1, mask2) Do mask1 and mask2 intersect?
|
||||
* int cpus_subset(mask1, mask2) Is mask1 a subset of mask2?
|
||||
* int cpus_empty(mask) Is mask empty (no bits sets)?
|
||||
* int cpus_full(mask) Is mask full (all bits sets)?
|
||||
* int cpus_weight(mask) Hamming weigh - number of set bits
|
||||
* int cpus_weight_nr(mask) Same using nr_cpu_ids instead of NR_CPUS
|
||||
*
|
||||
* void cpus_shift_right(dst, src, n) Shift right
|
||||
* void cpus_shift_left(dst, src, n) Shift left
|
||||
*
|
||||
* int first_cpu(mask) Number lowest set bit, or NR_CPUS
|
||||
* int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS
|
||||
* int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids
|
||||
*
|
||||
* cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set
|
||||
* (can be used as an lvalue)
|
||||
* CPU_MASK_ALL Initializer - all bits set
|
||||
* CPU_MASK_NONE Initializer - no bits set
|
||||
* unsigned long *cpus_addr(mask) Array of unsigned long's in mask
|
||||
*
|
||||
* CPUMASK_ALLOC kmalloc's a structure that is a composite of many cpumask_t
|
||||
* variables, and CPUMASK_PTR provides pointers to each field.
|
||||
*
|
||||
* The structure should be defined something like this:
|
||||
* struct my_cpumasks {
|
||||
* cpumask_t mask1;
|
||||
* cpumask_t mask2;
|
||||
* };
|
||||
*
|
||||
* Usage is then:
|
||||
* CPUMASK_ALLOC(my_cpumasks);
|
||||
* CPUMASK_PTR(mask1, my_cpumasks);
|
||||
* CPUMASK_PTR(mask2, my_cpumasks);
|
||||
*
|
||||
* --- DO NOT reference cpumask_t pointers until this check ---
|
||||
* if (my_cpumasks == NULL)
|
||||
* "kmalloc failed"...
|
||||
*
|
||||
* References are now pointers to the cpumask_t variables (*mask1, ...)
|
||||
*
|
||||
*if NR_CPUS > BITS_PER_LONG
|
||||
* CPUMASK_ALLOC(m) Declares and allocates struct m *m =
|
||||
* kmalloc(sizeof(*m), GFP_KERNEL)
|
||||
* CPUMASK_FREE(m) Macro for kfree(m)
|
||||
*else
|
||||
* CPUMASK_ALLOC(m) Declares struct m _m, *m = &_m
|
||||
* CPUMASK_FREE(m) Nop
|
||||
*endif
|
||||
* CPUMASK_PTR(v, m) Declares cpumask_t *v = &(m->v)
|
||||
* ------------------------------------------------------------------------
|
||||
*
|
||||
* int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
|
||||
* int cpumask_parse_user(ubuf, ulen, mask) Parse ascii string as cpumask
|
||||
* int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing
|
||||
* int cpulist_parse(buf, map) Parse ascii string as cpulist
|
||||
* int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit)
|
||||
* void cpus_remap(dst, src, old, new) *dst = map(old, new)(src)
|
||||
* void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap
|
||||
* void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz
|
||||
*
|
||||
* for_each_cpu_mask(cpu, mask) for-loop cpu over mask using NR_CPUS
|
||||
* for_each_cpu_mask_nr(cpu, mask) for-loop cpu over mask using nr_cpu_ids
|
||||
*
|
||||
* int num_online_cpus() Number of online CPUs
|
||||
* int num_possible_cpus() Number of all possible CPUs
|
||||
* int num_present_cpus() Number of present CPUs
|
||||
*
|
||||
* int cpu_online(cpu) Is some cpu online?
|
||||
* int cpu_possible(cpu) Is some cpu possible?
|
||||
* int cpu_present(cpu) Is some cpu present (can schedule)?
|
||||
*
|
||||
* int any_online_cpu(mask) First online cpu in mask
|
||||
*
|
||||
* for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map
|
||||
* for_each_online_cpu(cpu) for-loop cpu over cpu_online_map
|
||||
* for_each_present_cpu(cpu) for-loop cpu over cpu_present_map
|
||||
*
|
||||
* Subtlety:
|
||||
* 1) The 'type-checked' form of cpu_isset() causes gcc (3.3.2, anyway)
|
||||
* to generate slightly worse code. Note for example the additional
|
||||
* 40 lines of assembly code compiling the "for each possible cpu"
|
||||
* loops buried in the disk_stat_read() macros calls when compiling
|
||||
* drivers/block/genhd.c (arch i386, CONFIG_SMP=y). So use a simple
|
||||
* one-line #define for cpu_isset(), instead of wrapping an inline
|
||||
* inside a macro, the way we do the other calls.
|
||||
* set of CPU's in a system, one bit position per CPU number. In general,
|
||||
* only nr_cpu_ids (<= NR_CPUS) bits are valid.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/threads.h>
|
||||
#include <linux/bitmap.h>
|
||||
|
||||
typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
|
||||
extern cpumask_t _unused_cpumask_arg_;
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
set_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
|
||||
static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
clear_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
|
||||
static inline void __cpus_setall(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_fill(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
|
||||
static inline void __cpus_clear(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_zero(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
/* No static inline type checking - see Subtlety (1) above. */
|
||||
#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
|
||||
|
||||
#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
|
||||
static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
|
||||
{
|
||||
return test_and_set_bit(cpu, addr->bits);
|
||||
}
|
||||
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_andnot(dst, src1, src2) \
|
||||
__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
|
||||
static inline void __cpus_complement(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
bitmap_complement(dstp->bits, srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_equal(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_equal(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_intersects(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_subset(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_subset(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
|
||||
static inline int __cpus_empty(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_empty(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_full(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_full(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_weight(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_weight(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_right(dst, src, n) \
|
||||
__cpus_shift_right(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_right(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_right(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_left(dst, src, n) \
|
||||
__cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_left(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
* cpumask_bits - get the bits in a cpumask
|
||||
* @maskp: the struct cpumask *
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
* You should only assume nr_cpu_ids bits of this mask are valid. This is
|
||||
* a macro so it's const-correct.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special-case data structure for "single bit set only" constant CPU masks.
|
||||
*
|
||||
* We pre-generate all the 64 (or 32) possible bit positions, with enough
|
||||
* padding to the left and the right, and return the constant pointer
|
||||
* appropriately offset.
|
||||
*/
|
||||
extern const unsigned long
|
||||
cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)];
|
||||
|
||||
static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
p -= cpu / BITS_PER_LONG;
|
||||
return to_cpumask(p);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
/*
|
||||
* In cases where we take the address of the cpumask immediately,
|
||||
* gcc optimizes it out (it's a constant) and there's no huge stack
|
||||
* variable created:
|
||||
*/
|
||||
#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))
|
||||
|
||||
|
||||
#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)
|
||||
|
||||
#else
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
/* cpu_mask_all is in init/main.c */
|
||||
extern cpumask_t cpu_mask_all;
|
||||
#define CPU_MASK_ALL_PTR (&cpu_mask_all)
|
||||
|
||||
#endif
|
||||
|
||||
#define CPU_MASK_NONE \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_CPU0 \
|
||||
(cpumask_t) { { \
|
||||
[0] = 1UL \
|
||||
} }
|
||||
|
||||
#define cpus_addr(src) ((src).bits)
|
||||
|
||||
#if NR_CPUS > BITS_PER_LONG
|
||||
#define CPUMASK_ALLOC(m) struct m *m = kmalloc(sizeof(*m), GFP_KERNEL)
|
||||
#define CPUMASK_FREE(m) kfree(m)
|
||||
#else
|
||||
#define CPUMASK_ALLOC(m) struct m _m, *m = &_m
|
||||
#define CPUMASK_FREE(m)
|
||||
#endif
|
||||
#define CPUMASK_PTR(v, m) cpumask_t *v = &(m->v)
|
||||
|
||||
#define cpu_remap(oldbit, old, new) \
|
||||
__cpu_remap((oldbit), &(old), &(new), NR_CPUS)
|
||||
static inline int __cpu_remap(int oldbit,
|
||||
const cpumask_t *oldp, const cpumask_t *newp, int nbits)
|
||||
{
|
||||
return bitmap_bitremap(oldbit, oldp->bits, newp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_remap(dst, src, old, new) \
|
||||
__cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS)
|
||||
static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp,
|
||||
const cpumask_t *oldp, const cpumask_t *newp, int nbits)
|
||||
{
|
||||
bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_onto(dst, orig, relmap) \
|
||||
__cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS)
|
||||
static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp,
|
||||
const cpumask_t *relmapp, int nbits)
|
||||
{
|
||||
bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_fold(dst, orig, sz) \
|
||||
__cpus_fold(&(dst), &(orig), sz, NR_CPUS)
|
||||
static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp,
|
||||
int sz, int nbits)
|
||||
{
|
||||
bitmap_fold(dstp->bits, origp->bits, sz, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#define cpumask_bits(maskp) ((maskp)->bits)
|
||||
|
||||
#if NR_CPUS == 1
|
||||
|
||||
#define nr_cpu_ids 1
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#define first_cpu(src) ({ (void)(src); 0; })
|
||||
#define next_cpu(n, src) ({ (void)(src); 1; })
|
||||
#define any_online_cpu(mask) 0
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#else /* NR_CPUS > 1 */
|
||||
|
||||
#else
|
||||
extern int nr_cpu_ids;
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
int __first_cpu(const cpumask_t *srcp);
|
||||
int __next_cpu(int n, const cpumask_t *srcp);
|
||||
int __any_online_cpu(const cpumask_t *mask);
|
||||
|
||||
#define first_cpu(src) __first_cpu(&(src))
|
||||
#define next_cpu(n, src) __next_cpu((n), &(src))
|
||||
#define any_online_cpu(mask) __any_online_cpu(&(mask))
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu((cpu), (mask)), \
|
||||
(cpu) < NR_CPUS; )
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
#if NR_CPUS <= 64
|
||||
|
||||
#define next_cpu_nr(n, src) next_cpu(n, src)
|
||||
#define cpus_weight_nr(cpumask) cpus_weight(cpumask)
|
||||
#define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask)
|
||||
|
||||
#else /* NR_CPUS > 64 */
|
||||
|
||||
int __next_cpu_nr(int n, const cpumask_t *srcp);
|
||||
#define next_cpu_nr(n, src) __next_cpu_nr((n), &(src))
|
||||
#define cpus_weight_nr(cpumask) __cpus_weight(&(cpumask), nr_cpu_ids)
|
||||
#define for_each_cpu_mask_nr(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu_nr((cpu), (mask)), \
|
||||
(cpu) < nr_cpu_ids; )
|
||||
|
||||
#endif /* NR_CPUS > 64 */
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
|
||||
* not all bits may be allocated. */
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#else
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following particular system cpumasks and operations manage
|
||||
@@ -487,12 +80,6 @@ extern const struct cpumask *const cpu_online_mask;
|
||||
extern const struct cpumask *const cpu_present_mask;
|
||||
extern const struct cpumask *const cpu_active_mask;
|
||||
|
||||
/* These strip const, as traditionally they weren't const. */
|
||||
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
|
||||
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
|
||||
#define cpu_present_map (*(cpumask_t *)cpu_present_mask)
|
||||
#define cpu_active_map (*(cpumask_t *)cpu_active_mask)
|
||||
|
||||
#if NR_CPUS > 1
|
||||
#define num_online_cpus() cpumask_weight(cpu_online_mask)
|
||||
#define num_possible_cpus() cpumask_weight(cpu_possible_mask)
|
||||
@@ -511,35 +98,6 @@ extern const struct cpumask *const cpu_active_mask;
|
||||
#define cpu_active(cpu) ((cpu) == 0)
|
||||
#endif
|
||||
|
||||
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
|
||||
|
||||
/* These are the new versions of the cpumask operators: passed by pointer.
|
||||
* The older versions will be implemented in terms of these, then deleted. */
|
||||
#define cpumask_bits(maskp) ((maskp)->bits)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
#else /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
#endif /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#ifdef CONFIG_CPUMASK_OFFSTACK
|
||||
/* Assuming NR_CPUS is huge, a runtime limit is more efficient. Also,
|
||||
* not all bits may be allocated. */
|
||||
#define nr_cpumask_bits nr_cpu_ids
|
||||
#else
|
||||
#define nr_cpumask_bits NR_CPUS
|
||||
#endif
|
||||
|
||||
/* verify cpu argument to cpumask_* operators */
|
||||
static inline unsigned int cpumask_check(unsigned int cpu)
|
||||
{
|
||||
@@ -714,6 +272,18 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
|
||||
return test_and_set_bit(cpumask_check(cpu), cpumask_bits(cpumask));
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask
|
||||
* @cpu: cpu number (< nr_cpu_ids)
|
||||
* @cpumask: the cpumask pointer
|
||||
*
|
||||
* test_and_clear_bit wrapper for cpumasks.
|
||||
*/
|
||||
static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
|
||||
{
|
||||
return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask));
|
||||
}
|
||||
|
||||
/**
|
||||
* cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask
|
||||
* @dstp: the cpumask pointer
|
||||
@@ -1088,4 +658,241 @@ void set_cpu_active(unsigned int cpu, bool active);
|
||||
void init_cpu_present(const struct cpumask *src);
|
||||
void init_cpu_possible(const struct cpumask *src);
|
||||
void init_cpu_online(const struct cpumask *src);
|
||||
|
||||
/**
|
||||
* to_cpumask - convert an NR_CPUS bitmap to a struct cpumask *
|
||||
* @bitmap: the bitmap
|
||||
*
|
||||
* There are a few places where cpumask_var_t isn't appropriate and
|
||||
* static cpumasks must be used (eg. very early boot), yet we don't
|
||||
* expose the definition of 'struct cpumask'.
|
||||
*
|
||||
* This does the conversion, and can be used as a constant initializer.
|
||||
*/
|
||||
#define to_cpumask(bitmap) \
|
||||
((struct cpumask *)(1 ? (bitmap) \
|
||||
: (void *)sizeof(__check_is_bitmap(bitmap))))
|
||||
|
||||
static inline int __check_is_bitmap(const unsigned long *bitmap)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Special-case data structure for "single bit set only" constant CPU masks.
|
||||
*
|
||||
* We pre-generate all the 64 (or 32) possible bit positions, with enough
|
||||
* padding to the left and the right, and return the constant pointer
|
||||
* appropriately offset.
|
||||
*/
|
||||
extern const unsigned long
|
||||
cpu_bit_bitmap[BITS_PER_LONG+1][BITS_TO_LONGS(NR_CPUS)];
|
||||
|
||||
static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
|
||||
{
|
||||
const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
|
||||
p -= cpu / BITS_PER_LONG;
|
||||
return to_cpumask(p);
|
||||
}
|
||||
|
||||
#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
|
||||
#else /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
#define CPU_BITS_ALL \
|
||||
{ \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
}
|
||||
#endif /* NR_CPUS > BITS_PER_LONG */
|
||||
|
||||
/*
|
||||
*
|
||||
* From here down, all obsolete. Use cpumask_ variants!
|
||||
*
|
||||
*/
|
||||
#ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
|
||||
/* These strip const, as traditionally they weren't const. */
|
||||
#define cpu_possible_map (*(cpumask_t *)cpu_possible_mask)
|
||||
#define cpu_online_map (*(cpumask_t *)cpu_online_mask)
|
||||
#define cpu_present_map (*(cpumask_t *)cpu_present_mask)
|
||||
#define cpu_active_map (*(cpumask_t *)cpu_active_mask)
|
||||
|
||||
#define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu))
|
||||
|
||||
#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
|
||||
|
||||
#if NR_CPUS <= BITS_PER_LONG
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#else
|
||||
|
||||
#define CPU_MASK_ALL \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL, \
|
||||
[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD \
|
||||
} }
|
||||
|
||||
#endif
|
||||
|
||||
#define CPU_MASK_NONE \
|
||||
(cpumask_t) { { \
|
||||
[0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL \
|
||||
} }
|
||||
|
||||
#define CPU_MASK_CPU0 \
|
||||
(cpumask_t) { { \
|
||||
[0] = 1UL \
|
||||
} }
|
||||
|
||||
#if NR_CPUS == 1
|
||||
#define first_cpu(src) ({ (void)(src); 0; })
|
||||
#define next_cpu(n, src) ({ (void)(src); 1; })
|
||||
#define any_online_cpu(mask) 0
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
|
||||
#else /* NR_CPUS > 1 */
|
||||
int __first_cpu(const cpumask_t *srcp);
|
||||
int __next_cpu(int n, const cpumask_t *srcp);
|
||||
int __any_online_cpu(const cpumask_t *mask);
|
||||
|
||||
#define first_cpu(src) __first_cpu(&(src))
|
||||
#define next_cpu(n, src) __next_cpu((n), &(src))
|
||||
#define any_online_cpu(mask) __any_online_cpu(&(mask))
|
||||
#define for_each_cpu_mask(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = next_cpu((cpu), (mask)), \
|
||||
(cpu) < NR_CPUS; )
|
||||
#endif /* SMP */
|
||||
|
||||
#if NR_CPUS <= 64
|
||||
|
||||
#define for_each_cpu_mask_nr(cpu, mask) for_each_cpu_mask(cpu, mask)
|
||||
|
||||
#else /* NR_CPUS > 64 */
|
||||
|
||||
int __next_cpu_nr(int n, const cpumask_t *srcp);
|
||||
#define for_each_cpu_mask_nr(cpu, mask) \
|
||||
for ((cpu) = -1; \
|
||||
(cpu) = __next_cpu_nr((cpu), &(mask)), \
|
||||
(cpu) < nr_cpu_ids; )
|
||||
|
||||
#endif /* NR_CPUS > 64 */
|
||||
|
||||
#define cpus_addr(src) ((src).bits)
|
||||
|
||||
#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
|
||||
static inline void __cpu_set(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
set_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
|
||||
static inline void __cpu_clear(int cpu, volatile cpumask_t *dstp)
|
||||
{
|
||||
clear_bit(cpu, dstp->bits);
|
||||
}
|
||||
|
||||
#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
|
||||
static inline void __cpus_setall(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_fill(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
|
||||
static inline void __cpus_clear(cpumask_t *dstp, int nbits)
|
||||
{
|
||||
bitmap_zero(dstp->bits, nbits);
|
||||
}
|
||||
|
||||
/* No static inline type checking - see Subtlety (1) above. */
|
||||
#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
|
||||
|
||||
#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
|
||||
static inline int __cpu_test_and_set(int cpu, cpumask_t *addr)
|
||||
{
|
||||
return test_and_set_bit(cpu, addr->bits);
|
||||
}
|
||||
|
||||
#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_or(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_or(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
bitmap_xor(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_andnot(dst, src1, src2) \
|
||||
__cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_equal(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_equal(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_intersects(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_intersects(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
|
||||
static inline int __cpus_subset(const cpumask_t *src1p,
|
||||
const cpumask_t *src2p, int nbits)
|
||||
{
|
||||
return bitmap_subset(src1p->bits, src2p->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
|
||||
static inline int __cpus_empty(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_empty(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
|
||||
static inline int __cpus_weight(const cpumask_t *srcp, int nbits)
|
||||
{
|
||||
return bitmap_weight(srcp->bits, nbits);
|
||||
}
|
||||
|
||||
#define cpus_shift_left(dst, src, n) \
|
||||
__cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
|
||||
static inline void __cpus_shift_left(cpumask_t *dstp,
|
||||
const cpumask_t *srcp, int n, int nbits)
|
||||
{
|
||||
bitmap_shift_left(dstp->bits, srcp->bits, n, nbits);
|
||||
}
|
||||
#endif /* !CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS */
|
||||
|
||||
#endif /* __LINUX_CPUMASK_H */
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include <linux/capability.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/key.h>
|
||||
#include <linux/selinux.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
struct user_struct;
|
||||
@@ -175,21 +176,7 @@ extern void __invalid_creds(const struct cred *, const char *, unsigned);
|
||||
extern void __validate_process_creds(struct task_struct *,
|
||||
const char *, unsigned);
|
||||
|
||||
static inline bool creds_are_invalid(const struct cred *cred)
|
||||
{
|
||||
if (cred->magic != CRED_MAGIC)
|
||||
return true;
|
||||
if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers))
|
||||
return true;
|
||||
#ifdef CONFIG_SECURITY_SELINUX
|
||||
if ((unsigned long) cred->security < PAGE_SIZE)
|
||||
return true;
|
||||
if ((*(u32*)cred->security & 0xffffff00) ==
|
||||
(POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8))
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
extern bool creds_are_invalid(const struct cred *cred);
|
||||
|
||||
static inline void __validate_creds(const struct cred *cred,
|
||||
const char *file, unsigned line)
|
||||
|
@@ -499,6 +499,7 @@ struct cyclades_card {
|
||||
void __iomem *p9050;
|
||||
struct RUNTIME_9060 __iomem *p9060;
|
||||
} ctl_addr;
|
||||
struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
|
||||
int irq;
|
||||
unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
|
||||
unsigned int first_line; /* minor number of first channel on card */
|
||||
@@ -541,6 +542,15 @@ struct cyclades_port {
|
||||
int magic;
|
||||
struct tty_port port;
|
||||
struct cyclades_card *card;
|
||||
union {
|
||||
struct {
|
||||
void __iomem *base_addr;
|
||||
} cyy;
|
||||
struct {
|
||||
struct CH_CTRL __iomem *ch_ctrl;
|
||||
struct BUF_CTRL __iomem *buf_ctrl;
|
||||
} cyz;
|
||||
} u;
|
||||
int line;
|
||||
int flags; /* defined in tty.h */
|
||||
int type; /* UART type */
|
||||
@@ -568,7 +578,6 @@ struct cyclades_port {
|
||||
struct cyclades_idle_stats idle_stats;
|
||||
struct cyclades_icount icount;
|
||||
struct completion shutdown_wait;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
int throttle;
|
||||
};
|
||||
|
||||
|
@@ -20,6 +20,9 @@
|
||||
*/
|
||||
#ifndef DCA_H
|
||||
#define DCA_H
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
/* DCA Provider API */
|
||||
|
||||
/* DCA Notifier Interface */
|
||||
@@ -36,6 +39,12 @@ struct dca_provider {
|
||||
int id;
|
||||
};
|
||||
|
||||
struct dca_domain {
|
||||
struct list_head node;
|
||||
struct list_head dca_providers;
|
||||
struct pci_bus *pci_rc;
|
||||
};
|
||||
|
||||
struct dca_ops {
|
||||
int (*add_requester) (struct dca_provider *, struct device *);
|
||||
int (*remove_requester) (struct dca_provider *, struct device *);
|
||||
@@ -47,7 +56,7 @@ struct dca_ops {
|
||||
struct dca_provider *alloc_dca_provider(struct dca_ops *ops, int priv_size);
|
||||
void free_dca_provider(struct dca_provider *dca);
|
||||
int register_dca_provider(struct dca_provider *dca, struct device *dev);
|
||||
void unregister_dca_provider(struct dca_provider *dca);
|
||||
void unregister_dca_provider(struct dca_provider *dca, struct device *dev);
|
||||
|
||||
static inline void *dca_priv(struct dca_provider *dca)
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
* 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* debugfs is for people to use instead of /proc or /sys.
|
||||
* See Documentation/DocBook/kernel-api for more details.
|
||||
* See Documentation/DocBook/filesystems for more details.
|
||||
*/
|
||||
|
||||
#ifndef _DEBUGFS_H_
|
||||
|
@@ -18,7 +18,6 @@
|
||||
#define _LINUX_DELAYACCT_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/taskstats_kern.h>
|
||||
|
||||
/*
|
||||
* Per-task flags relevant to delay accounting
|
||||
|
@@ -2,7 +2,8 @@
|
||||
* device.h - generic, centralized driver model
|
||||
*
|
||||
* Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org>
|
||||
* Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2004-2009 Greg Kroah-Hartman <gregkh@suse.de>
|
||||
* Copyright (c) 2008-2009 Novell Inc.
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*
|
||||
@@ -62,7 +63,7 @@ struct bus_type {
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct bus_type_private *p;
|
||||
};
|
||||
@@ -130,9 +131,9 @@ struct device_driver {
|
||||
void (*shutdown) (struct device *dev);
|
||||
int (*suspend) (struct device *dev, pm_message_t state);
|
||||
int (*resume) (struct device *dev);
|
||||
struct attribute_group **groups;
|
||||
const struct attribute_group **groups;
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct driver_private *p;
|
||||
};
|
||||
@@ -192,7 +193,7 @@ struct class {
|
||||
struct kobject *dev_kobj;
|
||||
|
||||
int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
|
||||
void (*class_release)(struct class *class);
|
||||
void (*dev_release)(struct device *dev);
|
||||
@@ -200,7 +201,8 @@ struct class {
|
||||
int (*suspend)(struct device *dev, pm_message_t state);
|
||||
int (*resume)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
|
||||
struct class_private *p;
|
||||
};
|
||||
|
||||
@@ -223,6 +225,14 @@ extern void class_unregister(struct class *class);
|
||||
__class_register(class, &__key); \
|
||||
})
|
||||
|
||||
struct class_compat;
|
||||
struct class_compat *class_compat_register(const char *name);
|
||||
void class_compat_unregister(struct class_compat *cls);
|
||||
int class_compat_create_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
void class_compat_remove_link(struct class_compat *cls, struct device *dev,
|
||||
struct device *device_link);
|
||||
|
||||
extern void class_dev_iter_init(struct class_dev_iter *iter,
|
||||
struct class *class,
|
||||
struct device *start,
|
||||
@@ -286,12 +296,12 @@ extern void class_destroy(struct class *cls);
|
||||
*/
|
||||
struct device_type {
|
||||
const char *name;
|
||||
struct attribute_group **groups;
|
||||
const struct attribute_group **groups;
|
||||
int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
|
||||
char *(*nodename)(struct device *dev);
|
||||
char *(*devnode)(struct device *dev, mode_t *mode);
|
||||
void (*release)(struct device *dev);
|
||||
|
||||
struct dev_pm_ops *pm;
|
||||
const struct dev_pm_ops *pm;
|
||||
};
|
||||
|
||||
/* interface for exporting device attributes */
|
||||
@@ -380,7 +390,6 @@ struct device {
|
||||
struct bus_type *bus; /* type of bus device is on */
|
||||
struct device_driver *driver; /* which driver has allocated this
|
||||
device */
|
||||
void *driver_data; /* data private to the driver */
|
||||
void *platform_data; /* Platform specific data, device
|
||||
core doesn't touch it */
|
||||
struct dev_pm_info power;
|
||||
@@ -411,7 +420,7 @@ struct device {
|
||||
|
||||
struct klist_node knode_class;
|
||||
struct class *class;
|
||||
struct attribute_group **groups; /* optional groups */
|
||||
const struct attribute_group **groups; /* optional groups */
|
||||
|
||||
void (*release)(struct device *dev);
|
||||
};
|
||||
@@ -446,16 +455,6 @@ static inline void set_dev_node(struct device *dev, int node)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void *dev_get_drvdata(const struct device *dev)
|
||||
{
|
||||
return dev->driver_data;
|
||||
}
|
||||
|
||||
static inline void dev_set_drvdata(struct device *dev, void *data)
|
||||
{
|
||||
dev->driver_data = data;
|
||||
}
|
||||
|
||||
static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
|
||||
{
|
||||
return dev->kobj.uevent_suppress;
|
||||
@@ -488,7 +487,10 @@ extern struct device *device_find_child(struct device *dev, void *data,
|
||||
extern int device_rename(struct device *dev, char *new_name);
|
||||
extern int device_move(struct device *dev, struct device *new_parent,
|
||||
enum dpm_order dpm_order);
|
||||
extern const char *device_get_nodename(struct device *dev, const char **tmp);
|
||||
extern const char *device_get_devnode(struct device *dev,
|
||||
mode_t *mode, const char **tmp);
|
||||
extern void *dev_get_drvdata(const struct device *dev);
|
||||
extern void dev_set_drvdata(struct device *dev, void *data);
|
||||
|
||||
/*
|
||||
* Root device objects for grouping under /sys/devices
|
||||
@@ -501,6 +503,11 @@ static inline struct device *root_device_register(const char *name)
|
||||
}
|
||||
extern void root_device_unregister(struct device *root);
|
||||
|
||||
static inline void *dev_get_platdata(const struct device *dev)
|
||||
{
|
||||
return dev->platform_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
@@ -546,6 +553,16 @@ extern void put_device(struct device *dev);
|
||||
|
||||
extern void wait_for_device_probe(void);
|
||||
|
||||
#ifdef CONFIG_DEVTMPFS
|
||||
extern int devtmpfs_create_node(struct device *dev);
|
||||
extern int devtmpfs_delete_node(struct device *dev);
|
||||
extern int devtmpfs_mount(const char *mountpoint);
|
||||
#else
|
||||
static inline int devtmpfs_create_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
|
||||
static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
|
||||
#endif
|
||||
|
||||
/* drivers/base/power/shutdown.c */
|
||||
extern void device_shutdown(void);
|
||||
|
||||
|
@@ -58,6 +58,7 @@ struct dma_map_ops {
|
||||
enum dma_data_direction dir);
|
||||
int (*mapping_error)(struct device *dev, dma_addr_t dma_addr);
|
||||
int (*dma_supported)(struct device *dev, u64 mask);
|
||||
int (*set_dma_mask)(struct device *dev, u64 mask);
|
||||
int is_phys;
|
||||
};
|
||||
|
||||
|
@@ -48,19 +48,20 @@ enum dma_status {
|
||||
|
||||
/**
|
||||
* enum dma_transaction_type - DMA transaction types/indexes
|
||||
*
|
||||
* Note: The DMA_ASYNC_TX capability is not to be set by drivers. It is
|
||||
* automatically set as dma devices are registered.
|
||||
*/
|
||||
enum dma_transaction_type {
|
||||
DMA_MEMCPY,
|
||||
DMA_XOR,
|
||||
DMA_PQ_XOR,
|
||||
DMA_DUAL_XOR,
|
||||
DMA_PQ_UPDATE,
|
||||
DMA_ZERO_SUM,
|
||||
DMA_PQ_ZERO_SUM,
|
||||
DMA_PQ,
|
||||
DMA_XOR_VAL,
|
||||
DMA_PQ_VAL,
|
||||
DMA_MEMSET,
|
||||
DMA_MEMCPY_CRC32C,
|
||||
DMA_INTERRUPT,
|
||||
DMA_PRIVATE,
|
||||
DMA_ASYNC_TX,
|
||||
DMA_SLAVE,
|
||||
};
|
||||
|
||||
@@ -70,18 +71,25 @@ enum dma_transaction_type {
|
||||
|
||||
/**
|
||||
* enum dma_ctrl_flags - DMA flags to augment operation preparation,
|
||||
* control completion, and communicate status.
|
||||
* control completion, and communicate status.
|
||||
* @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
|
||||
* this transaction
|
||||
* this transaction
|
||||
* @DMA_CTRL_ACK - the descriptor cannot be reused until the client
|
||||
* acknowledges receipt, i.e. has has a chance to establish any
|
||||
* dependency chains
|
||||
* acknowledges receipt, i.e. has has a chance to establish any dependency
|
||||
* chains
|
||||
* @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)
|
||||
* @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s)
|
||||
* @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single
|
||||
* (if not set, do the source dma-unmapping as page)
|
||||
* @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single
|
||||
* (if not set, do the destination dma-unmapping as page)
|
||||
* @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q
|
||||
* @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P
|
||||
* @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as
|
||||
* sources that were the result of a previous operation, in the case of a PQ
|
||||
* operation it continues the calculation with new sources
|
||||
* @DMA_PREP_FENCE - tell the driver that subsequent operations depend
|
||||
* on the result of this operation
|
||||
*/
|
||||
enum dma_ctrl_flags {
|
||||
DMA_PREP_INTERRUPT = (1 << 0),
|
||||
@@ -90,8 +98,31 @@ enum dma_ctrl_flags {
|
||||
DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3),
|
||||
DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4),
|
||||
DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5),
|
||||
DMA_PREP_PQ_DISABLE_P = (1 << 6),
|
||||
DMA_PREP_PQ_DISABLE_Q = (1 << 7),
|
||||
DMA_PREP_CONTINUE = (1 << 8),
|
||||
DMA_PREP_FENCE = (1 << 9),
|
||||
};
|
||||
|
||||
/**
|
||||
* enum sum_check_bits - bit position of pq_check_flags
|
||||
*/
|
||||
enum sum_check_bits {
|
||||
SUM_CHECK_P = 0,
|
||||
SUM_CHECK_Q = 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum pq_check_flags - result of async_{xor,pq}_zero_sum operations
|
||||
* @SUM_CHECK_P_RESULT - 1 if xor zero sum error, 0 otherwise
|
||||
* @SUM_CHECK_Q_RESULT - 1 if reed-solomon zero sum error, 0 otherwise
|
||||
*/
|
||||
enum sum_check_flags {
|
||||
SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P),
|
||||
SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q),
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
|
||||
* See linux/cpumask.h
|
||||
@@ -180,8 +211,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
||||
* @flags: flags to augment operation preparation, control completion, and
|
||||
* communicate status
|
||||
* @phys: physical address of the descriptor
|
||||
* @tx_list: driver common field for operations that require multiple
|
||||
* descriptors
|
||||
* @chan: target channel for this operation
|
||||
* @tx_submit: set the prepared descriptor(s) to be executed by the engine
|
||||
* @callback: routine to call after this operation is complete
|
||||
@@ -195,7 +224,6 @@ struct dma_async_tx_descriptor {
|
||||
dma_cookie_t cookie;
|
||||
enum dma_ctrl_flags flags; /* not a 'long' to pack with cookie */
|
||||
dma_addr_t phys;
|
||||
struct list_head tx_list;
|
||||
struct dma_chan *chan;
|
||||
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
|
||||
dma_async_tx_callback callback;
|
||||
@@ -213,6 +241,11 @@ struct dma_async_tx_descriptor {
|
||||
* @global_node: list_head for global dma_device_list
|
||||
* @cap_mask: one or more dma_capability flags
|
||||
* @max_xor: maximum number of xor sources, 0 if no capability
|
||||
* @max_pq: maximum number of PQ sources and PQ-continue capability
|
||||
* @copy_align: alignment shift for memcpy operations
|
||||
* @xor_align: alignment shift for xor operations
|
||||
* @pq_align: alignment shift for pq operations
|
||||
* @fill_align: alignment shift for memset operations
|
||||
* @dev_id: unique device ID
|
||||
* @dev: struct device reference for dma mapping api
|
||||
* @device_alloc_chan_resources: allocate resources and return the
|
||||
@@ -220,7 +253,9 @@ struct dma_async_tx_descriptor {
|
||||
* @device_free_chan_resources: release DMA channel's resources
|
||||
* @device_prep_dma_memcpy: prepares a memcpy operation
|
||||
* @device_prep_dma_xor: prepares a xor operation
|
||||
* @device_prep_dma_zero_sum: prepares a zero_sum operation
|
||||
* @device_prep_dma_xor_val: prepares a xor validation operation
|
||||
* @device_prep_dma_pq: prepares a pq operation
|
||||
* @device_prep_dma_pq_val: prepares a pqzero_sum operation
|
||||
* @device_prep_dma_memset: prepares a memset operation
|
||||
* @device_prep_dma_interrupt: prepares an end of chain interrupt operation
|
||||
* @device_prep_slave_sg: prepares a slave dma operation
|
||||
@@ -235,7 +270,13 @@ struct dma_device {
|
||||
struct list_head channels;
|
||||
struct list_head global_node;
|
||||
dma_cap_mask_t cap_mask;
|
||||
int max_xor;
|
||||
unsigned short max_xor;
|
||||
unsigned short max_pq;
|
||||
u8 copy_align;
|
||||
u8 xor_align;
|
||||
u8 pq_align;
|
||||
u8 fill_align;
|
||||
#define DMA_HAS_PQ_CONTINUE (1 << 15)
|
||||
|
||||
int dev_id;
|
||||
struct device *dev;
|
||||
@@ -249,9 +290,17 @@ struct dma_device {
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
|
||||
struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
|
||||
unsigned int src_cnt, size_t len, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_xor_val)(
|
||||
struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
|
||||
size_t len, u32 *result, unsigned long flags);
|
||||
size_t len, enum sum_check_flags *result, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_pq)(
|
||||
struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf,
|
||||
size_t len, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_pq_val)(
|
||||
struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
|
||||
unsigned int src_cnt, const unsigned char *scf, size_t len,
|
||||
enum sum_check_flags *pqres, unsigned long flags);
|
||||
struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
|
||||
struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
|
||||
unsigned long flags);
|
||||
@@ -270,6 +319,96 @@ struct dma_device {
|
||||
void (*device_issue_pending)(struct dma_chan *chan);
|
||||
};
|
||||
|
||||
static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len)
|
||||
{
|
||||
size_t mask;
|
||||
|
||||
if (!align)
|
||||
return true;
|
||||
mask = (1 << align) - 1;
|
||||
if (mask & (off1 | off2 | len))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool is_dma_copy_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->copy_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_xor_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->xor_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_pq_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->pq_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline bool is_dma_fill_aligned(struct dma_device *dev, size_t off1,
|
||||
size_t off2, size_t len)
|
||||
{
|
||||
return dmaengine_check_align(dev->fill_align, off1, off2, len);
|
||||
}
|
||||
|
||||
static inline void
|
||||
dma_set_maxpq(struct dma_device *dma, int maxpq, int has_pq_continue)
|
||||
{
|
||||
dma->max_pq = maxpq;
|
||||
if (has_pq_continue)
|
||||
dma->max_pq |= DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool dmaf_continue(enum dma_ctrl_flags flags)
|
||||
{
|
||||
return (flags & DMA_PREP_CONTINUE) == DMA_PREP_CONTINUE;
|
||||
}
|
||||
|
||||
static inline bool dmaf_p_disabled_continue(enum dma_ctrl_flags flags)
|
||||
{
|
||||
enum dma_ctrl_flags mask = DMA_PREP_CONTINUE | DMA_PREP_PQ_DISABLE_P;
|
||||
|
||||
return (flags & mask) == mask;
|
||||
}
|
||||
|
||||
static inline bool dma_dev_has_pq_continue(struct dma_device *dma)
|
||||
{
|
||||
return (dma->max_pq & DMA_HAS_PQ_CONTINUE) == DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
static unsigned short dma_dev_to_maxpq(struct dma_device *dma)
|
||||
{
|
||||
return dma->max_pq & ~DMA_HAS_PQ_CONTINUE;
|
||||
}
|
||||
|
||||
/* dma_maxpq - reduce maxpq in the face of continued operations
|
||||
* @dma - dma device with PQ capability
|
||||
* @flags - to check if DMA_PREP_CONTINUE and DMA_PREP_PQ_DISABLE_P are set
|
||||
*
|
||||
* When an engine does not support native continuation we need 3 extra
|
||||
* source slots to reuse P and Q with the following coefficients:
|
||||
* 1/ {00} * P : remove P from Q', but use it as a source for P'
|
||||
* 2/ {01} * Q : use Q to continue Q' calculation
|
||||
* 3/ {00} * Q : subtract Q from P' to cancel (2)
|
||||
*
|
||||
* In the case where P is disabled we only need 1 extra source:
|
||||
* 1/ {01} * Q : use Q to continue Q' calculation
|
||||
*/
|
||||
static inline int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags)
|
||||
{
|
||||
if (dma_dev_has_pq_continue(dma) || !dmaf_continue(flags))
|
||||
return dma_dev_to_maxpq(dma);
|
||||
else if (dmaf_p_disabled_continue(flags))
|
||||
return dma_dev_to_maxpq(dma) - 1;
|
||||
else if (dmaf_continue(flags))
|
||||
return dma_dev_to_maxpq(dma) - 3;
|
||||
BUG();
|
||||
}
|
||||
|
||||
/* --- public DMA engine API --- */
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
@@ -299,7 +438,11 @@ static inline void net_dmaengine_put(void)
|
||||
#ifdef CONFIG_ASYNC_TX_DMA
|
||||
#define async_dmaengine_get() dmaengine_get()
|
||||
#define async_dmaengine_put() dmaengine_put()
|
||||
#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
|
||||
#define async_dma_find_channel(type) dma_find_channel(DMA_ASYNC_TX)
|
||||
#else
|
||||
#define async_dma_find_channel(type) dma_find_channel(type)
|
||||
#endif /* CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH */
|
||||
#else
|
||||
static inline void async_dmaengine_get(void)
|
||||
{
|
||||
@@ -312,7 +455,7 @@ async_dma_find_channel(enum dma_transaction_type type)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_ASYNC_TX_DMA */
|
||||
|
||||
dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
|
||||
void *dest, void *src, size_t len);
|
||||
|
@@ -1,22 +1,3 @@
|
||||
#if 0
|
||||
|
||||
#define TRACE_TXT(text) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
{ \
|
||||
console_print(text); \
|
||||
console_print("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define TRACE_CHR(chr) \
|
||||
{ \
|
||||
if(dtlk_trace) \
|
||||
console_print(chr); \
|
||||
} \
|
||||
|
||||
#endif
|
||||
|
||||
#define DTLK_MINOR 0
|
||||
#define DTLK_IO_EXTENT 0x02
|
||||
|
||||
|
@@ -151,5 +151,7 @@ struct dmx_stc {
|
||||
#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
|
||||
#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
|
||||
#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
|
||||
#define DMX_ADD_PID _IOW('o', 51, __u16)
|
||||
#define DMX_REMOVE_PID _IOW('o', 52, __u16)
|
||||
|
||||
#endif /*_DVBDMX_H_*/
|
||||
|
@@ -173,7 +173,8 @@ typedef enum fe_modulation {
|
||||
typedef enum fe_transmit_mode {
|
||||
TRANSMISSION_MODE_2K,
|
||||
TRANSMISSION_MODE_8K,
|
||||
TRANSMISSION_MODE_AUTO
|
||||
TRANSMISSION_MODE_AUTO,
|
||||
TRANSMISSION_MODE_4K
|
||||
} fe_transmit_mode_t;
|
||||
|
||||
typedef enum fe_bandwidth {
|
||||
@@ -268,15 +269,42 @@ struct dvb_frontend_event {
|
||||
#define DTV_FE_CAPABILITY 16
|
||||
#define DTV_DELIVERY_SYSTEM 17
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_API_VERSION 35
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
/* ISDB-T and ISDB-Tsb */
|
||||
#define DTV_ISDBT_PARTIAL_RECEPTION 18
|
||||
#define DTV_ISDBT_SOUND_BROADCASTING 19
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_HIERARCHY
|
||||
#define DTV_ISDBT_SB_SUBCHANNEL_ID 20
|
||||
#define DTV_ISDBT_SB_SEGMENT_IDX 21
|
||||
#define DTV_ISDBT_SB_SEGMENT_COUNT 22
|
||||
|
||||
#define DTV_ISDBT_LAYERA_FEC 23
|
||||
#define DTV_ISDBT_LAYERA_MODULATION 24
|
||||
#define DTV_ISDBT_LAYERA_SEGMENT_COUNT 25
|
||||
#define DTV_ISDBT_LAYERA_TIME_INTERLEAVING 26
|
||||
|
||||
#define DTV_ISDBT_LAYERB_FEC 27
|
||||
#define DTV_ISDBT_LAYERB_MODULATION 28
|
||||
#define DTV_ISDBT_LAYERB_SEGMENT_COUNT 29
|
||||
#define DTV_ISDBT_LAYERB_TIME_INTERLEAVING 30
|
||||
|
||||
#define DTV_ISDBT_LAYERC_FEC 31
|
||||
#define DTV_ISDBT_LAYERC_MODULATION 32
|
||||
#define DTV_ISDBT_LAYERC_SEGMENT_COUNT 33
|
||||
#define DTV_ISDBT_LAYERC_TIME_INTERLEAVING 34
|
||||
|
||||
#define DTV_API_VERSION 35
|
||||
|
||||
#define DTV_CODE_RATE_HP 36
|
||||
#define DTV_CODE_RATE_LP 37
|
||||
#define DTV_GUARD_INTERVAL 38
|
||||
#define DTV_TRANSMISSION_MODE 39
|
||||
#define DTV_HIERARCHY 40
|
||||
|
||||
#define DTV_ISDBT_LAYER_ENABLED 41
|
||||
|
||||
#define DTV_ISDBS_TS_ID 42
|
||||
|
||||
#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID
|
||||
|
||||
typedef enum fe_pilot {
|
||||
PILOT_ON,
|
||||
|
@@ -24,6 +24,6 @@
|
||||
#define _DVBVERSION_H_
|
||||
|
||||
#define DVB_API_VERSION 5
|
||||
#define DVB_API_VERSION_MINOR 0
|
||||
#define DVB_API_VERSION_MINOR 1
|
||||
|
||||
#endif /*_DVBVERSION_H_*/
|
||||
|
@@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int,
|
||||
enum enclosure_component_type, const char *);
|
||||
int enclosure_add_device(struct enclosure_device *enclosure, int component,
|
||||
struct device *dev);
|
||||
int enclosure_remove_device(struct enclosure_device *enclosure, int component);
|
||||
struct enclosure_device *enclosure_find(struct device *dev);
|
||||
int enclosure_remove_device(struct enclosure_device *, struct device *);
|
||||
struct enclosure_device *enclosure_find(struct device *dev,
|
||||
struct enclosure_device *start);
|
||||
int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
|
||||
void *data);
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#ifdef CONFIG_EVENTFD
|
||||
|
||||
struct file *eventfd_file_create(unsigned int count, int flags);
|
||||
struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx);
|
||||
void eventfd_ctx_put(struct eventfd_ctx *ctx);
|
||||
struct file *eventfd_fget(int fd);
|
||||
@@ -40,6 +41,11 @@ int eventfd_signal(struct eventfd_ctx *ctx, int n);
|
||||
* Ugly ugly ugly error layer to support modules that uses eventfd but
|
||||
* pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO.
|
||||
*/
|
||||
static inline struct file *eventfd_file_create(unsigned int count, int flags)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
|
@@ -134,20 +134,6 @@ struct fw_card {
|
||||
u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
|
||||
};
|
||||
|
||||
static inline struct fw_card *fw_card_get(struct fw_card *card)
|
||||
{
|
||||
kref_get(&card->kref);
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
void fw_card_release(struct kref *kref);
|
||||
|
||||
static inline void fw_card_put(struct fw_card *card)
|
||||
{
|
||||
kref_put(&card->kref, fw_card_release);
|
||||
}
|
||||
|
||||
struct fw_attribute_group {
|
||||
struct attribute_group *groups[2];
|
||||
struct attribute_group group;
|
||||
|
@@ -31,10 +31,32 @@ struct flex_array {
|
||||
};
|
||||
};
|
||||
|
||||
#define FLEX_ARRAY_INIT(size, total) { { {\
|
||||
.element_size = (size), \
|
||||
.total_nr_elements = (total), \
|
||||
} } }
|
||||
/* Number of bytes left in base struct flex_array, excluding metadata */
|
||||
#define FLEX_ARRAY_BASE_BYTES_LEFT \
|
||||
(FLEX_ARRAY_BASE_SIZE - offsetof(struct flex_array, parts))
|
||||
|
||||
/* Number of pointers in base to struct flex_array_part pages */
|
||||
#define FLEX_ARRAY_NR_BASE_PTRS \
|
||||
(FLEX_ARRAY_BASE_BYTES_LEFT / sizeof(struct flex_array_part *))
|
||||
|
||||
/* Number of elements of size that fit in struct flex_array_part */
|
||||
#define FLEX_ARRAY_ELEMENTS_PER_PART(size) \
|
||||
(FLEX_ARRAY_PART_SIZE / size)
|
||||
|
||||
/*
|
||||
* Defines a statically allocated flex array and ensures its parameters are
|
||||
* valid.
|
||||
*/
|
||||
#define DEFINE_FLEX_ARRAY(__arrayname, __element_size, __total) \
|
||||
struct flex_array __arrayname = { { { \
|
||||
.element_size = (__element_size), \
|
||||
.total_nr_elements = (__total), \
|
||||
} } }; \
|
||||
static inline void __arrayname##_invalid_parameter(void) \
|
||||
{ \
|
||||
BUILD_BUG_ON((__total) > FLEX_ARRAY_NR_BASE_PTRS * \
|
||||
FLEX_ARRAY_ELEMENTS_PER_PART(__element_size)); \
|
||||
}
|
||||
|
||||
struct flex_array *flex_array_alloc(int element_size, unsigned int total,
|
||||
gfp_t flags);
|
||||
@@ -44,6 +66,8 @@ void flex_array_free(struct flex_array *fa);
|
||||
void flex_array_free_parts(struct flex_array *fa);
|
||||
int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src,
|
||||
gfp_t flags);
|
||||
int flex_array_clear(struct flex_array *fa, unsigned int element_nr);
|
||||
void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
|
||||
int flex_array_shrink(struct flex_array *fa);
|
||||
|
||||
#endif /* _FLEX_ARRAY_H */
|
||||
|
@@ -161,8 +161,8 @@ struct inodes_stat_t {
|
||||
* These aren't really reads or writes, they pass down information about
|
||||
* parts of device that are now unused by the file system.
|
||||
*/
|
||||
#define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
|
||||
#define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
|
||||
#define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD))
|
||||
#define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER))
|
||||
|
||||
#define SEL_IN 1
|
||||
#define SEL_OUT 2
|
||||
@@ -595,6 +595,7 @@ struct address_space_operations {
|
||||
int (*launder_page) (struct page *);
|
||||
int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
|
||||
unsigned long);
|
||||
int (*error_remove_page)(struct address_space *, struct page *);
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -640,7 +641,6 @@ struct block_device {
|
||||
struct super_block * bd_super;
|
||||
int bd_openers;
|
||||
struct mutex bd_mutex; /* open/close mutex */
|
||||
struct semaphore bd_mount_sem;
|
||||
struct list_head bd_inodes;
|
||||
void * bd_holder;
|
||||
int bd_holders;
|
||||
@@ -655,7 +655,6 @@ struct block_device {
|
||||
int bd_invalidated;
|
||||
struct gendisk * bd_disk;
|
||||
struct list_head bd_list;
|
||||
struct backing_dev_info *bd_inode_backing_dev_info;
|
||||
/*
|
||||
* Private data. You must have bd_claim'ed the block_device
|
||||
* to use this. NOTE: bd_claim allows an owner to claim
|
||||
@@ -1067,8 +1066,8 @@ struct file_lock {
|
||||
struct fasync_struct * fl_fasync; /* for lease break notifications */
|
||||
unsigned long fl_break_time; /* for nonblocking lease breaks */
|
||||
|
||||
struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
|
||||
const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
|
||||
union {
|
||||
struct nfs_lock_info nfs_fl;
|
||||
struct nfs4_lock_info nfs4_fl;
|
||||
@@ -1316,11 +1315,11 @@ struct super_block {
|
||||
unsigned long s_blocksize;
|
||||
unsigned char s_blocksize_bits;
|
||||
unsigned char s_dirt;
|
||||
unsigned long long s_maxbytes; /* Max file size */
|
||||
loff_t s_maxbytes; /* Max file size */
|
||||
struct file_system_type *s_type;
|
||||
const struct super_operations *s_op;
|
||||
struct dquot_operations *dq_op;
|
||||
struct quotactl_ops *s_qcop;
|
||||
const struct dquot_operations *dq_op;
|
||||
const struct quotactl_ops *s_qcop;
|
||||
const struct export_operations *s_export_op;
|
||||
unsigned long s_flags;
|
||||
unsigned long s_magic;
|
||||
@@ -1343,6 +1342,7 @@ struct super_block {
|
||||
int s_nr_dentry_unused; /* # of dentry on lru */
|
||||
|
||||
struct block_device *s_bdev;
|
||||
struct backing_dev_info *s_bdi;
|
||||
struct mtd_info *s_mtd;
|
||||
struct list_head s_instances;
|
||||
struct quota_info s_dquot; /* Diskquota specific options */
|
||||
@@ -2156,6 +2156,7 @@ extern ino_t iunique(struct super_block *, ino_t);
|
||||
extern int inode_needs_sync(struct inode *inode);
|
||||
extern void generic_delete_inode(struct inode *inode);
|
||||
extern void generic_drop_inode(struct inode *inode);
|
||||
extern int generic_detach_inode(struct inode *inode);
|
||||
|
||||
extern struct inode *ilookup5_nowait(struct super_block *sb,
|
||||
unsigned long hashval, int (*test)(struct inode *, void *),
|
||||
@@ -2334,6 +2335,7 @@ extern void get_filesystem(struct file_system_type *fs);
|
||||
extern void put_filesystem(struct file_system_type *fs);
|
||||
extern struct file_system_type *get_fs_type(const char *name);
|
||||
extern struct super_block *get_super(struct block_device *);
|
||||
extern struct super_block *get_active_super(struct block_device *bdev);
|
||||
extern struct super_block *user_get_super(dev_t);
|
||||
extern void drop_super(struct super_block *sb);
|
||||
|
||||
@@ -2381,7 +2383,8 @@ extern int buffer_migrate_page(struct address_space *,
|
||||
#define buffer_migrate_page NULL
|
||||
#endif
|
||||
|
||||
extern int inode_change_ok(struct inode *, struct iattr *);
|
||||
extern int inode_change_ok(const struct inode *, struct iattr *);
|
||||
extern int inode_newsize_ok(const struct inode *, loff_t offset);
|
||||
extern int __must_check inode_setattr(struct inode *, struct iattr *);
|
||||
|
||||
extern void file_update_time(struct file *file);
|
||||
@@ -2467,7 +2470,7 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
|
||||
size_t len, loff_t *ppos);
|
||||
|
||||
struct ctl_table;
|
||||
int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
|
||||
int proc_nr_files(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos);
|
||||
|
||||
int __init get_filesystem_list(char *buf);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
extern int ftrace_enabled;
|
||||
extern int
|
||||
ftrace_enable_sysctl(struct ctl_table *table, int write,
|
||||
struct file *filp, void __user *buffer, size_t *lenp,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
|
||||
typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
|
||||
@@ -94,7 +94,7 @@ static inline void ftrace_start(void) { }
|
||||
extern int stack_tracer_enabled;
|
||||
int
|
||||
stack_trace_sysctl(struct ctl_table *table, int write,
|
||||
struct file *file, void __user *buffer, size_t *lenp,
|
||||
void __user *buffer, size_t *lenp,
|
||||
loff_t *ppos);
|
||||
#endif
|
||||
|
||||
@@ -446,7 +446,6 @@ static inline void unpause_graph_tracing(void) { }
|
||||
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
|
||||
|
||||
#ifdef CONFIG_TRACING
|
||||
#include <linux/sched.h>
|
||||
|
||||
/* flags for current->trace */
|
||||
enum {
|
||||
|
@@ -1,9 +1,10 @@
|
||||
#ifndef _LINUX_FTRACE_EVENT_H
|
||||
#define _LINUX_FTRACE_EVENT_H
|
||||
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/ring_buffer.h>
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/hardirq.h>
|
||||
|
||||
struct trace_array;
|
||||
struct tracer;
|
||||
@@ -34,7 +35,7 @@ struct trace_entry {
|
||||
unsigned char flags;
|
||||
unsigned char preempt_count;
|
||||
int pid;
|
||||
int tgid;
|
||||
int lock_depth;
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_EVENT \
|
||||
@@ -130,12 +131,17 @@ struct ftrace_event_call {
|
||||
void *data;
|
||||
|
||||
atomic_t profile_count;
|
||||
int (*profile_enable)(struct ftrace_event_call *);
|
||||
void (*profile_disable)(struct ftrace_event_call *);
|
||||
int (*profile_enable)(void);
|
||||
void (*profile_disable)(void);
|
||||
};
|
||||
|
||||
#define FTRACE_MAX_PROFILE_SIZE 2048
|
||||
|
||||
extern char *trace_profile_buf;
|
||||
extern char *trace_profile_buf_nmi;
|
||||
|
||||
#define MAX_FILTER_PRED 32
|
||||
#define MAX_FILTER_STR_VAL 128
|
||||
#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
|
||||
|
||||
extern void destroy_preds(struct ftrace_event_call *call);
|
||||
extern int filter_match_preds(struct ftrace_event_call *call, void *rec);
|
||||
|
@@ -30,6 +30,10 @@
|
||||
* - add umask flag to input argument of open, mknod and mkdir
|
||||
* - add notification messages for invalidation of inodes and
|
||||
* directory entries
|
||||
*
|
||||
* 7.13
|
||||
* - make max number of background requests and congestion threshold
|
||||
* tunables
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_FUSE_H
|
||||
@@ -37,11 +41,31 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Version negotiation:
|
||||
*
|
||||
* Both the kernel and userspace send the version they support in the
|
||||
* INIT request and reply respectively.
|
||||
*
|
||||
* If the major versions match then both shall use the smallest
|
||||
* of the two minor versions for communication.
|
||||
*
|
||||
* If the kernel supports a larger major version, then userspace shall
|
||||
* reply with the major version it supports, ignore the rest of the
|
||||
* INIT message and expect a new INIT message from the kernel with a
|
||||
* matching major version.
|
||||
*
|
||||
* If the library supports a larger major version, then it shall fall
|
||||
* back to the major protocol version sent by the kernel for
|
||||
* communication and reply with that major version (and an arbitrary
|
||||
* supported minor version).
|
||||
*/
|
||||
|
||||
/** Version number of this interface */
|
||||
#define FUSE_KERNEL_VERSION 7
|
||||
|
||||
/** Minor version number of this interface */
|
||||
#define FUSE_KERNEL_MINOR_VERSION 12
|
||||
#define FUSE_KERNEL_MINOR_VERSION 13
|
||||
|
||||
/** The node ID of the root inode */
|
||||
#define FUSE_ROOT_ID 1
|
||||
@@ -427,7 +451,8 @@ struct fuse_init_out {
|
||||
__u32 minor;
|
||||
__u32 max_readahead;
|
||||
__u32 flags;
|
||||
__u32 unused;
|
||||
__u16 max_background;
|
||||
__u16 congestion_threshold;
|
||||
__u32 max_write;
|
||||
};
|
||||
|
||||
|
@@ -4,11 +4,6 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct inode;
|
||||
struct mm_struct;
|
||||
struct task_struct;
|
||||
union ktime;
|
||||
|
||||
/* Second argument to futex syscall */
|
||||
|
||||
|
||||
@@ -129,6 +124,11 @@ struct robust_list_head {
|
||||
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
|
||||
|
||||
#ifdef __KERNEL__
|
||||
struct inode;
|
||||
struct mm_struct;
|
||||
struct task_struct;
|
||||
union ktime;
|
||||
|
||||
long do_futex(u32 __user *uaddr, int op, u32 val, union ktime *timeout,
|
||||
u32 __user *uaddr2, u32 val2, u32 val3);
|
||||
|
||||
|
@@ -98,7 +98,7 @@ struct hd_struct {
|
||||
int make_it_fail;
|
||||
#endif
|
||||
unsigned long stamp;
|
||||
int in_flight;
|
||||
int in_flight[2];
|
||||
#ifdef CONFIG_SMP
|
||||
struct disk_stats *dkstats;
|
||||
#else
|
||||
@@ -142,7 +142,7 @@ struct gendisk {
|
||||
* disks that can't be partitioned. */
|
||||
|
||||
char disk_name[DISK_NAME_LEN]; /* name of major driver */
|
||||
char *(*nodename)(struct gendisk *gd);
|
||||
char *(*devnode)(struct gendisk *gd, mode_t *mode);
|
||||
/* Array of pointers to partitions indexed by partno.
|
||||
* Protected with matching bdev lock but stat and other
|
||||
* non-critical accesses use RCU. Always access through
|
||||
@@ -151,7 +151,7 @@ struct gendisk {
|
||||
struct disk_part_tbl *part_tbl;
|
||||
struct hd_struct part0;
|
||||
|
||||
struct block_device_operations *fops;
|
||||
const struct block_device_operations *fops;
|
||||
struct request_queue *queue;
|
||||
void *private_data;
|
||||
|
||||
@@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part)
|
||||
#define part_stat_sub(cpu, gendiskp, field, subnd) \
|
||||
part_stat_add(cpu, gendiskp, field, -subnd)
|
||||
|
||||
static inline void part_inc_in_flight(struct hd_struct *part)
|
||||
static inline void part_inc_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight++;
|
||||
part->in_flight[rw]++;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight++;
|
||||
part_to_disk(part)->part0.in_flight[rw]++;
|
||||
}
|
||||
|
||||
static inline void part_dec_in_flight(struct hd_struct *part)
|
||||
static inline void part_dec_in_flight(struct hd_struct *part, int rw)
|
||||
{
|
||||
part->in_flight--;
|
||||
part->in_flight[rw]--;
|
||||
if (part->partno)
|
||||
part_to_disk(part)->part0.in_flight--;
|
||||
part_to_disk(part)->part0.in_flight[rw]--;
|
||||
}
|
||||
|
||||
static inline int part_in_flight(struct hd_struct *part)
|
||||
{
|
||||
return part->in_flight[0] + part->in_flight[1];
|
||||
}
|
||||
|
||||
/* block/blk-core.c */
|
||||
@@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_stat_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
extern ssize_t part_inflight_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
#ifdef CONFIG_FAIL_MAKE_REQUEST
|
||||
extern ssize_t part_fail_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf);
|
||||
|
@@ -220,7 +220,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
|
||||
((1 << ZONES_SHIFT) - 1);
|
||||
|
||||
if (__builtin_constant_p(bit))
|
||||
BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
MAYBE_BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
else {
|
||||
#ifdef CONFIG_DEBUG_VM
|
||||
BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
@@ -326,7 +326,6 @@ void free_pages_exact(void *virt, size_t size);
|
||||
extern void __free_pages(struct page *page, unsigned int order);
|
||||
extern void free_pages(unsigned long addr, unsigned int order);
|
||||
extern void free_hot_page(struct page *page);
|
||||
extern void free_cold_page(struct page *page);
|
||||
|
||||
#define __free_page(page) __free_pages((page), 0)
|
||||
#define free_page(addr) free_pages((addr),0)
|
||||
@@ -336,18 +335,6 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
||||
void drain_all_pages(void);
|
||||
void drain_local_pages(void *dummy);
|
||||
|
||||
extern bool oom_killer_disabled;
|
||||
|
||||
static inline void oom_killer_disable(void)
|
||||
{
|
||||
oom_killer_disabled = true;
|
||||
}
|
||||
|
||||
static inline void oom_killer_enable(void)
|
||||
{
|
||||
oom_killer_disabled = false;
|
||||
}
|
||||
|
||||
extern gfp_t gfp_allowed_mask;
|
||||
|
||||
static inline void set_gfp_allowed_mask(gfp_t mask)
|
||||
|
@@ -12,6 +12,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
struct device;
|
||||
|
||||
/*
|
||||
* Some platforms don't support the GPIO programming interface.
|
||||
*
|
||||
@@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
WARN_ON(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static inline void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
|
@@ -96,7 +96,6 @@ struct esp_struct {
|
||||
int xmit_head;
|
||||
int xmit_tail;
|
||||
int xmit_cnt;
|
||||
wait_queue_head_t delta_msr_wait;
|
||||
wait_queue_head_t break_wait;
|
||||
struct async_icount icount; /* kernel counters for the 4 input interrupts */
|
||||
struct hayes_esp_config config; /* port configuration */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#define __HID_DEBUG_H
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Jiri Kosina
|
||||
* Copyright (c) 2007-2009 Jiri Kosina
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -22,24 +22,44 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define HID_DEBUG_BUFSIZE 512
|
||||
|
||||
void hid_dump_input(struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *);
|
||||
void hid_dump_field(struct hid_field *, int);
|
||||
void hid_resolv_usage(unsigned);
|
||||
void hid_resolv_event(__u8, __u16);
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
void hid_dump_input(struct hid_device *, struct hid_usage *, __s32);
|
||||
void hid_dump_device(struct hid_device *, struct seq_file *);
|
||||
void hid_dump_field(struct hid_field *, int, struct seq_file *);
|
||||
char *hid_resolv_usage(unsigned, struct seq_file *);
|
||||
void hid_debug_register(struct hid_device *, const char *);
|
||||
void hid_debug_unregister(struct hid_device *);
|
||||
void hid_debug_init(void);
|
||||
void hid_debug_exit(void);
|
||||
void hid_debug_event(struct hid_device *, char *);
|
||||
|
||||
|
||||
struct hid_debug_list {
|
||||
char *hid_debug_buf;
|
||||
int head;
|
||||
int tail;
|
||||
struct fasync_struct *fasync;
|
||||
struct hid_device *hdev;
|
||||
struct list_head node;
|
||||
struct mutex read_mutex;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
#define hid_dump_input(a,b) do { } while (0)
|
||||
#define hid_dump_device(c) do { } while (0)
|
||||
#define hid_dump_field(a,b) do { } while (0)
|
||||
#define hid_resolv_usage(a) do { } while (0)
|
||||
#define hid_resolv_event(a,b) do { } while (0)
|
||||
|
||||
#endif /* CONFIG_HID_DEBUG */
|
||||
|
||||
#define hid_dump_input(a,b,c) do { } while (0)
|
||||
#define hid_dump_device(a,b) do { } while (0)
|
||||
#define hid_dump_field(a,b,c) do { } while (0)
|
||||
#define hid_resolv_usage(a,b) do { } while (0)
|
||||
#define hid_debug_register(a, b) do { } while (0)
|
||||
#define hid_debug_unregister(a) do { } while (0)
|
||||
#define hid_debug_init() do { } while (0)
|
||||
#define hid_debug_exit() do { } while (0)
|
||||
#define hid_debug_event(a,b) do { } while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -494,12 +494,21 @@ struct hid_device { /* device report descriptor */
|
||||
|
||||
/* hiddev event handler */
|
||||
int (*hiddev_connect)(struct hid_device *, unsigned int);
|
||||
void (*hiddev_disconnect)(struct hid_device *);
|
||||
void (*hiddev_hid_event) (struct hid_device *, struct hid_field *field,
|
||||
struct hid_usage *, __s32);
|
||||
void (*hiddev_report_event) (struct hid_device *, struct hid_report *);
|
||||
|
||||
/* handler for raw output data, used by hidraw */
|
||||
int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
|
||||
|
||||
/* debugging support via debugfs */
|
||||
unsigned short debug;
|
||||
struct dentry *debug_dir;
|
||||
struct dentry *debug_rdesc;
|
||||
struct dentry *debug_events;
|
||||
struct list_head debug_list;
|
||||
wait_queue_head_t debug_wait;
|
||||
};
|
||||
|
||||
static inline void *hid_get_drvdata(struct hid_device *hdev)
|
||||
@@ -657,9 +666,7 @@ struct hid_ll_driver {
|
||||
|
||||
/* HID core API */
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
extern int hid_debug;
|
||||
#endif
|
||||
|
||||
extern int hid_add_device(struct hid_device *);
|
||||
extern void hid_destroy_device(struct hid_device *);
|
||||
@@ -685,6 +692,7 @@ struct hid_device *hid_allocate_device(void);
|
||||
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
|
||||
int hid_check_keys_pressed(struct hid_device *hid);
|
||||
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
|
||||
void hid_disconnect(struct hid_device *hid);
|
||||
|
||||
/**
|
||||
* hid_map_usage - map usage input bits
|
||||
@@ -794,6 +802,7 @@ static inline int __must_check hid_hw_start(struct hid_device *hdev,
|
||||
*/
|
||||
static inline void hid_hw_stop(struct hid_device *hdev)
|
||||
{
|
||||
hid_disconnect(hdev);
|
||||
hdev->ll_driver->stop(hdev);
|
||||
}
|
||||
|
||||
@@ -815,21 +824,9 @@ int hid_pidff_init(struct hid_device *hid);
|
||||
#define hid_pidff_init NULL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HID_DEBUG
|
||||
#define dbg_hid(format, arg...) if (hid_debug) \
|
||||
printk(KERN_DEBUG "%s: " format ,\
|
||||
__FILE__ , ## arg)
|
||||
#define dbg_hid_line(format, arg...) if (hid_debug) \
|
||||
printk(format, ## arg)
|
||||
#else
|
||||
static inline int __attribute__((format(printf, 1, 2)))
|
||||
dbg_hid(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#define dbg_hid_line dbg_hid
|
||||
#endif /* HID_DEBUG */
|
||||
|
||||
#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
|
||||
__FILE__ , ## arg)
|
||||
#endif /* HID_FF */
|
||||
|
@@ -91,7 +91,6 @@ enum hrtimer_restart {
|
||||
* @function: timer expiry callback function
|
||||
* @base: pointer to the timer base (per cpu and per clock)
|
||||
* @state: state information (See bit values above)
|
||||
* @cb_entry: list head to enqueue an expired timer into the callback list
|
||||
* @start_site: timer statistics field to store the site where the timer
|
||||
* was started
|
||||
* @start_comm: timer statistics field to store the name of the process which
|
||||
@@ -108,7 +107,6 @@ struct hrtimer {
|
||||
enum hrtimer_restart (*function)(struct hrtimer *);
|
||||
struct hrtimer_clock_base *base;
|
||||
unsigned long state;
|
||||
struct list_head cb_entry;
|
||||
#ifdef CONFIG_TIMER_STATS
|
||||
int start_pid;
|
||||
void *start_site;
|
||||
|
@@ -20,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
|
||||
}
|
||||
|
||||
void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
|
||||
int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
|
||||
int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
|
||||
int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
|
||||
int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
|
||||
struct page **, struct vm_area_struct **,
|
||||
unsigned long *, int *, int, unsigned int flags);
|
||||
void unmap_hugepage_range(struct vm_area_struct *,
|
||||
unsigned long, unsigned long, struct page *);
|
||||
void __unmap_hugepage_range(struct vm_area_struct *,
|
||||
@@ -110,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
|
||||
|
||||
#endif /* !CONFIG_HUGETLB_PAGE */
|
||||
|
||||
#define HUGETLB_ANON_FILE "anon_hugepage"
|
||||
|
||||
enum {
|
||||
/*
|
||||
* The file will be used as an shm file so shmfs accounting rules
|
||||
* apply
|
||||
*/
|
||||
HUGETLB_SHMFS_INODE = 1,
|
||||
/*
|
||||
* The file is being created on the internal vfs mount and shmfs
|
||||
* accounting rules do not apply
|
||||
*/
|
||||
HUGETLB_ANONHUGE_INODE = 2,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_HUGETLBFS
|
||||
struct hugetlbfs_config {
|
||||
uid_t uid;
|
||||
@@ -148,7 +165,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
|
||||
extern const struct file_operations hugetlbfs_file_operations;
|
||||
extern struct vm_operations_struct hugetlb_vm_ops;
|
||||
struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
|
||||
struct user_struct **user);
|
||||
struct user_struct **user, int creat_flags);
|
||||
int hugetlb_get_quota(struct address_space *mapping, long delta);
|
||||
void hugetlb_put_quota(struct address_space *mapping, long delta);
|
||||
|
||||
@@ -170,7 +187,7 @@ static inline void set_file_hugepages(struct file *file)
|
||||
|
||||
#define is_file_hugepages(file) 0
|
||||
#define set_file_hugepages(file) BUG()
|
||||
#define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS)
|
||||
#define hugetlb_file_setup(name,size,acct,user,creat) ERR_PTR(-ENOSYS)
|
||||
|
||||
#endif /* !CONFIG_HUGETLBFS */
|
||||
|
||||
@@ -185,7 +202,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
|
||||
#define HSTATE_NAME_LEN 32
|
||||
/* Defines one hugetlb page size */
|
||||
struct hstate {
|
||||
int hugetlb_next_nid;
|
||||
int next_nid_to_alloc;
|
||||
int next_nid_to_free;
|
||||
unsigned int order;
|
||||
unsigned long mask;
|
||||
unsigned long max_huge_pages;
|
||||
|
@@ -27,17 +27,6 @@
|
||||
legacy chip driver needs to identify a bus or a bus driver needs to
|
||||
identify a legacy client. If you don't need them, just don't set them. */
|
||||
|
||||
/*
|
||||
* ---- Driver types -----------------------------------------------------
|
||||
*/
|
||||
|
||||
#define I2C_DRIVERID_MSP3400 1
|
||||
#define I2C_DRIVERID_TUNER 2
|
||||
#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */
|
||||
#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */
|
||||
#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */
|
||||
#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
|
||||
|
||||
/*
|
||||
* ---- Adapter types ----------------------------------------------------
|
||||
*/
|
||||
|
@@ -98,7 +98,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
|
||||
/**
|
||||
* struct i2c_driver - represent an I2C device driver
|
||||
* @id: Unique driver ID (optional)
|
||||
* @class: What kind of i2c device we instantiate (for detect)
|
||||
* @attach_adapter: Callback for bus addition (for legacy drivers)
|
||||
* @detach_adapter: Callback for bus removal (for legacy drivers)
|
||||
@@ -135,7 +134,6 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client,
|
||||
* not allowed.
|
||||
*/
|
||||
struct i2c_driver {
|
||||
int id;
|
||||
unsigned int class;
|
||||
|
||||
/* Notifies the driver that a new bus has appeared or is about to be
|
||||
|
92
include/linux/i2c/adp5588.h
Normal file
92
include/linux/i2c/adp5588.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller
|
||||
*
|
||||
* Copyright 2009 Analog Devices Inc.
|
||||
*
|
||||
* Licensed under the GPL-2 or later.
|
||||
*/
|
||||
|
||||
#ifndef _ADP5588_H
|
||||
#define _ADP5588_H
|
||||
|
||||
#define DEV_ID 0x00 /* Device ID */
|
||||
#define CFG 0x01 /* Configuration Register1 */
|
||||
#define INT_STAT 0x02 /* Interrupt Status Register */
|
||||
#define KEY_LCK_EC_STAT 0x03 /* Key Lock and Event Counter Register */
|
||||
#define Key_EVENTA 0x04 /* Key Event Register A */
|
||||
#define Key_EVENTB 0x05 /* Key Event Register B */
|
||||
#define Key_EVENTC 0x06 /* Key Event Register C */
|
||||
#define Key_EVENTD 0x07 /* Key Event Register D */
|
||||
#define Key_EVENTE 0x08 /* Key Event Register E */
|
||||
#define Key_EVENTF 0x09 /* Key Event Register F */
|
||||
#define Key_EVENTG 0x0A /* Key Event Register G */
|
||||
#define Key_EVENTH 0x0B /* Key Event Register H */
|
||||
#define Key_EVENTI 0x0C /* Key Event Register I */
|
||||
#define Key_EVENTJ 0x0D /* Key Event Register J */
|
||||
#define KP_LCK_TMR 0x0E /* Keypad Lock1 to Lock2 Timer */
|
||||
#define UNLOCK1 0x0F /* Unlock Key1 */
|
||||
#define UNLOCK2 0x10 /* Unlock Key2 */
|
||||
#define GPIO_INT_STAT1 0x11 /* GPIO Interrupt Status */
|
||||
#define GPIO_INT_STAT2 0x12 /* GPIO Interrupt Status */
|
||||
#define GPIO_INT_STAT3 0x13 /* GPIO Interrupt Status */
|
||||
#define GPIO_DAT_STAT1 0x14 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_STAT2 0x15 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_STAT3 0x16 /* GPIO Data Status, Read twice to clear */
|
||||
#define GPIO_DAT_OUT1 0x17 /* GPIO DATA OUT */
|
||||
#define GPIO_DAT_OUT2 0x18 /* GPIO DATA OUT */
|
||||
#define GPIO_DAT_OUT3 0x19 /* GPIO DATA OUT */
|
||||
#define GPIO_INT_EN1 0x1A /* GPIO Interrupt Enable */
|
||||
#define GPIO_INT_EN2 0x1B /* GPIO Interrupt Enable */
|
||||
#define GPIO_INT_EN3 0x1C /* GPIO Interrupt Enable */
|
||||
#define KP_GPIO1 0x1D /* Keypad or GPIO Selection */
|
||||
#define KP_GPIO2 0x1E /* Keypad or GPIO Selection */
|
||||
#define KP_GPIO3 0x1F /* Keypad or GPIO Selection */
|
||||
#define GPI_EM1 0x20 /* GPI Event Mode 1 */
|
||||
#define GPI_EM2 0x21 /* GPI Event Mode 2 */
|
||||
#define GPI_EM3 0x22 /* GPI Event Mode 3 */
|
||||
#define GPIO_DIR1 0x23 /* GPIO Data Direction */
|
||||
#define GPIO_DIR2 0x24 /* GPIO Data Direction */
|
||||
#define GPIO_DIR3 0x25 /* GPIO Data Direction */
|
||||
#define GPIO_INT_LVL1 0x26 /* GPIO Edge/Level Detect */
|
||||
#define GPIO_INT_LVL2 0x27 /* GPIO Edge/Level Detect */
|
||||
#define GPIO_INT_LVL3 0x28 /* GPIO Edge/Level Detect */
|
||||
#define Debounce_DIS1 0x29 /* Debounce Disable */
|
||||
#define Debounce_DIS2 0x2A /* Debounce Disable */
|
||||
#define Debounce_DIS3 0x2B /* Debounce Disable */
|
||||
#define GPIO_PULL1 0x2C /* GPIO Pull Disable */
|
||||
#define GPIO_PULL2 0x2D /* GPIO Pull Disable */
|
||||
#define GPIO_PULL3 0x2E /* GPIO Pull Disable */
|
||||
#define CMP_CFG_STAT 0x30 /* Comparator Configuration and Status Register */
|
||||
#define CMP_CONFG_SENS1 0x31 /* Sensor1 Comparator Configuration Register */
|
||||
#define CMP_CONFG_SENS2 0x32 /* L2 Light Sensor Reference Level, Output Falling for Sensor 1 */
|
||||
#define CMP1_LVL2_TRIP 0x33 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 1 */
|
||||
#define CMP1_LVL2_HYS 0x34 /* L3 Light Sensor Reference Level, Output Falling For Sensor 1 */
|
||||
#define CMP1_LVL3_TRIP 0x35 /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 1 */
|
||||
#define CMP1_LVL3_HYS 0x36 /* Sensor 2 Comparator Configuration Register */
|
||||
#define CMP2_LVL2_TRIP 0x37 /* L2 Light Sensor Reference Level, Output Falling for Sensor 2 */
|
||||
#define CMP2_LVL2_HYS 0x38 /* L2 Light Sensor Hysteresis (Active when Output Rising) for Sensor 2 */
|
||||
#define CMP2_LVL3_TRIP 0x39 /* L3 Light Sensor Reference Level, Output Falling For Sensor 2 */
|
||||
#define CMP2_LVL3_HYS 0x3A /* L3 Light Sensor Hysteresis (Active when Output Rising) For Sensor 2 */
|
||||
#define CMP1_ADC_DAT_R1 0x3B /* Comparator 1 ADC data Register1 */
|
||||
#define CMP1_ADC_DAT_R2 0x3C /* Comparator 1 ADC data Register2 */
|
||||
#define CMP2_ADC_DAT_R1 0x3D /* Comparator 2 ADC data Register1 */
|
||||
#define CMP2_ADC_DAT_R2 0x3E /* Comparator 2 ADC data Register2 */
|
||||
|
||||
#define ADP5588_DEVICE_ID_MASK 0xF
|
||||
|
||||
/* Put one of these structures in i2c_board_info platform_data */
|
||||
|
||||
#define ADP5588_KEYMAPSIZE 80
|
||||
|
||||
struct adp5588_kpad_platform_data {
|
||||
int rows; /* Number of rows */
|
||||
int cols; /* Number of columns */
|
||||
const unsigned short *keymap; /* Pointer to keymap */
|
||||
unsigned short keymapsize; /* Keymap size */
|
||||
unsigned repeat:1; /* Enable key repeat */
|
||||
unsigned en_keylock:1; /* Enable Key Lock feature */
|
||||
unsigned short unlock_key1; /* Unlock Key 1 */
|
||||
unsigned short unlock_key2; /* Unlock Key 2 */
|
||||
};
|
||||
|
||||
#endif
|
24
include/linux/i2c/mcs5000_ts.h
Normal file
24
include/linux/i2c/mcs5000_ts.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* mcs5000_ts.h
|
||||
*
|
||||
* Copyright (C) 2009 Samsung Electronics Co.Ltd
|
||||
* Author: Joonyoung Shim <jy0922.shim@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 __LINUX_MCS5000_TS_H
|
||||
#define __LINUX_MCS5000_TS_H
|
||||
|
||||
/* platform data for the MELFAS MCS-5000 touchscreen driver */
|
||||
struct mcs5000_ts_platform_data {
|
||||
void (*cfg_pin)(void);
|
||||
int x_size;
|
||||
int y_size;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MCS5000_TS_H */
|
@@ -25,6 +25,9 @@
|
||||
#ifndef __TWL4030_H_
|
||||
#define __TWL4030_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
|
||||
/*
|
||||
* Using the twl4030 core we address registers using a pair
|
||||
* { module id, relative register offset }
|
||||
@@ -220,19 +223,28 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
|
||||
/* Power bus message definitions */
|
||||
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1
|
||||
#define DEV_GRP_P2 0x2
|
||||
#define DEV_GRP_P3 0x4
|
||||
/* The TWL4030/5030 splits its power-management resources (the various
|
||||
* regulators, clock and reset lines) into 3 processor groups - P1, P2 and
|
||||
* P3. These groups can then be configured to transition between sleep, wait-on
|
||||
* and active states by sending messages to the power bus. See Section 5.4.2
|
||||
* Power Resources of TWL4030 TRM
|
||||
*/
|
||||
|
||||
#define RES_GRP_RES 0x0
|
||||
#define RES_GRP_PP 0x1
|
||||
#define RES_GRP_RC 0x2
|
||||
/* Processor groups */
|
||||
#define DEV_GRP_NULL 0x0
|
||||
#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */
|
||||
#define DEV_GRP_P2 0x2 /* P2: all Modem devices */
|
||||
#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */
|
||||
|
||||
/* Resource groups */
|
||||
#define RES_GRP_RES 0x0 /* Reserved */
|
||||
#define RES_GRP_PP 0x1 /* Power providers */
|
||||
#define RES_GRP_RC 0x2 /* Reset and control */
|
||||
#define RES_GRP_PP_RC 0x3
|
||||
#define RES_GRP_PR 0x4
|
||||
#define RES_GRP_PR 0x4 /* Power references */
|
||||
#define RES_GRP_PP_PR 0x5
|
||||
#define RES_GRP_RC_PR 0x6
|
||||
#define RES_GRP_ALL 0x7
|
||||
#define RES_GRP_ALL 0x7 /* All resource groups */
|
||||
|
||||
#define RES_TYPE2_R0 0x0
|
||||
|
||||
@@ -243,6 +255,41 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes);
|
||||
#define RES_STATE_SLEEP 0x8
|
||||
#define RES_STATE_OFF 0x0
|
||||
|
||||
/* Power resources */
|
||||
|
||||
/* Power providers */
|
||||
#define RES_VAUX1 1
|
||||
#define RES_VAUX2 2
|
||||
#define RES_VAUX3 3
|
||||
#define RES_VAUX4 4
|
||||
#define RES_VMMC1 5
|
||||
#define RES_VMMC2 6
|
||||
#define RES_VPLL1 7
|
||||
#define RES_VPLL2 8
|
||||
#define RES_VSIM 9
|
||||
#define RES_VDAC 10
|
||||
#define RES_VINTANA1 11
|
||||
#define RES_VINTANA2 12
|
||||
#define RES_VINTDIG 13
|
||||
#define RES_VIO 14
|
||||
#define RES_VDD1 15
|
||||
#define RES_VDD2 16
|
||||
#define RES_VUSB_1V5 17
|
||||
#define RES_VUSB_1V8 18
|
||||
#define RES_VUSB_3V1 19
|
||||
#define RES_VUSBCP 20
|
||||
#define RES_REGEN 21
|
||||
/* Reset and control */
|
||||
#define RES_NRES_PWRON 22
|
||||
#define RES_CLKEN 23
|
||||
#define RES_SYSEN 24
|
||||
#define RES_HFCLKOUT 25
|
||||
#define RES_32KCLKOUT 26
|
||||
#define RES_RESET 27
|
||||
/* Power Reference */
|
||||
#define RES_Main_Ref 28
|
||||
|
||||
#define TOTAL_RESOURCES 28
|
||||
/*
|
||||
* Power Bus Message Format ... these can be sent individually by Linux,
|
||||
* but are usually part of downloaded scripts that are run when various
|
||||
@@ -302,13 +349,17 @@ struct twl4030_madc_platform_data {
|
||||
int irq_line;
|
||||
};
|
||||
|
||||
/* Boards have uniqe mappings of {col, row} --> keycode.
|
||||
* Column and row are 4 bits, but range only from 0..7.
|
||||
* a PERSISTENT_KEY is "always on" and never reported.
|
||||
*/
|
||||
#define PERSISTENT_KEY(c, r) KEY((c), (r), KEY_RESERVED)
|
||||
|
||||
struct twl4030_keypad_data {
|
||||
int rows;
|
||||
int cols;
|
||||
int *keymap;
|
||||
int irq;
|
||||
unsigned int keymapsize;
|
||||
unsigned int rep:1;
|
||||
const struct matrix_keymap_data *keymap_data;
|
||||
unsigned rows;
|
||||
unsigned cols;
|
||||
bool rep;
|
||||
};
|
||||
|
||||
enum twl4030_usb_mode {
|
||||
@@ -320,6 +371,36 @@ struct twl4030_usb_data {
|
||||
enum twl4030_usb_mode usb_mode;
|
||||
};
|
||||
|
||||
struct twl4030_ins {
|
||||
u16 pmb_message;
|
||||
u8 delay;
|
||||
};
|
||||
|
||||
struct twl4030_script {
|
||||
struct twl4030_ins *script;
|
||||
unsigned size;
|
||||
u8 flags;
|
||||
#define TWL4030_WRST_SCRIPT (1<<0)
|
||||
#define TWL4030_WAKEUP12_SCRIPT (1<<1)
|
||||
#define TWL4030_WAKEUP3_SCRIPT (1<<2)
|
||||
#define TWL4030_SLEEP_SCRIPT (1<<3)
|
||||
};
|
||||
|
||||
struct twl4030_resconfig {
|
||||
u8 resource;
|
||||
u8 devgroup; /* Processor group that Power resource belongs to */
|
||||
u8 type; /* Power resource addressed, 6 / broadcast message */
|
||||
u8 type2; /* Power resource addressed, 3 / broadcast message */
|
||||
};
|
||||
|
||||
struct twl4030_power_data {
|
||||
struct twl4030_script **scripts;
|
||||
unsigned num;
|
||||
struct twl4030_resconfig *resource_config;
|
||||
};
|
||||
|
||||
extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
|
||||
|
||||
struct twl4030_platform_data {
|
||||
unsigned irq_base, irq_end;
|
||||
struct twl4030_bci_platform_data *bci;
|
||||
@@ -327,6 +408,7 @@ struct twl4030_platform_data {
|
||||
struct twl4030_madc_platform_data *madc;
|
||||
struct twl4030_keypad_data *keypad;
|
||||
struct twl4030_usb_data *usb;
|
||||
struct twl4030_power_data *power;
|
||||
|
||||
/* LDO regulators */
|
||||
struct regulator_init_data *vdac;
|
||||
@@ -357,7 +439,6 @@ int twl4030_sih_setup(int module);
|
||||
#define TWL4030_VAUX3_DEV_GRP 0x1F
|
||||
#define TWL4030_VAUX3_DEDICATED 0x22
|
||||
|
||||
|
||||
#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
|
||||
defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
|
||||
extern int twl4030charger_usb_en(int enable);
|
||||
|
@@ -7,6 +7,7 @@
|
||||
* the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Standard commands.
|
||||
@@ -30,6 +31,35 @@
|
||||
#define I8042_CMD_MUX_PFX 0x0090
|
||||
#define I8042_CMD_MUX_SEND 0x1090
|
||||
|
||||
struct serio;
|
||||
|
||||
#if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
|
||||
|
||||
void i8042_lock_chip(void);
|
||||
void i8042_unlock_chip(void);
|
||||
int i8042_command(unsigned char *param, int command);
|
||||
bool i8042_check_port_owner(const struct serio *);
|
||||
|
||||
#else
|
||||
|
||||
void i8042_lock_chip(void)
|
||||
{
|
||||
}
|
||||
|
||||
void i8042_unlock_chip(void)
|
||||
{
|
||||
}
|
||||
|
||||
int i8042_command(unsigned char *param, int command)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
bool i8042_check_port_owner(const struct serio *serio)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -258,6 +258,7 @@ enum {
|
||||
IDE_TFLAG_DYN = (1 << 5),
|
||||
IDE_TFLAG_FS = (1 << 6),
|
||||
IDE_TFLAG_MULTI_PIO = (1 << 7),
|
||||
IDE_TFLAG_SET_XFER = (1 << 8),
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -294,7 +295,7 @@ struct ide_cmd {
|
||||
} out, in;
|
||||
} valid;
|
||||
|
||||
u8 tf_flags;
|
||||
u16 tf_flags;
|
||||
u8 ftf_flags; /* for TASKFILE ioctl */
|
||||
int protocol;
|
||||
|
||||
@@ -918,8 +919,7 @@ __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL)
|
||||
typedef struct {
|
||||
const char *name;
|
||||
mode_t mode;
|
||||
read_proc_t *read_proc;
|
||||
write_proc_t *write_proc;
|
||||
const struct file_operations *proc_fops;
|
||||
} ide_proc_entry_t;
|
||||
|
||||
void proc_ide_create(void);
|
||||
@@ -931,24 +931,8 @@ void ide_proc_unregister_port(ide_hwif_t *);
|
||||
void ide_proc_register_driver(ide_drive_t *, struct ide_driver *);
|
||||
void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *);
|
||||
|
||||
read_proc_t proc_ide_read_capacity;
|
||||
read_proc_t proc_ide_read_geometry;
|
||||
|
||||
/*
|
||||
* Standard exit stuff:
|
||||
*/
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) \
|
||||
{ \
|
||||
len -= off; \
|
||||
if (len < count) { \
|
||||
*eof = 1; \
|
||||
if (len <= 0) \
|
||||
return 0; \
|
||||
} else \
|
||||
len = count; \
|
||||
*start = page + off; \
|
||||
return len; \
|
||||
}
|
||||
extern const struct file_operations ide_capacity_proc_fops;
|
||||
extern const struct file_operations ide_geometry_proc_fops;
|
||||
#else
|
||||
static inline void proc_ide_create(void) { ; }
|
||||
static inline void proc_ide_destroy(void) { ; }
|
||||
@@ -960,7 +944,6 @@ static inline void ide_proc_register_driver(ide_drive_t *drive,
|
||||
struct ide_driver *driver) { ; }
|
||||
static inline void ide_proc_unregister_driver(ide_drive_t *drive,
|
||||
struct ide_driver *driver) { ; }
|
||||
#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
|
||||
#endif
|
||||
|
||||
enum {
|
||||
@@ -1081,6 +1064,7 @@ extern void ide_fixstring(u8 *, const int, const int);
|
||||
|
||||
int ide_busy_sleep(ide_drive_t *, unsigned long, int);
|
||||
|
||||
int __ide_wait_stat(ide_drive_t *, u8, u8, unsigned long, u8 *);
|
||||
int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
|
||||
|
||||
ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
|
||||
@@ -1169,7 +1153,7 @@ int ide_no_data_taskfile(ide_drive_t *, struct ide_cmd *);
|
||||
|
||||
int ide_taskfile_ioctl(ide_drive_t *, unsigned long);
|
||||
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *);
|
||||
int ide_dev_read_id(ide_drive_t *, u8, u16 *, int);
|
||||
|
||||
extern int ide_driveid_update(ide_drive_t *);
|
||||
extern int ide_config_drive_speed(ide_drive_t *, u8);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user