From b652b438fcad4c9c079d0774e9d45ee58fae22e2 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 15 Jun 2005 12:38:14 +0100 Subject: [PATCH] I2C: Add PXA I2C driver Add support for the I2C PXA driver. Signed-off-by: Russell King --- include/asm-arm/arch-pxa/i2c.h | 70 ++++++++++++++++++++++++++++++++++++++++++ include/linux/i2c-id.h | 1 + include/linux/i2c-pxa.h | 48 +++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 include/asm-arm/arch-pxa/i2c.h create mode 100644 include/linux/i2c-pxa.h (limited to 'include') diff --git a/include/asm-arm/arch-pxa/i2c.h b/include/asm-arm/arch-pxa/i2c.h new file mode 100644 index 00000000000..46ec2243974 --- /dev/null +++ b/include/asm-arm/arch-pxa/i2c.h @@ -0,0 +1,70 @@ +/* + * i2c_pxa.h + * + * Copyright (C) 2002 Intrinsyc Software Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ +#ifndef _I2C_PXA_H_ +#define _I2C_PXA_H_ + +#if 0 +#define DEF_TIMEOUT 3 +#else +/* need a longer timeout if we're dealing with the fact we may well be + * looking at a multi-master environment +*/ +#define DEF_TIMEOUT 32 +#endif + +#define BUS_ERROR (-EREMOTEIO) +#define XFER_NAKED (-ECONNREFUSED) +#define I2C_RETRY (-2000) /* an error has occurred retry transmit */ + +/* ICR initialize bit values +* +* 15. FM 0 (100 Khz operation) +* 14. UR 0 (No unit reset) +* 13. SADIE 0 (Disables the unit from interrupting on slave addresses +* matching its slave address) +* 12. ALDIE 0 (Disables the unit from interrupt when it loses arbitration +* in master mode) +* 11. SSDIE 0 (Disables interrupts from a slave stop detected, in slave mode) +* 10. BEIE 1 (Enable interrupts from detected bus errors, no ACK sent) +* 9. IRFIE 1 (Enable interrupts from full buffer received) +* 8. ITEIE 1 (Enables the I2C unit to interrupt when transmit buffer empty) +* 7. GCD 1 (Disables i2c unit response to general call messages as a slave) +* 6. IUE 0 (Disable unit until we change settings) +* 5. SCLE 1 (Enables the i2c clock output for master mode (drives SCL) +* 4. MA 0 (Only send stop with the ICR stop bit) +* 3. TB 0 (We are not transmitting a byte initially) +* 2. ACKNAK 0 (Send an ACK after the unit receives a byte) +* 1. STOP 0 (Do not send a STOP) +* 0. START 0 (Do not send a START) +* +*/ +#define I2C_ICR_INIT (ICR_BEIE | ICR_IRFIE | ICR_ITEIE | ICR_GCD | ICR_SCLE) + +/* I2C status register init values + * + * 10. BED 1 (Clear bus error detected) + * 9. SAD 1 (Clear slave address detected) + * 7. IRF 1 (Clear IDBR Receive Full) + * 6. ITE 1 (Clear IDBR Transmit Empty) + * 5. ALD 1 (Clear Arbitration Loss Detected) + * 4. SSD 1 (Clear Slave Stop Detected) + */ +#define I2C_ISR_INIT 0x7FF /* status register init */ + +struct i2c_slave_client; + +struct i2c_pxa_platform_data { + unsigned int slave_addr; + struct i2c_slave_client *slave; +}; + +extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); +#endif diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 89270ce5147..74d6dc94271 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -203,6 +203,7 @@ #define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */ #define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */ #define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */ +#define I2C_ALGO_PXA 0x1c0000 /* Intel PXA I2C algorithm */ #define I2C_ALGO_EXP 0x800000 /* experimental */ diff --git a/include/linux/i2c-pxa.h b/include/linux/i2c-pxa.h new file mode 100644 index 00000000000..5f3eaf80222 --- /dev/null +++ b/include/linux/i2c-pxa.h @@ -0,0 +1,48 @@ +#ifndef _LINUX_I2C_ALGO_PXA_H +#define _LINUX_I2C_ALGO_PXA_H + +struct i2c_eeprom_emu_watcher { + void (*write)(void *, unsigned int addr, unsigned char newval); +}; + +struct i2c_eeprom_emu_watch { + struct list_head node; + unsigned int start; + unsigned int end; + struct i2c_eeprom_emu_watcher *ops; + void *data; +}; + +#define I2C_EEPROM_EMU_SIZE (256) + +struct i2c_eeprom_emu { + unsigned int size; + unsigned int ptr; + unsigned int seen_start; + struct list_head watch; + + unsigned char bytes[I2C_EEPROM_EMU_SIZE]; +}; + +typedef enum i2c_slave_event_e { + I2C_SLAVE_EVENT_START_READ, + I2C_SLAVE_EVENT_START_WRITE, + I2C_SLAVE_EVENT_STOP +} i2c_slave_event_t; + +struct i2c_slave_client { + void *data; + void (*event)(void *ptr, i2c_slave_event_t event); + int (*read) (void *ptr); + void (*write)(void *ptr, unsigned int val); +}; + +extern int i2c_eeprom_emu_addwatcher(struct i2c_eeprom_emu *, void *data, + unsigned int addr, unsigned int size, + struct i2c_eeprom_emu_watcher *); + +extern void i2c_eeprom_emu_delwatcher(struct i2c_eeprom_emu *, void *data, struct i2c_eeprom_emu_watcher *watcher); + +extern struct i2c_eeprom_emu *i2c_pxa_get_eeprom(void); + +#endif /* _LINUX_I2C_ALGO_PXA_H */ -- cgit v1.2.3 From df46b9a44ceb5af2ea2351ce8e28ae7bd840b00f Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 20 Jun 2005 14:04:44 +0200 Subject: [PATCH] Add blk_rq_map_kern() Add blk_rq_map_kern which takes a kernel buffer and maps it into a request and bio. This can be used by the dm hw_handlers, old sg_scsi_ioctl, and one day scsi special requests so all requests comming into scsi will have bios. All requests having bios should allow scsi to use scatter lists for all IO and allow it to use block layer functions. Signed-off-by: Jens Axboe --- include/linux/bio.h | 2 ++ include/linux/blkdev.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/bio.h b/include/linux/bio.h index 038022763f0..1dd2bc2e84a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -282,6 +282,8 @@ extern int bio_get_nr_vecs(struct block_device *); extern struct bio *bio_map_user(struct request_queue *, struct block_device *, unsigned long, unsigned int, int); extern void bio_unmap_user(struct bio *); +extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, + unsigned int); extern void bio_set_pages_dirty(struct bio *bio); extern void bio_check_pages_dirty(struct bio *bio); extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 4a99b76c5a3..67339bc5f6b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -560,6 +560,8 @@ extern void blk_run_queue(request_queue_t *); extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int); extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int); +extern struct request *blk_rq_map_kern(request_queue_t *, int, void *, + unsigned int, unsigned int); extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) -- cgit v1.2.3 From dd1cab95f356f1395278633565f198463cf6bd24 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 20 Jun 2005 14:06:01 +0200 Subject: [PATCH] Cleanup blk_rq_map_* interfaces Change the blk_rq_map_user() and blk_rq_map_kern() interface to require a previously allocated request to be passed in. This is both more efficient for multiple iterations of mapping data to the same request, and it is also a much nicer API. Signed-off-by: Jens Axboe --- include/linux/blkdev.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 67339bc5f6b..fc0dce07861 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -558,10 +558,9 @@ extern void blk_sync_queue(struct request_queue *q); extern void __blk_stop_queue(request_queue_t *q); extern void blk_run_queue(request_queue_t *); extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); -extern struct request *blk_rq_map_user(request_queue_t *, int, void __user *, unsigned int); -extern int blk_rq_unmap_user(struct request *, struct bio *, unsigned int); -extern struct request *blk_rq_map_kern(request_queue_t *, int, void *, - unsigned int, unsigned int); +extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); +extern int blk_rq_unmap_user(struct bio *, unsigned int); +extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) -- cgit v1.2.3 From f1970baf6d74e03bd32072ab453f2fc01bc1b8d3 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Mon, 20 Jun 2005 14:06:52 +0200 Subject: [PATCH] Add scatter-gather support for the block layer SG_IO Signed-off-by: Jens Axboe --- include/linux/bio.h | 4 ++++ include/linux/blkdev.h | 1 + 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/bio.h b/include/linux/bio.h index 1dd2bc2e84a..ebcd03ba2e2 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -281,6 +281,10 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); extern int bio_get_nr_vecs(struct block_device *); extern struct bio *bio_map_user(struct request_queue *, struct block_device *, unsigned long, unsigned int, int); +struct sg_iovec; +extern struct bio *bio_map_user_iov(struct request_queue *, + struct block_device *, + struct sg_iovec *, int, int); extern void bio_unmap_user(struct bio *); extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, unsigned int); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fc0dce07861..0430ea3e5f2 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -561,6 +561,7 @@ extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); extern int blk_rq_unmap_user(struct bio *, unsigned int); extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); +extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) -- cgit v1.2.3 From 994ca9a19616f0d4161a9e825f0835925d522426 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Mon, 20 Jun 2005 14:11:09 +0200 Subject: [PATCH] update blk_execute_rq to take an at_head parameter Original From: Mike Christie Modified to split out block changes (this patch) and SCSI pieces. Signed-off-by: Jens Axboe Signed-off-by: James Bottomley --- include/linux/blkdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0430ea3e5f2..a48dc12c669 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -562,8 +562,8 @@ extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, u extern int blk_rq_unmap_user(struct bio *, unsigned int); extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, unsigned int); extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); -extern int blk_execute_rq(request_queue_t *, struct gendisk *, struct request *); - +extern int blk_execute_rq(request_queue_t *, struct gendisk *, + struct request *, int); static inline request_queue_t *bdev_get_queue(struct block_device *bdev) { return bdev->bd_disk->queue; -- cgit v1.2.3 From 6f42ccf2fc50ecee8ea170040627f268430c1648 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 13 May 2005 00:00:00 -0400 Subject: ACPICA from Bob Moore Implemented support for PCI Express root bridges -- added support for device PNP0A08 in the root bridge search within AcpiEvPciConfigRegionSetup. acpi_ev_pci_config_region_setup(). The interpreter now automatically truncates incoming 64-bit constants to 32 bits if currently executing out of a 32-bit ACPI table (Revision < 2). This also affects the iASL compiler constant folding. (Note: as per below, the iASL compiler no longer allows 64-bit constants within 32-bit tables.) Fixed a problem where string and buffer objects with "static" pointers (pointers to initialization data within an ACPI table) were not handled consistently. The internal object copy operation now always copies the data to a newly allocated buffer, regardless of whether the source object is static or not. Fixed a problem with the FromBCD operator where an implicit result conversion was improperly performed while storing the result to the target operand. Since this is an "explicit conversion" operator, the implicit conversion should never be performed on the output. Fixed a problem with the CopyObject operator where a copy to an existing named object did not always completely overwrite the existing object stored at name. Specifically, a buffer-to-buffer copy did not delete the existing buffer. Replaced "interrupt_level" with "interrupt_number" in all GPE interfaces and structs for consistency. Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acevents.h | 2 +- include/acpi/aclocal.h | 3 ++- include/acpi/acopcode.h | 2 +- include/acpi/acpixf.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 2f6ab189fc6..a268c4ae187 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050408 +#define ACPI_CA_VERSION 0x20050513 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index 61a27c8c507..301c5cce666 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h @@ -136,7 +136,7 @@ acpi_ev_create_gpe_block ( struct acpi_generic_address *gpe_block_address, u32 register_count, u8 gpe_block_base_number, - u32 interrupt_level, + u32 interrupt_number, struct acpi_gpe_block_info **return_gpe_block); acpi_status diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 030e641115c..52c6a202586 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -365,7 +365,7 @@ struct acpi_gpe_xrupt_info struct acpi_gpe_xrupt_info *previous; struct acpi_gpe_xrupt_info *next; struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ - u32 interrupt_level; /* System interrupt level */ + u32 interrupt_number; /* System interrupt number */ }; @@ -737,6 +737,7 @@ struct acpi_parse_state ****************************************************************************/ #define PCI_ROOT_HID_STRING "PNP0A03" +#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" struct acpi_bit_register_info { diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index 118ecba4cf0..093f697e8c5 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h @@ -246,7 +246,7 @@ #define ARGI_FIELD_OP ARGI_INVALID_OPCODE #define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) -#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) +#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) #define ARGI_IF_OP ARGI_INVALID_OPCODE #define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) #define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index f8f619f8e4f..9ca212d73fb 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -387,7 +387,7 @@ acpi_install_gpe_block ( acpi_handle gpe_device, struct acpi_generic_address *gpe_block_address, u32 register_count, - u32 interrupt_level); + u32 interrupt_number); acpi_status acpi_remove_gpe_block ( -- cgit v1.2.3 From 88ac00f5a841dcfc5c682000f4a6add0add8caac Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 26 May 2005 00:00:00 -0400 Subject: ACPICA 20050526 from Bob Moore Implemented support to execute Type 1 and Type 2 AML opcodes appearing at the module level (not within a control method.) These opcodes are executed exactly once at the time the table is loaded. This type of code was legal up until the release of ACPI 2.0B (2002) and is now supported within ACPI CA in order to provide backwards compatibility with earlier BIOS implementations. This eliminates the "Encountered executable code at module level" warning that was previously generated upon detection of such code. Fixed a problem in the interpreter where an AE_NOT_FOUND exception could inadvertently be generated during the lookup of namespace objects in the second pass parse of ACPI tables and control methods. It appears that this problem could occur during the resolution of forward references to namespace objects. Added the ACPI_MUTEX_DEBUG #ifdef to the acpi_ut_release_mutex function, corresponding to the same the deadlock detection debug code to be compiled out in the normal case, improving mutex performance (and overall subsystem performance) considerably. As suggested by Alexey Starikovskiy. Implemented a handful of miscellaneous fixes for possible memory leaks on error conditions and error handling control paths. These fixes were suggested by FreeBSD and the Coverity Prevent source code analysis tool. Added a check for a null RSDT pointer in acpi_get_firmware_table (tbxfroot.c) to prevent a fault in this error case. Signed-off-by Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acstruct.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index a268c4ae187..6babcb10493 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050513 +#define ACPI_CA_VERSION 0x20050526 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index e6b9e36a2ed..4e926457bd2 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -78,7 +78,7 @@ struct acpi_walk_state u8 return_used; u16 opcode; /* Current AML opcode */ u8 scope_depth; - u8 reserved1; + u8 pass_number; /* Parse pass during table load */ u32 arg_count; /* push for fixed or var args */ u32 aml_offset; u32 arg_types; -- cgit v1.2.3 From 73459f73e5d1602c59ebec114fc45185521353c1 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 24 Jun 2005 00:00:00 -0400 Subject: ACPICA 20050617-0624 from Bob Moore ACPICA 20050617: Moved the object cache operations into the OS interface layer (OSL) to allow the host OS to handle these operations if desired (for example, the Linux OSL will invoke the slab allocator). This support is optional; the compile time define ACPI_USE_LOCAL_CACHE may be used to utilize the original cache code in the ACPI CA core. The new OSL interfaces are shown below. See utalloc.c for an example implementation, and acpiosxf.h for the exact interface definitions. Thanks to Alexey Starikovskiy. acpi_os_create_cache acpi_os_delete_cache acpi_os_purge_cache acpi_os_acquire_object acpi_os_release_object Modified the interfaces to acpi_os_acquire_lock and acpi_os_release_lock to return and restore a flags parameter. This fits better with many OS lock models. Note: the current execution state (interrupt handler or not) is no longer passed to these interfaces. If necessary, the OSL must determine this state by itself, a simple and fast operation. Thanks to Alexey Starikovskiy. Fixed a problem in the ACPI table handling where a valid XSDT was assumed present if the revision of the RSDP was 2 or greater. According to the ACPI specification, the XSDT is optional in all cases, and the table manager therefore now checks for both an RSDP >=2 and a valid XSDT pointer. Otherwise, the RSDT pointer is used. Some ACPI 2.0 compliant BIOSs contain only the RSDT. Fixed an interpreter problem with the Mid() operator in the case of an input string where the resulting output string is of zero length. It now correctly returns a valid, null terminated string object instead of a string object with a null pointer. Fixed a problem with the control method argument handling to allow a store to an Arg object that already contains an object of type Device. The Device object is now correctly overwritten. Previously, an error was returned. ACPICA 20050624: Modified the new OSL cache interfaces to use ACPI_CACHE_T as the type for the host-defined cache object. This allows the OSL implementation to define and type this object in any manner desired, simplifying the OSL implementation. For example, ACPI_CACHE_T is defined as kmem_cache_t for Linux, and should be defined in the OS-specific header file for other operating systems as required. Changed the interface to AcpiOsAcquireObject to directly return the requested object as the function return (instead of ACPI_STATUS.) This change was made for performance reasons, since this is the purpose of the interface in the first place. acpi_os_acquire_object is now similar to the acpi_os_allocate interface. Thanks to Alexey Starikovskiy. Modified the initialization sequence in acpi_initialize_subsystem to call the OSL interface acpi_osl_initialize first, before any local initialization. This change was required because the global initialization now calls OSL interfaces. Restructured the code base to split some files because of size and/or because the code logically belonged in a separate file. New files are listed below. utilities/utcache.c /* Local cache interfaces */ utilities/utmutex.c /* Local mutex support */ utilities/utstate.c /* State object support */ parser/psloop.c /* Main AML parse loop */ Signed-off-by: Len Brown --- include/acpi/acconfig.h | 9 +++--- include/acpi/acdebug.h | 6 +++- include/acpi/acdisasm.h | 1 + include/acpi/acdispat.h | 6 ---- include/acpi/acevents.h | 3 +- include/acpi/acglobal.h | 26 ++++++++++++++++- include/acpi/achware.h | 6 ++-- include/acpi/aclocal.h | 24 ++++++---------- include/acpi/acparser.h | 26 +++++++++++++---- include/acpi/acpiosxf.h | 35 ++++++++++++++++++++--- include/acpi/acstruct.h | 3 ++ include/acpi/actypes.h | 5 ++++ include/acpi/acutils.h | 63 ++++++++++++++++------------------------- include/acpi/amlcode.h | 4 +-- include/acpi/platform/acenv.h | 19 +++++++------ include/acpi/platform/aclinux.h | 11 +++++++ 16 files changed, 155 insertions(+), 92 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 6babcb10493..dd9b70cc963 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050526 +#define ACPI_CA_VERSION 0x20050624 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, @@ -78,11 +78,10 @@ /* Maximum objects in the various object caches */ -#define ACPI_MAX_STATE_CACHE_DEPTH 64 /* State objects */ +#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ #define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 64 /* Parse tree objects */ -#define ACPI_MAX_OBJECT_CACHE_DEPTH 64 /* Interpreter operand objects */ -#define ACPI_MAX_WALK_CACHE_DEPTH 4 /* Objects for parse tree walks */ +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ /* * Should the subystem abort the loading of an ACPI table if the diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index 8ba372b0f24..f8fa2227583 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -113,6 +113,10 @@ void acpi_db_set_method_call_breakpoint ( union acpi_parse_object *op); +void +acpi_db_get_bus_info ( + void); + void acpi_db_disassemble_aml ( char *statements, @@ -327,7 +331,7 @@ acpi_db_set_output_destination ( u32 where); void -acpi_db_dump_object ( +acpi_db_dump_external_object ( union acpi_object *obj_desc, u32 level); diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index dbfa877121b..fcc2d507fac 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -90,6 +90,7 @@ struct acpi_op_walk_info { u32 level; u32 bit_offset; + struct acpi_walk_state *walk_state; }; typedef diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 8f5f2f71b1d..fde6aa9fcd0 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -450,10 +450,4 @@ acpi_ds_result_pop_from_bottom ( union acpi_operand_object **object, struct acpi_walk_state *walk_state); -#ifdef ACPI_ENABLE_OBJECT_CACHE -void -acpi_ds_delete_walk_state_cache ( - void); -#endif - #endif /* _ACDISPAT_H_ */ diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index 301c5cce666..33ae2ca997b 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h @@ -122,8 +122,7 @@ acpi_ev_valid_gpe_event ( acpi_status acpi_ev_walk_gpe_list ( - ACPI_GPE_CALLBACK gpe_walk_callback, - u32 flags); + ACPI_GPE_CALLBACK gpe_walk_callback); acpi_status acpi_ev_delete_gpe_handlers ( diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 4946696088c..8d5a397abd6 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -151,6 +151,13 @@ ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; */ +/* The root table can be either an RSDT or an XSDT */ + +ACPI_EXTERN u8 acpi_gbl_root_table_type; +#define ACPI_TABLE_TYPE_RSDT 'R' +#define ACPI_TABLE_TYPE_XSDT 'X' + + /* * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: * If we are executing a method that exists in a 32-bit ACPI table, @@ -180,8 +187,23 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; * ****************************************************************************/ +#ifdef ACPI_DBG_TRACK_ALLOCATIONS + +/* Lists for tracking memory allocations */ + +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; +#endif + +/* Object caches */ + +ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; + +/* Global handlers */ -ACPI_EXTERN struct acpi_memory_list acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS]; ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; @@ -189,6 +211,8 @@ ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; +/* Misc */ + ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; ACPI_EXTERN u32 acpi_gbl_original_mode; ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; diff --git a/include/acpi/achware.h b/include/acpi/achware.h index 9d63641b8e7..cf5de4625a7 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h @@ -143,15 +143,15 @@ acpi_hw_get_gpe_status ( acpi_status acpi_hw_disable_all_gpes ( - u32 flags); + void); acpi_status acpi_hw_enable_all_runtime_gpes ( - u32 flags); + void); acpi_status acpi_hw_enable_all_wakeup_gpes ( - u32 flags); + void); acpi_status acpi_hw_enable_runtime_gpe_block ( diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 52c6a202586..58f9ba1a34e 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -953,24 +953,18 @@ struct acpi_debug_mem_block #define ACPI_MEM_LIST_GLOBAL 0 #define ACPI_MEM_LIST_NSNODE 1 - -#define ACPI_MEM_LIST_FIRST_CACHE_LIST 2 -#define ACPI_MEM_LIST_STATE 2 -#define ACPI_MEM_LIST_PSNODE 3 -#define ACPI_MEM_LIST_PSNODE_EXT 4 -#define ACPI_MEM_LIST_OPERAND 5 -#define ACPI_MEM_LIST_WALK 6 -#define ACPI_MEM_LIST_MAX 6 -#define ACPI_NUM_MEM_LISTS 7 +#define ACPI_MEM_LIST_MAX 1 +#define ACPI_NUM_MEM_LISTS 2 struct acpi_memory_list { + char *list_name; void *list_head; - u16 link_offset; - u16 max_cache_depth; - u16 cache_depth; u16 object_size; + u16 max_depth; + u16 current_depth; + u16 link_offset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS @@ -979,11 +973,9 @@ struct acpi_memory_list u32 total_allocated; u32 total_freed; u32 current_total_size; - u32 cache_requests; - u32 cache_hits; - char *list_name; + u32 requests; + u32 hits; #endif }; - #endif /* __ACLOCAL_H__ */ diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index 69827657181..ba9548f94de 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h @@ -63,6 +63,7 @@ #define ACPI_PARSE_MODE_MASK 0x0030 #define ACPI_PARSE_DEFERRED_OP 0x0100 +#define ACPI_PARSE_DISASSEMBLE 0x0200 /****************************************************************************** @@ -158,6 +159,25 @@ u16 acpi_ps_peek_opcode ( struct acpi_parse_state *state); +acpi_status +acpi_ps_complete_this_op ( + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); + +acpi_status +acpi_ps_next_parse_state ( + struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + acpi_status callback_status); + + +/* + * psloop - main parse loop + */ +acpi_status +acpi_ps_parse_loop ( + struct acpi_walk_state *walk_state); + /* * psscope - Scope stack management routines @@ -291,12 +311,6 @@ acpi_ps_set_name( union acpi_parse_object *op, u32 name); -#ifdef ACPI_ENABLE_OBJECT_CACHE -void -acpi_ps_delete_parse_cache ( - void); -#endif - /* * psdump - display parser tree diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ea489f23521..819a53f83cf 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -139,15 +139,14 @@ void acpi_os_delete_lock ( acpi_handle handle); -void +unsigned long acpi_os_acquire_lock ( - acpi_handle handle, - u32 flags); + acpi_handle handle); void acpi_os_release_lock ( acpi_handle handle, - u32 flags); + unsigned long flags); /* @@ -180,6 +179,34 @@ acpi_os_get_physical_address ( #endif + +/* + * Memory/Object Cache + */ +acpi_status +acpi_os_create_cache ( + char *cache_name, + u16 object_size, + u16 max_depth, + acpi_cache_t **return_cache); + +acpi_status +acpi_os_delete_cache ( + acpi_cache_t *cache); + +acpi_status +acpi_os_purge_cache ( + acpi_cache_t *cache); + +void * +acpi_os_acquire_object ( + acpi_cache_t *cache); + +acpi_status +acpi_os_release_object ( + acpi_cache_t *cache, + void *object); + /* * Interrupt handlers */ diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index 4e926457bd2..a2025a8da00 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -162,6 +162,9 @@ struct acpi_walk_info #define ACPI_DISPLAY_SUMMARY 0 #define ACPI_DISPLAY_OBJECTS 1 +#define ACPI_DISPLAY_MASK 1 + +#define ACPI_DISPLAY_SHORT 2 struct acpi_get_devices_info { diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 3a451dc48ac..8cd774a20c6 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -243,6 +243,11 @@ struct acpi_pointer #define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER #define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER +/* Types for the OS interface layer (OSL) */ + +#ifdef ACPI_USE_LOCAL_CACHE +#define acpi_cache_t struct acpi_memory_list +#endif /* * Useful defines diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 192d0bea388..e9c1584dd78 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -557,16 +557,6 @@ void acpi_ut_delete_generic_state ( union acpi_generic_state *state); -#ifdef ACPI_ENABLE_OBJECT_CACHE -void -acpi_ut_delete_generic_state_cache ( - void); - -void -acpi_ut_delete_object_cache ( - void); -#endif - /* * utmath @@ -622,22 +612,6 @@ acpi_ut_strtoul64 ( #define ACPI_ANY_BASE 0 -acpi_status -acpi_ut_mutex_initialize ( - void); - -void -acpi_ut_mutex_terminate ( - void); - -acpi_status -acpi_ut_acquire_mutex ( - acpi_mutex_handle mutex_id); - -acpi_status -acpi_ut_release_mutex ( - acpi_mutex_handle mutex_id); - u8 * acpi_ut_get_resource_end_tag ( union acpi_operand_object *obj_desc); @@ -666,22 +640,35 @@ acpi_ut_display_init_pathname ( /* - * utalloc - memory allocation and object caching + * utmutex - mutex support */ -void * -acpi_ut_acquire_from_cache ( - u32 list_id); +acpi_status +acpi_ut_mutex_initialize ( + void); void -acpi_ut_release_to_cache ( - u32 list_id, - void *object); +acpi_ut_mutex_terminate ( + void); -#ifdef ACPI_ENABLE_OBJECT_CACHE -void -acpi_ut_delete_generic_cache ( - u32 list_id); -#endif +acpi_status +acpi_ut_acquire_mutex ( + acpi_mutex_handle mutex_id); + +acpi_status +acpi_ut_release_mutex ( + acpi_mutex_handle mutex_id); + + +/* + * utalloc - memory allocation and object caching + */ +acpi_status +acpi_ut_create_caches ( + void); + +acpi_status +acpi_ut_delete_caches ( + void); acpi_status acpi_ut_validate_buffer ( diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 55e97ed2919..50a08890119 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h @@ -69,7 +69,7 @@ #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f #define AML_NAME_CHAR_SUBSEQ (u16) 0x30 #define AML_NAME_CHAR_FIRST (u16) 0x41 -#define AML_OP_PREFIX (u16) 0x5b +#define AML_EXTENDED_OP_PREFIX (u16) 0x5b #define AML_ROOT_PREFIX (u16) 0x5c #define AML_PARENT_PREFIX (u16) 0x5e #define AML_LOCAL_OP (u16) 0x60 @@ -146,7 +146,7 @@ /* prefixed opcodes */ -#define AML_EXTOP (u16) 0x005b /* prefix for 2-byte opcodes */ +#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ #define AML_MUTEX_OP (u16) 0x5b01 #define AML_EVENT_OP (u16) 0x5b02 diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index adf969efa51..aa63202e8d5 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -49,35 +49,38 @@ * Configuration for ACPI tools and utilities */ -#ifdef _ACPI_DUMP_APP +#ifdef ACPI_LIBRARY +#define ACPI_USE_LOCAL_CACHE +#endif + +#ifdef ACPI_DUMP_APP #ifndef MSDOS #define ACPI_DEBUG_OUTPUT #endif #define ACPI_APPLICATION #define ACPI_DISASSEMBLER #define ACPI_NO_METHOD_EXECUTION -#define ACPI_USE_SYSTEM_CLIBRARY -#define ACPI_ENABLE_OBJECT_CACHE #endif -#ifdef _ACPI_EXEC_APP +#ifdef ACPI_EXEC_APP #undef DEBUGGER_THREADING #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #define ACPI_DEBUG_OUTPUT #define ACPI_APPLICATION #define ACPI_DEBUGGER #define ACPI_DISASSEMBLER -#define ACPI_USE_SYSTEM_CLIBRARY -#define ACPI_ENABLE_OBJECT_CACHE #endif -#ifdef _ACPI_ASL_COMPILER +#ifdef ACPI_ASL_COMPILER #define ACPI_DEBUG_OUTPUT #define ACPI_APPLICATION #define ACPI_DISASSEMBLER #define ACPI_CONSTANT_EVAL_ONLY +#endif + +#ifdef ACPI_APPLICATION #define ACPI_USE_SYSTEM_CLIBRARY -#define ACPI_ENABLE_OBJECT_CACHE +#define ACPI_USE_LOCAL_CACHE #endif /* diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index a3de0db8569..4fbc0fd52a2 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -62,6 +62,17 @@ #define ACPI_MACHINE_WIDTH BITS_PER_LONG +/* Type(s) for the OSL */ + +#ifdef ACPI_USE_LOCAL_CACHE +#define acpi_cache_t struct acpi_memory_list +#else +#include +#define acpi_cache_t kmem_cache_t +#endif + + + #else /* !__KERNEL__ */ #include -- cgit v1.2.3 From f9f4601f331aa1226d7a798a01950efbb388f07f Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 8 Jul 2005 00:00:00 -0400 Subject: ACPICA 20050708 from Bob Moore The use of the CPU stack in the debug version of the subsystem has been considerably reduced. Previously, a debug structure was declared in every function that used the debug macros. This structure has been removed in favor of declaring the individual elements as parameters to the debug functions. This reduces the cumulative stack use during nested execution of ACPI function calls at the cost of a small increase in the code size of the debug version of the subsystem. With assistance from Alexey Starikovskiy and Len Brown. Added the ACPI_GET_FUNCTION_NAME macro to enable the compiler-dependent headers to define a macro that will return the current function name at runtime (such as __FUNCTION__ or _func_, etc.) The function name is used by the debug trace output. If ACPI_GET_FUNCTION_NAME is not defined in the compiler-dependent header, the function name is saved on the CPU stack (one pointer per function.) This mechanism is used because apparently there exists no standard ANSI-C defined macro that that returns the function name. Alexey Starikovskiy redesigned and reimplemented the "Owner ID" mechanism used to track namespace objects created/deleted by ACPI tables and control method execution. A bitmap is now used to allocate and free the IDs, thus solving the wraparound problem present in the previous implementation. The size of the namespace node descriptor was reduced by 2 bytes as a result. Removed the UINT32_BIT and UINT16_BIT types that were used for the bitfield flag definitions within the headers for the predefined ACPI tables. These have been replaced by UINT8_BIT in order to increase the code portability of the subsystem. If the use of UINT8 remains a problem, we may be forced to eliminate bitfields entirely because of a lack of portability. Alexey Starikovksiy enhanced the performance of acpi_ut_update_object_reference. This is a frequently used function and this improvement increases the performance of the entire subsystem. Alexey Starikovskiy fixed several possible memory leaks and the inverse - premature object deletion. Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdisasm.h | 2 +- include/acpi/acexcep.h | 6 ++- include/acpi/acglobal.h | 3 +- include/acpi/aclocal.h | 57 +++++++++++----------- include/acpi/acmacros.h | 100 ++++++++++++++++++++++---------------- include/acpi/acnamesp.h | 4 +- include/acpi/acobject.h | 2 +- include/acpi/acoutput.h | 2 +- include/acpi/acstruct.h | 11 ++--- include/acpi/actables.h | 4 ++ include/acpi/actbl.h | 58 ++++++++++++---------- include/acpi/actbl1.h | 52 +++++++++++--------- include/acpi/actbl2.h | 109 ++++++++++++++++++++++++------------------ include/acpi/actypes.h | 18 ++++--- include/acpi/acutils.h | 56 +++++++++++++++------- include/acpi/platform/acgcc.h | 8 +++- 17 files changed, 287 insertions(+), 207 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index dd9b70cc963..aa3c08c6da4 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050624 +#define ACPI_CA_VERSION 0x20050708 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index fcc2d507fac..26325430db8 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -211,7 +211,7 @@ acpi_dm_byte_list ( union acpi_parse_object *op); void -acpi_is_eisa_id ( +acpi_dm_is_eisa_id ( union acpi_parse_object *op); void diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 60d737b2d70..0a6f492f3c8 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -95,8 +95,9 @@ #define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL) #define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL) #define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL) +#define AE_OWNER_ID_LIMIT (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001E +#define AE_CODE_ENV_MAX 0x001F /* @@ -226,7 +227,8 @@ char const *acpi_gbl_exception_names_env[] = "AE_LOGICAL_ADDRESS", "AE_ABORT_METHOD", "AE_SAME_HANDLER", - "AE_WAKE_ONLY_GPE" + "AE_WAKE_ONLY_GPE", + "AE_OWNER_ID_LIMIT" }; char const *acpi_gbl_exception_names_pgm[] = diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 8d5a397abd6..e3cf16eadbe 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -218,9 +218,8 @@ ACPI_EXTERN u32 acpi_gbl_original_mode; ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; ACPI_EXTERN u32 acpi_gbl_ps_find_count; +ACPI_EXTERN u32 acpi_gbl_owner_id_mask; ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; -ACPI_EXTERN u16 acpi_gbl_next_table_owner_id; -ACPI_EXTERN u16 acpi_gbl_next_method_owner_id; ACPI_EXTERN u16 acpi_gbl_global_lock_handle; ACPI_EXTERN u8 acpi_gbl_debugger_configuration; ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 58f9ba1a34e..4d2635698e1 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -56,6 +56,13 @@ typedef u32 acpi_mutex_handle; #define AML_NUM_OPCODES 0x7F +/* Forward declarations */ + +struct acpi_walk_state ; +struct acpi_obj_mutex; +union acpi_parse_object ; + + /***************************************************************************** * * Mutex typedefs and structs @@ -116,19 +123,24 @@ static char *acpi_gbl_mutex_names[] = #endif +/* Owner IDs are used to track namespace nodes for selective deletion */ + +typedef u8 acpi_owner_id; +#define ACPI_OWNER_ID_MAX 0xFF + +/* This Thread ID means that the mutex is not in use (unlocked) */ + +#define ACPI_MUTEX_NOT_ACQUIRED (u32) -1 + /* Table for the global mutexes */ struct acpi_mutex_info { acpi_mutex mutex; u32 use_count; - u32 owner_id; + u32 thread_id; }; -/* This owner ID means that the mutex is not in use (unlocked) */ - -#define ACPI_MUTEX_NOT_ACQUIRED (u32) (-1) - /* Lock flag parameter for various interfaces */ @@ -136,13 +148,6 @@ struct acpi_mutex_info #define ACPI_MTX_LOCK 1 -typedef u16 acpi_owner_id; -#define ACPI_OWNER_TYPE_TABLE 0x0 -#define ACPI_OWNER_TYPE_METHOD 0x1 -#define ACPI_FIRST_METHOD_ID 0x0001 -#define ACPI_FIRST_TABLE_ID 0xF000 - - /* Field access granularities */ #define ACPI_FIELD_BYTE_GRANULARITY 1 @@ -185,13 +190,20 @@ struct acpi_namespace_node { u8 descriptor; /* Used to differentiate object descriptor types */ u8 type; /* Type associated with this name */ - u16 owner_id; + u16 reference_count; /* Current count of references and children */ union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ struct acpi_namespace_node *child; /* First child */ struct acpi_namespace_node *peer; /* Next peer*/ - u16 reference_count; /* Current count of references and children */ + u8 owner_id; /* Who created this node */ u8 flags; + + /* Fields used by the ASL compiler only */ + +#ifdef ACPI_ASL_COMPILER + u32 value; + union acpi_parse_object *op; +#endif }; @@ -222,7 +234,7 @@ struct acpi_table_desc u64 physical_address; u32 aml_length; acpi_size length; - acpi_owner_id table_id; + acpi_owner_id owner_id; u8 type; u8 allocation; u8 loaded_into_namespace; @@ -420,13 +432,6 @@ struct acpi_field_info #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 -/* Forward declarations */ - -struct acpi_walk_state ; -struct acpi_obj_mutex; -union acpi_parse_object ; - - #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ u8 data_type; /* To differentiate various internal objs */\ u8 flags; \ @@ -916,14 +921,6 @@ struct acpi_integrity_info * ****************************************************************************/ -struct acpi_debug_print_info -{ - u32 component_id; - char *proc_name; - char *module_name; -}; - - /* Entry for a memory allocation (debug only) */ #define ACPI_MEM_MALLOC 0 diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 09be937d2c3..5b100cef8df 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -437,21 +437,22 @@ #define ACPI_PARAM_LIST(pl) pl /* - * Error reporting. These versions add callers module and line#. Since - * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only - * use it in debug mode. + * Error reporting. These versions add callers module and line#. + * + * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT + * isn't defined, only use it in debug mode. */ #ifdef ACPI_DEBUG_OUTPUT -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ +#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ +#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \ acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ +#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \ acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); +#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e); -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); +#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e); #else @@ -480,36 +481,56 @@ * Debug macros that are conditionally compiled */ #ifdef ACPI_DEBUG_OUTPUT +#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; -#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; +/* + * Common parameters used for debug output functions: + * line number, function name, module(file) name, component ID + */ +#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT /* - * Function entry tracing. - * The first parameter should be the procedure name as a quoted string. This is declared - * as a local string ("_proc_name) so that it can be also used by the function exit macros below. + * Function entry tracing */ -#define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \ - _debug_info.component_id = _COMPONENT; \ - _debug_info.proc_name = a; \ - _debug_info.module_name = _THIS_MODULE; - -#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace(__LINE__,&_debug_info) -#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b) -#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b) -#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b) - -#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() + +/* + * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, + * define it now. This is the case where there the compiler does not support + * a __FUNCTION__ macro or equivalent. We save the function name on the + * local stack. + */ +#ifndef ACPI_GET_FUNCTION_NAME +#define ACPI_GET_FUNCTION_NAME _acpi_function_name +/* + * The Name parameter should be the procedure name as a quoted string. + * This is declared as a local string ("my_function_name") so that it can + * be also used by the function exit macros below. + */ +#define ACPI_FUNCTION_NAME(name) char *_acpi_function_name = name; + +#else +/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ + +#define ACPI_FUNCTION_NAME(name) +#endif + +#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace(ACPI_DEBUG_PARAMETERS) +#define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) +#define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) +#define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ + acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) + +#define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() /* * Function exit tracing. * WARNING: These macros include a return statement. This is usually considered * bad form, but having a separate exit macro is very ugly and difficult to maintain. * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros - * so that "_proc_name" is defined. + * so that "_acpi_function_name" is defined. */ #ifdef ACPI_USE_DO_WHILE_0 #define ACPI_DO_WHILE0(a) do a while(0) @@ -517,10 +538,10 @@ #define ACPI_DO_WHILE0(a) a #endif -#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;}) -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));}) -#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));}) -#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));}) +#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) +#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) +#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) +#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) /* Conditional execution */ @@ -535,7 +556,7 @@ /* Stack and buffer dumping */ #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) +#define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) @@ -572,7 +593,7 @@ * leaving no executable debug code! */ #define ACPI_MODULE_NAME(name) -#define _THIS_MODULE "" +#define _acpi_module_name "" #define ACPI_DEBUG_EXEC(a) #define ACPI_NORMAL_EXEC(a) a; @@ -648,19 +669,18 @@ /* Memory allocation */ -#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) #define ACPI_MEM_FREE(a) acpi_os_free(a) #define ACPI_MEM_TRACKING(a) - #else /* Memory allocation */ -#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) -#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) +#define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) +#define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) #define ACPI_MEM_TRACKING(a) a #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index d1b3ce80056..870e2544bd9 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -163,7 +163,7 @@ acpi_ns_delete_namespace_subtree ( void acpi_ns_delete_namespace_by_owner ( - u16 table_id); + acpi_owner_id owner_id); void acpi_ns_detach_object ( @@ -219,7 +219,7 @@ acpi_ns_dump_objects ( acpi_object_type type, u8 display_type, u32 max_depth, - u32 ownder_id, + acpi_owner_id owner_id, acpi_handle start_handle); #endif /* ACPI_FUTURE_USAGE */ diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index e079b94e4fc..34f9d1f1f79 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -199,7 +199,7 @@ struct acpi_object_method ACPI_INTERNAL_METHOD implementation; u8 concurrency; u8 thread_count; - acpi_owner_id owning_id; + acpi_owner_id owner_id; }; diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 2fbe180fee6..d7e828cb84b 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -136,7 +136,7 @@ /* * Debug level macros that are used in the DEBUG_PRINT macros */ -#define ACPI_DEBUG_LEVEL(dl) (u32) dl,__LINE__,&_debug_info +#define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS /* Exception level -- used in the global "debug_level" */ diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index a2025a8da00..f375c17ad0b 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -71,7 +71,6 @@ struct acpi_walk_state u8 walk_type; acpi_owner_id owner_id; /* Owner of objects created during the walk */ u8 last_predicate; /* Result of last predicate */ - u8 reserved; /* For alignment */ u8 current_result; /* */ u8 next_op_info; /* Info about next_op */ u8 num_operands; /* Stack pointer for Operands[] array */ @@ -154,17 +153,17 @@ struct acpi_device_walk_info struct acpi_walk_info { u32 debug_level; - u32 owner_id; + acpi_owner_id owner_id; u8 display_type; }; /* Display Types */ -#define ACPI_DISPLAY_SUMMARY 0 -#define ACPI_DISPLAY_OBJECTS 1 -#define ACPI_DISPLAY_MASK 1 +#define ACPI_DISPLAY_SUMMARY (u8) 0 +#define ACPI_DISPLAY_OBJECTS (u8) 1 +#define ACPI_DISPLAY_MASK (u8) 1 -#define ACPI_DISPLAY_SHORT 2 +#define ACPI_DISPLAY_SHORT (u8) 2 struct acpi_get_devices_info { diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 39df92e21a0..97e6f12da52 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h @@ -169,6 +169,10 @@ acpi_status acpi_tb_get_table_rsdt ( void); +acpi_status +acpi_tb_validate_rsdp ( + struct rsdp_descriptor *rsdp); + /* * tbutils - common table utilities diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index b5cdcca444c..c1e9110c366 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -86,15 +86,15 @@ */ struct rsdp_descriptor /* Root System Descriptor Pointer */ { - char signature [8]; /* ACPI signature, contains "RSD PTR " */ - u8 checksum; /* To make sum of struct == 0 */ - char oem_id [6]; /* OEM identification */ - u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */ - u32 rsdt_physical_address; /* 32-bit physical address of RSDT */ - u32 length; /* XSDT Length in bytes including hdr */ - u64 xsdt_physical_address; /* 64-bit physical address of XSDT */ - u8 extended_checksum; /* Checksum of entire table */ - char reserved [3]; /* Reserved field must be 0 */ + char signature[8]; /* ACPI signature, contains "RSD PTR " */ + u8 checksum; /* ACPI 1.0 checksum */ + char oem_id[6]; /* OEM identification */ + u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ + u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ + u32 length; /* XSDT Length in bytes, including header */ + u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ + u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ + char reserved[3]; /* Reserved, must be zero */ }; @@ -107,15 +107,15 @@ struct acpi_common_facs /* Common FACS for internal use */ #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ - char signature [4]; /* ACPI signature (4 ASCII characters) */\ - u32 length; /* Length of table, in bytes, including header */\ + char signature[4]; /* ASCII table signature */\ + u32 length; /* Length of table in bytes, including this header */\ u8 revision; /* ACPI Specification minor version # */\ u8 checksum; /* To make sum of entire table == 0 */\ - char oem_id [6]; /* OEM identification */\ - char oem_table_id [8]; /* OEM table identification */\ + char oem_id[6]; /* ASCII OEM identification */\ + char oem_table_id[8]; /* ASCII OEM table identification */\ u32 oem_revision; /* OEM revision number */\ - char asl_compiler_id [4]; /* ASL compiler vendor ID */\ - u32 asl_compiler_revision; /* ASL compiler revision number */ + char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ + u32 asl_compiler_revision; /* ASL compiler version */ struct acpi_table_header /* ACPI common table header */ @@ -139,8 +139,12 @@ struct multiple_apic_table { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ u32 local_apic_address; /* Physical address of local APIC */ - u32 PCATcompat : 1; /* A one indicates system also has dual 8259s */ - u32 reserved1 : 31; + + /* Flags (32 bits) */ + + u8 PCATcompat : 1; /* 00: System also has dual 8259s */ + u8 : 7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ }; /* Values for Type in APIC_HEADER_DEF */ @@ -180,16 +184,18 @@ struct apic_header #define TRIGGER_RESERVED 2 #define TRIGGER_LEVEL 3 -/* Common flag definitions */ +/* Common flag definitions (16 bits each) */ #define MPS_INTI_FLAGS \ - u16 polarity : 2; /* Polarity of APIC I/O input signals */\ - u16 trigger_mode : 2; /* Trigger mode of APIC input signals */\ - u16 reserved1 : 12; /* Reserved, must be zero */ + u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ + u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ + u8 : 4; /* 04-07: Reserved, must be zero */\ + u8 reserved1; /* 08-15: Reserved, must be zero */ #define LOCAL_APIC_FLAGS \ - u32 processor_enabled: 1; /* Processor is usable if set */\ - u32 reserved2 : 31; /* Reserved, must be zero */ + u8 processor_enabled: 1; /* 00: Processor is usable if set */\ + u8 : 7; /* 01-07: Reserved, must be zero */\ + u8 reserved2; /* 08-15: Reserved, must be zero */ /* Sub-structures for MADT */ @@ -238,7 +244,7 @@ struct madt_local_apic_nmi struct madt_address_override { APIC_HEADER_DEF - u16 reserved; /* Reserved - must be zero */ + u16 reserved; /* Reserved, must be zero */ u64 address; /* APIC physical address */ }; @@ -246,7 +252,7 @@ struct madt_io_sapic { APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ - u8 reserved; /* Reserved - must be zero */ + u8 reserved; /* Reserved, must be zero */ u32 interrupt_base; /* Glocal interrupt for SAPIC start */ u64 address; /* SAPIC physical address */ }; @@ -257,7 +263,7 @@ struct madt_local_sapic u8 processor_id; /* ACPI processor id */ u8 local_sapic_id; /* SAPIC ID */ u8 local_sapic_eid; /* SAPIC EID */ - u8 reserved [3]; /* Reserved - must be zero */ + u8 reserved[3]; /* Reserved, must be zero */ LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 33de5f4d2cc..93c175a4f44 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -52,8 +52,7 @@ struct rsdt_descriptor_rev1 { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 table_offset_entry [1]; /* Array of pointers to other */ - /* ACPI tables */ + u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; @@ -62,14 +61,19 @@ struct rsdt_descriptor_rev1 */ struct facs_descriptor_rev1 { - char signature[4]; /* ACPI Signature */ - u32 length; /* Length of structure, in bytes */ + char signature[4]; /* ASCII table signature */ + u32 length; /* Length of structure in bytes */ u32 hardware_signature; /* Hardware configuration signature */ u32 firmware_waking_vector; /* ACPI OS waking vector */ u32 global_lock; /* Global Lock */ - u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* Must be 0 */ - u8 resverved3 [40]; /* Reserved - must be zero */ + + /* Flags (32 bits) */ + + u8 S4bios_f : 1; /* 00: S4BIOS support is present */ + u8 : 7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ + + u8 reserved2[40]; /* Reserved, must be zero */ }; @@ -82,13 +86,13 @@ struct fadt_descriptor_rev1 u32 firmware_ctrl; /* Physical address of FACS */ u32 dsdt; /* Physical address of DSDT */ u8 model; /* System Interrupt Model */ - u8 reserved1; /* Reserved */ + u8 reserved1; /* Reserved, must be zero */ u16 sci_int; /* System vector of SCI interrupt */ u32 smi_cmd; /* Port address of SMI command port */ u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* Reserved - must be zero */ + u8 reserved2; /* Reserved, must be zero */ u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ @@ -104,7 +108,7 @@ struct fadt_descriptor_rev1 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ - u8 reserved3; /* Reserved */ + u8 reserved3; /* Reserved, must be zero */ u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ u16 flush_size; /* Size of area read to flush caches */ @@ -114,19 +118,21 @@ struct fadt_descriptor_rev1 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ u8 century; /* Index to century in RTC CMOS RAM */ - u8 reserved4; /* Reserved */ - u8 reserved4a; /* Reserved */ - u8 reserved4b; /* Reserved */ - u32 wb_invd : 1; /* The wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* All processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* The tmr_val width is 32 bits (0 = 24 bits) */ - u32 reserved5 : 23; /* Reserved - must be zero */ + u8 reserved4[3]; /* Reserved, must be zero */ + + /* Flags (32 bits) */ + + u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ + u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ + u8 proc_c1 : 1; /* 02: All processors support C1 state */ + u8 plvl2_up : 1; /* 03: C2 state works on MP system */ + u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ + u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ + u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ + u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ + u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ + u8 : 7; /* 09-15: Reserved, must be zero */ + u8 reserved5[2]; /* 16-31: Reserved, must be zero */ }; #pragma pack() diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index e1729c967e0..84ce5abbd6f 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -73,8 +73,7 @@ struct rsdt_descriptor_rev2 { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 table_offset_entry [1]; /* Array of pointers to */ - /* ACPI table headers */ + u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; @@ -84,8 +83,7 @@ struct rsdt_descriptor_rev2 struct xsdt_descriptor_rev2 { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u64 table_offset_entry [1]; /* Array of pointers to */ - /* ACPI table headers */ + u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; @@ -94,16 +92,21 @@ struct xsdt_descriptor_rev2 */ struct facs_descriptor_rev2 { - char signature[4]; /* ACPI signature */ + char signature[4]; /* ASCII table signature */ u32 length; /* Length of structure, in bytes */ u32 hardware_signature; /* Hardware configuration signature */ - u32 firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */ + u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ - u32 S4bios_f : 1; /* S4Bios_f - Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* Must be 0 */ - u64 xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */ + + /* Flags (32 bits) */ + + u8 S4bios_f : 1; /* 00: S4BIOS support is present */ + u8 : 7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ + + u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ u8 version; /* Version of this table */ - u8 reserved3 [31]; /* Reserved - must be zero */ + u8 reserved3[31]; /* Reserved, must be zero */ }; @@ -165,35 +168,37 @@ struct fadt_descriptor_rev2 { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ FADT_REV2_COMMON - u8 reserved2; /* Reserved */ - u32 wb_invd : 1; /* The wbinvd instruction works properly */ - u32 wb_invd_flush : 1; /* The wbinvd flushes but does not invalidate */ - u32 proc_c1 : 1; /* All processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* Indicates tmr_val is 32 bits 0=24-bits */ - u32 dock_cap : 1; /* Supports Docking */ - u32 reset_reg_sup : 1; /* Indicates system supports system reset via the FADT RESET_REG */ - u32 sealed_case : 1; /* Indicates system has no internal expansion capabilities and case is sealed */ - u32 headless : 1; /* Indicates system does not have local video capabilities or local input devices */ - u32 cpu_sw_sleep : 1; /* Indicates to OSPM that a processor native instruction */ - /* must be executed after writing the SLP_TYPx register */ - /* ACPI 3.0 flag bits */ - - u32 pci_exp_wak : 1; /* System supports PCIEXP_WAKE (STS/EN) bits */ - u32 use_platform_clock : 1; /* OSPM should use platform-provided timer */ - u32 S4rtc_sts_valid : 1; /* Contents of RTC_STS valid after S4 wake */ - u32 remote_power_on_capable : 1; /* System is compatible with remote power on */ - u32 force_apic_cluster_model : 1; /* All local APICs must use cluster model */ - u32 force_apic_physical_destination_mode : 1; /* all local x_aPICs must use physical dest mode */ - u32 reserved6 : 12;/* Reserved - must be zero */ + u8 reserved2; /* Reserved, must be zero */ + + /* Flags (32 bits) */ + + u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ + u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ + u8 proc_c1 : 1; /* 02: All processors support C1 state */ + u8 plvl2_up : 1; /* 03: C2 state works on MP system */ + u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ + u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ + u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ + u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ + u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */ + u8 dock_cap : 1; /* 09: Docking supported */ + u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */ + u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */ + u8 headless : 1; /* 12: No local video capabilities or local input devices */ + u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */ + + u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ + u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ + u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ + u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */ + u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ + u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ + u8 : 4; /* 20-23: Reserved, must be zero */ + u8 reserved3; /* 24-31: Reserved, must be zero */ struct acpi_generic_address reset_register; /* Reset register address in GAS format */ u8 reset_value; /* Value to write to the reset_register port to reset the system */ - u8 reserved7[3]; /* These three bytes must be zero */ + u8 reserved4[3]; /* These three bytes must be zero */ u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ u64 Xdsdt; /* 64-bit physical address of DSDT */ struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ @@ -213,11 +218,11 @@ struct fadt_descriptor_rev2_minus { ACPI_TABLE_HEADER_DEF /* ACPI common table header */ FADT_REV2_COMMON - u8 reserved2; /* Reserved */ + u8 reserved2; /* Reserved, must be zero */ u32 flags; struct acpi_generic_address reset_register; /* Reset register address in GAS format */ u8 reset_value; /* Value to write to the reset_register port to reset the system. */ - u8 reserved7[3]; /* These three bytes must be zero */ + u8 reserved7[3]; /* Reserved, must be zero */ }; @@ -242,11 +247,16 @@ struct static_resource_alloc u8 length; u8 proximity_domain_lo; u8 apic_id; - u32 enabled :1; - u32 reserved3 :31; + + /* Flags (32 bits) */ + + u8 enabled :1; /* 00: Use affinity structure */ + u8 :7; /* 01-07: Reserved, must be zero */ + u8 reserved3[3]; /* 08-31: Reserved, must be zero */ + u8 local_sapic_eid; u8 proximity_domain_hi[3]; - u32 reserved4; + u32 reserved4; /* Reserved, must be zero */ }; struct memory_affinity @@ -258,18 +268,23 @@ struct memory_affinity u64 base_address; u64 address_length; u32 reserved4; - u32 enabled :1; - u32 hot_pluggable :1; - u32 non_volatile :1; - u32 reserved5 :29; - u64 reserved6; + + /* Flags (32 bits) */ + + u8 enabled :1; /* 00: Use affinity structure */ + u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */ + u8 non_volatile :1; /* 02: Memory is non-volatile */ + u8 :5; /* 03-07: Reserved, must be zero */ + u8 reserved5[3]; /* 08-31: Reserved, must be zero */ + + u64 reserved6; /* Reserved, must be zero */ }; struct system_resource_affinity { ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ - u64 reserved2; + u64 reserved2; /* Reserved, must be zero */ }; diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 8cd774a20c6..1895b862ce0 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -205,10 +205,11 @@ typedef u32 acpi_size; /* - * Miscellaneous common types + * This type is used for bitfields in ACPI tables. The only type that is + * even remotely portable is u8. Anything else is not portable, so + * do not add any more bitfield types. */ -typedef u16 UINT16_BIT; -typedef u32 UINT32_BIT; +typedef u8 UINT8_BIT; typedef acpi_native_uint ACPI_PTRDIFF; /* @@ -243,10 +244,13 @@ struct acpi_pointer #define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER #define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER -/* Types for the OS interface layer (OSL) */ - -#ifdef ACPI_USE_LOCAL_CACHE -#define acpi_cache_t struct acpi_memory_list +/* + * If acpi_cache_t was not defined in the OS-dependent header, + * define it now. This is typically the case where the local cache + * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) + */ +#ifndef acpi_cache_t +#define acpi_cache_t struct acpi_memory_list #endif /* diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index e9c1584dd78..9c05c10e379 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -120,10 +120,6 @@ u8 acpi_ut_valid_object_type ( acpi_object_type type); -acpi_owner_id -acpi_ut_allocate_owner_id ( - u32 id_type); - /* * utinit - miscellaneous initialization and shutdown @@ -306,47 +302,63 @@ acpi_ut_track_stack_ptr ( void acpi_ut_trace ( u32 line_number, - struct acpi_debug_print_info *dbg_info); + char *function_name, + char *module_name, + u32 component_id); void acpi_ut_trace_ptr ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, void *pointer); void acpi_ut_trace_u32 ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, u32 integer); void acpi_ut_trace_str ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, char *string); void acpi_ut_exit ( u32 line_number, - struct acpi_debug_print_info *dbg_info); + char *function_name, + char *module_name, + u32 component_id); void acpi_ut_status_exit ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, acpi_status status); void acpi_ut_value_exit ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, acpi_integer value); void acpi_ut_ptr_exit ( u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, u8 *ptr); void @@ -378,7 +390,9 @@ void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print ( u32 requested_debug_level, u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; @@ -386,7 +400,9 @@ void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print_raw ( u32 requested_debug_level, u32 line_number, - struct acpi_debug_print_info *dbg_info, + char *function_name, + char *module_name, + u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; @@ -477,8 +493,8 @@ acpi_ut_allocate_object_desc_dbg ( u32 line_number, u32 component_id); -#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t) -#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT) +#define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) +#define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) void acpi_ut_delete_object_desc ( @@ -579,6 +595,14 @@ acpi_ut_short_divide ( * utmisc */ acpi_status +acpi_ut_allocate_owner_id ( + acpi_owner_id *owner_id); + +acpi_status +acpi_ut_release_owner_id ( + acpi_owner_id owner_id); + +acpi_status acpi_ut_walk_package_tree ( union acpi_operand_object *source_object, void *target_object, diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 91fda36b042..39264127574 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -44,13 +44,17 @@ #ifndef __ACGCC_H__ #define __ACGCC_H__ +/* Function name is used for debug output. Non-ANSI, compiler-dependent */ + +#define ACPI_GET_FUNCTION_NAME __FUNCTION__ + /* This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. */ -#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 4, 5))) +#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7))) /* Some compilers complain about unused variables. Sometimes we don't want to - * use all the variables (most specifically for _THIS_MODULE). This allow us + * 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 * is unused. */ -- cgit v1.2.3 From 6d30e3a8995c9fa9e8471bb1dff8e070638df5ea Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 14 Jul 2005 20:15:44 +0000 Subject: kbuild: Avoid inconsistent kallsyms data Several reports on inconsistent kallsyms data has been caused by the aliased symbols __sched_text_start and __down to shift places in the output of nm. The root cause was that on second pass ld aligned __sched_text_start to a 4 byte boundary which is the function alignment on i386. sched.text and spinlock.text is now aligned to an 8 byte boundary to make sure they are aligned to a function alignemnt on most (all?) archs. Tested by: Paulo Marques Tested by: Alexander Stohr Signed-off-by: Sam Ravnborg --- include/asm-generic/vmlinux.lds.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b3bb326ae5b..3fa94288aa9 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -6,6 +6,9 @@ #define VMLINUX_SYMBOL(_sym_) _sym_ #endif +/* Align . to a 8 byte boundary equals to maximum function alignment. */ +#define ALIGN_FUNCTION() . = ALIGN(8) + #define RODATA \ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ *(.rodata) *(.rodata.*) \ @@ -79,12 +82,18 @@ VMLINUX_SYMBOL(__security_initcall_end) = .; \ } +/* sched.text is aling to function alignment to secure we have same + * address even at second ld pass when generating System.map */ #define SCHED_TEXT \ + ALIGN_FUNCTION(); \ VMLINUX_SYMBOL(__sched_text_start) = .; \ *(.sched.text) \ VMLINUX_SYMBOL(__sched_text_end) = .; +/* spinlock.text is aling to function alignment to secure we have same + * address even at second ld pass when generating System.map */ #define LOCK_TEXT \ + ALIGN_FUNCTION(); \ VMLINUX_SYMBOL(__lock_text_start) = .; \ *(.spinlock.text) \ VMLINUX_SYMBOL(__lock_text_end) = .; -- cgit v1.2.3 From 5d75ab45594c78d2d976a3248ea1ca281c9d7056 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 29 Jul 2005 00:03:55 -0400 Subject: [ACPI] handle const char * __FUNCTION__ in debug code build warning: discards qualifiers from pointer target type when mixing "const char *" and "char *" We should probably update the routines to expect const, but easier for now to shut up the warning with 1 cast. Signed-off-by: Len Brown --- include/acpi/platform/acgcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 39264127574..e410e3b6141 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -46,7 +46,7 @@ /* Function name is used for debug output. Non-ANSI, compiler-dependent */ -#define ACPI_GET_FUNCTION_NAME __FUNCTION__ +#define ACPI_GET_FUNCTION_NAME (char *) __FUNCTION__ /* This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. -- cgit v1.2.3 From 0c9938cc75057c0fca1af55a55dcfc2842436695 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 29 Jul 2005 15:15:00 -0700 Subject: [ACPI] ACPICA 20050729 from Bob Moore Implemented support to ignore an attempt to install/load a particular ACPI table more than once. Apparently there exists BIOS code that repeatedly attempts to load the same SSDT upon certain events. Thanks to Venkatesh Pallipadi. Restructured the main interface to the AML parser in order to correctly handle all exceptional conditions. This will prevent leakage of the OwnerId resource and should eliminate the AE_OWNER_ID_LIMIT exceptions seen on some machines. Thanks to Alexey Starikovskiy. Support for "module level code" has been disabled in this version due to a number of issues that have appeared on various machines. The support can be enabled by defining ACPI_ENABLE_MODULE_LEVEL_CODE during subsystem compilation. When the issues are fully resolved, the code will be enabled by default again. Modified the internal functions for debug print support to define the FunctionName parameter as a (const char *) for compatibility with compiler built-in macros such as __FUNCTION__, etc. Linted the entire ACPICA source tree for both 32-bit and 64-bit. Signed-off-by: Robert Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdispat.h | 4 ++-- include/acpi/acmacros.h | 4 +++- include/acpi/acnames.h | 5 +++++ include/acpi/acnamesp.h | 2 +- include/acpi/acparser.h | 7 +------ include/acpi/acstruct.h | 3 +++ include/acpi/actables.h | 6 +++++- include/acpi/acutils.h | 26 +++++++++++++------------- include/acpi/platform/acenv.h | 18 +++++++++--------- include/acpi/platform/acgcc.h | 2 +- 11 files changed, 44 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index aa3c08c6da4..d62af729392 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050708 +#define ACPI_CA_VERSION 0x20050729 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index fde6aa9fcd0..90b7d30bd25 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -236,7 +236,7 @@ acpi_ds_method_data_init ( */ acpi_status acpi_ds_parse_method ( - acpi_handle obj_handle); + struct acpi_namespace_node *node); acpi_status acpi_ds_call_control_method ( @@ -391,7 +391,7 @@ acpi_ds_init_aml_walk ( u8 *aml_start, u32 aml_length, struct acpi_parameter_info *info, - u32 pass_number); + u8 pass_number); acpi_status acpi_ds_obj_stack_pop_and_delete ( diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 5b100cef8df..fcdef0a4b01 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -505,8 +505,10 @@ * The Name parameter should be the procedure name as a quoted string. * This is declared as a local string ("my_function_name") so that it can * be also used by the function exit macros below. + * Note: (const char) is used to be compatible with the debug interfaces + * and macros such as __FUNCTION__. */ -#define ACPI_FUNCTION_NAME(name) char *_acpi_function_name = name; +#define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; #else /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index deb7cb06f5f..280e9ed7667 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -78,6 +78,11 @@ #define ACPI_NS_ROOT_PATH "\\" #define ACPI_NS_SYSTEM_BUS "_SB_" +/*! [Begin] no source code translation (not handled by acpisrc) */ +#define ACPI_FUNCTION_PREFIX1 'ipcA' +#define ACPI_FUNCTION_PREFIX2 'ipca' +/*! [End] no source code translation !*/ + #endif /* __ACNAMES_H__ */ diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index 870e2544bd9..0c9ba707925 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -124,7 +124,7 @@ acpi_ns_parse_table ( acpi_status acpi_ns_one_complete_parse ( - u32 pass_number, + u8 pass_number, struct acpi_table_desc *table_desc); diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index ba9548f94de..f692ad56cd8 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h @@ -77,12 +77,7 @@ * psxface - Parser external interfaces */ acpi_status -acpi_psx_load_table ( - u8 *pcode_addr, - u32 pcode_length); - -acpi_status -acpi_psx_execute ( +acpi_ps_execute_method ( struct acpi_parameter_info *info); diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index f375c17ad0b..27b22bb3d22 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -153,6 +153,7 @@ struct acpi_device_walk_info struct acpi_walk_info { u32 debug_level; + u32 count; acpi_owner_id owner_id; u8 display_type; }; @@ -209,8 +210,10 @@ union acpi_aml_operands struct acpi_parameter_info { struct acpi_namespace_node *node; + union acpi_operand_object *obj_desc; union acpi_operand_object **parameters; union acpi_operand_object *return_object; + u8 pass_number; u8 parameter_type; u8 return_object_type; }; diff --git a/include/acpi/actables.h b/include/acpi/actables.h index 97e6f12da52..e6ceb181964 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h @@ -178,11 +178,15 @@ acpi_tb_validate_rsdp ( * tbutils - common table utilities */ acpi_status +acpi_tb_is_table_installed ( + struct acpi_table_desc *new_table_desc); + +acpi_status acpi_tb_verify_table_checksum ( struct acpi_table_header *table_header); u8 -acpi_tb_checksum ( +acpi_tb_generate_checksum ( void *buffer, u32 length); diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 9c05c10e379..0e7b0a3e3b5 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -302,14 +302,14 @@ acpi_ut_track_stack_ptr ( void acpi_ut_trace ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id); void acpi_ut_trace_ptr ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, void *pointer); @@ -317,7 +317,7 @@ acpi_ut_trace_ptr ( void acpi_ut_trace_u32 ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, u32 integer); @@ -325,7 +325,7 @@ acpi_ut_trace_u32 ( void acpi_ut_trace_str ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, char *string); @@ -333,14 +333,14 @@ acpi_ut_trace_str ( void acpi_ut_exit ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id); void acpi_ut_status_exit ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, acpi_status status); @@ -348,7 +348,7 @@ acpi_ut_status_exit ( void acpi_ut_value_exit ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, acpi_integer value); @@ -356,7 +356,7 @@ acpi_ut_value_exit ( void acpi_ut_ptr_exit ( u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, u8 *ptr); @@ -390,7 +390,7 @@ void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print ( u32 requested_debug_level, u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, char *format, @@ -400,7 +400,7 @@ void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print_raw ( u32 requested_debug_level, u32 line_number, - char *function_name, + const char *function_name, char *module_name, u32 component_id, char *format, @@ -598,9 +598,9 @@ acpi_status acpi_ut_allocate_owner_id ( acpi_owner_id *owner_id); -acpi_status +void acpi_ut_release_owner_id ( - acpi_owner_id owner_id); + acpi_owner_id *owner_id); acpi_status acpi_ut_walk_package_tree ( @@ -609,7 +609,7 @@ acpi_ut_walk_package_tree ( acpi_pkg_callback walk_callback, void *context); -char * +void acpi_ut_strupr ( char *src_string); diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index aa63202e8d5..bae1fbed097 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -241,15 +241,15 @@ #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) -#define ACPI_TOUPPER toupper -#define ACPI_TOLOWER tolower -#define ACPI_IS_XDIGIT isxdigit -#define ACPI_IS_DIGIT isdigit -#define ACPI_IS_SPACE isspace -#define ACPI_IS_UPPER isupper -#define ACPI_IS_PRINT isprint -#define ACPI_IS_ALPHA isalpha -#define ACPI_IS_ASCII isascii +#define ACPI_TOUPPER(i) toupper((int) (i)) +#define ACPI_TOLOWER(i) tolower((int) (i)) +#define ACPI_IS_XDIGIT(i) isxdigit((int) (i)) +#define ACPI_IS_DIGIT(i) isdigit((int) (i)) +#define ACPI_IS_SPACE(i) isspace((int) (i)) +#define ACPI_IS_UPPER(i) isupper((int) (i)) +#define ACPI_IS_PRINT(i) isprint((int) (i)) +#define ACPI_IS_ALPHA(i) isalpha((int) (i)) +#define ACPI_IS_ASCII(i) isascii((int) (i)) #else diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index e410e3b6141..39264127574 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -46,7 +46,7 @@ /* Function name is used for debug output. Non-ANSI, compiler-dependent */ -#define ACPI_GET_FUNCTION_NAME (char *) __FUNCTION__ +#define ACPI_GET_FUNCTION_NAME __FUNCTION__ /* This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. -- cgit v1.2.3 From d3301874083874f8a0ac88aa1bb7da6b62df34d2 Mon Sep 17 00:00:00 2001 From: Mike Anderson Date: Thu, 16 Jun 2005 11:12:38 -0700 Subject: [SCSI] host state model update: replace old host bitmap state Migrate the current SCSI host state model to a model like SCSI device is using. Signed-off-by: Mike Anderson Rejections fixed up and Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 81d5234f677..0b1e275b269 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -429,12 +429,15 @@ struct scsi_host_template { }; /* - * shost states + * shost state: If you alter this, you also need to alter scsi_sysfs.c + * (for the ascii descriptions) and the state model enforcer: + * scsi_host_set_state() */ -enum { - SHOST_ADD, - SHOST_DEL, +enum scsi_host_state { + SHOST_CREATED = 1, + SHOST_RUNNING, SHOST_CANCEL, + SHOST_DEL, SHOST_RECOVERY, }; @@ -575,7 +578,7 @@ struct Scsi_Host { unsigned int irq; - unsigned long shost_state; + enum scsi_host_state shost_state; /* ldm bits */ struct device shost_gendev; @@ -633,6 +636,7 @@ extern void scsi_remove_host(struct Scsi_Host *); extern struct Scsi_Host *scsi_host_get(struct Scsi_Host *); extern void scsi_host_put(struct Scsi_Host *t); extern struct Scsi_Host *scsi_host_lookup(unsigned short); +extern const char *scsi_host_state_name(enum scsi_host_state); extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); -- cgit v1.2.3 From 82f29467a025f6a2192d281e97fca0be46e905cc Mon Sep 17 00:00:00 2001 From: Mike Anderson Date: Thu, 16 Jun 2005 11:14:33 -0700 Subject: [SCSI] host state model update: mediate host add/remove race Add support to not allow additions to a host when it is being removed. Signed-off-by: Mike Anderson Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 0b1e275b269..1ea5b51d174 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -650,6 +650,15 @@ static inline struct device *scsi_get_device(struct Scsi_Host *shost) return shost->shost_gendev.parent; } +/** + * scsi_host_scan_allowed - Is scanning of this host allowed + * @shost: Pointer to Scsi_Host. + **/ +static inline int scsi_host_scan_allowed(struct Scsi_Host *shost) +{ + return shost->shost_state == SHOST_RUNNING; +} + extern void scsi_unblock_requests(struct Scsi_Host *); extern void scsi_block_requests(struct Scsi_Host *); -- cgit v1.2.3 From 47ba39eead9f4495cd6a3eca39d7c73d0f0d61c9 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sat, 30 Jul 2005 11:39:53 -0500 Subject: [SCSI] add template for scsi_host_set_state() Fixes up some warnings in the tree. Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 1ea5b51d174..ac1b6125e3a 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -676,5 +676,6 @@ extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *); /* legacy interfaces */ extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); extern void scsi_unregister(struct Scsi_Host *); +extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state); #endif /* _SCSI_SCSI_HOST_H */ -- cgit v1.2.3 From d872ebe4549576e7aab60ed7c746193196381dd0 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Wed, 3 Aug 2005 15:43:52 -0500 Subject: [SCSI] add missing hold_mcs parameter to the spi transport class This parameter is important only to people who take the time to tune the margin control settings, otherwise it's completely irrelevant. However, just in case anyone should want to do this, it's appropriate to include the parameter. I don't do anything with it in DV by design, so the parameter will come up as off by default, so if anyone actually wants to play with the margin control settings they'll have to enable it under the spi_transport class first. I also updated the transfer settings display to report all of the PPR settings instead of only DT, IU and QAS Signed-off-by: James Bottomley --- include/scsi/scsi_transport_spi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index a30d6cd4c0e..d8ef86006e0 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h @@ -39,6 +39,7 @@ struct spi_transport_attrs { unsigned int rd_strm:1; /* Read streaming enabled */ unsigned int rti:1; /* Retain Training Information */ unsigned int pcomp_en:1;/* Precompensation enabled */ + unsigned int hold_mcs:1;/* Hold Margin Control Settings */ unsigned int initial_dv:1; /* DV done to this target yet */ unsigned long flags; /* flags field for drivers to use */ /* Device Properties fields */ @@ -78,6 +79,7 @@ struct spi_host_attrs { #define spi_rd_strm(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rd_strm) #define spi_rti(x) (((struct spi_transport_attrs *)&(x)->starget_data)->rti) #define spi_pcomp_en(x) (((struct spi_transport_attrs *)&(x)->starget_data)->pcomp_en) +#define spi_hold_mcs(x) (((struct spi_transport_attrs *)&(x)->starget_data)->hold_mcs) #define spi_initial_dv(x) (((struct spi_transport_attrs *)&(x)->starget_data)->initial_dv) #define spi_support_sync(x) (((struct spi_transport_attrs *)&(x)->starget_data)->support_sync) @@ -114,6 +116,8 @@ struct spi_function_template { void (*set_rti)(struct scsi_target *, int); void (*get_pcomp_en)(struct scsi_target *); void (*set_pcomp_en)(struct scsi_target *, int); + void (*get_hold_mcs)(struct scsi_target *); + void (*set_hold_mcs)(struct scsi_target *, int); void (*get_signalling)(struct Scsi_Host *); void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); /* The driver sets these to tell the transport class it @@ -130,6 +134,7 @@ struct spi_function_template { unsigned long show_rd_strm:1; unsigned long show_rti:1; unsigned long show_pcomp_en:1; + unsigned long show_hold_mcs:1; }; struct scsi_transport_template *spi_attach_transport(struct spi_function_template *); -- cgit v1.2.3 From 1f3a6a15771ed70d3b2581663dcc6b9bc134baa5 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Thu, 28 Jul 2005 14:42:00 -0400 Subject: [ACPI] acpi_register_gsi() can return error Current acpi_register_gsi() function has no way to indicate errors to its callers even though acpi_register_gsi() can fail to register gsi because of some reasons (out of memory, lack of interrupt vectors, incorrect BIOS, and so on). As a result, caller of acpi_register_gsi() cannot handle the case that acpi_register_gsi() fails. I think failure of acpi_register_gsi() should be handled properly. This series of patches changes acpi_register_gsi() to return negative value on error, and also changes callers of acpi_register_gsi() to handle failure of acpi_register_gsi(). This patch changes the type of return value of acpi_register_gsi() from "unsigned int" to "int" to indicate an error. If acpi_register_gsi() fails to register gsi, it returns negative value. Signed-off-by: Kenji Kaneshige Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ca0cd240cee..9378bcde73a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -432,7 +432,7 @@ static inline int acpi_boot_table_init(void) #endif /*!CONFIG_ACPI_BOOT*/ -unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); +int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); /* -- cgit v1.2.3 From 53de49f52e305e96143375d1741f15acff7bf34b Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 30 Jul 2005 04:18:00 -0400 Subject: [ACPI] CONFIG_ACPI=n build fix Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/linux/acpi.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 9378bcde73a..bf96ae9d93a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -420,16 +420,6 @@ extern int sbf_port ; #define acpi_mp_config 0 -static inline int acpi_boot_init(void) -{ - return 0; -} - -static inline int acpi_boot_table_init(void) -{ - return 0; -} - #endif /*!CONFIG_ACPI_BOOT*/ int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); @@ -536,5 +526,17 @@ static inline int acpi_get_pxm(acpi_handle handle) extern int pnpacpi_disabled; +#else /* CONFIG_ACPI */ + +static inline int acpi_boot_init(void) +{ + return 0; +} + +static inline int acpi_boot_table_init(void) +{ + return 0; +} + #endif /* CONFIG_ACPI */ #endif /*_LINUX_ACPI_H*/ -- cgit v1.2.3 From e92310a930462c6e1611f35453f57357c42bde14 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 30 Jul 2005 04:18:00 -0400 Subject: [ACPI] fix IA64 build warning Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/asm-ia64/acpi-ext.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h index 9271d74c64c..56d2ddc97b3 100644 --- a/include/asm-ia64/acpi-ext.h +++ b/include/asm-ia64/acpi-ext.h @@ -11,6 +11,7 @@ #define _ASM_IA64_ACPI_EXT_H #include +#include extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length); -- cgit v1.2.3 From 4be44fcd3bf648b782f4460fd06dfae6c42ded4b Mon Sep 17 00:00:00 2001 From: Len Brown Date: Fri, 5 Aug 2005 00:44:28 -0400 Subject: [ACPI] Lindent all ACPI files Signed-off-by: Len Brown --- include/acpi/acconfig.h | 26 +- include/acpi/acdebug.h | 263 ++++--------- include/acpi/acdisasm.h | 323 ++++++---------- include/acpi/acdispat.h | 398 ++++++++------------ include/acpi/acevents.h | 240 ++++-------- include/acpi/acexcep.h | 28 +- include/acpi/acglobal.h | 262 +++++++------ include/acpi/achware.h | 107 ++---- include/acpi/acinterp.h | 626 +++++++++++-------------------- include/acpi/aclocal.h | 678 ++++++++++++++-------------------- include/acpi/acmacros.h | 43 +-- include/acpi/acnames.h | 11 +- include/acpi/acnamesp.h | 357 ++++++------------ include/acpi/acobject.h | 390 ++++++++------------ include/acpi/acopcode.h | 4 +- include/acpi/acoutput.h | 8 +- include/acpi/acparser.h | 248 ++++--------- include/acpi/acpi.h | 35 +- include/acpi/acpi_bus.h | 332 ++++++++--------- include/acpi/acpi_drivers.h | 38 +- include/acpi/acpiosxf.h | 275 ++++---------- include/acpi/acpixf.h | 408 ++++++-------------- include/acpi/acresrc.h | 309 ++++++---------- include/acpi/acstruct.h | 216 +++++------ include/acpi/actables.h | 127 ++----- include/acpi/actbl.h | 260 ++++++------- include/acpi/actbl1.h | 133 ++++--- include/acpi/actbl2.h | 245 ++++++------ include/acpi/actbl71.h | 148 ++++---- include/acpi/actypes.h | 800 +++++++++++++++++----------------------- include/acpi/acutils.h | 709 +++++++++++------------------------ include/acpi/amlcode.h | 170 ++++----- include/acpi/amlresrc.h | 380 +++++++++---------- include/acpi/container.h | 3 +- include/acpi/pdc_intel.h | 4 +- include/acpi/platform/acenv.h | 33 +- include/acpi/platform/acgcc.h | 2 +- include/acpi/platform/aclinux.h | 8 +- include/acpi/processor.h | 238 ++++++------ 39 files changed, 3353 insertions(+), 5532 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d62af729392..f3810cc5d48 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -44,7 +44,6 @@ #ifndef _ACCONFIG_H #define _ACCONFIG_H - /****************************************************************************** * * Configuration options @@ -78,10 +77,10 @@ /* Maximum objects in the various object caches */ -#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ -#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ -#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ +#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */ +#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ +#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ /* * Should the subystem abort the loading of an ACPI table if the @@ -89,7 +88,6 @@ */ #define ACPI_CHECKSUM_ABORT FALSE - /****************************************************************************** * * Subsystem Constants @@ -103,7 +101,7 @@ /* String size constants */ #define ACPI_MAX_STRING_LENGTH 512 -#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ +#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ /* Maximum count for a semaphore object */ @@ -117,7 +115,6 @@ #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 - /****************************************************************************** * * ACPI Specification constants (Do not change unless the specification changes) @@ -155,15 +152,15 @@ /* Names within the namespace are 4 bytes long */ #define ACPI_NAME_SIZE 4 -#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ +#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ #define ACPI_PATH_SEPARATOR '.' /* Constants used in searching for the RSDP in low memory */ -#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ +#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ #define ACPI_EBDA_PTR_LENGTH 2 #define ACPI_EBDA_WINDOW_SIZE 1024 -#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ +#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */ #define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000 #define ACPI_RSDP_SCAN_STEP 16 @@ -198,18 +195,15 @@ #define ACPI_NUM_OSI_STRINGS 10 - /****************************************************************************** * * ACPI AML Debugger * *****************************************************************************/ -#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ +#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ #define ACPI_DEBUGGER_COMMAND_PROMPT '-' #define ACPI_DEBUGGER_EXECUTE_PROMPT '%' - -#endif /* _ACCONFIG_H */ - +#endif /* _ACCONFIG_H */ diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index f8fa2227583..70ce3b4d006 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -44,22 +44,17 @@ #ifndef __ACDEBUG_H__ #define __ACDEBUG_H__ - #define ACPI_DEBUG_BUFFER_SIZE 4196 -struct command_info -{ - char *name; /* Command Name */ - u8 min_args; /* Minimum arguments required */ +struct command_info { + char *name; /* Command Name */ + u8 min_args; /* Minimum arguments required */ }; - -struct argument_info -{ - char *name; /* Argument Name */ +struct argument_info { + char *name; /* Argument Name */ }; - #define PARAM_LIST(pl) pl #define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ @@ -68,279 +63,155 @@ struct argument_info #define EX_NO_SINGLE_STEP 1 #define EX_SINGLE_STEP 2 - /* * dbxface - external debugger interfaces */ -acpi_status -acpi_db_initialize ( - void); +acpi_status acpi_db_initialize(void); -void -acpi_db_terminate ( - void); +void acpi_db_terminate(void); acpi_status -acpi_db_single_step ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 op_type); - +acpi_db_single_step(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, u32 op_type); /* * dbcmds - debug commands and output routines */ -acpi_status -acpi_db_disassemble_method ( - char *name); - -void -acpi_db_display_table_info ( - char *table_arg); +acpi_status acpi_db_disassemble_method(char *name); -void -acpi_db_unload_acpi_table ( - char *table_arg, - char *instance_arg); +void acpi_db_display_table_info(char *table_arg); -void -acpi_db_set_method_breakpoint ( - char *location, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg); void -acpi_db_set_method_call_breakpoint ( - union acpi_parse_object *op); +acpi_db_set_method_breakpoint(char *location, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); -void -acpi_db_get_bus_info ( - void); +void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op); -void -acpi_db_disassemble_aml ( - char *statements, - union acpi_parse_object *op); +void acpi_db_get_bus_info(void); -void -acpi_db_dump_namespace ( - char *start_arg, - char *depth_arg); +void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op); -void -acpi_db_dump_namespace_by_owner ( - char *owner_arg, - char *depth_arg); +void acpi_db_dump_namespace(char *start_arg, char *depth_arg); -void -acpi_db_send_notify ( - char *name, - u32 value); +void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg); -void -acpi_db_set_method_data ( - char *type_arg, - char *index_arg, - char *value_arg); +void acpi_db_send_notify(char *name, u32 value); -acpi_status -acpi_db_display_objects ( - char *obj_type_arg, - char *display_count_arg); +void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg); acpi_status -acpi_db_find_name_in_namespace ( - char *name_arg); +acpi_db_display_objects(char *obj_type_arg, char *display_count_arg); -void -acpi_db_set_scope ( - char *name); +acpi_status acpi_db_find_name_in_namespace(char *name_arg); -acpi_status -acpi_db_sleep ( - char *object_arg); +void acpi_db_set_scope(char *name); -void -acpi_db_find_references ( - char *object_arg); +acpi_status acpi_db_sleep(char *object_arg); -void -acpi_db_display_locks ( - void); +void acpi_db_find_references(char *object_arg); -void -acpi_db_display_resources ( - char *object_arg); +void acpi_db_display_locks(void); -void -acpi_db_display_gpes ( - void); +void acpi_db_display_resources(char *object_arg); -void -acpi_db_check_integrity ( - void); +void acpi_db_display_gpes(void); -void -acpi_db_generate_gpe ( - char *gpe_arg, - char *block_arg); +void acpi_db_check_integrity(void); +void acpi_db_generate_gpe(char *gpe_arg, char *block_arg); /* * dbdisply - debug display commands */ -void -acpi_db_display_method_info ( - union acpi_parse_object *op); +void acpi_db_display_method_info(union acpi_parse_object *op); -void -acpi_db_decode_and_display_object ( - char *target, - char *output_type); +void acpi_db_decode_and_display_object(char *target, char *output_type); void -acpi_db_display_result_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); +acpi_db_display_result_object(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); -acpi_status -acpi_db_display_all_methods ( - char *display_count_arg); +acpi_status acpi_db_display_all_methods(char *display_count_arg); -void -acpi_db_display_arguments ( - void); +void acpi_db_display_arguments(void); -void -acpi_db_display_locals ( - void); +void acpi_db_display_locals(void); -void -acpi_db_display_results ( - void); +void acpi_db_display_results(void); -void -acpi_db_display_calling_tree ( - void); +void acpi_db_display_calling_tree(void); -void -acpi_db_display_object_type ( - char *object_arg); +void acpi_db_display_object_type(char *object_arg); void -acpi_db_display_argument_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); - +acpi_db_display_argument_object(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); /* * dbexec - debugger control method execution */ -void -acpi_db_execute ( - char *name, - char **args, - u32 flags); +void acpi_db_execute(char *name, char **args, u32 flags); void -acpi_db_create_execution_threads ( - char *num_threads_arg, - char *num_loops_arg, - char *method_name_arg); - +acpi_db_create_execution_threads(char *num_threads_arg, + char *num_loops_arg, char *method_name_arg); /* * dbfileio - Debugger file I/O commands */ acpi_object_type -acpi_db_match_argument ( - char *user_argument, - struct argument_info *arguments); +acpi_db_match_argument(char *user_argument, struct argument_info *arguments); -void -acpi_db_close_debug_file ( - void); +void acpi_db_close_debug_file(void); -void -acpi_db_open_debug_file ( - char *name); +void acpi_db_open_debug_file(char *name); -acpi_status -acpi_db_load_acpi_table ( - char *filename); +acpi_status acpi_db_load_acpi_table(char *filename); acpi_status -acpi_db_get_table_from_file ( - char *filename, - struct acpi_table_header **table); +acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table); acpi_status -acpi_db_read_table_from_file ( - char *filename, - struct acpi_table_header **table); - +acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table); /* * dbhistry - debugger HISTORY command */ -void -acpi_db_add_to_history ( - char *command_line); +void acpi_db_add_to_history(char *command_line); -void -acpi_db_display_history ( - void); - -char * -acpi_db_get_from_history ( - char *command_num_arg); +void acpi_db_display_history(void); +char *acpi_db_get_from_history(char *command_num_arg); /* * dbinput - user front-end to the AML debugger */ acpi_status -acpi_db_command_dispatch ( - char *input_buffer, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -void ACPI_SYSTEM_XFACE -acpi_db_execute_thread ( - void *context); +acpi_db_command_dispatch(char *input_buffer, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); +void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context); /* * dbstats - Generation and display of ACPI table statistics */ -void -acpi_db_generate_statistics ( - union acpi_parse_object *root, - u8 is_method); - -acpi_status -acpi_db_display_statistics ( - char *type_arg); +void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method); +acpi_status acpi_db_display_statistics(char *type_arg); /* * dbutils - AML debugger utilities */ -void -acpi_db_set_output_destination ( - u32 where); +void acpi_db_set_output_destination(u32 where); -void -acpi_db_dump_external_object ( - union acpi_object *obj_desc, - u32 level); +void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level); -void -acpi_db_prep_namestring ( - char *name); +void acpi_db_prep_namestring(char *name); -struct acpi_namespace_node * -acpi_db_local_ns_lookup ( - char *name); +struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name); -#endif /* __ACDEBUG_H__ */ +#endif /* __ACDEBUG_H__ */ diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 26325430db8..3d96dcb1bb4 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -46,328 +46,219 @@ #include "amlresrc.h" - #define BLOCK_NONE 0 #define BLOCK_PAREN 1 #define BLOCK_BRACE 2 #define BLOCK_COMMA_LIST 4 -struct acpi_external_list -{ - char *path; - struct acpi_external_list *next; +struct acpi_external_list { + char *path; + struct acpi_external_list *next; }; -extern struct acpi_external_list *acpi_gbl_external_list; -extern const char *acpi_gbl_io_decode[2]; -extern const char *acpi_gbl_word_decode[4]; -extern const char *acpi_gbl_consume_decode[2]; -extern const char *acpi_gbl_min_decode[2]; -extern const char *acpi_gbl_max_decode[2]; -extern const char *acpi_gbl_DECdecode[2]; -extern const char *acpi_gbl_RNGdecode[4]; -extern const char *acpi_gbl_MEMdecode[4]; -extern const char *acpi_gbl_RWdecode[2]; -extern const char *acpi_gbl_irq_decode[2]; -extern const char *acpi_gbl_HEdecode[2]; -extern const char *acpi_gbl_LLdecode[2]; -extern const char *acpi_gbl_SHRdecode[2]; -extern const char *acpi_gbl_TYPdecode[4]; -extern const char *acpi_gbl_BMdecode[2]; -extern const char *acpi_gbl_SIZdecode[4]; -extern const char *acpi_gbl_TTPdecode[2]; -extern const char *acpi_gbl_MTPdecode[4]; -extern const char *acpi_gbl_TRSdecode[2]; - - -extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; -extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; -extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; -extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; - - -struct acpi_op_walk_info -{ - u32 level; - u32 bit_offset; - struct acpi_walk_state *walk_state; +extern struct acpi_external_list *acpi_gbl_external_list; +extern const char *acpi_gbl_io_decode[2]; +extern const char *acpi_gbl_word_decode[4]; +extern const char *acpi_gbl_consume_decode[2]; +extern const char *acpi_gbl_min_decode[2]; +extern const char *acpi_gbl_max_decode[2]; +extern const char *acpi_gbl_DECdecode[2]; +extern const char *acpi_gbl_RNGdecode[4]; +extern const char *acpi_gbl_MEMdecode[4]; +extern const char *acpi_gbl_RWdecode[2]; +extern const char *acpi_gbl_irq_decode[2]; +extern const char *acpi_gbl_HEdecode[2]; +extern const char *acpi_gbl_LLdecode[2]; +extern const char *acpi_gbl_SHRdecode[2]; +extern const char *acpi_gbl_TYPdecode[4]; +extern const char *acpi_gbl_BMdecode[2]; +extern const char *acpi_gbl_SIZdecode[4]; +extern const char *acpi_gbl_TTPdecode[2]; +extern const char *acpi_gbl_MTPdecode[4]; +extern const char *acpi_gbl_TRSdecode[2]; + +extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; +extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; +extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; +extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; + +struct acpi_op_walk_info { + u32 level; + u32 bit_offset; + struct acpi_walk_state *walk_state; }; typedef -acpi_status (*asl_walk_callback) ( - union acpi_parse_object *op, - u32 level, - void *context); - +acpi_status(*asl_walk_callback) (union acpi_parse_object * op, + u32 level, void *context); /* * dmwalk */ void -acpi_dm_disassemble ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *origin, - u32 num_opcodes); - +acpi_dm_disassemble(struct acpi_walk_state *walk_state, + union acpi_parse_object *origin, u32 num_opcodes); /* * dmopcode */ void -acpi_dm_disassemble_one_op ( - struct acpi_walk_state *walk_state, - struct acpi_op_walk_info *info, - union acpi_parse_object *op); +acpi_dm_disassemble_one_op(struct acpi_walk_state *walk_state, + struct acpi_op_walk_info *info, + union acpi_parse_object *op); -void -acpi_dm_decode_internal_object ( - union acpi_operand_object *obj_desc); +void acpi_dm_decode_internal_object(union acpi_operand_object *obj_desc); -u32 -acpi_dm_list_type ( - union acpi_parse_object *op); +u32 acpi_dm_list_type(union acpi_parse_object *op); -void -acpi_dm_method_flags ( - union acpi_parse_object *op); - -void -acpi_dm_field_flags ( - union acpi_parse_object *op); +void acpi_dm_method_flags(union acpi_parse_object *op); -void -acpi_dm_address_space ( - u8 space_id); +void acpi_dm_field_flags(union acpi_parse_object *op); -void -acpi_dm_region_flags ( - union acpi_parse_object *op); +void acpi_dm_address_space(u8 space_id); -void -acpi_dm_match_op ( - union acpi_parse_object *op); +void acpi_dm_region_flags(union acpi_parse_object *op); -u8 -acpi_dm_comma_if_list_member ( - union acpi_parse_object *op); +void acpi_dm_match_op(union acpi_parse_object *op); -void -acpi_dm_comma_if_field_member ( - union acpi_parse_object *op); +u8 acpi_dm_comma_if_list_member(union acpi_parse_object *op); +void acpi_dm_comma_if_field_member(union acpi_parse_object *op); /* * dmnames */ -u32 -acpi_dm_dump_name ( - char *name); +u32 acpi_dm_dump_name(char *name); acpi_status -acpi_ps_display_object_pathname ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - -void -acpi_dm_namestring ( - char *name); +acpi_ps_display_object_pathname(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); +void acpi_dm_namestring(char *name); /* * dmobject */ void -acpi_dm_display_internal_object ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); +acpi_dm_display_internal_object(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); -void -acpi_dm_display_arguments ( - struct acpi_walk_state *walk_state); +void acpi_dm_display_arguments(struct acpi_walk_state *walk_state); -void -acpi_dm_display_locals ( - struct acpi_walk_state *walk_state); +void acpi_dm_display_locals(struct acpi_walk_state *walk_state); void -acpi_dm_dump_method_info ( - acpi_status status, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - +acpi_dm_dump_method_info(acpi_status status, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); /* * dmbuffer */ -void -acpi_dm_disasm_byte_list ( - u32 level, - u8 *byte_data, - u32 byte_count); +void acpi_dm_disasm_byte_list(u32 level, u8 * byte_data, u32 byte_count); void -acpi_dm_byte_list ( - struct acpi_op_walk_info *info, - union acpi_parse_object *op); +acpi_dm_byte_list(struct acpi_op_walk_info *info, union acpi_parse_object *op); -void -acpi_dm_is_eisa_id ( - union acpi_parse_object *op); +void acpi_dm_is_eisa_id(union acpi_parse_object *op); -void -acpi_dm_eisa_id ( - u32 encoded_id); - -u8 -acpi_dm_is_unicode_buffer ( - union acpi_parse_object *op); +void acpi_dm_eisa_id(u32 encoded_id); -u8 -acpi_dm_is_string_buffer ( - union acpi_parse_object *op); +u8 acpi_dm_is_unicode_buffer(union acpi_parse_object *op); +u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); /* * dmresrc */ void -acpi_dm_resource_descriptor ( - struct acpi_op_walk_info *info, - u8 *byte_data, - u32 byte_count); +acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, + u8 * byte_data, u32 byte_count); -u8 -acpi_dm_is_resource_descriptor ( - union acpi_parse_object *op); +u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); -void -acpi_dm_indent ( - u32 level); +void acpi_dm_indent(u32 level); -void -acpi_dm_bit_list ( - u16 mask); - -void -acpi_dm_decode_attribute ( - u8 attribute); +void acpi_dm_bit_list(u16 mask); +void acpi_dm_decode_attribute(u8 attribute); /* * dmresrcl */ void -acpi_dm_word_descriptor ( - struct asl_word_address_desc *resource, - u32 length, - u32 level); +acpi_dm_word_descriptor(struct asl_word_address_desc *resource, + u32 length, u32 level); void -acpi_dm_dword_descriptor ( - struct asl_dword_address_desc *resource, - u32 length, - u32 level); +acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, + u32 length, u32 level); void -acpi_dm_extended_descriptor ( - struct asl_extended_address_desc *resource, - u32 length, - u32 level); +acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, + u32 length, u32 level); void -acpi_dm_qword_descriptor ( - struct asl_qword_address_desc *resource, - u32 length, - u32 level); +acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, + u32 length, u32 level); void -acpi_dm_memory24_descriptor ( - struct asl_memory_24_desc *resource, - u32 length, - u32 level); +acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, + u32 length, u32 level); void -acpi_dm_memory32_descriptor ( - struct asl_memory_32_desc *resource, - u32 length, - u32 level); +acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, + u32 length, u32 level); void -acpi_dm_fixed_mem32_descriptor ( - struct asl_fixed_memory_32_desc *resource, - u32 length, - u32 level); +acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, + u32 length, u32 level); void -acpi_dm_generic_register_descriptor ( - struct asl_general_register_desc *resource, - u32 length, - u32 level); +acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, + u32 length, u32 level); void -acpi_dm_interrupt_descriptor ( - struct asl_extended_xrupt_desc *resource, - u32 length, - u32 level); +acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, + u32 length, u32 level); void -acpi_dm_vendor_large_descriptor ( - struct asl_large_vendor_desc *resource, - u32 length, - u32 level); - +acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, + u32 length, u32 level); /* * dmresrcs */ void -acpi_dm_irq_descriptor ( - struct asl_irq_format_desc *resource, - u32 length, - u32 level); +acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, + u32 length, u32 level); void -acpi_dm_dma_descriptor ( - struct asl_dma_format_desc *resource, - u32 length, - u32 level); +acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, + u32 length, u32 level); void -acpi_dm_io_descriptor ( - struct asl_io_port_desc *resource, - u32 length, - u32 level); +acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level); void -acpi_dm_fixed_io_descriptor ( - struct asl_fixed_io_port_desc *resource, - u32 length, - u32 level); +acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, + u32 length, u32 level); void -acpi_dm_start_dependent_descriptor ( - struct asl_start_dependent_desc *resource, - u32 length, - u32 level); +acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, + u32 length, u32 level); void -acpi_dm_end_dependent_descriptor ( - struct asl_start_dependent_desc *resource, - u32 length, - u32 level); +acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, + u32 length, u32 level); void -acpi_dm_vendor_small_descriptor ( - struct asl_small_vendor_desc *resource, - u32 length, - u32 level); - +acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, + u32 length, u32 level); /* * dmutils */ -void -acpi_dm_add_to_external_list ( - char *path); +void acpi_dm_add_to_external_list(char *path); -#endif /* __ACDISASM_H__ */ +#endif /* __ACDISASM_H__ */ diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 90b7d30bd25..59306186f5e 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -41,413 +41,305 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #ifndef _ACDISPAT_H_ #define _ACDISPAT_H_ - #define NAMEOF_LOCAL_NTE "__L0" #define NAMEOF_ARG_NTE "__A0" - /* * dsopcode - support for late evaluation */ acpi_status -acpi_ds_get_buffer_field_arguments ( - union acpi_operand_object *obj_desc); +acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc); -acpi_status -acpi_ds_get_region_arguments ( - union acpi_operand_object *rgn_desc); +acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc); -acpi_status -acpi_ds_get_buffer_arguments ( - union acpi_operand_object *obj_desc); +acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc); -acpi_status -acpi_ds_get_package_arguments ( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ds_eval_buffer_field_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +acpi_status acpi_ds_get_package_arguments(union acpi_operand_object *obj_desc); acpi_status -acpi_ds_eval_region_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +acpi_ds_eval_buffer_field_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); acpi_status -acpi_ds_eval_data_object_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - union acpi_operand_object *obj_desc); +acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); acpi_status -acpi_ds_initialize_region ( - acpi_handle obj_handle); +acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + union acpi_operand_object *obj_desc); +acpi_status acpi_ds_initialize_region(acpi_handle obj_handle); /* * dsctrl - Parser/Interpreter interface, control stack routines */ acpi_status -acpi_ds_exec_begin_control_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +acpi_ds_exec_begin_control_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); acpi_status -acpi_ds_exec_end_control_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); - +acpi_ds_exec_end_control_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); /* * dsexec - Parser/Interpreter interface, method execution callbacks */ acpi_status -acpi_ds_get_predicate_value ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *result_obj); +acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state, + union acpi_operand_object *result_obj); acpi_status -acpi_ds_exec_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -acpi_status -acpi_ds_exec_end_op ( - struct acpi_walk_state *state); +acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); +acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *state); /* * dsfield - Parser/Interpreter interface for AML fields */ acpi_status -acpi_ds_create_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); +acpi_ds_create_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_create_bank_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); +acpi_ds_create_bank_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_create_index_field ( - union acpi_parse_object *op, - struct acpi_namespace_node *region_node, - struct acpi_walk_state *walk_state); +acpi_ds_create_index_field(union acpi_parse_object *op, + struct acpi_namespace_node *region_node, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_create_buffer_field ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); +acpi_ds_create_buffer_field(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_init_field_objects ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); - +acpi_ds_init_field_objects(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); /* * dsload - Parser/Interpreter interface, namespace load callbacks */ acpi_status -acpi_ds_load1_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); +acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); -acpi_status -acpi_ds_load1_end_op ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state); acpi_status -acpi_ds_load2_begin_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); +acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, + union acpi_parse_object **out_op); -acpi_status -acpi_ds_load2_end_op ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state); acpi_status -acpi_ds_init_callbacks ( - struct acpi_walk_state *walk_state, - u32 pass_number); - +acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number); /* * dsmthdat - method data (locals/args) */ acpi_status -acpi_ds_store_object_to_local ( - u16 opcode, - u32 index, - union acpi_operand_object *src_desc, - struct acpi_walk_state *walk_state); +acpi_ds_store_object_to_local(u16 opcode, + u32 index, + union acpi_operand_object *src_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_method_data_get_entry ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - union acpi_operand_object ***node); +acpi_ds_method_data_get_entry(u16 opcode, + u32 index, + struct acpi_walk_state *walk_state, + union acpi_operand_object ***node); -void -acpi_ds_method_data_delete_all ( - struct acpi_walk_state *walk_state); +void acpi_ds_method_data_delete_all(struct acpi_walk_state *walk_state); -u8 -acpi_ds_is_method_value ( - union acpi_operand_object *obj_desc); +u8 acpi_ds_is_method_value(union acpi_operand_object *obj_desc); acpi_status -acpi_ds_method_data_get_value ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - union acpi_operand_object **dest_desc); +acpi_ds_method_data_get_value(u16 opcode, + u32 index, + struct acpi_walk_state *walk_state, + union acpi_operand_object **dest_desc); acpi_status -acpi_ds_method_data_init_args ( - union acpi_operand_object **params, - u32 max_param_count, - struct acpi_walk_state *walk_state); +acpi_ds_method_data_init_args(union acpi_operand_object **params, + u32 max_param_count, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_method_data_get_node ( - u16 opcode, - u32 index, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **node); - -void -acpi_ds_method_data_init ( - struct acpi_walk_state *walk_state); +acpi_ds_method_data_get_node(u16 opcode, + u32 index, + struct acpi_walk_state *walk_state, + struct acpi_namespace_node **node); +void acpi_ds_method_data_init(struct acpi_walk_state *walk_state); /* * dsmethod - Parser/Interpreter interface - control method parsing */ -acpi_status -acpi_ds_parse_method ( - struct acpi_namespace_node *node); +acpi_status acpi_ds_parse_method(struct acpi_namespace_node *node); acpi_status -acpi_ds_call_control_method ( - struct acpi_thread_state *thread, - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +acpi_ds_call_control_method(struct acpi_thread_state *thread, + struct acpi_walk_state *walk_state, + union acpi_parse_object *op); acpi_status -acpi_ds_restart_control_method ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *return_desc); +acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, + union acpi_operand_object *return_desc); acpi_status -acpi_ds_terminate_control_method ( - struct acpi_walk_state *walk_state); +acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); acpi_status -acpi_ds_begin_method_execution ( - struct acpi_namespace_node *method_node, - union acpi_operand_object *obj_desc, - struct acpi_namespace_node *calling_method_node); - +acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, + union acpi_operand_object *obj_desc, + struct acpi_namespace_node *calling_method_node); /* * dsinit */ acpi_status -acpi_ds_initialize_objects ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *start_node); - +acpi_ds_initialize_objects(struct acpi_table_desc *table_desc, + struct acpi_namespace_node *start_node); /* * dsobject - Parser/Interpreter interface - object initialization and conversion */ acpi_status -acpi_ds_build_internal_buffer_obj ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 buffer_length, - union acpi_operand_object **obj_desc_ptr); +acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u32 buffer_length, + union acpi_operand_object **obj_desc_ptr); acpi_status -acpi_ds_build_internal_package_obj ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u32 package_length, - union acpi_operand_object **obj_desc); +acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u32 package_length, + union acpi_operand_object **obj_desc); acpi_status -acpi_ds_init_object_from_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - u16 opcode, - union acpi_operand_object **obj_desc); +acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + u16 opcode, union acpi_operand_object **obj_desc); acpi_status -acpi_ds_create_node ( - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *node, - union acpi_parse_object *op); - +acpi_ds_create_node(struct acpi_walk_state *walk_state, + struct acpi_namespace_node *node, + union acpi_parse_object *op); /* * dsutils - Parser/Interpreter interface utility routines */ -void -acpi_ds_clear_implicit_return ( - struct acpi_walk_state *walk_state); +void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state); u8 -acpi_ds_do_implicit_return ( - union acpi_operand_object *return_desc, - struct acpi_walk_state *walk_state, - u8 add_reference); +acpi_ds_do_implicit_return(union acpi_operand_object *return_desc, + struct acpi_walk_state *walk_state, + u8 add_reference); u8 -acpi_ds_is_result_used ( - union acpi_parse_object *op, - struct acpi_walk_state *walk_state); +acpi_ds_is_result_used(union acpi_parse_object *op, + struct acpi_walk_state *walk_state); void -acpi_ds_delete_result_if_not_used ( - union acpi_parse_object *op, - union acpi_operand_object *result_obj, - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ds_create_operand ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *arg, - u32 args_remaining); +acpi_ds_delete_result_if_not_used(union acpi_parse_object *op, + union acpi_operand_object *result_obj, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_create_operands ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *first_arg); +acpi_ds_create_operand(struct acpi_walk_state *walk_state, + union acpi_parse_object *arg, u32 args_remaining); acpi_status -acpi_ds_resolve_operands ( - struct acpi_walk_state *walk_state); +acpi_ds_create_operands(struct acpi_walk_state *walk_state, + union acpi_parse_object *first_arg); -void -acpi_ds_clear_operands ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state); +void acpi_ds_clear_operands(struct acpi_walk_state *walk_state); /* * dswscope - Scope Stack manipulation */ acpi_status -acpi_ds_scope_stack_push ( - struct acpi_namespace_node *node, - acpi_object_type type, - struct acpi_walk_state *walk_state); +acpi_ds_scope_stack_push(struct acpi_namespace_node *node, + acpi_object_type type, + struct acpi_walk_state *walk_state); +acpi_status acpi_ds_scope_stack_pop(struct acpi_walk_state *walk_state); -acpi_status -acpi_ds_scope_stack_pop ( - struct acpi_walk_state *walk_state); - -void -acpi_ds_scope_stack_clear ( - struct acpi_walk_state *walk_state); - +void acpi_ds_scope_stack_clear(struct acpi_walk_state *walk_state); /* * dswstate - parser WALK_STATE management routines */ acpi_status -acpi_ds_obj_stack_push ( - void *object, - struct acpi_walk_state *walk_state); +acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state); acpi_status -acpi_ds_obj_stack_pop ( - u32 pop_count, - struct acpi_walk_state *walk_state); +acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state); -struct acpi_walk_state * -acpi_ds_create_walk_state ( - acpi_owner_id owner_id, - union acpi_parse_object *origin, - union acpi_operand_object *mth_desc, - struct acpi_thread_state *thread); +struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, + union acpi_parse_object + *origin, + union acpi_operand_object + *mth_desc, + struct acpi_thread_state + *thread); acpi_status -acpi_ds_init_aml_walk ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - struct acpi_namespace_node *method_node, - u8 *aml_start, - u32 aml_length, - struct acpi_parameter_info *info, - u8 pass_number); +acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + struct acpi_namespace_node *method_node, + u8 * aml_start, + u32 aml_length, + struct acpi_parameter_info *info, u8 pass_number); acpi_status -acpi_ds_obj_stack_pop_and_delete ( - u32 pop_count, - struct acpi_walk_state *walk_state); +acpi_ds_obj_stack_pop_and_delete(u32 pop_count, + struct acpi_walk_state *walk_state); -void -acpi_ds_delete_walk_state ( - struct acpi_walk_state *walk_state); +void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state); -struct acpi_walk_state * -acpi_ds_pop_walk_state ( - struct acpi_thread_state *thread); +struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state + *thread); void -acpi_ds_push_walk_state ( - struct acpi_walk_state *walk_state, - struct acpi_thread_state *thread); +acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, + struct acpi_thread_state *thread); -acpi_status -acpi_ds_result_stack_pop ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state); -acpi_status -acpi_ds_result_stack_push ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state); -acpi_status -acpi_ds_result_stack_clear ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state); -struct acpi_walk_state * -acpi_ds_get_current_walk_state ( - struct acpi_thread_state *thread); +struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state + *thread); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_ds_result_remove ( - union acpi_operand_object **object, - u32 index, - struct acpi_walk_state *walk_state); +acpi_ds_result_remove(union acpi_operand_object **object, + u32 index, struct acpi_walk_state *walk_state); #endif acpi_status -acpi_ds_result_pop ( - union acpi_operand_object **object, - struct acpi_walk_state *walk_state); +acpi_ds_result_pop(union acpi_operand_object **object, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_result_push ( - union acpi_operand_object *object, - struct acpi_walk_state *walk_state); +acpi_ds_result_push(union acpi_operand_object *object, + struct acpi_walk_state *walk_state); acpi_status -acpi_ds_result_pop_from_bottom ( - union acpi_operand_object **object, - struct acpi_walk_state *walk_state); +acpi_ds_result_pop_from_bottom(union acpi_operand_object **object, + struct acpi_walk_state *walk_state); -#endif /* _ACDISPAT_H_ */ +#endif /* _ACDISPAT_H_ */ diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index 33ae2ca997b..bfa54600ecd 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h @@ -44,249 +44,167 @@ #ifndef __ACEVENTS_H__ #define __ACEVENTS_H__ - /* * evevent */ -acpi_status -acpi_ev_initialize_events ( - void); +acpi_status acpi_ev_initialize_events(void); -acpi_status -acpi_ev_install_xrupt_handlers ( - void); - -u32 -acpi_ev_fixed_event_detect ( - void); +acpi_status acpi_ev_install_xrupt_handlers(void); +u32 acpi_ev_fixed_event_detect(void); /* * evmisc */ -u8 -acpi_ev_is_notify_object ( - struct acpi_namespace_node *node); +u8 acpi_ev_is_notify_object(struct acpi_namespace_node *node); -acpi_status -acpi_ev_acquire_global_lock( - u16 timeout); +acpi_status acpi_ev_acquire_global_lock(u16 timeout); -acpi_status -acpi_ev_release_global_lock( - void); +acpi_status acpi_ev_release_global_lock(void); -acpi_status -acpi_ev_init_global_lock_handler ( - void); +acpi_status acpi_ev_init_global_lock_handler(void); -u32 -acpi_ev_get_gpe_number_index ( - u32 gpe_number); +u32 acpi_ev_get_gpe_number_index(u32 gpe_number); acpi_status -acpi_ev_queue_notify_request ( - struct acpi_namespace_node *node, - u32 notify_value); - +acpi_ev_queue_notify_request(struct acpi_namespace_node *node, + u32 notify_value); /* * evgpe - GPE handling and dispatch */ acpi_status -acpi_ev_update_gpe_enable_masks ( - struct acpi_gpe_event_info *gpe_event_info, - u8 type); +acpi_ev_update_gpe_enable_masks(struct acpi_gpe_event_info *gpe_event_info, + u8 type); acpi_status -acpi_ev_enable_gpe ( - struct acpi_gpe_event_info *gpe_event_info, - u8 write_to_hardware); +acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info, + u8 write_to_hardware); -acpi_status -acpi_ev_disable_gpe ( - struct acpi_gpe_event_info *gpe_event_info); - -struct acpi_gpe_event_info * -acpi_ev_get_gpe_event_info ( - acpi_handle gpe_device, - u32 gpe_number); +acpi_status acpi_ev_disable_gpe(struct acpi_gpe_event_info *gpe_event_info); +struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device, + u32 gpe_number); /* * evgpeblk */ -u8 -acpi_ev_valid_gpe_event ( - struct acpi_gpe_event_info *gpe_event_info); - -acpi_status -acpi_ev_walk_gpe_list ( - ACPI_GPE_CALLBACK gpe_walk_callback); +u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info); -acpi_status -acpi_ev_delete_gpe_handlers ( - struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); +acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback); acpi_status -acpi_ev_create_gpe_block ( - struct acpi_namespace_node *gpe_device, - struct acpi_generic_address *gpe_block_address, - u32 register_count, - u8 gpe_block_base_number, - u32 interrupt_number, - struct acpi_gpe_block_info **return_gpe_block); +acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block); acpi_status -acpi_ev_delete_gpe_block ( - struct acpi_gpe_block_info *gpe_block); +acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, + struct acpi_generic_address *gpe_block_address, + u32 register_count, + u8 gpe_block_base_number, + u32 interrupt_number, + struct acpi_gpe_block_info **return_gpe_block); -u32 -acpi_ev_gpe_dispatch ( - struct acpi_gpe_event_info *gpe_event_info, - u32 gpe_number); +acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); u32 -acpi_ev_gpe_detect ( - struct acpi_gpe_xrupt_info *gpe_xrupt_list); +acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, + u32 gpe_number); -acpi_status -acpi_ev_set_gpe_type ( - struct acpi_gpe_event_info *gpe_event_info, - u8 type); +u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list); acpi_status -acpi_ev_check_for_wake_only_gpe ( - struct acpi_gpe_event_info *gpe_event_info); +acpi_ev_set_gpe_type(struct acpi_gpe_event_info *gpe_event_info, u8 type); acpi_status -acpi_ev_gpe_initialize ( - void); +acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info); +acpi_status acpi_ev_gpe_initialize(void); /* * evregion - Address Space handling */ -acpi_status -acpi_ev_install_region_handlers ( - void); +acpi_status acpi_ev_install_region_handlers(void); -acpi_status -acpi_ev_initialize_op_regions ( - void); +acpi_status acpi_ev_initialize_op_regions(void); acpi_status -acpi_ev_address_space_dispatch ( - union acpi_operand_object *region_obj, - u32 function, - acpi_physical_address address, - u32 bit_width, - void *value); +acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj, + u32 function, + acpi_physical_address address, + u32 bit_width, void *value); acpi_status -acpi_ev_attach_region ( - union acpi_operand_object *handler_obj, - union acpi_operand_object *region_obj, - u8 acpi_ns_is_locked); +acpi_ev_attach_region(union acpi_operand_object *handler_obj, + union acpi_operand_object *region_obj, + u8 acpi_ns_is_locked); void -acpi_ev_detach_region ( - union acpi_operand_object *region_obj, - u8 acpi_ns_is_locked); +acpi_ev_detach_region(union acpi_operand_object *region_obj, + u8 acpi_ns_is_locked); acpi_status -acpi_ev_install_space_handler ( - struct acpi_namespace_node *node, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler, - acpi_adr_space_setup setup, - void *context); +acpi_ev_install_space_handler(struct acpi_namespace_node *node, + acpi_adr_space_type space_id, + acpi_adr_space_handler handler, + acpi_adr_space_setup setup, void *context); acpi_status -acpi_ev_execute_reg_methods ( - struct acpi_namespace_node *node, - acpi_adr_space_type space_id); +acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, + acpi_adr_space_type space_id); acpi_status -acpi_ev_execute_reg_method ( - union acpi_operand_object *region_obj, - u32 function); - +acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function); /* * evregini - Region initialization and setup */ acpi_status -acpi_ev_system_memory_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_system_memory_region_setup(acpi_handle handle, + u32 function, + void *handler_context, + void **region_context); acpi_status -acpi_ev_io_space_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_io_space_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); acpi_status -acpi_ev_pci_config_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_pci_config_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); acpi_status -acpi_ev_cmos_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_cmos_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); acpi_status -acpi_ev_pci_bar_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_pci_bar_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); acpi_status -acpi_ev_default_region_setup ( - acpi_handle handle, - u32 function, - void *handler_context, - void **region_context); +acpi_ev_default_region_setup(acpi_handle handle, + u32 function, + void *handler_context, void **region_context); acpi_status -acpi_ev_initialize_region ( - union acpi_operand_object *region_obj, - u8 acpi_ns_locked); - +acpi_ev_initialize_region(union acpi_operand_object *region_obj, + u8 acpi_ns_locked); /* * evsci - SCI (System Control Interrupt) handling/dispatch */ -u32 ACPI_SYSTEM_XFACE -acpi_ev_gpe_xrupt_handler ( - void *context); - -u32 -acpi_ev_install_sci_handler ( - void); +u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context); -acpi_status -acpi_ev_remove_sci_handler ( - void); +u32 acpi_ev_install_sci_handler(void); -u32 -acpi_ev_initialize_sCI ( - u32 program_sCI); +acpi_status acpi_ev_remove_sci_handler(void); -void -acpi_ev_terminate ( - void); +u32 acpi_ev_initialize_sCI(u32 program_sCI); +void acpi_ev_terminate(void); -#endif /* __ACEVENTS_H__ */ +#endif /* __ACEVENTS_H__ */ diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 0a6f492f3c8..4f005eb6592 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -44,7 +44,6 @@ #ifndef __ACEXCEP_H__ #define __ACEXCEP_H__ - /* * Exceptions returned by external ACPI interfaces */ @@ -55,11 +54,9 @@ #define AE_CODE_CONTROL 0x4000 #define AE_CODE_MASK 0xF000 - #define ACPI_SUCCESS(a) (!(a)) #define ACPI_FAILURE(a) (a) - #define AE_OK (acpi_status) 0x0000 /* @@ -99,7 +96,6 @@ #define AE_CODE_ENV_MAX 0x001F - /* * Programmer exceptions */ @@ -115,7 +111,6 @@ #define AE_CODE_PGM_MAX 0x0009 - /* * Acpi table exceptions */ @@ -128,7 +123,6 @@ #define AE_CODE_TBL_MAX 0x0006 - /* * AML exceptions. These are caused by problems with * the actual AML byte stream @@ -169,7 +163,6 @@ #define AE_CODE_AML_MAX 0x0021 - /* * Internal exceptions used for control */ @@ -187,16 +180,13 @@ #define AE_CODE_CTRL_MAX 0x000B - #ifdef DEFINE_ACPI_GLOBALS - /* * String versions of the exception codes above * These strings must match the corresponding defines exactly */ -char const *acpi_gbl_exception_names_env[] = -{ +char const *acpi_gbl_exception_names_env[] = { "AE_OK", "AE_ERROR", "AE_NO_ACPI_TABLES", @@ -231,8 +221,7 @@ char const *acpi_gbl_exception_names_env[] = "AE_OWNER_ID_LIMIT" }; -char const *acpi_gbl_exception_names_pgm[] = -{ +char const *acpi_gbl_exception_names_pgm[] = { "AE_BAD_PARAMETER", "AE_BAD_CHARACTER", "AE_BAD_PATHNAME", @@ -244,8 +233,7 @@ char const *acpi_gbl_exception_names_pgm[] = "AE_BAD_DECIMAL_CONSTANT" }; -char const *acpi_gbl_exception_names_tbl[] = -{ +char const *acpi_gbl_exception_names_tbl[] = { "AE_BAD_SIGNATURE", "AE_BAD_HEADER", "AE_BAD_CHECKSUM", @@ -254,8 +242,7 @@ char const *acpi_gbl_exception_names_tbl[] = "AE_INVALID_TABLE_LENGTH" }; -char const *acpi_gbl_exception_names_aml[] = -{ +char const *acpi_gbl_exception_names_aml[] = { "AE_AML_ERROR", "AE_AML_PARSE", "AE_AML_BAD_OPCODE", @@ -291,8 +278,7 @@ char const *acpi_gbl_exception_names_aml[] = "AE_AML_BAD_RESOURCE_LENGTH" }; -char const *acpi_gbl_exception_names_ctrl[] = -{ +char const *acpi_gbl_exception_names_ctrl[] = { "AE_CTRL_RETURN_VALUE", "AE_CTRL_PENDING", "AE_CTRL_TERMINATE", @@ -306,6 +292,6 @@ char const *acpi_gbl_exception_names_ctrl[] = "AE_CTRL_SKIP" }; -#endif /* ACPI GLOBALS */ +#endif /* ACPI GLOBALS */ -#endif /* __ACEXCEP_H__ */ +#endif /* __ACEXCEP_H__ */ diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index e3cf16eadbe..e9c2790139e 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -44,7 +44,6 @@ #ifndef __ACGLOBAL_H__ #define __ACGLOBAL_H__ - /* * Ensure that the globals are actually defined and initialized only once. * @@ -63,9 +62,8 @@ * Keep local copies of these FADT-based registers. NOTE: These globals * are first in this file for alignment reasons on 64-bit systems. */ -ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; -ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; - +ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable; +ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; /***************************************************************************** * @@ -75,13 +73,12 @@ ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable; /* Runtime configuration of debug print levels */ -extern u32 acpi_dbg_level; -extern u32 acpi_dbg_layer; +extern u32 acpi_dbg_level; +extern u32 acpi_dbg_layer; /* Procedure nesting level for debug output */ -extern u32 acpi_gbl_nesting_level; - +extern u32 acpi_gbl_nesting_level; /***************************************************************************** * @@ -98,7 +95,7 @@ extern u32 acpi_gbl_nesting_level; * 3) Allow access to uninitialized locals/args (auto-init to integer 0) * 4) Allow ANY object type to be a source operand for the Store() operator */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE); +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); /* * Automatically serialize ALL control methods? Default is FALSE, meaning @@ -106,22 +103,21 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE) * Only change this if the ASL code is poorly written and cannot handle * reentrancy even though methods are marked "not_serialized". */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_all_methods_serialized, FALSE); +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE); /* * Create the predefined _OSI method in the namespace? Default is TRUE * because ACPI CA is fully compatible with other ACPI implementations. * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_create_osi_method, TRUE); +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE); /* * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only * be enabled just before going to sleep. */ -ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE); - +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE); /***************************************************************************** * @@ -137,49 +133,46 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE); * These tables are single-table only; meaning that there can be at most one * of each in the system. Each global points to the actual table. */ -ACPI_EXTERN u32 acpi_gbl_table_flags; -ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; -ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; -ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; -ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; -ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; -ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; -ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; +ACPI_EXTERN u32 acpi_gbl_table_flags; +ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; +ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; +ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; +ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; +ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; +ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; +ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; /* * Since there may be multiple SSDTs and PSDTs, a single pointer is not * sufficient; Therefore, there isn't one! */ - /* The root table can be either an RSDT or an XSDT */ -ACPI_EXTERN u8 acpi_gbl_root_table_type; +ACPI_EXTERN u8 acpi_gbl_root_table_type; #define ACPI_TABLE_TYPE_RSDT 'R' #define ACPI_TABLE_TYPE_XSDT 'X' - /* * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: * If we are executing a method that exists in a 32-bit ACPI table, * use only the lower 32 bits of the (internal) 64-bit Integer. */ -ACPI_EXTERN u8 acpi_gbl_integer_bit_width; -ACPI_EXTERN u8 acpi_gbl_integer_byte_width; -ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; +ACPI_EXTERN u8 acpi_gbl_integer_bit_width; +ACPI_EXTERN u8 acpi_gbl_integer_byte_width; +ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; /* * ACPI Table info arrays */ -extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; -extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; +extern struct acpi_table_list acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES]; +extern struct acpi_table_support acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES]; /* * Predefined mutex objects. This array contains the * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. * (The table maps local handles to the real OS handles) */ -ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; - +ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; /***************************************************************************** * @@ -191,53 +184,52 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[NUM_MUTEX]; /* Lists for tracking memory allocations */ -ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; -ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; #endif /* Object caches */ -ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; -ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache; +ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache; /* Global handlers */ -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; -ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; -ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; -ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; -ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; -ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify; +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; +ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; +ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; +ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; +ACPI_EXTERN acpi_handle acpi_gbl_global_lock_semaphore; /* Misc */ -ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; -ACPI_EXTERN u32 acpi_gbl_original_mode; -ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; -ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; -ACPI_EXTERN u32 acpi_gbl_ps_find_count; -ACPI_EXTERN u32 acpi_gbl_owner_id_mask; -ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; -ACPI_EXTERN u16 acpi_gbl_global_lock_handle; -ACPI_EXTERN u8 acpi_gbl_debugger_configuration; -ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; -ACPI_EXTERN u8 acpi_gbl_step_to_next_call; -ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; -ACPI_EXTERN u8 acpi_gbl_global_lock_present; -ACPI_EXTERN u8 acpi_gbl_events_initialized; -ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; - -extern u8 acpi_gbl_shutdown; -extern u32 acpi_gbl_startup_flags; -extern const u8 acpi_gbl_decode_to8bit[8]; -extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; -extern const char *acpi_gbl_highest_dstate_names[4]; -extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; -extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; -extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; - +ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count; +ACPI_EXTERN u32 acpi_gbl_original_mode; +ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; +ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; +ACPI_EXTERN u32 acpi_gbl_ps_find_count; +ACPI_EXTERN u32 acpi_gbl_owner_id_mask; +ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; +ACPI_EXTERN u16 acpi_gbl_global_lock_handle; +ACPI_EXTERN u8 acpi_gbl_debugger_configuration; +ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; +ACPI_EXTERN u8 acpi_gbl_step_to_next_call; +ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; +ACPI_EXTERN u8 acpi_gbl_global_lock_present; +ACPI_EXTERN u8 acpi_gbl_events_initialized; +ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; + +extern u8 acpi_gbl_shutdown; +extern u32 acpi_gbl_startup_flags; +extern const u8 acpi_gbl_decode_to8bit[8]; +extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; +extern const char *acpi_gbl_highest_dstate_names[4]; +extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; +extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; +extern const char *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS]; /***************************************************************************** * @@ -253,36 +245,34 @@ extern const char *acpi_gbl_valid_osi_strings[ACPI_ #define NUM_PREDEFINED_NAMES 9 #endif -ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; +ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct; +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; -extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; -extern const struct acpi_predefined_names acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES]; +extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; +extern const struct acpi_predefined_names + acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; #ifdef ACPI_DEBUG_OUTPUT -ACPI_EXTERN u32 acpi_gbl_current_node_count; -ACPI_EXTERN u32 acpi_gbl_current_node_size; -ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; -ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; -ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; -ACPI_EXTERN u32 acpi_gbl_deepest_nesting; +ACPI_EXTERN u32 acpi_gbl_current_node_count; +ACPI_EXTERN u32 acpi_gbl_current_node_size; +ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; +ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; +ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; +ACPI_EXTERN u32 acpi_gbl_deepest_nesting; #endif - /***************************************************************************** * * Interpreter globals * ****************************************************************************/ - -ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; +ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list; /* Control method single step flag */ -ACPI_EXTERN u8 acpi_gbl_cm_single_step; - +ACPI_EXTERN u8 acpi_gbl_cm_single_step; /***************************************************************************** * @@ -290,8 +280,7 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step; * ****************************************************************************/ -ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; - +ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; /***************************************************************************** * @@ -299,10 +288,10 @@ ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; * ****************************************************************************/ -extern struct acpi_bit_register_info acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; -ACPI_EXTERN u8 acpi_gbl_sleep_type_a; -ACPI_EXTERN u8 acpi_gbl_sleep_type_b; - +extern struct acpi_bit_register_info + acpi_gbl_bit_register_info[ACPI_NUM_BITREG]; +ACPI_EXTERN u8 acpi_gbl_sleep_type_a; +ACPI_EXTERN u8 acpi_gbl_sleep_type_b; /***************************************************************************** * @@ -310,12 +299,14 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b; * ****************************************************************************/ -extern struct acpi_fixed_event_info acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; -ACPI_EXTERN struct acpi_fixed_event_handler acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; -ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; -ACPI_EXTERN struct acpi_gpe_block_info *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; -ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; - +extern struct acpi_fixed_event_info + acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS]; +ACPI_EXTERN struct acpi_fixed_event_handler + acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS]; +ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head; +ACPI_EXTERN struct acpi_gpe_block_info + *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS]; +ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; /***************************************************************************** * @@ -323,58 +314,55 @@ ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock; * ****************************************************************************/ -ACPI_EXTERN u8 acpi_gbl_db_output_flags; +ACPI_EXTERN u8 acpi_gbl_db_output_flags; #ifdef ACPI_DISASSEMBLER -ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; -ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; +ACPI_EXTERN u8 acpi_gbl_db_opt_disasm; +ACPI_EXTERN u8 acpi_gbl_db_opt_verbose; #endif - #ifdef ACPI_DEBUGGER -extern u8 acpi_gbl_method_executing; -extern u8 acpi_gbl_abort_method; -extern u8 acpi_gbl_db_terminate_threads; - -ACPI_EXTERN int optind; -ACPI_EXTERN char *optarg; - -ACPI_EXTERN u8 acpi_gbl_db_opt_tables; -ACPI_EXTERN u8 acpi_gbl_db_opt_stats; -ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; - - -ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; -ACPI_EXTERN char acpi_gbl_db_line_buf[80]; -ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; -ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; -ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; -ACPI_EXTERN u8 acpi_gbl_db_output_to_file; -ACPI_EXTERN char *acpi_gbl_db_buffer; -ACPI_EXTERN char *acpi_gbl_db_filename; -ACPI_EXTERN u32 acpi_gbl_db_debug_level; -ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; -ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; -ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; +extern u8 acpi_gbl_method_executing; +extern u8 acpi_gbl_abort_method; +extern u8 acpi_gbl_db_terminate_threads; + +ACPI_EXTERN int optind; +ACPI_EXTERN char *optarg; + +ACPI_EXTERN u8 acpi_gbl_db_opt_tables; +ACPI_EXTERN u8 acpi_gbl_db_opt_stats; +ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods; + +ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS]; +ACPI_EXTERN char acpi_gbl_db_line_buf[80]; +ACPI_EXTERN char acpi_gbl_db_parsed_buf[80]; +ACPI_EXTERN char acpi_gbl_db_scope_buf[40]; +ACPI_EXTERN char acpi_gbl_db_debug_filename[40]; +ACPI_EXTERN u8 acpi_gbl_db_output_to_file; +ACPI_EXTERN char *acpi_gbl_db_buffer; +ACPI_EXTERN char *acpi_gbl_db_filename; +ACPI_EXTERN u32 acpi_gbl_db_debug_level; +ACPI_EXTERN u32 acpi_gbl_db_console_debug_level; +ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr; +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node; /* * Statistic globals */ -ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; -ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; -ACPI_EXTERN u32 acpi_gbl_num_nodes; -ACPI_EXTERN u32 acpi_gbl_num_objects; - +ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; +ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]; +ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc; +ACPI_EXTERN u16 acpi_gbl_node_type_count_misc; +ACPI_EXTERN u32 acpi_gbl_num_nodes; +ACPI_EXTERN u32 acpi_gbl_num_objects; -ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; -ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; -ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; -ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; +ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree; +ACPI_EXTERN u32 acpi_gbl_size_of_method_trees; +ACPI_EXTERN u32 acpi_gbl_size_of_node_entries; +ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects; -#endif /* ACPI_DEBUGGER */ +#endif /* ACPI_DEBUGGER */ -#endif /* __ACGLOBAL_H__ */ +#endif /* __ACGLOBAL_H__ */ diff --git a/include/acpi/achware.h b/include/acpi/achware.h index cf5de4625a7..3644d7248e7 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h @@ -44,7 +44,6 @@ #ifndef __ACHWARE_H__ #define __ACHWARE_H__ - /* PM Timer ticks per second (HZ) */ #define PM_TIMER_FREQUENCY 3579545 @@ -57,126 +56,78 @@ #define ACPI_SST_SLEEPING 3 #define ACPI_SST_SLEEP_CONTEXT 4 - /* Prototypes */ - /* * hwacpi - high level functions */ -acpi_status -acpi_hw_initialize ( - void); +acpi_status acpi_hw_initialize(void); -acpi_status -acpi_hw_set_mode ( - u32 mode); - -u32 -acpi_hw_get_mode ( - void); +acpi_status acpi_hw_set_mode(u32 mode); +u32 acpi_hw_get_mode(void); /* * hwregs - ACPI Register I/O */ -struct acpi_bit_register_info * -acpi_hw_get_bit_register_info ( - u32 register_id); - -acpi_status -acpi_hw_register_read ( - u8 use_lock, - u32 register_id, - u32 *return_value); +struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id); acpi_status -acpi_hw_register_write ( - u8 use_lock, - u32 register_id, - u32 value); +acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value); -acpi_status -acpi_hw_low_level_read ( - u32 width, - u32 *value, - struct acpi_generic_address *reg); +acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value); acpi_status -acpi_hw_low_level_write ( - u32 width, - u32 value, - struct acpi_generic_address *reg); +acpi_hw_low_level_read(u32 width, + u32 * value, struct acpi_generic_address *reg); acpi_status -acpi_hw_clear_acpi_status ( - u32 flags); +acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg); +acpi_status acpi_hw_clear_acpi_status(u32 flags); /* * hwgpe - GPE support */ acpi_status -acpi_hw_write_gpe_enable_reg ( - struct acpi_gpe_event_info *gpe_event_info); +acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info); acpi_status -acpi_hw_disable_gpe_block ( - struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); +acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block); -acpi_status -acpi_hw_clear_gpe ( - struct acpi_gpe_event_info *gpe_event_info); +acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info); acpi_status -acpi_hw_clear_gpe_block ( - struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); +acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_hw_get_gpe_status ( - struct acpi_gpe_event_info *gpe_event_info, - acpi_event_status *event_status); -#endif /* ACPI_FUTURE_USAGE */ +acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info, + acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ -acpi_status -acpi_hw_disable_all_gpes ( - void); +acpi_status acpi_hw_disable_all_gpes(void); -acpi_status -acpi_hw_enable_all_runtime_gpes ( - void); +acpi_status acpi_hw_enable_all_runtime_gpes(void); -acpi_status -acpi_hw_enable_all_wakeup_gpes ( - void); +acpi_status acpi_hw_enable_all_wakeup_gpes(void); acpi_status -acpi_hw_enable_runtime_gpe_block ( - struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); - +acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block); #ifdef ACPI_FUTURE_USAGE /* * hwtimer - ACPI Timer prototypes */ -acpi_status -acpi_get_timer_resolution ( - u32 *resolution); +acpi_status acpi_get_timer_resolution(u32 * resolution); -acpi_status -acpi_get_timer ( - u32 *ticks); +acpi_status acpi_get_timer(u32 * ticks); acpi_status -acpi_get_timer_duration ( - u32 start_ticks, - u32 end_ticks, - u32 *time_elapsed); -#endif /* ACPI_FUTURE_USAGE */ - +acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed); +#endif /* ACPI_FUTURE_USAGE */ -#endif /* __ACHWARE_H__ */ +#endif /* __ACHWARE_H__ */ diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 5c7172477a0..2c9c1a1d1b7 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -44,29 +44,22 @@ #ifndef __ACINTERP_H__ #define __ACINTERP_H__ - #define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) - /* * exconvrt - object conversion */ acpi_status -acpi_ex_convert_to_integer ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - u32 flags); +acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc, + union acpi_operand_object **result_desc, u32 flags); acpi_status -acpi_ex_convert_to_buffer ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc); +acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc, + union acpi_operand_object **result_desc); acpi_status -acpi_ex_convert_to_string ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc, - u32 type); +acpi_ex_convert_to_string(union acpi_operand_object *obj_desc, + union acpi_operand_object **result_desc, u32 type); /* Types for ->String conversion */ @@ -76,587 +69,412 @@ acpi_ex_convert_to_string ( #define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003 acpi_status -acpi_ex_convert_to_target_type ( - acpi_object_type destination_type, - union acpi_operand_object *source_desc, - union acpi_operand_object **result_desc, - struct acpi_walk_state *walk_state); - +acpi_ex_convert_to_target_type(acpi_object_type destination_type, + union acpi_operand_object *source_desc, + union acpi_operand_object **result_desc, + struct acpi_walk_state *walk_state); /* * exfield - ACPI AML (p-code) execution - field manipulation */ acpi_status -acpi_ex_common_buffer_setup ( - union acpi_operand_object *obj_desc, - u32 buffer_length, - u32 *datum_count); +acpi_ex_common_buffer_setup(union acpi_operand_object *obj_desc, + u32 buffer_length, u32 * datum_count); acpi_status -acpi_ex_write_with_update_rule ( - union acpi_operand_object *obj_desc, - acpi_integer mask, - acpi_integer field_value, - u32 field_datum_byte_offset); +acpi_ex_write_with_update_rule(union acpi_operand_object *obj_desc, + acpi_integer mask, + acpi_integer field_value, + u32 field_datum_byte_offset); void -acpi_ex_get_buffer_datum( - acpi_integer *datum, - void *buffer, - u32 buffer_length, - u32 byte_granularity, - u32 buffer_offset); +acpi_ex_get_buffer_datum(acpi_integer * datum, + void *buffer, + u32 buffer_length, + u32 byte_granularity, u32 buffer_offset); void -acpi_ex_set_buffer_datum ( - acpi_integer merged_datum, - void *buffer, - u32 buffer_length, - u32 byte_granularity, - u32 buffer_offset); +acpi_ex_set_buffer_datum(acpi_integer merged_datum, + void *buffer, + u32 buffer_length, + u32 byte_granularity, u32 buffer_offset); acpi_status -acpi_ex_read_data_from_field ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *obj_desc, - union acpi_operand_object **ret_buffer_desc); +acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, + union acpi_operand_object *obj_desc, + union acpi_operand_object **ret_buffer_desc); acpi_status -acpi_ex_write_data_to_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *obj_desc, - union acpi_operand_object **result_desc); - +acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, + union acpi_operand_object *obj_desc, + union acpi_operand_object **result_desc); /* * exfldio - low level field I/O */ acpi_status -acpi_ex_extract_from_field ( - union acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); +acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, + void *buffer, u32 buffer_length); acpi_status -acpi_ex_insert_into_field ( - union acpi_operand_object *obj_desc, - void *buffer, - u32 buffer_length); +acpi_ex_insert_into_field(union acpi_operand_object *obj_desc, + void *buffer, u32 buffer_length); acpi_status -acpi_ex_access_region ( - union acpi_operand_object *obj_desc, - u32 field_datum_byte_offset, - acpi_integer *value, - u32 read_write); - +acpi_ex_access_region(union acpi_operand_object *obj_desc, + u32 field_datum_byte_offset, + acpi_integer * value, u32 read_write); /* * exmisc - misc support routines */ acpi_status -acpi_ex_get_object_reference ( - union acpi_operand_object *obj_desc, - union acpi_operand_object **return_desc, - struct acpi_walk_state *walk_state); +acpi_ex_get_object_reference(union acpi_operand_object *obj_desc, + union acpi_operand_object **return_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_concat_template ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *obj_desc2, - union acpi_operand_object **actual_return_desc, - struct acpi_walk_state *walk_state); +acpi_ex_concat_template(union acpi_operand_object *obj_desc, + union acpi_operand_object *obj_desc2, + union acpi_operand_object **actual_return_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_do_concatenate ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *obj_desc2, - union acpi_operand_object **actual_return_desc, - struct acpi_walk_state *walk_state); +acpi_ex_do_concatenate(union acpi_operand_object *obj_desc, + union acpi_operand_object *obj_desc2, + union acpi_operand_object **actual_return_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_do_logical_numeric_op ( - u16 opcode, - acpi_integer integer0, - acpi_integer integer1, - u8 *logical_result); +acpi_ex_do_logical_numeric_op(u16 opcode, + acpi_integer integer0, + acpi_integer integer1, u8 * logical_result); acpi_status -acpi_ex_do_logical_op ( - u16 opcode, - union acpi_operand_object *operand0, - union acpi_operand_object *operand1, - u8 *logical_result); +acpi_ex_do_logical_op(u16 opcode, + union acpi_operand_object *operand0, + union acpi_operand_object *operand1, u8 * logical_result); acpi_integer -acpi_ex_do_math_op ( - u16 opcode, - acpi_integer operand0, - acpi_integer operand1); +acpi_ex_do_math_op(u16 opcode, acpi_integer operand0, acpi_integer operand1); -acpi_status -acpi_ex_create_mutex ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_create_processor ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_create_power_resource ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state); acpi_status -acpi_ex_create_region ( - u8 *aml_start, - u32 aml_length, - u8 region_space, - struct acpi_walk_state *walk_state); +acpi_ex_create_region(u8 * aml_start, + u32 aml_length, + u8 region_space, struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_create_table_region ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_create_event ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_create_alias ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state); acpi_status -acpi_ex_create_method ( - u8 *aml_start, - u32 aml_length, - struct acpi_walk_state *walk_state); - +acpi_ex_create_method(u8 * aml_start, + u32 aml_length, struct acpi_walk_state *walk_state); /* * exconfig - dynamic table load/unload */ acpi_status -acpi_ex_load_op ( - union acpi_operand_object *obj_desc, - union acpi_operand_object *target, - struct acpi_walk_state *walk_state); +acpi_ex_load_op(union acpi_operand_object *obj_desc, + union acpi_operand_object *target, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_load_table_op ( - struct acpi_walk_state *walk_state, - union acpi_operand_object **return_desc); - -acpi_status -acpi_ex_unload_table ( - union acpi_operand_object *ddb_handle); +acpi_ex_load_table_op(struct acpi_walk_state *walk_state, + union acpi_operand_object **return_desc); +acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle); /* * exmutex - mutex support */ acpi_status -acpi_ex_acquire_mutex ( - union acpi_operand_object *time_desc, - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); +acpi_ex_acquire_mutex(union acpi_operand_object *time_desc, + union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_release_mutex ( - union acpi_operand_object *obj_desc, - struct acpi_walk_state *walk_state); +acpi_ex_release_mutex(union acpi_operand_object *obj_desc, + struct acpi_walk_state *walk_state); -void -acpi_ex_release_all_mutexes ( - struct acpi_thread_state *thread); - -void -acpi_ex_unlink_mutex ( - union acpi_operand_object *obj_desc); +void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); +void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); /* * exprep - ACPI AML execution - prep utilities */ acpi_status -acpi_ex_prep_common_field_object ( - union acpi_operand_object *obj_desc, - u8 field_flags, - u8 field_attribute, - u32 field_bit_position, - u32 field_bit_length); - -acpi_status -acpi_ex_prep_field_value ( - struct acpi_create_field_info *info); +acpi_ex_prep_common_field_object(union acpi_operand_object *obj_desc, + u8 field_flags, + u8 field_attribute, + u32 field_bit_position, u32 field_bit_length); +acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info); /* * exsystem - Interface to OS services */ acpi_status -acpi_ex_system_do_notify_op ( - union acpi_operand_object *value, - union acpi_operand_object *obj_desc); +acpi_ex_system_do_notify_op(union acpi_operand_object *value, + union acpi_operand_object *obj_desc); -acpi_status -acpi_ex_system_do_suspend( - acpi_integer time); +acpi_status acpi_ex_system_do_suspend(acpi_integer time); -acpi_status -acpi_ex_system_do_stall ( - u32 time); +acpi_status acpi_ex_system_do_stall(u32 time); acpi_status -acpi_ex_system_acquire_mutex( - union acpi_operand_object *time, - union acpi_operand_object *obj_desc); +acpi_ex_system_acquire_mutex(union acpi_operand_object *time, + union acpi_operand_object *obj_desc); -acpi_status -acpi_ex_system_release_mutex( - union acpi_operand_object *obj_desc); +acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc); -acpi_status -acpi_ex_system_signal_event( - union acpi_operand_object *obj_desc); +acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc); acpi_status -acpi_ex_system_wait_event( - union acpi_operand_object *time, - union acpi_operand_object *obj_desc); +acpi_ex_system_wait_event(union acpi_operand_object *time, + union acpi_operand_object *obj_desc); -acpi_status -acpi_ex_system_reset_event( - union acpi_operand_object *obj_desc); - -acpi_status -acpi_ex_system_wait_semaphore ( - acpi_handle semaphore, - u16 timeout); +acpi_status acpi_ex_system_reset_event(union acpi_operand_object *obj_desc); +acpi_status acpi_ex_system_wait_semaphore(acpi_handle semaphore, u16 timeout); /* * exoparg1 - ACPI AML execution, 1 operand */ -acpi_status -acpi_ex_opcode_0A_0T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_0A_0T_1R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_1A_0T_0R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_1A_0T_0R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_1A_0T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_1A_1T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_1A_1T_1R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_1A_1T_0R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_1A_1T_0R(struct acpi_walk_state *walk_state); /* * exoparg2 - ACPI AML execution, 2 operands */ -acpi_status -acpi_ex_opcode_2A_0T_0R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_2A_0T_0R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_2A_0T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_2A_0T_1R(struct acpi_walk_state *walk_state); -acpi_status -acpi_ex_opcode_2A_1T_1R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_2A_2T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_2A_2T_1R(struct acpi_walk_state *walk_state); /* * exoparg3 - ACPI AML execution, 3 operands */ -acpi_status -acpi_ex_opcode_3A_0T_0R ( - struct acpi_walk_state *walk_state); - -acpi_status -acpi_ex_opcode_3A_1T_1R ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state); +acpi_status acpi_ex_opcode_3A_1T_1R(struct acpi_walk_state *walk_state); /* * exoparg6 - ACPI AML execution, 6 operands */ -acpi_status -acpi_ex_opcode_6A_0T_1R ( - struct acpi_walk_state *walk_state); - +acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state); /* * exresolv - Object resolution and get value functions */ acpi_status -acpi_ex_resolve_to_value ( - union acpi_operand_object **stack_ptr, - struct acpi_walk_state *walk_state); +acpi_ex_resolve_to_value(union acpi_operand_object **stack_ptr, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_resolve_multiple ( - struct acpi_walk_state *walk_state, - union acpi_operand_object *operand, - acpi_object_type *return_type, - union acpi_operand_object **return_desc); - +acpi_ex_resolve_multiple(struct acpi_walk_state *walk_state, + union acpi_operand_object *operand, + acpi_object_type * return_type, + union acpi_operand_object **return_desc); /* * exresnte - resolve namespace node */ acpi_status -acpi_ex_resolve_node_to_value ( - struct acpi_namespace_node **stack_ptr, - struct acpi_walk_state *walk_state); - +acpi_ex_resolve_node_to_value(struct acpi_namespace_node **stack_ptr, + struct acpi_walk_state *walk_state); /* * exresop - resolve operand to value */ acpi_status -acpi_ex_resolve_operands ( - u16 opcode, - union acpi_operand_object **stack_ptr, - struct acpi_walk_state *walk_state); - +acpi_ex_resolve_operands(u16 opcode, + union acpi_operand_object **stack_ptr, + struct acpi_walk_state *walk_state); /* * exdump - Interpreter debug output routines */ -void -acpi_ex_dump_operand ( - union acpi_operand_object *obj_desc, - u32 depth); +void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth); void -acpi_ex_dump_operands ( - union acpi_operand_object **operands, - acpi_interpreter_mode interpreter_mode, - char *ident, - u32 num_levels, - char *note, - char *module_name, - u32 line_number); +acpi_ex_dump_operands(union acpi_operand_object **operands, + acpi_interpreter_mode interpreter_mode, + char *ident, + u32 num_levels, + char *note, char *module_name, u32 line_number); #ifdef ACPI_FUTURE_USAGE void -acpi_ex_dump_object_descriptor ( - union acpi_operand_object *object, - u32 flags); - -void -acpi_ex_dump_node ( - struct acpi_namespace_node *node, - u32 flags); -#endif /* ACPI_FUTURE_USAGE */ +acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); +void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); +#endif /* ACPI_FUTURE_USAGE */ /* * exnames - AML namestring support */ acpi_status -acpi_ex_get_name_string ( - acpi_object_type data_type, - u8 *in_aml_address, - char **out_name_string, - u32 *out_name_length); - +acpi_ex_get_name_string(acpi_object_type data_type, + u8 * in_aml_address, + char **out_name_string, u32 * out_name_length); /* * exstore - Object store support */ acpi_status -acpi_ex_store ( - union acpi_operand_object *val_desc, - union acpi_operand_object *dest_desc, - struct acpi_walk_state *walk_state); +acpi_ex_store(union acpi_operand_object *val_desc, + union acpi_operand_object *dest_desc, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_store_object_to_node ( - union acpi_operand_object *source_desc, - struct acpi_namespace_node *node, - struct acpi_walk_state *walk_state, - u8 implicit_conversion); +acpi_ex_store_object_to_node(union acpi_operand_object *source_desc, + struct acpi_namespace_node *node, + struct acpi_walk_state *walk_state, + u8 implicit_conversion); #define ACPI_IMPLICIT_CONVERSION TRUE #define ACPI_NO_IMPLICIT_CONVERSION FALSE - /* * exstoren - resolve/store object */ acpi_status -acpi_ex_resolve_object ( - union acpi_operand_object **source_desc_ptr, - acpi_object_type target_type, - struct acpi_walk_state *walk_state); +acpi_ex_resolve_object(union acpi_operand_object **source_desc_ptr, + acpi_object_type target_type, + struct acpi_walk_state *walk_state); acpi_status -acpi_ex_store_object_to_object ( - union acpi_operand_object *source_desc, - union acpi_operand_object *dest_desc, - union acpi_operand_object **new_desc, - struct acpi_walk_state *walk_state); - +acpi_ex_store_object_to_object(union acpi_operand_object *source_desc, + union acpi_operand_object *dest_desc, + union acpi_operand_object **new_desc, + struct acpi_walk_state *walk_state); /* * exstorob - store object - buffer/string */ acpi_status -acpi_ex_store_buffer_to_buffer ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); +acpi_ex_store_buffer_to_buffer(union acpi_operand_object *source_desc, + union acpi_operand_object *target_desc); acpi_status -acpi_ex_store_string_to_string ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - +acpi_ex_store_string_to_string(union acpi_operand_object *source_desc, + union acpi_operand_object *target_desc); /* * excopy - object copy */ acpi_status -acpi_ex_copy_integer_to_index_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); +acpi_ex_copy_integer_to_index_field(union acpi_operand_object *source_desc, + union acpi_operand_object *target_desc); acpi_status -acpi_ex_copy_integer_to_bank_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); +acpi_ex_copy_integer_to_bank_field(union acpi_operand_object *source_desc, + union acpi_operand_object *target_desc); acpi_status -acpi_ex_copy_data_to_named_field ( - union acpi_operand_object *source_desc, - struct acpi_namespace_node *node); +acpi_ex_copy_data_to_named_field(union acpi_operand_object *source_desc, + struct acpi_namespace_node *node); acpi_status -acpi_ex_copy_integer_to_buffer_field ( - union acpi_operand_object *source_desc, - union acpi_operand_object *target_desc); - +acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc, + union acpi_operand_object *target_desc); /* * exutils - interpreter/scanner utilities */ -acpi_status -acpi_ex_enter_interpreter ( - void); +acpi_status acpi_ex_enter_interpreter(void); -void -acpi_ex_exit_interpreter ( - void); +void acpi_ex_exit_interpreter(void); -void -acpi_ex_truncate_for32bit_table ( - union acpi_operand_object *obj_desc); +void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); -u8 -acpi_ex_acquire_global_lock ( - u32 rule); +u8 acpi_ex_acquire_global_lock(u32 rule); -void -acpi_ex_release_global_lock ( - u8 locked); +void acpi_ex_release_global_lock(u8 locked); -void -acpi_ex_eisa_id_to_string ( - u32 numeric_id, - char *out_string); - -void -acpi_ex_unsigned_integer_to_string ( - acpi_integer value, - char *out_string); +void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string); +void acpi_ex_unsigned_integer_to_string(acpi_integer value, char *out_string); /* * exregion - default op_region handlers */ acpi_status -acpi_ex_system_memory_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_system_io_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_pci_config_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_cmos_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_pci_bar_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_embedded_controller_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -acpi_status -acpi_ex_sm_bus_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - - -acpi_status -acpi_ex_data_table_space_handler ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); - -#endif /* __INTERP_H__ */ +acpi_ex_system_memory_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, + void *region_context); + +acpi_status +acpi_ex_system_io_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +acpi_status +acpi_ex_pci_config_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +acpi_status +acpi_ex_cmos_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +acpi_status +acpi_ex_pci_bar_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +acpi_status +acpi_ex_embedded_controller_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, + void *region_context); + +acpi_status +acpi_ex_sm_bus_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +acpi_status +acpi_ex_data_table_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, void *region_context); + +#endif /* __INTERP_H__ */ diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 4d2635698e1..9fba0fddda9 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -44,24 +44,20 @@ #ifndef __ACLOCAL_H__ #define __ACLOCAL_H__ +#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ -#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */ - -typedef void * acpi_mutex; -typedef u32 acpi_mutex_handle; - +typedef void *acpi_mutex; +typedef u32 acpi_mutex_handle; /* Total number of aml opcodes defined */ #define AML_NUM_OPCODES 0x7F - /* Forward declarations */ -struct acpi_walk_state ; +struct acpi_walk_state; struct acpi_obj_mutex; -union acpi_parse_object ; - +union acpi_parse_object; /***************************************************************************** * @@ -69,7 +65,6 @@ union acpi_parse_object ; * ****************************************************************************/ - /* * Predefined handles for the mutex objects used within the subsystem * All mutex objects are automatically created by acpi_ut_mutex_initialize. @@ -96,14 +91,12 @@ union acpi_parse_object ; #define MAX_MUTEX 12 #define NUM_MUTEX MAX_MUTEX+1 - #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) #ifdef DEFINE_ACPI_GLOBALS /* Names for the mutexes used in the subsystem */ -static char *acpi_gbl_mutex_names[] = -{ +static char *acpi_gbl_mutex_names[] = { "ACPI_MTX_Execute", "ACPI_MTX_Interpreter", "ACPI_MTX_Parser", @@ -122,10 +115,9 @@ static char *acpi_gbl_mutex_names[] = #endif #endif - /* Owner IDs are used to track namespace nodes for selective deletion */ -typedef u8 acpi_owner_id; +typedef u8 acpi_owner_id; #define ACPI_OWNER_ID_MAX 0xFF /* This Thread ID means that the mutex is not in use (unlocked) */ @@ -134,20 +126,17 @@ typedef u8 acpi_owner_id; /* Table for the global mutexes */ -struct acpi_mutex_info -{ - acpi_mutex mutex; - u32 use_count; - u32 thread_id; +struct acpi_mutex_info { + acpi_mutex mutex; + u32 use_count; + u32 thread_id; }; - /* Lock flag parameter for various interfaces */ #define ACPI_MTX_DO_NOT_LOCK 0 #define ACPI_MTX_LOCK 1 - /* Field access granularities */ #define ACPI_FIELD_BYTE_GRANULARITY 1 @@ -155,7 +144,6 @@ struct acpi_mutex_info #define ACPI_FIELD_DWORD_GRANULARITY 4 #define ACPI_FIELD_QWORD_GRANULARITY 8 - /***************************************************************************** * * Namespace typedefs and structs @@ -164,15 +152,12 @@ struct acpi_mutex_info /* Operational modes of the AML interpreter/scanner */ -typedef enum -{ - ACPI_IMODE_LOAD_PASS1 = 0x01, - ACPI_IMODE_LOAD_PASS2 = 0x02, - ACPI_IMODE_EXECUTE = 0x0E - +typedef enum { + ACPI_IMODE_LOAD_PASS1 = 0x01, + ACPI_IMODE_LOAD_PASS2 = 0x02, + ACPI_IMODE_EXECUTE = 0x0E } acpi_interpreter_mode; - /* * The Node describes a named object that appears in the AML * An acpi_node is used to store Nodes. @@ -180,41 +165,37 @@ typedef enum * data_type is used to differentiate between internal descriptors, and MUST * be the first byte in this structure. */ -union acpi_name_union -{ - u32 integer; - char ascii[4]; -}; - -struct acpi_namespace_node -{ - u8 descriptor; /* Used to differentiate object descriptor types */ - u8 type; /* Type associated with this name */ - u16 reference_count; /* Current count of references and children */ - union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ - union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ - struct acpi_namespace_node *child; /* First child */ - struct acpi_namespace_node *peer; /* Next peer*/ - u8 owner_id; /* Who created this node */ - u8 flags; +union acpi_name_union { + u32 integer; + char ascii[4]; +}; + +struct acpi_namespace_node { + u8 descriptor; /* Used to differentiate object descriptor types */ + u8 type; /* Type associated with this name */ + u16 reference_count; /* Current count of references and children */ + union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ + union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */ + struct acpi_namespace_node *child; /* First child */ + struct acpi_namespace_node *peer; /* Next peer */ + u8 owner_id; /* Who created this node */ + u8 flags; /* Fields used by the ASL compiler only */ #ifdef ACPI_ASL_COMPILER - u32 value; - union acpi_parse_object *op; + u32 value; + union acpi_parse_object *op; #endif }; - #define ACPI_ENTRY_NOT_FOUND NULL - /* Node flags */ #define ANOBJ_RESERVED 0x01 #define ANOBJ_END_OF_PEER_LIST 0x02 -#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ +#define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */ #define ANOBJ_METHOD_ARG 0x08 #define ANOBJ_METHOD_LOCAL 0x10 #define ANOBJ_METHOD_NO_RETVAL 0x20 @@ -224,91 +205,77 @@ struct acpi_namespace_node /* * ACPI Table Descriptor. One per ACPI table */ -struct acpi_table_desc -{ - struct acpi_table_desc *prev; - struct acpi_table_desc *next; - struct acpi_table_desc *installed_desc; - struct acpi_table_header *pointer; - u8 *aml_start; - u64 physical_address; - u32 aml_length; - acpi_size length; - acpi_owner_id owner_id; - u8 type; - u8 allocation; - u8 loaded_into_namespace; +struct acpi_table_desc { + struct acpi_table_desc *prev; + struct acpi_table_desc *next; + struct acpi_table_desc *installed_desc; + struct acpi_table_header *pointer; + u8 *aml_start; + u64 physical_address; + u32 aml_length; + acpi_size length; + acpi_owner_id owner_id; + u8 type; + u8 allocation; + u8 loaded_into_namespace; }; -struct acpi_table_list -{ - struct acpi_table_desc *next; - u32 count; +struct acpi_table_list { + struct acpi_table_desc *next; + u32 count; }; - -struct acpi_find_context -{ - char *search_for; - acpi_handle *list; - u32 *count; +struct acpi_find_context { + char *search_for; + acpi_handle *list; + u32 *count; }; - -struct acpi_ns_search_data -{ - struct acpi_namespace_node *node; +struct acpi_ns_search_data { + struct acpi_namespace_node *node; }; - /* * Predefined Namespace items */ -struct acpi_predefined_names -{ - char *name; - u8 type; - char *val; +struct acpi_predefined_names { + char *name; + u8 type; + char *val; }; - /* Object types used during package copies */ - #define ACPI_COPY_TYPE_SIMPLE 0 #define ACPI_COPY_TYPE_PACKAGE 1 /* Info structure used to convert external<->internal namestrings */ -struct acpi_namestring_info -{ - char *external_name; - char *next_external_char; - char *internal_name; - u32 length; - u32 num_segments; - u32 num_carats; - u8 fully_qualified; +struct acpi_namestring_info { + char *external_name; + char *next_external_char; + char *internal_name; + u32 length; + u32 num_segments; + u32 num_carats; + u8 fully_qualified; }; - /* Field creation info */ -struct acpi_create_field_info -{ - struct acpi_namespace_node *region_node; - struct acpi_namespace_node *field_node; - struct acpi_namespace_node *register_node; - struct acpi_namespace_node *data_register_node; - u32 bank_value; - u32 field_bit_position; - u32 field_bit_length; - u8 field_flags; - u8 attribute; - u8 field_type; +struct acpi_create_field_info { + struct acpi_namespace_node *region_node; + struct acpi_namespace_node *field_node; + struct acpi_namespace_node *register_node; + struct acpi_namespace_node *data_register_node; + u32 bank_value; + u32 field_bit_position; + u32 field_bit_length; + u8 field_flags; + u8 attribute; + u8 field_type; }; - /***************************************************************************** * * Event typedefs and structs @@ -317,108 +284,95 @@ struct acpi_create_field_info /* Dispatch info for each GPE -- either a method or handler, cannot be both */ -struct acpi_handler_info -{ - acpi_event_handler address; /* Address of handler, if any */ - void *context; /* Context to be passed to handler */ - struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ +struct acpi_handler_info { + acpi_event_handler address; /* Address of handler, if any */ + void *context; /* Context to be passed to handler */ + struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */ }; -union acpi_gpe_dispatch_info -{ - struct acpi_namespace_node *method_node; /* Method node for this GPE level */ - struct acpi_handler_info *handler; +union acpi_gpe_dispatch_info { + struct acpi_namespace_node *method_node; /* Method node for this GPE level */ + struct acpi_handler_info *handler; }; /* * Information about a GPE, one per each GPE in an array. * NOTE: Important to keep this struct as small as possible. */ -struct acpi_gpe_event_info -{ - union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ - struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ - u8 flags; /* Misc info about this GPE */ - u8 register_bit; /* This GPE bit within the register */ +struct acpi_gpe_event_info { + union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ + struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ + u8 flags; /* Misc info about this GPE */ + u8 register_bit; /* This GPE bit within the register */ }; /* Information about a GPE register pair, one per each status/enable pair in an array */ -struct acpi_gpe_register_info -{ - struct acpi_generic_address status_address; /* Address of status reg */ - struct acpi_generic_address enable_address; /* Address of enable reg */ - u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ - u8 enable_for_run; /* GPEs to keep enabled when running */ - u8 base_gpe_number; /* Base GPE number for this register */ +struct acpi_gpe_register_info { + struct acpi_generic_address status_address; /* Address of status reg */ + struct acpi_generic_address enable_address; /* Address of enable reg */ + u8 enable_for_wake; /* GPEs to keep enabled when sleeping */ + u8 enable_for_run; /* GPEs to keep enabled when running */ + u8 base_gpe_number; /* Base GPE number for this register */ }; /* * Information about a GPE register block, one per each installed block -- * GPE0, GPE1, and one per each installed GPE Block Device. */ -struct acpi_gpe_block_info -{ - struct acpi_namespace_node *node; - struct acpi_gpe_block_info *previous; - struct acpi_gpe_block_info *next; - struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ - struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ - struct acpi_gpe_event_info *event_info; /* One for each GPE */ - struct acpi_generic_address block_address; /* Base address of the block */ - u32 register_count; /* Number of register pairs in block */ - u8 block_base_number;/* Base GPE number for this block */ +struct acpi_gpe_block_info { + struct acpi_namespace_node *node; + struct acpi_gpe_block_info *previous; + struct acpi_gpe_block_info *next; + struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */ + struct acpi_gpe_register_info *register_info; /* One per GPE register pair */ + struct acpi_gpe_event_info *event_info; /* One for each GPE */ + struct acpi_generic_address block_address; /* Base address of the block */ + u32 register_count; /* Number of register pairs in block */ + u8 block_base_number; /* Base GPE number for this block */ }; /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ -struct acpi_gpe_xrupt_info -{ - struct acpi_gpe_xrupt_info *previous; - struct acpi_gpe_xrupt_info *next; - struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ - u32 interrupt_number; /* System interrupt number */ +struct acpi_gpe_xrupt_info { + struct acpi_gpe_xrupt_info *previous; + struct acpi_gpe_xrupt_info *next; + struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */ + u32 interrupt_number; /* System interrupt number */ }; - -struct acpi_gpe_walk_info -{ - struct acpi_namespace_node *gpe_device; - struct acpi_gpe_block_info *gpe_block; +struct acpi_gpe_walk_info { + struct acpi_namespace_node *gpe_device; + struct acpi_gpe_block_info *gpe_block; }; - -typedef acpi_status (*ACPI_GPE_CALLBACK) ( - struct acpi_gpe_xrupt_info *gpe_xrupt_info, - struct acpi_gpe_block_info *gpe_block); - +typedef acpi_status(*ACPI_GPE_CALLBACK) (struct acpi_gpe_xrupt_info * + gpe_xrupt_info, + struct acpi_gpe_block_info * + gpe_block); /* Information about each particular fixed event */ -struct acpi_fixed_event_handler -{ - acpi_event_handler handler; /* Address of handler. */ - void *context; /* Context to be passed to handler */ +struct acpi_fixed_event_handler { + acpi_event_handler handler; /* Address of handler. */ + void *context; /* Context to be passed to handler */ }; -struct acpi_fixed_event_info -{ - u8 status_register_id; - u8 enable_register_id; - u16 status_bit_mask; - u16 enable_bit_mask; +struct acpi_fixed_event_info { + u8 status_register_id; + u8 enable_register_id; + u16 status_bit_mask; + u16 enable_bit_mask; }; /* Information used during field processing */ -struct acpi_field_info -{ - u8 skip_field; - u8 field_flag; - u32 pkg_length; +struct acpi_field_info { + u8 skip_field; + u8 field_flag; + u32 pkg_length; }; - /***************************************************************************** * * Generic "state" object for stacks @@ -431,7 +385,6 @@ struct acpi_field_info #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 - #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ u8 data_type; /* To differentiate various internal objs */\ u8 flags; \ @@ -440,147 +393,112 @@ struct acpi_field_info u16 reserved; \ void *next; \ -struct acpi_common_state -{ - ACPI_STATE_COMMON -}; - +struct acpi_common_state { +ACPI_STATE_COMMON}; /* * Update state - used to traverse complex objects such as packages */ -struct acpi_update_state -{ - ACPI_STATE_COMMON - union acpi_operand_object *object; +struct acpi_update_state { + ACPI_STATE_COMMON union acpi_operand_object *object; }; - /* * Pkg state - used to traverse nested package structures */ -struct acpi_pkg_state -{ - ACPI_STATE_COMMON - union acpi_operand_object *source_object; - union acpi_operand_object *dest_object; - struct acpi_walk_state *walk_state; - void *this_target_obj; - u32 num_packages; - u16 index; +struct acpi_pkg_state { + ACPI_STATE_COMMON union acpi_operand_object *source_object; + union acpi_operand_object *dest_object; + struct acpi_walk_state *walk_state; + void *this_target_obj; + u32 num_packages; + u16 index; }; - /* * Control state - one per if/else and while constructs. * Allows nesting of these constructs */ -struct acpi_control_state -{ - ACPI_STATE_COMMON - union acpi_parse_object *predicate_op; - u8 *aml_predicate_start; /* Start of if/while predicate */ - u8 *package_end; /* End of if/while block */ - u16 opcode; +struct acpi_control_state { + ACPI_STATE_COMMON union acpi_parse_object *predicate_op; + u8 *aml_predicate_start; /* Start of if/while predicate */ + u8 *package_end; /* End of if/while block */ + u16 opcode; }; - /* * Scope state - current scope during namespace lookups */ -struct acpi_scope_state -{ - ACPI_STATE_COMMON - struct acpi_namespace_node *node; +struct acpi_scope_state { + ACPI_STATE_COMMON struct acpi_namespace_node *node; }; - -struct acpi_pscope_state -{ - ACPI_STATE_COMMON - union acpi_parse_object *op; /* Current op being parsed */ - u8 *arg_end; /* Current argument end */ - u8 *pkg_end; /* Current package end */ - u32 arg_list; /* Next argument to parse */ - u32 arg_count; /* Number of fixed arguments */ +struct acpi_pscope_state { + ACPI_STATE_COMMON union acpi_parse_object *op; /* Current op being parsed */ + u8 *arg_end; /* Current argument end */ + u8 *pkg_end; /* Current package end */ + u32 arg_list; /* Next argument to parse */ + u32 arg_count; /* Number of fixed arguments */ }; - /* * Thread state - one per thread across multiple walk states. Multiple walk * states are created when there are nested control methods executing. */ -struct acpi_thread_state -{ - ACPI_STATE_COMMON - struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ - union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ - u32 thread_id; /* Running thread ID */ - u8 current_sync_level; /* Mutex Sync (nested acquire) level */ +struct acpi_thread_state { + ACPI_STATE_COMMON struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */ + union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */ + u32 thread_id; /* Running thread ID */ + u8 current_sync_level; /* Mutex Sync (nested acquire) level */ }; - /* * Result values - used to accumulate the results of nested * AML arguments */ -struct acpi_result_values -{ +struct acpi_result_values { ACPI_STATE_COMMON - union acpi_operand_object *obj_desc [ACPI_OBJ_NUM_OPERANDS]; - u8 num_results; - u8 last_insert; + union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS]; + u8 num_results; + u8 last_insert; }; - typedef -acpi_status (*acpi_parse_downwards) ( - struct acpi_walk_state *walk_state, - union acpi_parse_object **out_op); - -typedef -acpi_status (*acpi_parse_upwards) ( - struct acpi_walk_state *walk_state); +acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state, + union acpi_parse_object ** out_op); +typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state); /* * Notify info - used to pass info to the deferred notify * handler/dispatcher. */ -struct acpi_notify_info -{ - ACPI_STATE_COMMON - struct acpi_namespace_node *node; - union acpi_operand_object *handler_obj; +struct acpi_notify_info { + ACPI_STATE_COMMON struct acpi_namespace_node *node; + union acpi_operand_object *handler_obj; }; - /* Generic state is union of structs above */ -union acpi_generic_state -{ - struct acpi_common_state common; - struct acpi_control_state control; - struct acpi_update_state update; - struct acpi_scope_state scope; - struct acpi_pscope_state parse_scope; - struct acpi_pkg_state pkg; - struct acpi_thread_state thread; - struct acpi_result_values results; - struct acpi_notify_info notify; +union acpi_generic_state { + struct acpi_common_state common; + struct acpi_control_state control; + struct acpi_update_state update; + struct acpi_scope_state scope; + struct acpi_pscope_state parse_scope; + struct acpi_pkg_state pkg; + struct acpi_thread_state thread; + struct acpi_result_values results; + struct acpi_notify_info notify; }; - /***************************************************************************** * * Interpreter typedefs and structs * ****************************************************************************/ -typedef -acpi_status (*ACPI_EXECUTE_OP) ( - struct acpi_walk_state *walk_state); - +typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state); /***************************************************************************** * @@ -591,28 +509,26 @@ acpi_status (*ACPI_EXECUTE_OP) ( /* * AML opcode, name, and argument layout */ -struct acpi_opcode_info -{ +struct acpi_opcode_info { #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) - char *name; /* Opcode name (disassembler/debug only) */ + char *name; /* Opcode name (disassembler/debug only) */ #endif - u32 parse_args; /* Grammar/Parse time arguments */ - u32 runtime_args; /* Interpret time arguments */ - u32 flags; /* Misc flags */ - u8 object_type; /* Corresponding internal object type */ - u8 class; /* Opcode class */ - u8 type; /* Opcode type */ + u32 parse_args; /* Grammar/Parse time arguments */ + u32 runtime_args; /* Interpret time arguments */ + u32 flags; /* Misc flags */ + u8 object_type; /* Corresponding internal object type */ + u8 class; /* Opcode class */ + u8 type; /* Opcode type */ }; -union acpi_parse_value -{ - acpi_integer integer; /* Integer constant (Up to 64 bits) */ - struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ - u32 size; /* bytelist or field size */ - char *string; /* NULL terminated string */ - u8 *buffer; /* buffer or string */ - char *name; /* NULL terminated string */ - union acpi_parse_object *arg; /* arguments and contained ops */ +union acpi_parse_value { + acpi_integer integer; /* Integer constant (Up to 64 bits) */ + struct uint64_struct integer64; /* Structure overlay for 2 32-bit Dwords */ + u32 size; /* bytelist or field size */ + char *string; /* NULL terminated string */ + u8 *buffer; /* buffer or string */ + char *name; /* NULL terminated string */ + union acpi_parse_object *arg; /* arguments and contained ops */ }; #define ACPI_PARSE_COMMON \ @@ -641,84 +557,72 @@ union acpi_parse_value /* * generic operation (for example: If, While, Store) */ -struct acpi_parse_obj_common -{ - ACPI_PARSE_COMMON -}; - +struct acpi_parse_obj_common { +ACPI_PARSE_COMMON}; /* * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions), * and bytelists. */ -struct acpi_parse_obj_named -{ - ACPI_PARSE_COMMON - u8 *path; - u8 *data; /* AML body or bytelist data */ - u32 length; /* AML length */ - u32 name; /* 4-byte name or zero if no name */ +struct acpi_parse_obj_named { + ACPI_PARSE_COMMON u8 * path; + u8 *data; /* AML body or bytelist data */ + u32 length; /* AML length */ + u32 name; /* 4-byte name or zero if no name */ }; - /* The parse node is the fundamental element of the parse tree */ -struct acpi_parse_obj_asl -{ - ACPI_PARSE_COMMON - union acpi_parse_object *child; - union acpi_parse_object *parent_method; - char *filename; - char *external_name; - char *namepath; - char name_seg[4]; - u32 extra_value; - u32 column; - u32 line_number; - u32 logical_line_number; - u32 logical_byte_offset; - u32 end_line; - u32 end_logical_line; - u32 acpi_btype; - u32 aml_length; - u32 aml_subtree_length; - u32 final_aml_length; - u32 final_aml_offset; - u32 compile_flags; - u16 parse_opcode; - u8 aml_opcode_length; - u8 aml_pkg_len_bytes; - u8 extra; - char parse_op_name[12]; -}; - -union acpi_parse_object -{ - struct acpi_parse_obj_common common; - struct acpi_parse_obj_named named; - struct acpi_parse_obj_asl asl; +struct acpi_parse_obj_asl { + ACPI_PARSE_COMMON union acpi_parse_object *child; + union acpi_parse_object *parent_method; + char *filename; + char *external_name; + char *namepath; + char name_seg[4]; + u32 extra_value; + u32 column; + u32 line_number; + u32 logical_line_number; + u32 logical_byte_offset; + u32 end_line; + u32 end_logical_line; + u32 acpi_btype; + u32 aml_length; + u32 aml_subtree_length; + u32 final_aml_length; + u32 final_aml_offset; + u32 compile_flags; + u16 parse_opcode; + u8 aml_opcode_length; + u8 aml_pkg_len_bytes; + u8 extra; + char parse_op_name[12]; +}; + +union acpi_parse_object { + struct acpi_parse_obj_common common; + struct acpi_parse_obj_named named; + struct acpi_parse_obj_asl asl; }; - /* * Parse state - one state per parser invocation and each control * method. */ -struct acpi_parse_state -{ - u32 aml_size; - u8 *aml_start; /* First AML byte */ - u8 *aml; /* Next AML byte */ - u8 *aml_end; /* (last + 1) AML byte */ - u8 *pkg_start; /* Current package begin */ - u8 *pkg_end; /* Current package end */ - union acpi_parse_object *start_op; /* Root of parse tree */ - struct acpi_namespace_node *start_node; - union acpi_generic_state *scope; /* Current scope */ - union acpi_parse_object *start_scope; +struct acpi_parse_state { + u32 aml_size; + u8 *aml_start; /* First AML byte */ + u8 *aml; /* Next AML byte */ + u8 *aml_end; /* (last + 1) AML byte */ + u8 *pkg_start; /* Current package begin */ + u8 *pkg_end; /* Current package end */ + union acpi_parse_object *start_op; /* Root of parse tree */ + struct acpi_namespace_node *start_node; + union acpi_generic_state *scope; /* Current scope */ + union acpi_parse_object *start_scope; }; - /* Parse object flags */ #define ACPI_PARSEOP_GENERIC 0x01 @@ -734,7 +638,6 @@ struct acpi_parse_state #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 #define ACPI_PARSEOP_SPECIAL 0x10 - /***************************************************************************** * * Hardware (ACPI registers) and PNP @@ -744,14 +647,12 @@ struct acpi_parse_state #define PCI_ROOT_HID_STRING "PNP0A03" #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" -struct acpi_bit_register_info -{ - u8 parent_register; - u8 bit_position; - u16 access_bit_mask; +struct acpi_bit_register_info { + u8 parent_register; + u8 bit_position; + u16 access_bit_mask; }; - /* * Register IDs * These are the full ACPI registers @@ -766,7 +667,6 @@ struct acpi_bit_register_info #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09 - /* Masks used to access the bit_registers */ #define ACPI_BITMASK_TIMER_STATUS 0x0001 @@ -775,7 +675,7 @@ struct acpi_bit_register_info #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 -#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ +#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ #define ACPI_BITMASK_WAKE_STATUS 0x8000 #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \ @@ -791,7 +691,7 @@ struct acpi_bit_register_info #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 -#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ +#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ #define ACPI_BITMASK_SCI_ENABLE 0x0001 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 @@ -801,7 +701,6 @@ struct acpi_bit_register_info #define ACPI_BITMASK_ARB_DISABLE 0x0001 - /* Raw bit position of each bit_register */ #define ACPI_BITPOSITION_TIMER_STATUS 0x00 @@ -810,7 +709,7 @@ struct acpi_bit_register_info #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A -#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ +#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ #define ACPI_BITPOSITION_WAKE_STATUS 0x0F #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 @@ -818,7 +717,7 @@ struct acpi_bit_register_info #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A -#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ +#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ #define ACPI_BITPOSITION_SCI_ENABLE 0x00 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 @@ -828,7 +727,6 @@ struct acpi_bit_register_info #define ACPI_BITPOSITION_ARB_DISABLE 0x00 - /***************************************************************************** * * Resource descriptors @@ -847,8 +745,7 @@ struct acpi_bit_register_info #define ACPI_RDESC_TYPE_SMALL 0x00 #define ACPI_RDESC_TYPE_MASK 0x80 -#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ - +#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ /* * Small resource descriptor types @@ -877,7 +774,6 @@ struct acpi_bit_register_info #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B - /***************************************************************************** * * Miscellaneous @@ -886,35 +782,30 @@ struct acpi_bit_register_info #define ACPI_ASCII_ZERO 0x30 - /***************************************************************************** * * Debugger * ****************************************************************************/ -struct acpi_db_method_info -{ - acpi_handle thread_gate; - char *name; - char **args; - u32 flags; - u32 num_loops; - char pathname[128]; +struct acpi_db_method_info { + acpi_handle thread_gate; + char *name; + char **args; + u32 flags; + u32 num_loops; + char pathname[128]; }; -struct acpi_integrity_info -{ - u32 nodes; - u32 objects; +struct acpi_integrity_info { + u32 nodes; + u32 objects; }; - #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 #define ACPI_DB_CONSOLE_OUTPUT 0x02 #define ACPI_DB_DUPLICATE_OUTPUT 0x03 - /***************************************************************************** * * Debug @@ -936,43 +827,36 @@ struct acpi_integrity_info char module[ACPI_MAX_MODULE_NAME]; \ u8 alloc_type; -struct acpi_debug_mem_header -{ - ACPI_COMMON_DEBUG_MEM_HEADER -}; +struct acpi_debug_mem_header { +ACPI_COMMON_DEBUG_MEM_HEADER}; -struct acpi_debug_mem_block -{ - ACPI_COMMON_DEBUG_MEM_HEADER - u64 user_space; +struct acpi_debug_mem_block { + ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space; }; - #define ACPI_MEM_LIST_GLOBAL 0 #define ACPI_MEM_LIST_NSNODE 1 #define ACPI_MEM_LIST_MAX 1 #define ACPI_NUM_MEM_LISTS 2 - -struct acpi_memory_list -{ - char *list_name; - void *list_head; - u16 object_size; - u16 max_depth; - u16 current_depth; - u16 link_offset; +struct acpi_memory_list { + char *list_name; + void *list_head; + u16 object_size; + u16 max_depth; + u16 current_depth; + u16 link_offset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS /* Statistics for debug memory tracking only */ - u32 total_allocated; - u32 total_freed; - u32 current_total_size; - u32 requests; - u32 hits; + u32 total_allocated; + u32 total_freed; + u32 current_total_size; + u32 requests; + u32 hits; #endif }; -#endif /* __ACLOCAL_H__ */ +#endif /* __ACLOCAL_H__ */ diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index fcdef0a4b01..702cc4e57f5 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -44,7 +44,6 @@ #ifndef __ACMACROS_H__ #define __ACMACROS_H__ - /* * Data manipulation macros */ @@ -57,7 +56,6 @@ #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) - #if ACPI_MACHINE_WIDTH == 16 /* @@ -168,7 +166,7 @@ /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ @@ -183,9 +181,9 @@ /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ @@ -219,14 +217,14 @@ /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) #else @@ -238,14 +236,14 @@ /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) #define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) #endif @@ -266,7 +264,7 @@ /* 32-bit source, 16/32/64 destination */ -#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ @@ -277,8 +275,8 @@ /* 64-bit source, 16/32/64 destination */ -#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ -#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ +#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ +#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ @@ -305,7 +303,6 @@ #error unknown ACPI_MACHINE_WIDTH #endif - /* * Fast power-of-two math macros for non-optimized compilers */ @@ -329,7 +326,6 @@ #define ACPI_MUL_16(a) _ACPI_MUL(a,4) #define ACPI_MOD_16(a) _ACPI_MOD(a,16) - /* * Rounding macros (Power of two boundaries only) */ @@ -344,7 +340,6 @@ #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) - #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) @@ -365,7 +360,6 @@ #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) - /* Bitfields within ACPI registers */ #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) @@ -381,7 +375,6 @@ #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) - /* Macro to test the object type */ #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) @@ -430,7 +423,6 @@ #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) - /* * Reporting macros that are never compiled out */ @@ -554,20 +546,17 @@ #define ACPI_DEBUG_ONLY_MEMBERS(a) a; #define _VERBOSE_STRUCTURES - /* Stack and buffer dumping */ #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) #define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) - #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) - /* * Generate INT3 on ACPI_ERROR (Debug only!) */ @@ -588,7 +577,6 @@ #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) - #else /* * This is the non-debug case -- make everything go away, @@ -639,7 +627,6 @@ #define ACPI_DEBUGGER_EXEC(a) #endif - /* * For 16-bit code, we want to shrink some things even though * we are using ACPI_DEBUG_OUTPUT to get the debug output @@ -650,7 +637,6 @@ #define ACPI_DEBUG_ONLY_MEMBERS(a) #endif - #ifdef ACPI_DEBUG_OUTPUT /* * 1) Set name to blanks @@ -663,7 +649,6 @@ #define ACPI_ADD_OBJECT_NAME(a,b) #endif - /* * Memory allocation tracking (DEBUG ONLY) */ @@ -685,6 +670,6 @@ #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) #define ACPI_MEM_TRACKING(a) a -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ +#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ -#endif /* ACMACROS_H */ +#endif /* ACMACROS_H */ diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 280e9ed7667..79152fbc8f8 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -71,9 +71,9 @@ /* Definitions of the predefined namespace names */ -#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ -#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ -#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ +#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ +#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ +#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ #define ACPI_NS_ROOT_PATH "\\" #define ACPI_NS_SYSTEM_BUS "_SB_" @@ -83,7 +83,4 @@ #define ACPI_FUNCTION_PREFIX2 'ipca' /*! [End] no source code translation !*/ - -#endif /* __ACNAMES_H__ */ - - +#endif /* __ACNAMES_H__ */ diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index 0c9ba707925..dd3501f7e5d 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -44,7 +44,6 @@ #ifndef __ACNAMESP_H__ #define __ACNAMESP_H__ - /* To search the entire name space, pass this as search_base */ #define ACPI_NS_ALL ((acpi_handle)0) @@ -54,8 +53,8 @@ * and should be one-to-one with values of acpi_object_type */ #define ACPI_NS_NORMAL 0 -#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ -#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ +#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ +#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ @@ -68,357 +67,237 @@ #define ACPI_NS_WALK_UNLOCK TRUE #define ACPI_NS_WALK_NO_UNLOCK FALSE - /* * nsinit - Namespace initialization */ -acpi_status -acpi_ns_initialize_objects ( - void); - -acpi_status -acpi_ns_initialize_devices ( - void); +acpi_status acpi_ns_initialize_objects(void); +acpi_status acpi_ns_initialize_devices(void); /* * nsload - Namespace loading */ -acpi_status -acpi_ns_load_namespace ( - void); +acpi_status acpi_ns_load_namespace(void); acpi_status -acpi_ns_load_table ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *node); - +acpi_ns_load_table(struct acpi_table_desc *table_desc, + struct acpi_namespace_node *node); /* * nswalk - walk the namespace */ acpi_status -acpi_ns_walk_namespace ( - acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - u8 unlock_before_callback, - acpi_walk_callback user_function, - void *context, - void **return_value); - -struct acpi_namespace_node * -acpi_ns_get_next_node ( - acpi_object_type type, - struct acpi_namespace_node *parent, - struct acpi_namespace_node *child); - +acpi_ns_walk_namespace(acpi_object_type type, + acpi_handle start_object, + u32 max_depth, + u8 unlock_before_callback, + acpi_walk_callback user_function, + void *context, void **return_value); + +struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, + struct acpi_namespace_node + *parent, + struct acpi_namespace_node + *child); /* * nsparse - table parsing */ acpi_status -acpi_ns_parse_table ( - struct acpi_table_desc *table_desc, - struct acpi_namespace_node *scope); +acpi_ns_parse_table(struct acpi_table_desc *table_desc, + struct acpi_namespace_node *scope); acpi_status -acpi_ns_one_complete_parse ( - u8 pass_number, - struct acpi_table_desc *table_desc); - +acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc); /* * nsaccess - Top-level namespace access */ -acpi_status -acpi_ns_root_initialize ( - void); +acpi_status acpi_ns_root_initialize(void); acpi_status -acpi_ns_lookup ( - union acpi_generic_state *scope_info, - char *name, - acpi_object_type type, - acpi_interpreter_mode interpreter_mode, - u32 flags, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node **ret_node); - +acpi_ns_lookup(union acpi_generic_state *scope_info, + char *name, + acpi_object_type type, + acpi_interpreter_mode interpreter_mode, + u32 flags, + struct acpi_walk_state *walk_state, + struct acpi_namespace_node **ret_node); /* * nsalloc - Named object allocation/deallocation */ -struct acpi_namespace_node * -acpi_ns_create_node ( - u32 name); - -void -acpi_ns_delete_node ( - struct acpi_namespace_node *node); +struct acpi_namespace_node *acpi_ns_create_node(u32 name); -void -acpi_ns_delete_namespace_subtree ( - struct acpi_namespace_node *parent_handle); +void acpi_ns_delete_node(struct acpi_namespace_node *node); void -acpi_ns_delete_namespace_by_owner ( - acpi_owner_id owner_id); +acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle); -void -acpi_ns_detach_object ( - struct acpi_namespace_node *node); +void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id); -void -acpi_ns_delete_children ( - struct acpi_namespace_node *parent); +void acpi_ns_detach_object(struct acpi_namespace_node *node); -int -acpi_ns_compare_names ( - char *name1, - char *name2); +void acpi_ns_delete_children(struct acpi_namespace_node *parent); +int acpi_ns_compare_names(char *name1, char *name2); /* * nsdump - Namespace dump/print utilities */ #ifdef ACPI_FUTURE_USAGE -void -acpi_ns_dump_tables ( - acpi_handle search_base, - u32 max_depth); -#endif /* ACPI_FUTURE_USAGE */ +void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth); +#endif /* ACPI_FUTURE_USAGE */ -void -acpi_ns_dump_entry ( - acpi_handle handle, - u32 debug_level); +void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level); void -acpi_ns_dump_pathname ( - acpi_handle handle, - char *msg, - u32 level, - u32 component); +acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component); -void -acpi_ns_print_pathname ( - u32 num_segments, - char *pathname); +void acpi_ns_print_pathname(u32 num_segments, char *pathname); acpi_status -acpi_ns_dump_one_object ( - acpi_handle obj_handle, - u32 level, - void *context, - void **return_value); +acpi_ns_dump_one_object(acpi_handle obj_handle, + u32 level, void *context, void **return_value); #ifdef ACPI_FUTURE_USAGE void -acpi_ns_dump_objects ( - acpi_object_type type, - u8 display_type, - u32 max_depth, - acpi_owner_id owner_id, - acpi_handle start_handle); -#endif /* ACPI_FUTURE_USAGE */ - +acpi_ns_dump_objects(acpi_object_type type, + u8 display_type, + u32 max_depth, + acpi_owner_id owner_id, acpi_handle start_handle); +#endif /* ACPI_FUTURE_USAGE */ /* * nseval - Namespace evaluation functions */ -acpi_status -acpi_ns_evaluate_by_handle ( - struct acpi_parameter_info *info); +acpi_status acpi_ns_evaluate_by_handle(struct acpi_parameter_info *info); acpi_status -acpi_ns_evaluate_by_name ( - char *pathname, - struct acpi_parameter_info *info); +acpi_ns_evaluate_by_name(char *pathname, struct acpi_parameter_info *info); acpi_status -acpi_ns_evaluate_relative ( - char *pathname, - struct acpi_parameter_info *info); - +acpi_ns_evaluate_relative(char *pathname, struct acpi_parameter_info *info); /* * nsnames - Name and Scope manipulation */ -u32 -acpi_ns_opens_scope ( - acpi_object_type type); +u32 acpi_ns_opens_scope(acpi_object_type type); -char * -acpi_ns_get_external_pathname ( - struct acpi_namespace_node *node); +char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node); -char * -acpi_ns_name_of_current_scope ( - struct acpi_walk_state *walk_state); +char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state); acpi_status -acpi_ns_handle_to_pathname ( - acpi_handle target_handle, - struct acpi_buffer *buffer); +acpi_ns_handle_to_pathname(acpi_handle target_handle, + struct acpi_buffer *buffer); u8 -acpi_ns_pattern_match ( - struct acpi_namespace_node *obj_node, - char *search_for); +acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for); acpi_status -acpi_ns_get_node_by_path ( - char *external_pathname, - struct acpi_namespace_node *in_prefix_node, - u32 flags, - struct acpi_namespace_node **out_node); - -acpi_size -acpi_ns_get_pathname_length ( - struct acpi_namespace_node *node); +acpi_ns_get_node_by_path(char *external_pathname, + struct acpi_namespace_node *in_prefix_node, + u32 flags, struct acpi_namespace_node **out_node); +acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node); /* * nsobject - Object management for namespace nodes */ acpi_status -acpi_ns_attach_object ( - struct acpi_namespace_node *node, - union acpi_operand_object *object, - acpi_object_type type); +acpi_ns_attach_object(struct acpi_namespace_node *node, + union acpi_operand_object *object, acpi_object_type type); -union acpi_operand_object * -acpi_ns_get_attached_object ( - struct acpi_namespace_node *node); +union acpi_operand_object *acpi_ns_get_attached_object(struct + acpi_namespace_node + *node); -union acpi_operand_object * -acpi_ns_get_secondary_object ( - union acpi_operand_object *obj_desc); +union acpi_operand_object *acpi_ns_get_secondary_object(union + acpi_operand_object + *obj_desc); acpi_status -acpi_ns_attach_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler, - void *data); +acpi_ns_attach_data(struct acpi_namespace_node *node, + acpi_object_handler handler, void *data); acpi_status -acpi_ns_detach_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler); +acpi_ns_detach_data(struct acpi_namespace_node *node, + acpi_object_handler handler); acpi_status -acpi_ns_get_attached_data ( - struct acpi_namespace_node *node, - acpi_object_handler handler, - void **data); - +acpi_ns_get_attached_data(struct acpi_namespace_node *node, + acpi_object_handler handler, void **data); /* * nssearch - Namespace searching and entry */ acpi_status -acpi_ns_search_and_enter ( - u32 entry_name, - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *node, - acpi_interpreter_mode interpreter_mode, - acpi_object_type type, - u32 flags, - struct acpi_namespace_node **ret_node); +acpi_ns_search_and_enter(u32 entry_name, + struct acpi_walk_state *walk_state, + struct acpi_namespace_node *node, + acpi_interpreter_mode interpreter_mode, + acpi_object_type type, + u32 flags, struct acpi_namespace_node **ret_node); acpi_status -acpi_ns_search_node ( - u32 entry_name, - struct acpi_namespace_node *node, - acpi_object_type type, - struct acpi_namespace_node **ret_node); +acpi_ns_search_node(u32 entry_name, + struct acpi_namespace_node *node, + acpi_object_type type, + struct acpi_namespace_node **ret_node); void -acpi_ns_install_node ( - struct acpi_walk_state *walk_state, - struct acpi_namespace_node *parent_node, - struct acpi_namespace_node *node, - acpi_object_type type); - +acpi_ns_install_node(struct acpi_walk_state *walk_state, + struct acpi_namespace_node *parent_node, + struct acpi_namespace_node *node, acpi_object_type type); /* * nsutils - Utility functions */ -u8 -acpi_ns_valid_root_prefix ( - char prefix); +u8 acpi_ns_valid_root_prefix(char prefix); -acpi_object_type -acpi_ns_get_type ( - struct acpi_namespace_node *node); +acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node); -u32 -acpi_ns_local ( - acpi_object_type type); +u32 acpi_ns_local(acpi_object_type type); void -acpi_ns_report_error ( - char *module_name, - u32 line_number, - u32 component_id, - char *internal_name, - acpi_status lookup_status); +acpi_ns_report_error(char *module_name, + u32 line_number, + u32 component_id, + char *internal_name, acpi_status lookup_status); void -acpi_ns_report_method_error ( - char *module_name, - u32 line_number, - u32 component_id, - char *message, - struct acpi_namespace_node *node, - char *path, - acpi_status lookup_status); +acpi_ns_report_method_error(char *module_name, + u32 line_number, + u32 component_id, + char *message, + struct acpi_namespace_node *node, + char *path, acpi_status lookup_status); -void -acpi_ns_print_node_pathname ( - struct acpi_namespace_node *node, - char *msg); +void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg); -acpi_status -acpi_ns_build_internal_name ( - struct acpi_namestring_info *info); +acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info); -void -acpi_ns_get_internal_name_length ( - struct acpi_namestring_info *info); +void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info); -acpi_status -acpi_ns_internalize_name ( - char *dotted_name, - char **converted_name); +acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name); acpi_status -acpi_ns_externalize_name ( - u32 internal_name_length, - char *internal_name, - u32 *converted_name_length, - char **converted_name); +acpi_ns_externalize_name(u32 internal_name_length, + char *internal_name, + u32 * converted_name_length, char **converted_name); -struct acpi_namespace_node * -acpi_ns_map_handle_to_node ( - acpi_handle handle); +struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle); -acpi_handle -acpi_ns_convert_entry_to_handle( - struct acpi_namespace_node *node); - -void -acpi_ns_terminate ( - void); +acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node); -struct acpi_namespace_node * -acpi_ns_get_parent_node ( - struct acpi_namespace_node *node); +void acpi_ns_terminate(void); +struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node + *node); -struct acpi_namespace_node * -acpi_ns_get_next_valid_node ( - struct acpi_namespace_node *node); +struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct + acpi_namespace_node + *node); -#endif /* __ACNAMESP_H__ */ +#endif /* __ACNAMESP_H__ */ diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 34f9d1f1f79..4a326ba6d48 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -45,7 +45,6 @@ #ifndef _ACOBJECT_H #define _ACOBJECT_H - /* * The union acpi_operand_object is used to pass AML operands from the dispatcher * to the interpreter, and to keep track of the various handlers such as @@ -81,7 +80,6 @@ #define AOPOBJ_SETUP_COMPLETE 0x10 #define AOPOBJ_SINGLE_DATUM 0x20 - /* * Common bitfield for the field objects * "Field Datum" -- a datum from the actual field object @@ -96,8 +94,7 @@ u8 start_field_bit_offset;/* Bit offset within first field datum (0-63) */\ u8 access_bit_width; /* Read/Write size in bits (8-64) */\ u32 value; /* Value to store into the Bank or Index register */\ - struct acpi_namespace_node *node; /* Link back to parent node */ - + struct acpi_namespace_node *node; /* Link back to parent node */ /* * Fields common to both Strings and Buffers @@ -105,15 +102,13 @@ #define ACPI_COMMON_BUFFER_INFO \ u32 length; - /* * Common fields for objects that support ASL notifications */ #define ACPI_COMMON_NOTIFY_INFO \ union acpi_operand_object *system_notify; /* Handler for system notifies */\ union acpi_operand_object *device_notify; /* Handler for driver notifies */\ - union acpi_operand_object *handler; /* Handler for Address space */ - + union acpi_operand_object *handler; /* Handler for Address space */ /****************************************************************************** * @@ -121,161 +116,110 @@ * *****************************************************************************/ -struct acpi_object_common -{ - ACPI_OBJECT_COMMON_HEADER -}; +struct acpi_object_common { +ACPI_OBJECT_COMMON_HEADER}; - -struct acpi_object_integer -{ - ACPI_OBJECT_COMMON_HEADER - acpi_integer value; +struct acpi_object_integer { + ACPI_OBJECT_COMMON_HEADER acpi_integer value; }; - /* * Note: The String and Buffer object must be identical through the Pointer * element. There is code that depends on this. */ -struct acpi_object_string /* Null terminated, ASCII characters only */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_BUFFER_INFO - char *pointer; /* String in AML stream or allocated string */ +struct acpi_object_string { /* Null terminated, ASCII characters only */ + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO char *pointer; /* String in AML stream or allocated string */ }; - -struct acpi_object_buffer -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_BUFFER_INFO - u8 *pointer; /* Buffer in AML stream or allocated buffer */ - struct acpi_namespace_node *node; /* Link back to parent node */ - u8 *aml_start; - u32 aml_length; +struct acpi_object_buffer { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO u8 * pointer; /* Buffer in AML stream or allocated buffer */ + struct acpi_namespace_node *node; /* Link back to parent node */ + u8 *aml_start; + u32 aml_length; }; - -struct acpi_object_package -{ - ACPI_OBJECT_COMMON_HEADER - - u32 count; /* # of elements in package */ - u32 aml_length; - u8 *aml_start; - struct acpi_namespace_node *node; /* Link back to parent node */ - union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ +struct acpi_object_package { + ACPI_OBJECT_COMMON_HEADER u32 count; /* # of elements in package */ + u32 aml_length; + u8 *aml_start; + struct acpi_namespace_node *node; /* Link back to parent node */ + union acpi_operand_object **elements; /* Array of pointers to acpi_objects */ }; - /****************************************************************************** * * Complex data types * *****************************************************************************/ -struct acpi_object_event -{ - ACPI_OBJECT_COMMON_HEADER - void *semaphore; +struct acpi_object_event { + ACPI_OBJECT_COMMON_HEADER void *semaphore; }; - #define ACPI_INFINITE_CONCURRENCY 0xFF typedef -acpi_status (*ACPI_INTERNAL_METHOD) ( - struct acpi_walk_state *walk_state); - -struct acpi_object_method -{ - ACPI_OBJECT_COMMON_HEADER - u8 method_flags; - u8 param_count; - u32 aml_length; - void *semaphore; - u8 *aml_start; - ACPI_INTERNAL_METHOD implementation; - u8 concurrency; - u8 thread_count; - acpi_owner_id owner_id; +acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state); + +struct acpi_object_method { + ACPI_OBJECT_COMMON_HEADER u8 method_flags; + u8 param_count; + u32 aml_length; + void *semaphore; + u8 *aml_start; + ACPI_INTERNAL_METHOD implementation; + u8 concurrency; + u8 thread_count; + acpi_owner_id owner_id; }; - -struct acpi_object_mutex -{ - ACPI_OBJECT_COMMON_HEADER - u8 sync_level; /* 0-15, specified in Mutex() call */ - u16 acquisition_depth; /* Allow multiple Acquires, same thread */ - struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ - void *semaphore; /* Actual OS synchronization object */ - union acpi_operand_object *prev; /* Link for list of acquired mutexes */ - union acpi_operand_object *next; /* Link for list of acquired mutexes */ - struct acpi_namespace_node *node; /* Containing namespace node */ - u8 original_sync_level; /* Owner's original sync level (0-15) */ +struct acpi_object_mutex { + ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ + u16 acquisition_depth; /* Allow multiple Acquires, same thread */ + struct acpi_thread_state *owner_thread; /* Current owner of the mutex */ + void *semaphore; /* Actual OS synchronization object */ + union acpi_operand_object *prev; /* Link for list of acquired mutexes */ + union acpi_operand_object *next; /* Link for list of acquired mutexes */ + struct acpi_namespace_node *node; /* Containing namespace node */ + u8 original_sync_level; /* Owner's original sync level (0-15) */ }; - -struct acpi_object_region -{ - ACPI_OBJECT_COMMON_HEADER - - u8 space_id; - union acpi_operand_object *handler; /* Handler for region access */ - struct acpi_namespace_node *node; /* Containing namespace node */ - union acpi_operand_object *next; - u32 length; - acpi_physical_address address; +struct acpi_object_region { + ACPI_OBJECT_COMMON_HEADER u8 space_id; + union acpi_operand_object *handler; /* Handler for region access */ + struct acpi_namespace_node *node; /* Containing namespace node */ + union acpi_operand_object *next; + u32 length; + acpi_physical_address address; }; - /****************************************************************************** * * Objects that can be notified. All share a common notify_info area. * *****************************************************************************/ -struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO -}; - - -struct acpi_object_device -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO - struct acpi_gpe_block_info *gpe_block; -}; - +struct acpi_object_notify_common { /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ +ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; -struct acpi_object_power_resource -{ +struct acpi_object_device { ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO - u32 system_level; - u32 resource_order; + ACPI_COMMON_NOTIFY_INFO struct acpi_gpe_block_info *gpe_block; }; - -struct acpi_object_processor -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO - u32 proc_id; - u32 length; - acpi_io_address address; +struct acpi_object_power_resource { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 system_level; + u32 resource_order; }; - -struct acpi_object_thermal_zone -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_NOTIFY_INFO +struct acpi_object_processor { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 proc_id; + u32 length; + acpi_io_address address; }; +struct acpi_object_thermal_zone { +ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO}; /****************************************************************************** * @@ -283,90 +227,63 @@ struct acpi_object_thermal_zone * *****************************************************************************/ -struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing Operation Region object */ - /* (REGION/BANK fields only) */ +struct acpi_object_field_common { /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing Operation Region object */ + /* (REGION/BANK fields only) */ }; - -struct acpi_object_region_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing op_region object */ +struct acpi_object_region_field { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ }; - -struct acpi_object_bank_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *region_obj; /* Containing op_region object */ - union acpi_operand_object *bank_obj; /* bank_select Register object */ +struct acpi_object_bank_field { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj; /* Containing op_region object */ + union acpi_operand_object *bank_obj; /* bank_select Register object */ }; - -struct acpi_object_index_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - - /* - * No "region_obj" pointer needed since the Index and Data registers - * are each field definitions unto themselves. - */ - union acpi_operand_object *index_obj; /* Index register */ - union acpi_operand_object *data_obj; /* Data register */ +struct acpi_object_index_field { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + /* + * No "region_obj" pointer needed since the Index and Data registers + * are each field definitions unto themselves. + */ + union acpi_operand_object *index_obj; /* Index register */ + union acpi_operand_object *data_obj; /* Data register */ }; - /* The buffer_field is different in that it is part of a Buffer, not an op_region */ -struct acpi_object_buffer_field -{ - ACPI_OBJECT_COMMON_HEADER - ACPI_COMMON_FIELD_INFO - union acpi_operand_object *buffer_obj; /* Containing Buffer object */ +struct acpi_object_buffer_field { + ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *buffer_obj; /* Containing Buffer object */ }; - /****************************************************************************** * * Objects for handlers * *****************************************************************************/ -struct acpi_object_notify_handler -{ - ACPI_OBJECT_COMMON_HEADER - struct acpi_namespace_node *node; /* Parent device */ - acpi_notify_handler handler; - void *context; +struct acpi_object_notify_handler { + ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node; /* Parent device */ + acpi_notify_handler handler; + void *context; }; - /* Flags for address handler */ #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x1 - -struct acpi_object_addr_handler -{ - ACPI_OBJECT_COMMON_HEADER - u8 space_id; - u16 hflags; - acpi_adr_space_handler handler; - struct acpi_namespace_node *node; /* Parent device */ - void *context; - acpi_adr_space_setup setup; - union acpi_operand_object *region_list; /* regions using this handler */ - union acpi_operand_object *next; +struct acpi_object_addr_handler { + ACPI_OBJECT_COMMON_HEADER u8 space_id; + u16 hflags; + acpi_adr_space_handler handler; + struct acpi_namespace_node *node; /* Parent device */ + void *context; + acpi_adr_space_setup setup; + union acpi_operand_object *region_list; /* regions using this handler */ + union acpi_operand_object *next; }; - /****************************************************************************** * * Special internal objects @@ -377,18 +294,15 @@ struct acpi_object_addr_handler * The Reference object type is used for these opcodes: * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op */ -struct acpi_object_reference -{ - ACPI_OBJECT_COMMON_HEADER - u8 target_type; /* Used for index_op */ - u16 opcode; - u32 offset; /* Used for arg_op, local_op, and index_op */ - void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ - struct acpi_namespace_node *node; - union acpi_operand_object **where; +struct acpi_object_reference { + ACPI_OBJECT_COMMON_HEADER u8 target_type; /* Used for index_op */ + u16 opcode; + u32 offset; /* Used for arg_op, local_op, and index_op */ + void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */ + struct acpi_namespace_node *node; + union acpi_operand_object **where; }; - /* * Extra object is used as additional storage for types that * have AML code in their declarations (term_args) that must be @@ -396,73 +310,62 @@ struct acpi_object_reference * * Currently: Region and field_unit types */ -struct acpi_object_extra -{ - ACPI_OBJECT_COMMON_HEADER - u8 byte_fill1; - u16 word_fill1; - u32 aml_length; - u8 *aml_start; - struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ - void *region_context; /* Region-specific data */ +struct acpi_object_extra { + ACPI_OBJECT_COMMON_HEADER u8 byte_fill1; + u16 word_fill1; + u32 aml_length; + u8 *aml_start; + struct acpi_namespace_node *method_REG; /* _REG method for this region (if any) */ + void *region_context; /* Region-specific data */ }; - /* Additional data that can be attached to namespace nodes */ -struct acpi_object_data -{ - ACPI_OBJECT_COMMON_HEADER - acpi_object_handler handler; - void *pointer; +struct acpi_object_data { + ACPI_OBJECT_COMMON_HEADER acpi_object_handler handler; + void *pointer; }; - /* Structure used when objects are cached for reuse */ -struct acpi_object_cache_list -{ - ACPI_OBJECT_COMMON_HEADER - union acpi_operand_object *next; /* Link for object cache and internal lists*/ +struct acpi_object_cache_list { + ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next; /* Link for object cache and internal lists */ }; - /****************************************************************************** * * union acpi_operand_object Descriptor - a giant union of all of the above * *****************************************************************************/ -union acpi_operand_object -{ - struct acpi_object_common common; - struct acpi_object_integer integer; - struct acpi_object_string string; - struct acpi_object_buffer buffer; - struct acpi_object_package package; - struct acpi_object_event event; - struct acpi_object_method method; - struct acpi_object_mutex mutex; - struct acpi_object_region region; - struct acpi_object_notify_common common_notify; - struct acpi_object_device device; - struct acpi_object_power_resource power_resource; - struct acpi_object_processor processor; - struct acpi_object_thermal_zone thermal_zone; - struct acpi_object_field_common common_field; - struct acpi_object_region_field field; - struct acpi_object_buffer_field buffer_field; - struct acpi_object_bank_field bank_field; - struct acpi_object_index_field index_field; - struct acpi_object_notify_handler notify; - struct acpi_object_addr_handler address_space; - struct acpi_object_reference reference; - struct acpi_object_extra extra; - struct acpi_object_data data; - struct acpi_object_cache_list cache; +union acpi_operand_object { + struct acpi_object_common common; + struct acpi_object_integer integer; + struct acpi_object_string string; + struct acpi_object_buffer buffer; + struct acpi_object_package package; + struct acpi_object_event event; + struct acpi_object_method method; + struct acpi_object_mutex mutex; + struct acpi_object_region region; + struct acpi_object_notify_common common_notify; + struct acpi_object_device device; + struct acpi_object_power_resource power_resource; + struct acpi_object_processor processor; + struct acpi_object_thermal_zone thermal_zone; + struct acpi_object_field_common common_field; + struct acpi_object_region_field field; + struct acpi_object_buffer_field buffer_field; + struct acpi_object_bank_field bank_field; + struct acpi_object_index_field index_field; + struct acpi_object_notify_handler notify; + struct acpi_object_addr_handler address_space; + struct acpi_object_reference reference; + struct acpi_object_extra extra; + struct acpi_object_data data; + struct acpi_object_cache_list cache; }; - /****************************************************************************** * * union acpi_descriptor - objects that share a common descriptor identifier @@ -471,7 +374,7 @@ union acpi_operand_object /* Object descriptor types */ -#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ +#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ #define ACPI_DESC_TYPE_STATE 0x02 #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 @@ -488,14 +391,11 @@ union acpi_operand_object #define ACPI_DESC_TYPE_NAMED 0x0F #define ACPI_DESC_TYPE_MAX 0x0F - -union acpi_descriptor -{ - u8 descriptor_id; /* To differentiate various internal objs */\ - union acpi_operand_object object; - struct acpi_namespace_node node; - union acpi_parse_object op; +union acpi_descriptor { + u8 descriptor_id; /* To differentiate various internal objs */ + union acpi_operand_object object; + struct acpi_namespace_node node; + union acpi_parse_object op; }; - -#endif /* _ACOBJECT_H */ +#endif /* _ACOBJECT_H */ diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index 093f697e8c5..64da4299219 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h @@ -62,7 +62,6 @@ #define _NAM 0x6C #define _PFX 0x6D - /* * All AML opcodes and the parse-time arguments for each. Used by the AML * parser Each list is compressed into a 32-bit number and stored in the @@ -191,7 +190,6 @@ #define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA) #define ARGP_ZERO_OP ARG_NONE - /* * All AML opcodes and the runtime arguments for each. Used by the AML * interpreter Each list is compressed into a 32-bit number and stored @@ -322,4 +320,4 @@ #define ARGI_WORD_OP ARGI_INVALID_OPCODE #define ARGI_ZERO_OP ARG_NONE -#endif /* __ACOPCODE_H__ */ +#endif /* __ACOPCODE_H__ */ diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index d7e828cb84b..68d7edf0f69 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -73,12 +73,10 @@ #define ACPI_ALL_COMPONENTS 0x00003FFF #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) - /* Component IDs reserved for ACPI drivers */ #define ACPI_ALL_DRIVERS 0xFFFF0000 - /* * Raw debug output levels, do not use these in the DEBUG_PRINT macros */ @@ -132,7 +130,6 @@ #define ACPI_LV_VERBOSE 0xF0000000 - /* * Debug level macros that are used in the DEBUG_PRINT macros */ @@ -147,7 +144,6 @@ #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) - /* Trace level -- also used in the global "debug_level" */ #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) @@ -174,12 +170,10 @@ #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) - /* Defaults for debug_level, debug and normal */ #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) - -#endif /* __ACOUTPUT_H__ */ +#endif /* __ACOUTPUT_H__ */ diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index f692ad56cd8..d352d40de1f 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h @@ -41,18 +41,15 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #ifndef __ACPARSER_H__ #define __ACPARSER_H__ - #define OP_HAS_RETURN_VALUE 1 /* variable # arguments */ #define ACPI_VAR_ARGS ACPI_UINT32_MAX - #define ACPI_PARSE_DELETE_TREE 0x0001 #define ACPI_PARSE_NO_TREE_DELETE 0x0000 #define ACPI_PARSE_TREE_MASK 0x0001 @@ -65,266 +62,171 @@ #define ACPI_PARSE_DEFERRED_OP 0x0100 #define ACPI_PARSE_DISASSEMBLE 0x0200 - /****************************************************************************** * * Parser interfaces * *****************************************************************************/ - /* * psxface - Parser external interfaces */ -acpi_status -acpi_ps_execute_method ( - struct acpi_parameter_info *info); - +acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); /* * psargs - Parse AML opcode arguments */ -u8 * -acpi_ps_get_next_package_end ( - struct acpi_parse_state *parser_state); +u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state); -char * -acpi_ps_get_next_namestring ( - struct acpi_parse_state *parser_state); +char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state); void -acpi_ps_get_next_simple_arg ( - struct acpi_parse_state *parser_state, - u32 arg_type, - union acpi_parse_object *arg); +acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state, + u32 arg_type, union acpi_parse_object *arg); acpi_status -acpi_ps_get_next_namepath ( - struct acpi_walk_state *walk_state, - struct acpi_parse_state *parser_state, - union acpi_parse_object *arg, - u8 method_call); +acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, + struct acpi_parse_state *parser_state, + union acpi_parse_object *arg, u8 method_call); acpi_status -acpi_ps_get_next_arg ( - struct acpi_walk_state *walk_state, - struct acpi_parse_state *parser_state, - u32 arg_type, - union acpi_parse_object **return_arg); - +acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, + struct acpi_parse_state *parser_state, + u32 arg_type, union acpi_parse_object **return_arg); /* * psfind */ -union acpi_parse_object * -acpi_ps_find_name ( - union acpi_parse_object *scope, - u32 name, - u32 opcode); - -union acpi_parse_object* -acpi_ps_get_parent ( - union acpi_parse_object *op); +union acpi_parse_object *acpi_ps_find_name(union acpi_parse_object *scope, + u32 name, u32 opcode); +union acpi_parse_object *acpi_ps_get_parent(union acpi_parse_object *op); /* * psopcode - AML Opcode information */ -const struct acpi_opcode_info * -acpi_ps_get_opcode_info ( - u16 opcode); - -char * -acpi_ps_get_opcode_name ( - u16 opcode); +const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode); +char *acpi_ps_get_opcode_name(u16 opcode); /* * psparse - top level parsing routines */ -acpi_status -acpi_ps_parse_aml ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state); -u32 -acpi_ps_get_opcode_size ( - u32 opcode); +u32 acpi_ps_get_opcode_size(u32 opcode); -u16 -acpi_ps_peek_opcode ( - struct acpi_parse_state *state); +u16 acpi_ps_peek_opcode(struct acpi_parse_state *state); acpi_status -acpi_ps_complete_this_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op); +acpi_ps_complete_this_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op); acpi_status -acpi_ps_next_parse_state ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - acpi_status callback_status); - +acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + acpi_status callback_status); /* * psloop - main parse loop */ -acpi_status -acpi_ps_parse_loop ( - struct acpi_walk_state *walk_state); - +acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state); /* * psscope - Scope stack management routines */ acpi_status -acpi_ps_init_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object *root); +acpi_ps_init_scope(struct acpi_parse_state *parser_state, + union acpi_parse_object *root); -union acpi_parse_object * -acpi_ps_get_parent_scope ( - struct acpi_parse_state *state); +union acpi_parse_object *acpi_ps_get_parent_scope(struct acpi_parse_state + *state); -u8 -acpi_ps_has_completed_scope ( - struct acpi_parse_state *parser_state); +u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state); void -acpi_ps_pop_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object **op, - u32 *arg_list, - u32 *arg_count); +acpi_ps_pop_scope(struct acpi_parse_state *parser_state, + union acpi_parse_object **op, + u32 * arg_list, u32 * arg_count); acpi_status -acpi_ps_push_scope ( - struct acpi_parse_state *parser_state, - union acpi_parse_object *op, - u32 remaining_args, - u32 arg_count); - -void -acpi_ps_cleanup_scope ( - struct acpi_parse_state *state); +acpi_ps_push_scope(struct acpi_parse_state *parser_state, + union acpi_parse_object *op, + u32 remaining_args, u32 arg_count); +void acpi_ps_cleanup_scope(struct acpi_parse_state *state); /* * pstree - parse tree manipulation routines */ void -acpi_ps_append_arg( - union acpi_parse_object *op, - union acpi_parse_object *arg); - -union acpi_parse_object* -acpi_ps_find ( - union acpi_parse_object *scope, - char *path, - u16 opcode, - u32 create); - -union acpi_parse_object * -acpi_ps_get_arg( - union acpi_parse_object *op, - u32 argn); +acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg); -#ifdef ACPI_FUTURE_USAGE -union acpi_parse_object * -acpi_ps_get_depth_next ( - union acpi_parse_object *origin, - union acpi_parse_object *op); -#endif /* ACPI_FUTURE_USAGE */ +union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope, + char *path, u16 opcode, u32 create); + +union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn); +#ifdef ACPI_FUTURE_USAGE +union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, + union acpi_parse_object *op); +#endif /* ACPI_FUTURE_USAGE */ /* * pswalk - parse tree walk routines */ acpi_status -acpi_ps_walk_parsed_aml ( - union acpi_parse_object *start_op, - union acpi_parse_object *end_op, - union acpi_operand_object *mth_desc, - struct acpi_namespace_node *start_node, - union acpi_operand_object **params, - union acpi_operand_object **caller_return_desc, - acpi_owner_id owner_id, - acpi_parse_downwards descending_callback, - acpi_parse_upwards ascending_callback); - -acpi_status -acpi_ps_get_next_walk_op ( - struct acpi_walk_state *walk_state, - union acpi_parse_object *op, - acpi_parse_upwards ascending_callback); +acpi_ps_walk_parsed_aml(union acpi_parse_object *start_op, + union acpi_parse_object *end_op, + union acpi_operand_object *mth_desc, + struct acpi_namespace_node *start_node, + union acpi_operand_object **params, + union acpi_operand_object **caller_return_desc, + acpi_owner_id owner_id, + acpi_parse_downwards descending_callback, + acpi_parse_upwards ascending_callback); acpi_status -acpi_ps_delete_completed_op ( - struct acpi_walk_state *walk_state); +acpi_ps_get_next_walk_op(struct acpi_walk_state *walk_state, + union acpi_parse_object *op, + acpi_parse_upwards ascending_callback); -void -acpi_ps_delete_parse_tree ( - union acpi_parse_object *root); +acpi_status acpi_ps_delete_completed_op(struct acpi_walk_state *walk_state); +void acpi_ps_delete_parse_tree(union acpi_parse_object *root); /* * psutils - parser utilities */ -union acpi_parse_object * -acpi_ps_create_scope_op ( - void); +union acpi_parse_object *acpi_ps_create_scope_op(void); -void -acpi_ps_init_op ( - union acpi_parse_object *op, - u16 opcode); +void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode); -union acpi_parse_object * -acpi_ps_alloc_op ( - u16 opcode); +union acpi_parse_object *acpi_ps_alloc_op(u16 opcode); -void -acpi_ps_free_op ( - union acpi_parse_object *op); +void acpi_ps_free_op(union acpi_parse_object *op); -u8 -acpi_ps_is_leading_char ( - u32 c); +u8 acpi_ps_is_leading_char(u32 c); -u8 -acpi_ps_is_prefix_char ( - u32 c); +u8 acpi_ps_is_prefix_char(u32 c); #ifdef ACPI_FUTURE_USAGE -u32 -acpi_ps_get_name( - union acpi_parse_object *op); -#endif /* ACPI_FUTURE_USAGE */ - -void -acpi_ps_set_name( - union acpi_parse_object *op, - u32 name); +u32 acpi_ps_get_name(union acpi_parse_object *op); +#endif /* ACPI_FUTURE_USAGE */ +void acpi_ps_set_name(union acpi_parse_object *op, u32 name); /* * psdump - display parser tree */ u32 -acpi_ps_sprint_path ( - char *buffer_start, - u32 buffer_size, - union acpi_parse_object *op); +acpi_ps_sprint_path(char *buffer_start, + u32 buffer_size, union acpi_parse_object *op); u32 -acpi_ps_sprint_op ( - char *buffer_start, - u32 buffer_size, - union acpi_parse_object *op); - -void -acpi_ps_show ( - union acpi_parse_object *op); +acpi_ps_sprint_op(char *buffer_start, + u32 buffer_size, union acpi_parse_object *op); +void acpi_ps_show(union acpi_parse_object *op); -#endif /* __ACPARSER_H__ */ +#endif /* __ACPARSER_H__ */ diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index a69d7894204..ccf34f9dac6 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h @@ -49,22 +49,21 @@ * We put them here because we don't want to duplicate them * in the rest of the source code again and again. */ -#include "acnames.h" /* Global ACPI names and strings */ -#include "acconfig.h" /* Configuration constants */ -#include "platform/acenv.h" /* Target environment specific items */ -#include "actypes.h" /* Fundamental common data types */ -#include "acexcep.h" /* ACPI exception codes */ -#include "acmacros.h" /* C macros */ -#include "actbl.h" /* ACPI table definitions */ -#include "aclocal.h" /* Internal data types */ -#include "acoutput.h" /* Error output and Debug macros */ -#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer*/ -#include "acpixf.h" /* ACPI core subsystem external interfaces */ -#include "acobject.h" /* ACPI internal object */ -#include "acstruct.h" /* Common structures */ -#include "acglobal.h" /* All global variables */ -#include "achware.h" /* Hardware defines and interfaces */ -#include "acutils.h" /* Utility interfaces */ +#include "acnames.h" /* Global ACPI names and strings */ +#include "acconfig.h" /* Configuration constants */ +#include "platform/acenv.h" /* Target environment specific items */ +#include "actypes.h" /* Fundamental common data types */ +#include "acexcep.h" /* ACPI exception codes */ +#include "acmacros.h" /* C macros */ +#include "actbl.h" /* ACPI table definitions */ +#include "aclocal.h" /* Internal data types */ +#include "acoutput.h" /* Error output and Debug macros */ +#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer */ +#include "acpixf.h" /* ACPI core subsystem external interfaces */ +#include "acobject.h" /* ACPI internal object */ +#include "acstruct.h" /* Common structures */ +#include "acglobal.h" /* All global variables */ +#include "achware.h" /* Hardware defines and interfaces */ +#include "acutils.h" /* Utility interfaces */ - -#endif /* __ACPI_H__ */ +#endif /* __ACPI_H__ */ diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 8d0e1290bc7..4f4b2baa717 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -35,48 +35,41 @@ /* TBD: Make dynamic */ #define ACPI_MAX_HANDLES 10 struct acpi_handle_list { - u32 count; - acpi_handle handles[ACPI_MAX_HANDLES]; + u32 count; + acpi_handle handles[ACPI_MAX_HANDLES]; }; - /* acpi_utils.h */ acpi_status -acpi_extract_package ( - union acpi_object *package, - struct acpi_buffer *format, - struct acpi_buffer *buffer); +acpi_extract_package(union acpi_object *package, + struct acpi_buffer *format, struct acpi_buffer *buffer); acpi_status -acpi_evaluate_integer ( - acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, - unsigned long *data); +acpi_evaluate_integer(acpi_handle handle, + acpi_string pathname, + struct acpi_object_list *arguments, unsigned long *data); acpi_status -acpi_evaluate_reference ( - acpi_handle handle, - acpi_string pathname, - struct acpi_object_list *arguments, - struct acpi_handle_list *list); - +acpi_evaluate_reference(acpi_handle handle, + acpi_string pathname, + struct acpi_object_list *arguments, + struct acpi_handle_list *list); #ifdef CONFIG_ACPI_BUS #include #define ACPI_BUS_FILE_ROOT "acpi" -extern struct proc_dir_entry *acpi_root_dir; -extern FADT_DESCRIPTOR acpi_fadt; +extern struct proc_dir_entry *acpi_root_dir; +extern FADT_DESCRIPTOR acpi_fadt; enum acpi_bus_removal_type { - ACPI_BUS_REMOVAL_NORMAL = 0, + ACPI_BUS_REMOVAL_NORMAL = 0, ACPI_BUS_REMOVAL_EJECT, ACPI_BUS_REMOVAL_SUPRISE, ACPI_BUS_REMOVAL_TYPE_COUNT }; enum acpi_bus_device_type { - ACPI_BUS_TYPE_DEVICE = 0, + ACPI_BUS_TYPE_DEVICE = 0, ACPI_BUS_TYPE_POWER, ACPI_BUS_TYPE_PROCESSOR, ACPI_BUS_TYPE_THERMAL, @@ -89,61 +82,60 @@ enum acpi_bus_device_type { struct acpi_driver; struct acpi_device; - /* * ACPI Driver * ----------- */ -typedef int (*acpi_op_add) (struct acpi_device *device); -typedef int (*acpi_op_remove) (struct acpi_device *device, int type); -typedef int (*acpi_op_lock) (struct acpi_device *device, int type); -typedef int (*acpi_op_start) (struct acpi_device *device); -typedef int (*acpi_op_stop) (struct acpi_device *device, int type); -typedef int (*acpi_op_suspend) (struct acpi_device *device, int state); -typedef int (*acpi_op_resume) (struct acpi_device *device, int state); -typedef int (*acpi_op_scan) (struct acpi_device *device); -typedef int (*acpi_op_bind) (struct acpi_device *device); -typedef int (*acpi_op_unbind) (struct acpi_device *device); -typedef int (*acpi_op_match) (struct acpi_device *device, - struct acpi_driver *driver); +typedef int (*acpi_op_add) (struct acpi_device * device); +typedef int (*acpi_op_remove) (struct acpi_device * device, int type); +typedef int (*acpi_op_lock) (struct acpi_device * device, int type); +typedef int (*acpi_op_start) (struct acpi_device * device); +typedef int (*acpi_op_stop) (struct acpi_device * device, int type); +typedef int (*acpi_op_suspend) (struct acpi_device * device, int state); +typedef int (*acpi_op_resume) (struct acpi_device * device, int state); +typedef int (*acpi_op_scan) (struct acpi_device * device); +typedef int (*acpi_op_bind) (struct acpi_device * device); +typedef int (*acpi_op_unbind) (struct acpi_device * device); +typedef int (*acpi_op_match) (struct acpi_device * device, + struct acpi_driver * driver); struct acpi_bus_ops { - u32 acpi_op_add:1; - u32 acpi_op_remove:1; - u32 acpi_op_lock:1; - u32 acpi_op_start:1; - u32 acpi_op_stop:1; - u32 acpi_op_suspend:1; - u32 acpi_op_resume:1; - u32 acpi_op_scan:1; - u32 acpi_op_bind:1; - u32 acpi_op_unbind:1; - u32 acpi_op_match:1; - u32 reserved:21; + u32 acpi_op_add:1; + u32 acpi_op_remove:1; + u32 acpi_op_lock:1; + u32 acpi_op_start:1; + u32 acpi_op_stop:1; + u32 acpi_op_suspend:1; + u32 acpi_op_resume:1; + u32 acpi_op_scan:1; + u32 acpi_op_bind:1; + u32 acpi_op_unbind:1; + u32 acpi_op_match:1; + u32 reserved:21; }; struct acpi_device_ops { - acpi_op_add add; - acpi_op_remove remove; - acpi_op_lock lock; - acpi_op_start start; - acpi_op_stop stop; - acpi_op_suspend suspend; - acpi_op_resume resume; - acpi_op_scan scan; - acpi_op_bind bind; - acpi_op_unbind unbind; - acpi_op_match match; + acpi_op_add add; + acpi_op_remove remove; + acpi_op_lock lock; + acpi_op_start start; + acpi_op_stop stop; + acpi_op_suspend suspend; + acpi_op_resume resume; + acpi_op_scan scan; + acpi_op_bind bind; + acpi_op_unbind unbind; + acpi_op_match match; }; struct acpi_driver { - struct list_head node; - char name[80]; - char class[80]; - atomic_t references; - char *ids; /* Supported Hardware IDs */ - struct acpi_device_ops ops; + struct list_head node; + char name[80]; + char class[80]; + atomic_t references; + char *ids; /* Supported Hardware IDs */ + struct acpi_device_ops ops; }; /* @@ -154,60 +146,57 @@ struct acpi_driver { /* Status (_STA) */ struct acpi_device_status { - u32 present:1; - u32 enabled:1; - u32 show_in_ui:1; - u32 functional:1; - u32 battery_present:1; - u32 reserved:27; + u32 present:1; + u32 enabled:1; + u32 show_in_ui:1; + u32 functional:1; + u32 battery_present:1; + u32 reserved:27; }; - /* Flags */ struct acpi_device_flags { - u32 dynamic_status:1; - u32 hardware_id:1; - u32 compatible_ids:1; - u32 bus_address:1; - u32 unique_id:1; - u32 removable:1; - u32 ejectable:1; - u32 lockable:1; - u32 suprise_removal_ok:1; - u32 power_manageable:1; - u32 performance_manageable:1; - u32 wake_capable:1; /* Wakeup(_PRW) supported? */ - u32 reserved:20; + u32 dynamic_status:1; + u32 hardware_id:1; + u32 compatible_ids:1; + u32 bus_address:1; + u32 unique_id:1; + u32 removable:1; + u32 ejectable:1; + u32 lockable:1; + u32 suprise_removal_ok:1; + u32 power_manageable:1; + u32 performance_manageable:1; + u32 wake_capable:1; /* Wakeup(_PRW) supported? */ + u32 reserved:20; }; - /* File System */ struct acpi_device_dir { - struct proc_dir_entry *entry; + struct proc_dir_entry *entry; }; #define acpi_device_dir(d) ((d)->dir.entry) - /* Plug and Play */ -typedef char acpi_bus_id[5]; -typedef unsigned long acpi_bus_address; -typedef char acpi_hardware_id[9]; -typedef char acpi_unique_id[9]; -typedef char acpi_device_name[40]; -typedef char acpi_device_class[20]; +typedef char acpi_bus_id[5]; +typedef unsigned long acpi_bus_address; +typedef char acpi_hardware_id[9]; +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 */ - acpi_device_name device_name; /* Driver-determined */ - acpi_device_class device_class; /* " */ + 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 */ + acpi_device_name device_name; /* Driver-determined */ + acpi_device_class device_class; /* " */ }; #define acpi_device_bid(d) ((d)->pnp.bus_id) @@ -217,114 +206,111 @@ struct acpi_device_pnp { #define acpi_device_name(d) ((d)->pnp.device_name) #define acpi_device_class(d) ((d)->pnp.device_class) - /* Power Management */ struct acpi_device_power_flags { - u32 explicit_get:1; /* _PSC present? */ - u32 power_resources:1; /* Power resources */ - u32 inrush_current:1; /* Serialize Dx->D0 */ - u32 power_removed:1; /* Optimize Dx->D0 */ - u32 reserved:28; + u32 explicit_get:1; /* _PSC present? */ + u32 power_resources:1; /* Power resources */ + u32 inrush_current:1; /* Serialize Dx->D0 */ + u32 power_removed:1; /* Optimize Dx->D0 */ + u32 reserved:28; }; struct acpi_device_power_state { struct { - u8 valid:1; - u8 explicit_set:1; /* _PSx present? */ - u8 reserved:6; - } flags; - int power; /* % Power (compared to D0) */ - int latency; /* Dx->D0 time (microseconds) */ - struct acpi_handle_list resources; /* Power resources referenced */ + u8 valid:1; + u8 explicit_set:1; /* _PSx present? */ + u8 reserved:6; + } flags; + int power; /* % Power (compared to D0) */ + int latency; /* Dx->D0 time (microseconds) */ + struct acpi_handle_list resources; /* Power resources referenced */ }; struct acpi_device_power { - int state; /* Current state */ + int state; /* Current state */ struct acpi_device_power_flags flags; - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ + struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ }; - /* Performance Management */ struct acpi_device_perf_flags { - u8 reserved:8; + u8 reserved:8; }; struct acpi_device_perf_state { struct { - u8 valid:1; - u8 reserved:7; - } flags; - u8 power; /* % Power (compared to P0) */ - u8 performance; /* % Performance ( " ) */ - int latency; /* Px->P0 time (microseconds) */ + u8 valid:1; + u8 reserved:7; + } flags; + u8 power; /* % Power (compared to P0) */ + u8 performance; /* % Performance ( " ) */ + int latency; /* Px->P0 time (microseconds) */ }; struct acpi_device_perf { - int state; + int state; struct acpi_device_perf_flags flags; - int state_count; + int state_count; struct acpi_device_perf_state *states; }; /* Wakeup Management */ struct acpi_device_wakeup_flags { - u8 valid:1; /* Can successfully enable wakeup? */ - u8 run_wake:1; /* Run-Wake GPE devices */ + u8 valid:1; /* Can successfully enable wakeup? */ + u8 run_wake:1; /* Run-Wake GPE devices */ }; struct acpi_device_wakeup_state { - u8 enabled:1; - u8 active:1; + u8 enabled:1; + u8 active:1; }; struct acpi_device_wakeup { - acpi_handle gpe_device; - acpi_integer gpe_number;; - acpi_integer sleep_state; - struct acpi_handle_list resources; - struct acpi_device_wakeup_state state; - struct acpi_device_wakeup_flags flags; + acpi_handle gpe_device; + acpi_integer gpe_number;; + acpi_integer sleep_state; + struct acpi_handle_list resources; + struct acpi_device_wakeup_state state; + struct acpi_device_wakeup_flags flags; }; /* Device */ struct acpi_device { - acpi_handle handle; - struct acpi_device *parent; - struct list_head children; - struct list_head node; - struct list_head wakeup_list; - struct list_head g_list; + acpi_handle handle; + struct acpi_device *parent; + struct list_head children; + struct list_head node; + struct list_head wakeup_list; + struct list_head g_list; struct acpi_device_status status; struct acpi_device_flags flags; - struct acpi_device_pnp pnp; + struct acpi_device_pnp pnp; struct acpi_device_power power; struct acpi_device_wakeup wakeup; - struct acpi_device_perf performance; - struct acpi_device_dir dir; - struct acpi_device_ops ops; - struct acpi_driver *driver; - void *driver_data; - struct kobject kobj; + struct acpi_device_perf performance; + struct acpi_device_dir dir; + struct acpi_device_ops ops; + struct acpi_driver *driver; + void *driver_data; + struct kobject kobj; }; #define acpi_driver_data(d) ((d)->driver_data) - /* * Events * ------ */ struct acpi_bus_event { - struct list_head node; - acpi_device_class device_class; - acpi_bus_id bus_id; - u32 type; - u32 data; + struct list_head node; + acpi_device_class device_class; + acpi_bus_id bus_id; + u32 type; + u32 data; }; extern struct subsystem acpi_subsys; @@ -335,34 +321,32 @@ extern struct subsystem acpi_subsys; int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); void acpi_bus_data_handler(acpi_handle handle, u32 function, 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); -int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data); -int acpi_bus_receive_event (struct acpi_bus_event *event); -int acpi_bus_register_driver (struct acpi_driver *driver); -int acpi_bus_unregister_driver (struct acpi_driver *driver); -int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent, - acpi_handle handle, int type); -int acpi_bus_start (struct acpi_device *device); - - -int acpi_match_ids (struct acpi_device *device, char *ids); +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); +int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data); +int acpi_bus_receive_event(struct acpi_bus_event *event); +int acpi_bus_register_driver(struct acpi_driver *driver); +int acpi_bus_unregister_driver(struct acpi_driver *driver); +int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, + acpi_handle handle, int type); +int acpi_bus_start(struct acpi_device *device); + +int acpi_match_ids(struct acpi_device *device, char *ids); int acpi_create_dir(struct acpi_device *); void acpi_remove_dir(struct acpi_device *); - /* * Bind physical devices with ACPI devices */ #include struct acpi_bus_type { - struct list_head list; - struct bus_type *bus; - /* For general devices under the bus*/ - int (*find_device)(struct device *, acpi_handle*); + struct list_head list; + struct bus_type *bus; + /* For general devices under the bus */ + int (*find_device) (struct device *, acpi_handle *); /* For bridges, such as PCI root bridge, IDE controller */ - int (*find_bridge)(struct device *, acpi_handle *); + int (*find_bridge) (struct device *, acpi_handle *); }; int register_acpi_bus_type(struct acpi_bus_type *); int unregister_acpi_bus_type(struct acpi_bus_type *); @@ -372,6 +356,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) -#endif /*CONFIG_ACPI_BUS*/ +#endif /*CONFIG_ACPI_BUS */ #endif /*__ACPI_BUS_H__*/ diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 579fe191b7e..e976cb109b1 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -29,7 +29,6 @@ #include #include - #define ACPI_MAX_STRING 80 #define ACPI_BUS_COMPONENT 0x00010000 @@ -44,7 +43,6 @@ #define ACPI_BUTTON_HID_POWERF "ACPI_FPB" #define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" - /* -------------------------------------------------------------------------- PCI -------------------------------------------------------------------------- */ @@ -55,49 +53,49 @@ /* ACPI PCI Interrupt Link (pci_link.c) */ -int acpi_irq_penalty_init (void); -int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level, - int *active_high_low, char **name); +int acpi_irq_penalty_init(void); +int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, + int *active_high_low, char **name); int acpi_pci_link_free_irq(acpi_handle handle); /* ACPI PCI Interrupt Routing (pci_irq.c) */ -int acpi_pci_irq_add_prt (acpi_handle handle, int segment, int bus); -void acpi_pci_irq_del_prt (int segment, int bus); +int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); +void acpi_pci_irq_del_prt(int segment, int bus); /* ACPI PCI Device Binding (pci_bind.c) */ struct pci_bus; -acpi_status acpi_get_pci_id (acpi_handle handle, struct acpi_pci_id *id); -int acpi_pci_bind (struct acpi_device *device); -int acpi_pci_unbind (struct acpi_device *device); -int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); +acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id); +int acpi_pci_bind(struct acpi_device *device); +int acpi_pci_unbind(struct acpi_device *device); +int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, + struct pci_bus *bus); /* Arch-defined function to add a bus to the system */ -struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus); - -#endif /*CONFIG_ACPI_PCI*/ +struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, + int bus); +#endif /*CONFIG_ACPI_PCI */ /* -------------------------------------------------------------------------- Power Resource -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_POWER -int acpi_enable_wakeup_device_power (struct acpi_device *dev); -int acpi_disable_wakeup_device_power (struct acpi_device *dev); -int acpi_power_get_inferred_state (struct acpi_device *device); -int acpi_power_transition (struct acpi_device *device, int state); +int acpi_enable_wakeup_device_power(struct acpi_device *dev); +int acpi_disable_wakeup_device_power(struct acpi_device *dev); +int acpi_power_get_inferred_state(struct acpi_device *device); +int acpi_power_transition(struct acpi_device *device, int state); #endif - /* -------------------------------------------------------------------------- Embedded Controller -------------------------------------------------------------------------- */ #ifdef CONFIG_ACPI_EC -int acpi_ec_ecdt_probe (void); +int acpi_ec_ecdt_probe(void); #endif /* -------------------------------------------------------------------------- diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 819a53f83cf..98e0b8cd14e 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -7,7 +7,6 @@ * *****************************************************************************/ - /* * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. @@ -51,7 +50,6 @@ #include "platform/acenv.h" #include "actypes.h" - /* Priorities for acpi_os_queue_for_execution */ #define OSD_PRIORITY_GPE 1 @@ -62,227 +60,136 @@ #define ACPI_NO_UNIT_LIMIT ((u32) -1) #define ACPI_MUTEX_SEM 1 - /* Functions for acpi_os_signal */ #define ACPI_SIGNAL_FATAL 0 #define ACPI_SIGNAL_BREAKPOINT 1 -struct acpi_signal_fatal_info -{ - u32 type; - u32 code; - u32 argument; +struct acpi_signal_fatal_info { + u32 type; + u32 code; + u32 argument; }; - /* * OSL Initialization and shutdown primitives */ -acpi_status -acpi_os_initialize ( - void); - -acpi_status -acpi_os_terminate ( - void); +acpi_status acpi_os_initialize(void); +acpi_status acpi_os_terminate(void); /* * ACPI Table interfaces */ -acpi_status -acpi_os_get_root_pointer ( - u32 flags, - struct acpi_pointer *address); +acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address); acpi_status -acpi_os_predefined_override ( - const struct acpi_predefined_names *init_val, - acpi_string *new_val); +acpi_os_predefined_override(const struct acpi_predefined_names *init_val, + acpi_string * new_val); acpi_status -acpi_os_table_override ( - struct acpi_table_header *existing_table, - struct acpi_table_header **new_table); - +acpi_os_table_override(struct acpi_table_header *existing_table, + struct acpi_table_header **new_table); /* * Synchronization primitives */ acpi_status -acpi_os_create_semaphore ( - u32 max_units, - u32 initial_units, - acpi_handle *out_handle); - -acpi_status -acpi_os_delete_semaphore ( - acpi_handle handle); +acpi_os_create_semaphore(u32 max_units, + u32 initial_units, acpi_handle * out_handle); -acpi_status -acpi_os_wait_semaphore ( - acpi_handle handle, - u32 units, - u16 timeout); +acpi_status acpi_os_delete_semaphore(acpi_handle handle); -acpi_status -acpi_os_signal_semaphore ( - acpi_handle handle, - u32 units); +acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout); -acpi_status -acpi_os_create_lock ( - acpi_handle *out_handle); +acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units); -void -acpi_os_delete_lock ( - acpi_handle handle); +acpi_status acpi_os_create_lock(acpi_handle * out_handle); -unsigned long -acpi_os_acquire_lock ( - acpi_handle handle); +void acpi_os_delete_lock(acpi_handle handle); -void -acpi_os_release_lock ( - acpi_handle handle, - unsigned long flags); +unsigned long acpi_os_acquire_lock(acpi_handle handle); +void acpi_os_release_lock(acpi_handle handle, unsigned long flags); /* * Memory allocation and mapping */ -void * -acpi_os_allocate ( - acpi_size size); +void *acpi_os_allocate(acpi_size size); -void -acpi_os_free ( - void * memory); +void acpi_os_free(void *memory); acpi_status -acpi_os_map_memory ( - acpi_physical_address physical_address, - acpi_size size, - void __iomem **logical_address); +acpi_os_map_memory(acpi_physical_address physical_address, + acpi_size size, void __iomem ** logical_address); -void -acpi_os_unmap_memory ( - void __iomem *logical_address, - acpi_size size); +void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_os_get_physical_address ( - void *logical_address, - acpi_physical_address *physical_address); +acpi_os_get_physical_address(void *logical_address, + acpi_physical_address * physical_address); #endif - - /* * Memory/Object Cache */ acpi_status -acpi_os_create_cache ( - char *cache_name, - u16 object_size, - u16 max_depth, - acpi_cache_t **return_cache); +acpi_os_create_cache(char *cache_name, + u16 object_size, + u16 max_depth, acpi_cache_t ** return_cache); -acpi_status -acpi_os_delete_cache ( - acpi_cache_t *cache); +acpi_status acpi_os_delete_cache(acpi_cache_t * cache); -acpi_status -acpi_os_purge_cache ( - acpi_cache_t *cache); +acpi_status acpi_os_purge_cache(acpi_cache_t * cache); -void * -acpi_os_acquire_object ( - acpi_cache_t *cache); +void *acpi_os_acquire_object(acpi_cache_t * cache); -acpi_status -acpi_os_release_object ( - acpi_cache_t *cache, - void *object); +acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); /* * Interrupt handlers */ acpi_status -acpi_os_install_interrupt_handler ( - u32 gsi, - acpi_osd_handler service_routine, - void *context); +acpi_os_install_interrupt_handler(u32 gsi, + acpi_osd_handler service_routine, + void *context); acpi_status -acpi_os_remove_interrupt_handler ( - u32 gsi, - acpi_osd_handler service_routine); - +acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); /* * Threads and Scheduling */ -u32 -acpi_os_get_thread_id ( - void); +u32 acpi_os_get_thread_id(void); acpi_status -acpi_os_queue_for_execution ( - u32 priority, - acpi_osd_exec_callback function, - void *context); - -void -acpi_os_wait_events_complete( - void * context); +acpi_os_queue_for_execution(u32 priority, + acpi_osd_exec_callback function, void *context); -void -acpi_os_wait_events_complete ( - void *context); +void acpi_os_wait_events_complete(void *context); -void -acpi_os_sleep ( - acpi_integer milliseconds); +void acpi_os_wait_events_complete(void *context); -void -acpi_os_stall ( - u32 microseconds); +void acpi_os_sleep(acpi_integer milliseconds); +void acpi_os_stall(u32 microseconds); /* * Platform and hardware-independent I/O interfaces */ -acpi_status -acpi_os_read_port ( - acpi_io_address address, - u32 *value, - u32 width); - -acpi_status -acpi_os_write_port ( - acpi_io_address address, - u32 value, - u32 width); +acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width); +acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); /* * Platform and hardware-independent physical memory interfaces */ acpi_status -acpi_os_read_memory ( - acpi_physical_address address, - u32 *value, - u32 width); +acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width); acpi_status -acpi_os_write_memory ( - acpi_physical_address address, - u32 value, - u32 width); - +acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); /* * Platform and hardware-independent PCI configuration space access @@ -290,111 +197,69 @@ acpi_os_write_memory ( * certain compilers complain. */ acpi_status -acpi_os_read_pci_configuration ( - struct acpi_pci_id *pci_id, - u32 reg, - void *value, - u32 width); +acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, + u32 reg, void *value, u32 width); acpi_status -acpi_os_write_pci_configuration ( - struct acpi_pci_id *pci_id, - u32 reg, - acpi_integer value, - u32 width); +acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, + u32 reg, acpi_integer value, u32 width); /* * Interim function needed for PCI IRQ routing */ void -acpi_os_derive_pci_id( - acpi_handle rhandle, - acpi_handle chandle, - struct acpi_pci_id **pci_id); +acpi_os_derive_pci_id(acpi_handle rhandle, + acpi_handle chandle, struct acpi_pci_id **pci_id); /* * Miscellaneous */ -u8 -acpi_os_readable ( - void *pointer, - acpi_size length); +u8 acpi_os_readable(void *pointer, acpi_size length); #ifdef ACPI_FUTURE_USAGE -u8 -acpi_os_writable ( - void *pointer, - acpi_size length); +u8 acpi_os_writable(void *pointer, acpi_size length); #endif -u64 -acpi_os_get_timer ( - void); +u64 acpi_os_get_timer(void); -acpi_status -acpi_os_signal ( - u32 function, - void *info); +acpi_status acpi_os_signal(u32 function, void *info); /* * Debug print routines */ -void ACPI_INTERNAL_VAR_XFACE -acpi_os_printf ( - const char *format, - ...); - -void -acpi_os_vprintf ( - const char *format, - va_list args); +void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); -void -acpi_os_redirect_output ( - void *destination); +void acpi_os_vprintf(const char *format, va_list args); +void acpi_os_redirect_output(void *destination); #ifdef ACPI_FUTURE_USAGE /* * Debug input */ -u32 -acpi_os_get_line ( - char *buffer); +u32 acpi_os_get_line(char *buffer); #endif - /* * Directory manipulation */ -void * -acpi_os_open_directory ( - char *pathname, - char *wildcard_spec, - char requested_file_type); +void *acpi_os_open_directory(char *pathname, + char *wildcard_spec, char requested_file_type); /* requeste_file_type values */ #define REQUEST_FILE_ONLY 0 #define REQUEST_DIR_ONLY 1 +char *acpi_os_get_next_filename(void *dir_handle); -char * -acpi_os_get_next_filename ( - void *dir_handle); - -void -acpi_os_close_directory ( - void *dir_handle); +void acpi_os_close_directory(void *dir_handle); /* * Debug */ void -acpi_os_dbg_assert( - void *failed_assertion, - void *file_name, - u32 line_number, - char *message); +acpi_os_dbg_assert(void *failed_assertion, + void *file_name, u32 line_number, char *message); -#endif /* __ACPIOSXF_H__ */ +#endif /* __ACPIOSXF_H__ */ diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 9ca212d73fb..2a9dbc13b0f 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -42,447 +42,283 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #ifndef __ACXFACE_H__ #define __ACXFACE_H__ #include "actypes.h" #include "actbl.h" - /* * Global interfaces */ -acpi_status -acpi_initialize_subsystem ( - void); +acpi_status acpi_initialize_subsystem(void); -acpi_status -acpi_enable_subsystem ( - u32 flags); +acpi_status acpi_enable_subsystem(u32 flags); -acpi_status -acpi_initialize_objects ( - u32 flags); +acpi_status acpi_initialize_objects(u32 flags); -acpi_status -acpi_terminate ( - void); +acpi_status acpi_terminate(void); #ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_subsystem_status ( - void); +acpi_status acpi_subsystem_status(void); #endif -acpi_status -acpi_enable ( - void); +acpi_status acpi_enable(void); -acpi_status -acpi_disable ( - void); +acpi_status acpi_disable(void); #ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_get_system_info ( - struct acpi_buffer *ret_buffer); +acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); #endif -const char * -acpi_format_exception ( - acpi_status exception); +const char *acpi_format_exception(acpi_status exception); -acpi_status -acpi_purge_cached_objects ( - void); +acpi_status acpi_purge_cached_objects(void); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_install_initialization_handler ( - acpi_init_handler handler, - u32 function); +acpi_install_initialization_handler(acpi_init_handler handler, u32 function); #endif /* * ACPI Memory managment */ -void * -acpi_allocate ( - u32 size); - -void * -acpi_callocate ( - u32 size); +void *acpi_allocate(u32 size); -void -acpi_free ( - void *address); +void *acpi_callocate(u32 size); +void acpi_free(void *address); /* * ACPI table manipulation interfaces */ acpi_status -acpi_find_root_pointer ( - u32 flags, - struct acpi_pointer *rsdp_address); +acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address); -acpi_status -acpi_load_tables ( - void); +acpi_status acpi_load_tables(void); #ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_load_table ( - struct acpi_table_header *table_ptr); +acpi_status acpi_load_table(struct acpi_table_header *table_ptr); -acpi_status -acpi_unload_table ( - acpi_table_type table_type); +acpi_status acpi_unload_table(acpi_table_type table_type); acpi_status -acpi_get_table_header ( - acpi_table_type table_type, - u32 instance, - struct acpi_table_header *out_table_header); -#endif /* ACPI_FUTURE_USAGE */ +acpi_get_table_header(acpi_table_type table_type, + u32 instance, struct acpi_table_header *out_table_header); +#endif /* ACPI_FUTURE_USAGE */ acpi_status -acpi_get_table ( - acpi_table_type table_type, - u32 instance, - struct acpi_buffer *ret_buffer); +acpi_get_table(acpi_table_type table_type, + u32 instance, struct acpi_buffer *ret_buffer); acpi_status -acpi_get_firmware_table ( - acpi_string signature, - u32 instance, - u32 flags, - struct acpi_table_header **table_pointer); - +acpi_get_firmware_table(acpi_string signature, + u32 instance, + u32 flags, struct acpi_table_header **table_pointer); /* * Namespace and name interfaces */ acpi_status -acpi_walk_namespace ( - acpi_object_type type, - acpi_handle start_object, - u32 max_depth, - acpi_walk_callback user_function, - void *context, - void **return_value); +acpi_walk_namespace(acpi_object_type type, + acpi_handle start_object, + u32 max_depth, + acpi_walk_callback user_function, + void *context, void **return_value); acpi_status -acpi_get_devices ( - char *HID, - acpi_walk_callback user_function, - void *context, - void **return_value); +acpi_get_devices(char *HID, + acpi_walk_callback user_function, + void *context, void **return_value); acpi_status -acpi_get_name ( - acpi_handle handle, - u32 name_type, - struct acpi_buffer *ret_path_ptr); +acpi_get_name(acpi_handle handle, + u32 name_type, struct acpi_buffer *ret_path_ptr); acpi_status -acpi_get_handle ( - acpi_handle parent, - acpi_string pathname, - acpi_handle *ret_handle); +acpi_get_handle(acpi_handle parent, + acpi_string pathname, acpi_handle * ret_handle); acpi_status -acpi_attach_data ( - acpi_handle obj_handle, - acpi_object_handler handler, - void *data); +acpi_attach_data(acpi_handle obj_handle, + acpi_object_handler handler, void *data); acpi_status -acpi_detach_data ( - acpi_handle obj_handle, - acpi_object_handler handler); +acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); acpi_status -acpi_get_data ( - acpi_handle obj_handle, - acpi_object_handler handler, - void **data); - +acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); /* * Object manipulation and enumeration */ acpi_status -acpi_evaluate_object ( - acpi_handle object, - acpi_string pathname, - struct acpi_object_list *parameter_objects, - struct acpi_buffer *return_object_buffer); +acpi_evaluate_object(acpi_handle object, + acpi_string pathname, + struct acpi_object_list *parameter_objects, + struct acpi_buffer *return_object_buffer); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_evaluate_object_typed ( - acpi_handle object, - acpi_string pathname, - struct acpi_object_list *external_params, - struct acpi_buffer *return_buffer, - acpi_object_type return_type); +acpi_evaluate_object_typed(acpi_handle object, + acpi_string pathname, + struct acpi_object_list *external_params, + struct acpi_buffer *return_buffer, + acpi_object_type return_type); #endif acpi_status -acpi_get_object_info ( - acpi_handle handle, - struct acpi_buffer *return_buffer); +acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer); acpi_status -acpi_get_next_object ( - acpi_object_type type, - acpi_handle parent, - acpi_handle child, - acpi_handle *out_handle); +acpi_get_next_object(acpi_object_type type, + acpi_handle parent, + acpi_handle child, acpi_handle * out_handle); -acpi_status -acpi_get_type ( - acpi_handle object, - acpi_object_type *out_type); - -acpi_status -acpi_get_parent ( - acpi_handle object, - acpi_handle *out_handle); +acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); +acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); /* * Event handler interfaces */ acpi_status -acpi_install_fixed_event_handler ( - u32 acpi_event, - acpi_event_handler handler, - void *context); +acpi_install_fixed_event_handler(u32 acpi_event, + acpi_event_handler handler, void *context); acpi_status -acpi_remove_fixed_event_handler ( - u32 acpi_event, - acpi_event_handler handler); +acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); acpi_status -acpi_install_notify_handler ( - acpi_handle device, - u32 handler_type, - acpi_notify_handler handler, - void *context); +acpi_install_notify_handler(acpi_handle device, + u32 handler_type, + acpi_notify_handler handler, void *context); acpi_status -acpi_remove_notify_handler ( - acpi_handle device, - u32 handler_type, - acpi_notify_handler handler); +acpi_remove_notify_handler(acpi_handle device, + u32 handler_type, acpi_notify_handler handler); acpi_status -acpi_install_address_space_handler ( - acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler, - acpi_adr_space_setup setup, - void *context); +acpi_install_address_space_handler(acpi_handle device, + acpi_adr_space_type space_id, + acpi_adr_space_handler handler, + acpi_adr_space_setup setup, void *context); acpi_status -acpi_remove_address_space_handler ( - acpi_handle device, - acpi_adr_space_type space_id, - acpi_adr_space_handler handler); +acpi_remove_address_space_handler(acpi_handle device, + acpi_adr_space_type space_id, + acpi_adr_space_handler handler); acpi_status -acpi_install_gpe_handler ( - acpi_handle gpe_device, - u32 gpe_number, - u32 type, - acpi_event_handler address, - void *context); +acpi_install_gpe_handler(acpi_handle gpe_device, + u32 gpe_number, + u32 type, acpi_event_handler address, void *context); #ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_install_exception_handler ( - acpi_exception_handler handler); +acpi_status acpi_install_exception_handler(acpi_exception_handler handler); #endif - /* * Event interfaces */ -acpi_status -acpi_acquire_global_lock ( - u16 timeout, - u32 *handle); +acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); -acpi_status -acpi_release_global_lock ( - u32 handle); +acpi_status acpi_release_global_lock(u32 handle); acpi_status -acpi_remove_gpe_handler ( - acpi_handle gpe_device, - u32 gpe_number, - acpi_event_handler address); +acpi_remove_gpe_handler(acpi_handle gpe_device, + u32 gpe_number, acpi_event_handler address); -acpi_status -acpi_enable_event ( - u32 event, - u32 flags); +acpi_status acpi_enable_event(u32 event, u32 flags); -acpi_status -acpi_disable_event ( - u32 event, - u32 flags); +acpi_status acpi_disable_event(u32 event, u32 flags); -acpi_status -acpi_clear_event ( - u32 event); +acpi_status acpi_clear_event(u32 event); #ifdef ACPI_FUTURE_USAGE -acpi_status -acpi_get_event_status ( - u32 event, - acpi_event_status *event_status); -#endif /* ACPI_FUTURE_USAGE */ +acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ -acpi_status -acpi_set_gpe_type ( - acpi_handle gpe_device, - u32 gpe_number, - u8 type); +acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); -acpi_status -acpi_enable_gpe ( - acpi_handle gpe_device, - u32 gpe_number, - u32 flags); +acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); -acpi_status -acpi_disable_gpe ( - acpi_handle gpe_device, - u32 gpe_number, - u32 flags); +acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); -acpi_status -acpi_clear_gpe ( - acpi_handle gpe_device, - u32 gpe_number, - u32 flags); +acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_get_gpe_status ( - acpi_handle gpe_device, - u32 gpe_number, - u32 flags, - acpi_event_status *event_status); -#endif /* ACPI_FUTURE_USAGE */ +acpi_get_gpe_status(acpi_handle gpe_device, + u32 gpe_number, + u32 flags, acpi_event_status * event_status); +#endif /* ACPI_FUTURE_USAGE */ acpi_status -acpi_install_gpe_block ( - acpi_handle gpe_device, - struct acpi_generic_address *gpe_block_address, - u32 register_count, - u32 interrupt_number); - -acpi_status -acpi_remove_gpe_block ( - acpi_handle gpe_device); +acpi_install_gpe_block(acpi_handle gpe_device, + struct acpi_generic_address *gpe_block_address, + u32 register_count, u32 interrupt_number); +acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); /* * Resource interfaces */ typedef -acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) ( - struct acpi_resource *resource, - void *context); - +acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, + void *context); acpi_status -acpi_get_current_resources( - acpi_handle device_handle, - struct acpi_buffer *ret_buffer); +acpi_get_current_resources(acpi_handle device_handle, + struct acpi_buffer *ret_buffer); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_get_possible_resources( - acpi_handle device_handle, - struct acpi_buffer *ret_buffer); +acpi_get_possible_resources(acpi_handle device_handle, + struct acpi_buffer *ret_buffer); #endif acpi_status -acpi_walk_resources ( - acpi_handle device_handle, - char *path, - ACPI_WALK_RESOURCE_CALLBACK user_function, - void *context); +acpi_walk_resources(acpi_handle device_handle, + char *path, + ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); acpi_status -acpi_set_current_resources ( - acpi_handle device_handle, - struct acpi_buffer *in_buffer); +acpi_set_current_resources(acpi_handle device_handle, + struct acpi_buffer *in_buffer); acpi_status -acpi_get_irq_routing_table ( - acpi_handle bus_device_handle, - struct acpi_buffer *ret_buffer); +acpi_get_irq_routing_table(acpi_handle bus_device_handle, + struct acpi_buffer *ret_buffer); acpi_status -acpi_resource_to_address64 ( - struct acpi_resource *resource, - struct acpi_resource_address64 *out); +acpi_resource_to_address64(struct acpi_resource *resource, + struct acpi_resource_address64 *out); /* * Hardware (ACPI device) interfaces */ -acpi_status -acpi_get_register ( - u32 register_id, - u32 *return_value, - u32 flags); +acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags); -acpi_status -acpi_set_register ( - u32 register_id, - u32 value, - u32 flags); +acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags); acpi_status -acpi_set_firmware_waking_vector ( - acpi_physical_address physical_address); +acpi_set_firmware_waking_vector(acpi_physical_address physical_address); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_get_firmware_waking_vector ( - acpi_physical_address *physical_address); +acpi_get_firmware_waking_vector(acpi_physical_address * physical_address); #endif acpi_status -acpi_get_sleep_type_data ( - u8 sleep_state, - u8 *slp_typ_a, - u8 *slp_typ_b); +acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); -acpi_status -acpi_enter_sleep_state_prep ( - u8 sleep_state); +acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); -acpi_status asmlinkage -acpi_enter_sleep_state ( - u8 sleep_state); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); -acpi_status asmlinkage -acpi_enter_sleep_state_s4bios ( - void); - -acpi_status -acpi_leave_sleep_state ( - u8 sleep_state); +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); +acpi_status acpi_leave_sleep_state(u8 sleep_state); -#endif /* __ACXFACE_H__ */ +#endif /* __ACXFACE_H__ */ diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ed679264c12..38e798b05d0 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -44,303 +44,216 @@ #ifndef __ACRESRC_H__ #define __ACRESRC_H__ - /* * Function prototypes called from Acpi* APIs */ acpi_status -acpi_rs_get_prt_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); - +acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); acpi_status -acpi_rs_get_crs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); +acpi_rs_get_crs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_rs_get_prs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); -#endif /* ACPI_FUTURE_USAGE */ +acpi_rs_get_prs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); +#endif /* ACPI_FUTURE_USAGE */ acpi_status -acpi_rs_get_method_data ( - acpi_handle handle, - char *path, - struct acpi_buffer *ret_buffer); +acpi_rs_get_method_data(acpi_handle handle, + char *path, struct acpi_buffer *ret_buffer); acpi_status -acpi_rs_set_srs_method_data ( - acpi_handle handle, - struct acpi_buffer *ret_buffer); +acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); acpi_status -acpi_rs_create_resource_list ( - union acpi_operand_object *byte_stream_buffer, - struct acpi_buffer *output_buffer); +acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, + struct acpi_buffer *output_buffer); acpi_status -acpi_rs_create_byte_stream ( - struct acpi_resource *linked_list_buffer, - struct acpi_buffer *output_buffer); +acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, + struct acpi_buffer *output_buffer); acpi_status -acpi_rs_create_pci_routing_table ( - union acpi_operand_object *package_object, - struct acpi_buffer *output_buffer); - +acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, + struct acpi_buffer *output_buffer); /* * rsdump */ #ifdef ACPI_FUTURE_USAGE -void -acpi_rs_dump_resource_list ( - struct acpi_resource *resource); - -void -acpi_rs_dump_irq_list ( - u8 *route_table); -#endif /* ACPI_FUTURE_USAGE */ +void acpi_rs_dump_resource_list(struct acpi_resource *resource); +void acpi_rs_dump_irq_list(u8 * route_table); +#endif /* ACPI_FUTURE_USAGE */ /* * rscalc */ acpi_status -acpi_rs_get_byte_stream_start ( - u8 *byte_stream_buffer, - u8 **byte_stream_start, - u32 *size); +acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer, + u8 ** byte_stream_start, u32 * size); acpi_status -acpi_rs_get_list_length ( - u8 *byte_stream_buffer, - u32 byte_stream_buffer_length, - acpi_size *size_needed); +acpi_rs_get_list_length(u8 * byte_stream_buffer, + u32 byte_stream_buffer_length, acpi_size * size_needed); acpi_status -acpi_rs_get_byte_stream_length ( - struct acpi_resource *linked_list_buffer, - acpi_size *size_needed); +acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer, + acpi_size * size_needed); acpi_status -acpi_rs_get_pci_routing_table_length ( - union acpi_operand_object *package_object, - acpi_size *buffer_size_needed); +acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, + acpi_size * buffer_size_needed); acpi_status -acpi_rs_byte_stream_to_list ( - u8 *byte_stream_buffer, - u32 byte_stream_buffer_length, - u8 *output_buffer); +acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer, + u32 byte_stream_buffer_length, u8 * output_buffer); acpi_status -acpi_rs_list_to_byte_stream ( - struct acpi_resource *linked_list, - acpi_size byte_stream_size_needed, - u8 *output_buffer); +acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list, + acpi_size byte_stream_size_needed, + u8 * output_buffer); acpi_status -acpi_rs_io_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_io_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_fixed_io_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_io_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_io_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_fixed_io_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_irq_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_irq_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_irq_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_irq_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_dma_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_dma_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_dma_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_dma_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_address16_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_address16_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address16_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_address16_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_address32_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_address32_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address32_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_address32_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_address64_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_address64_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address64_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_address64_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_start_depend_fns_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, + acpi_size * structure_size); acpi_status -acpi_rs_end_depend_fns_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, + acpi_size * structure_size); acpi_status -acpi_rs_start_depend_fns_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, + acpi_size * bytes_consumed); acpi_status -acpi_rs_end_depend_fns_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_memory24_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_memory24_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_memory24_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_memory24_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_memory32_range_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, + acpi_size * structure_size); acpi_status -acpi_rs_fixed_memory32_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, + acpi_size * structure_size); acpi_status -acpi_rs_memory32_range_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_memory32_range_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_fixed_memory32_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_extended_irq_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_extended_irq_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_end_tag_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_end_tag_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_end_tag_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_end_tag_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_vendor_resource ( - u8 *byte_stream_buffer, - acpi_size *bytes_consumed, - u8 **output_buffer, - acpi_size *structure_size); +acpi_rs_vendor_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_vendor_stream ( - struct acpi_resource *linked_list, - u8 **output_buffer, - acpi_size *bytes_consumed); +acpi_rs_vendor_stream(struct acpi_resource *linked_list, + u8 ** output_buffer, acpi_size * bytes_consumed); -u8 -acpi_rs_get_resource_type ( - u8 resource_start_byte); +u8 acpi_rs_get_resource_type(u8 resource_start_byte); -#endif /* __ACRESRC_H__ */ +#endif /* __ACRESRC_H__ */ diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index 27b22bb3d22..99d23533980 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -44,14 +44,12 @@ #ifndef __ACSTRUCT_H__ #define __ACSTRUCT_H__ - /***************************************************************************** * * Tree walking typedefs and structs * ****************************************************************************/ - /* * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through * the tree (for whatever reason), and for control method execution. @@ -65,97 +63,90 @@ #define ACPI_WALK_CONST_REQUIRED 3 #define ACPI_WALK_CONST_OPTIONAL 4 -struct acpi_walk_state -{ - u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\ - u8 walk_type; - acpi_owner_id owner_id; /* Owner of objects created during the walk */ - u8 last_predicate; /* Result of last predicate */ - u8 current_result; /* */ - u8 next_op_info; /* Info about next_op */ - u8 num_operands; /* Stack pointer for Operands[] array */ - u8 return_used; - u16 opcode; /* Current AML opcode */ - u8 scope_depth; - u8 pass_number; /* Parse pass during table load */ - u32 arg_count; /* push for fixed or var args */ - u32 aml_offset; - u32 arg_types; - u32 method_breakpoint; /* For single stepping */ - u32 user_breakpoint; /* User AML breakpoint */ - u32 parse_flags; - u32 prev_arg_types; - - u8 *aml_last_while; - struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ - union acpi_operand_object **caller_return_desc; - union acpi_generic_state *control_state; /* List of control states (nested IFs) */ - struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ - struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ - union acpi_operand_object *implicit_return_obj; - struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ - struct acpi_namespace_node *method_call_node; /* Called method Node*/ - union acpi_parse_object *method_call_op; /* method_call Op if running a method */ - union acpi_operand_object *method_desc; /* Method descriptor if running a method */ - struct acpi_namespace_node *method_node; /* Method node if running a method. */ - union acpi_parse_object *op; /* Current parser op */ - union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ - const struct acpi_opcode_info *op_info; /* Info on current opcode */ - union acpi_parse_object *origin; /* Start of walk [Obsolete] */ - union acpi_operand_object **params; - struct acpi_parse_state parser_state; /* Current state of parser */ - union acpi_operand_object *result_obj; - union acpi_generic_state *results; /* Stack of accumulated results */ - union acpi_operand_object *return_desc; /* Return object, if any */ - union acpi_generic_state *scope_info; /* Stack of nested scopes */ - - union acpi_parse_object *prev_op; /* Last op that was processed */ - union acpi_parse_object *next_op; /* next op to be processed */ - acpi_parse_downwards descending_callback; - acpi_parse_upwards ascending_callback; - struct acpi_thread_state *thread; - struct acpi_walk_state *next; /* Next walk_state in list */ +struct acpi_walk_state { + u8 data_type; /* To differentiate various internal objs MUST BE FIRST! */ + u8 walk_type; + acpi_owner_id owner_id; /* Owner of objects created during the walk */ + u8 last_predicate; /* Result of last predicate */ + u8 current_result; /* */ + u8 next_op_info; /* Info about next_op */ + u8 num_operands; /* Stack pointer for Operands[] array */ + u8 return_used; + u16 opcode; /* Current AML opcode */ + u8 scope_depth; + u8 pass_number; /* Parse pass during table load */ + u32 arg_count; /* push for fixed or var args */ + u32 aml_offset; + u32 arg_types; + u32 method_breakpoint; /* For single stepping */ + u32 user_breakpoint; /* User AML breakpoint */ + u32 parse_flags; + u32 prev_arg_types; + + u8 *aml_last_while; + struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ + union acpi_operand_object **caller_return_desc; + union acpi_generic_state *control_state; /* List of control states (nested IFs) */ + struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */ + struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */ + union acpi_operand_object *implicit_return_obj; + struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ + struct acpi_namespace_node *method_call_node; /* Called method Node */ + union acpi_parse_object *method_call_op; /* method_call Op if running a method */ + union acpi_operand_object *method_desc; /* Method descriptor if running a method */ + struct acpi_namespace_node *method_node; /* Method node if running a method. */ + union acpi_parse_object *op; /* Current parser op */ + union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ + const struct acpi_opcode_info *op_info; /* Info on current opcode */ + union acpi_parse_object *origin; /* Start of walk [Obsolete] */ + union acpi_operand_object **params; + struct acpi_parse_state parser_state; /* Current state of parser */ + union acpi_operand_object *result_obj; + union acpi_generic_state *results; /* Stack of accumulated results */ + union acpi_operand_object *return_desc; /* Return object, if any */ + union acpi_generic_state *scope_info; /* Stack of nested scopes */ + + union acpi_parse_object *prev_op; /* Last op that was processed */ + union acpi_parse_object *next_op; /* next op to be processed */ + acpi_parse_downwards descending_callback; + acpi_parse_upwards ascending_callback; + struct acpi_thread_state *thread; + struct acpi_walk_state *next; /* Next walk_state in list */ }; - /* Info used by acpi_ps_init_objects */ -struct acpi_init_walk_info -{ - u16 method_count; - u16 device_count; - u16 op_region_count; - u16 field_count; - u16 buffer_count; - u16 package_count; - u16 op_region_init; - u16 field_init; - u16 buffer_init; - u16 package_init; - u16 object_count; - struct acpi_table_desc *table_desc; +struct acpi_init_walk_info { + u16 method_count; + u16 device_count; + u16 op_region_count; + u16 field_count; + u16 buffer_count; + u16 package_count; + u16 op_region_init; + u16 field_init; + u16 buffer_init; + u16 package_init; + u16 object_count; + struct acpi_table_desc *table_desc; }; - /* Info used by acpi_ns_initialize_devices */ -struct acpi_device_walk_info -{ - u16 device_count; - u16 num_STA; - u16 num_INI; - struct acpi_table_desc *table_desc; +struct acpi_device_walk_info { + u16 device_count; + u16 num_STA; + u16 num_INI; + struct acpi_table_desc *table_desc; }; - /* TBD: [Restructure] Merge with struct above */ -struct acpi_walk_info -{ - u32 debug_level; - u32 count; - acpi_owner_id owner_id; - u8 display_type; +struct acpi_walk_info { + u32 debug_level; + u32 count; + acpi_owner_id owner_id; + u8 display_type; }; /* Display Types */ @@ -166,56 +157,48 @@ struct acpi_walk_info #define ACPI_DISPLAY_SHORT (u8) 2 -struct acpi_get_devices_info -{ - acpi_walk_callback user_function; - void *context; - char *hid; +struct acpi_get_devices_info { + acpi_walk_callback user_function; + void *context; + char *hid; }; +union acpi_aml_operands { + union acpi_operand_object *operands[7]; -union acpi_aml_operands -{ - union acpi_operand_object *operands[7]; - - struct - { - struct acpi_object_integer *type; - struct acpi_object_integer *code; - struct acpi_object_integer *argument; + struct { + struct acpi_object_integer *type; + struct acpi_object_integer *code; + struct acpi_object_integer *argument; } fatal; - struct - { - union acpi_operand_object *source; - struct acpi_object_integer *index; - union acpi_operand_object *target; + struct { + union acpi_operand_object *source; + struct acpi_object_integer *index; + union acpi_operand_object *target; } index; - struct - { - union acpi_operand_object *source; - struct acpi_object_integer *index; - struct acpi_object_integer *length; - union acpi_operand_object *target; + struct { + union acpi_operand_object *source; + struct acpi_object_integer *index; + struct acpi_object_integer *length; + union acpi_operand_object *target; } mid; }; - /* Internal method parameter list */ -struct acpi_parameter_info -{ - struct acpi_namespace_node *node; - union acpi_operand_object *obj_desc; - union acpi_operand_object **parameters; - union acpi_operand_object *return_object; - u8 pass_number; - u8 parameter_type; - u8 return_object_type; +struct acpi_parameter_info { + struct acpi_namespace_node *node; + union acpi_operand_object *obj_desc; + union acpi_operand_object **parameters; + union acpi_operand_object *return_object; + u8 pass_number; + u8 parameter_type; + u8 return_object_type; }; /* Types for parameter_type above */ @@ -223,5 +206,4 @@ struct acpi_parameter_info #define ACPI_PARAM_ARGS 0 #define ACPI_PARAM_GPE 1 - #endif diff --git a/include/acpi/actables.h b/include/acpi/actables.h index e6ceb181964..f92c1858b80 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h @@ -44,154 +44,101 @@ #ifndef __ACTABLES_H__ #define __ACTABLES_H__ - /* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ #define SIZE_IN_HEADER 0 - /* * tbconvrt - Table conversion routines */ -acpi_status -acpi_tb_convert_to_xsdt ( - struct acpi_table_desc *table_info); +acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info); -acpi_status -acpi_tb_convert_table_fadt ( - void); +acpi_status acpi_tb_convert_table_fadt(void); -acpi_status -acpi_tb_build_common_facs ( - struct acpi_table_desc *table_info); +acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info); u32 -acpi_tb_get_table_count ( - struct rsdp_descriptor *RSDP, - struct acpi_table_header *RSDT); - +acpi_tb_get_table_count(struct rsdp_descriptor *RSDP, + struct acpi_table_header *RSDT); /* * tbget - Table "get" routines */ acpi_status -acpi_tb_get_table ( - struct acpi_pointer *address, - struct acpi_table_desc *table_info); - -acpi_status -acpi_tb_get_table_header ( - struct acpi_pointer *address, - struct acpi_table_header *return_header); +acpi_tb_get_table(struct acpi_pointer *address, + struct acpi_table_desc *table_info); acpi_status -acpi_tb_get_table_body ( - struct acpi_pointer *address, - struct acpi_table_header *header, - struct acpi_table_desc *table_info); +acpi_tb_get_table_header(struct acpi_pointer *address, + struct acpi_table_header *return_header); acpi_status -acpi_tb_get_table_ptr ( - acpi_table_type table_type, - u32 instance, - struct acpi_table_header **table_ptr_loc); +acpi_tb_get_table_body(struct acpi_pointer *address, + struct acpi_table_header *header, + struct acpi_table_desc *table_info); acpi_status -acpi_tb_verify_rsdp ( - struct acpi_pointer *address); +acpi_tb_get_table_ptr(acpi_table_type table_type, + u32 instance, struct acpi_table_header **table_ptr_loc); -void -acpi_tb_get_rsdt_address ( - struct acpi_pointer *out_address); +acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address); -acpi_status -acpi_tb_validate_rsdt ( - struct acpi_table_header *table_ptr); +void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address); +acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr); /* * tbgetall - get multiple required tables */ -acpi_status -acpi_tb_get_required_tables ( - void); - +acpi_status acpi_tb_get_required_tables(void); /* * tbinstall - Table installation */ -acpi_status -acpi_tb_install_table ( - struct acpi_table_desc *table_info); +acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info); acpi_status -acpi_tb_recognize_table ( - struct acpi_table_desc *table_info, - u8 search_type); +acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type); acpi_status -acpi_tb_init_table_descriptor ( - acpi_table_type table_type, - struct acpi_table_desc *table_info); - +acpi_tb_init_table_descriptor(acpi_table_type table_type, + struct acpi_table_desc *table_info); /* * tbremove - Table removal and deletion */ -void -acpi_tb_delete_all_tables ( - void); - -void -acpi_tb_delete_tables_by_type ( - acpi_table_type type); +void acpi_tb_delete_all_tables(void); -void -acpi_tb_delete_single_table ( - struct acpi_table_desc *table_desc); +void acpi_tb_delete_tables_by_type(acpi_table_type type); -struct acpi_table_desc * -acpi_tb_uninstall_table ( - struct acpi_table_desc *table_desc); +void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc); +struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc + *table_desc); /* * tbxfroot - RSDP, RSDT utilities */ acpi_status -acpi_tb_find_table ( - char *signature, - char *oem_id, - char *oem_table_id, - struct acpi_table_header **table_ptr); +acpi_tb_find_table(char *signature, + char *oem_id, + char *oem_table_id, struct acpi_table_header **table_ptr); -acpi_status -acpi_tb_get_table_rsdt ( - void); - -acpi_status -acpi_tb_validate_rsdp ( - struct rsdp_descriptor *rsdp); +acpi_status acpi_tb_get_table_rsdt(void); +acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp); /* * tbutils - common table utilities */ -acpi_status -acpi_tb_is_table_installed ( - struct acpi_table_desc *new_table_desc); +acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); acpi_status -acpi_tb_verify_table_checksum ( - struct acpi_table_header *table_header); +acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); -u8 -acpi_tb_generate_checksum ( - void *buffer, - u32 length); +u8 acpi_tb_generate_checksum(void *buffer, u32 length); acpi_status -acpi_tb_validate_table_header ( - struct acpi_table_header *table_header); +acpi_tb_validate_table_header(struct acpi_table_header *table_header); -#endif /* __ACTABLES_H__ */ +#endif /* __ACTABLES_H__ */ diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index c1e9110c366..a46f406e1c9 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -44,27 +44,24 @@ #ifndef __ACTBL_H__ #define __ACTBL_H__ - /* * Values for description table header signatures */ #define RSDP_NAME "RSDP" -#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ -#define APIC_SIG "APIC" /* Multiple APIC Description Table */ -#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ -#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ -#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ -#define PSDT_SIG "PSDT" /* Persistent System Description Table */ -#define RSDT_SIG "RSDT" /* Root System Description Table */ -#define XSDT_SIG "XSDT" /* Extended System Description Table */ -#define SSDT_SIG "SSDT" /* Secondary System Description Table */ -#define SBST_SIG "SBST" /* Smart Battery Specification Table */ -#define SPIC_SIG "SPIC" /* IOSAPIC table */ -#define BOOT_SIG "BOOT" /* Boot table */ - - -#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ - +#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ +#define APIC_SIG "APIC" /* Multiple APIC Description Table */ +#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ +#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ +#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ +#define PSDT_SIG "PSDT" /* Persistent System Description Table */ +#define RSDT_SIG "RSDT" /* Root System Description Table */ +#define XSDT_SIG "XSDT" /* Extended System Description Table */ +#define SSDT_SIG "SSDT" /* Secondary System Description Table */ +#define SBST_SIG "SBST" /* Smart Battery Specification Table */ +#define SPIC_SIG "SPIC" /* IOSAPIC table */ +#define BOOT_SIG "BOOT" /* Boot table */ + +#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ /* * Common table types. The base code can remain @@ -75,7 +72,6 @@ #define FACS_DESCRIPTOR struct facs_descriptor_rev2 #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 - #pragma pack(1) /* @@ -84,28 +80,24 @@ * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) * are in separate files. */ -struct rsdp_descriptor /* Root System Descriptor Pointer */ -{ - char signature[8]; /* ACPI signature, contains "RSD PTR " */ - u8 checksum; /* ACPI 1.0 checksum */ - char oem_id[6]; /* OEM identification */ - u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ - u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ - u32 length; /* XSDT Length in bytes, including header */ - u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ - u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ - char reserved[3]; /* Reserved, must be zero */ +struct rsdp_descriptor { /* Root System Descriptor Pointer */ + char signature[8]; /* ACPI signature, contains "RSD PTR " */ + u8 checksum; /* ACPI 1.0 checksum */ + char oem_id[6]; /* OEM identification */ + u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ + u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ + u32 length; /* XSDT Length in bytes, including header */ + u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ + u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ + char reserved[3]; /* Reserved, must be zero */ }; - -struct acpi_common_facs /* Common FACS for internal use */ -{ - u32 *global_lock; - u64 *firmware_waking_vector; - u8 vector_width; +struct acpi_common_facs { /* Common FACS for internal use */ + u32 *global_lock; + u64 *firmware_waking_vector; + u8 vector_width; }; - #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ char signature[4]; /* ASCII table signature */\ u32 length; /* Length of table in bytes, including this header */\ @@ -115,14 +107,10 @@ struct acpi_common_facs /* Common FACS for internal use */ char oem_table_id[8]; /* ASCII OEM table identification */\ u32 oem_revision; /* OEM revision number */\ char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ - u32 asl_compiler_revision; /* ASL compiler version */ - - -struct acpi_table_header /* ACPI common table header */ -{ - ACPI_TABLE_HEADER_DEF -}; + u32 asl_compiler_revision; /* ASL compiler version */ +struct acpi_table_header { /* ACPI common table header */ +ACPI_TABLE_HEADER_DEF}; /* * MADT values and structures @@ -135,16 +123,15 @@ struct acpi_table_header /* ACPI common table header */ /* Master MADT */ -struct multiple_apic_table -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 local_apic_address; /* Physical address of local APIC */ +struct multiple_apic_table { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u32 local_apic_address; /* Physical address of local APIC */ /* Flags (32 bits) */ - u8 PCATcompat : 1; /* 00: System also has dual 8259s */ - u8 : 7; /* 01-07: Reserved, must be zero */ - u8 reserved1[3]; /* 08-31: Reserved, must be zero */ + u8 PCATcompat:1; /* 00: System also has dual 8259s */ + u8:7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ }; /* Values for Type in APIC_HEADER_DEF */ @@ -158,7 +145,7 @@ struct multiple_apic_table #define APIC_IO_SAPIC 6 #define APIC_LOCAL_SAPIC 7 #define APIC_XRUPT_SOURCE 8 -#define APIC_RESERVED 9 /* 9 and greater are reserved */ +#define APIC_RESERVED 9 /* 9 and greater are reserved */ /* * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) @@ -167,10 +154,8 @@ struct multiple_apic_table u8 type; \ u8 length; -struct apic_header -{ - APIC_HEADER_DEF -}; +struct apic_header { +APIC_HEADER_DEF}; /* Values for MPS INTI flags */ @@ -190,113 +175,84 @@ struct apic_header u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ u8 : 4; /* 04-07: Reserved, must be zero */\ - u8 reserved1; /* 08-15: Reserved, must be zero */ + u8 reserved1; /* 08-15: Reserved, must be zero */ #define LOCAL_APIC_FLAGS \ u8 processor_enabled: 1; /* 00: Processor is usable if set */\ u8 : 7; /* 01-07: Reserved, must be zero */\ - u8 reserved2; /* 08-15: Reserved, must be zero */ + u8 reserved2; /* 08-15: Reserved, must be zero */ /* Sub-structures for MADT */ -struct madt_processor_apic -{ - APIC_HEADER_DEF - u8 processor_id; /* ACPI processor id */ - u8 local_apic_id; /* Processor's local APIC id */ - LOCAL_APIC_FLAGS +struct madt_processor_apic { + APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ + u8 local_apic_id; /* Processor's local APIC id */ + LOCAL_APIC_FLAGS}; + +struct madt_io_apic { + APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ + u8 reserved; /* Reserved - must be zero */ + u32 address; /* APIC physical address */ + u32 interrupt; /* Global system interrupt where INTI + * lines start */ }; -struct madt_io_apic -{ - APIC_HEADER_DEF - u8 io_apic_id; /* I/O APIC ID */ - u8 reserved; /* Reserved - must be zero */ - u32 address; /* APIC physical address */ - u32 interrupt; /* Global system interrupt where INTI - * lines start */ -}; - -struct madt_interrupt_override -{ - APIC_HEADER_DEF - u8 bus; /* 0 - ISA */ - u8 source; /* Interrupt source (IRQ) */ - u32 interrupt; /* Global system interrupt */ - MPS_INTI_FLAGS -}; +struct madt_interrupt_override { + APIC_HEADER_DEF u8 bus; /* 0 - ISA */ + u8 source; /* Interrupt source (IRQ) */ + u32 interrupt; /* Global system interrupt */ + MPS_INTI_FLAGS}; -struct madt_nmi_source -{ - APIC_HEADER_DEF - MPS_INTI_FLAGS - u32 interrupt; /* Global system interrupt */ +struct madt_nmi_source { + APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ }; -struct madt_local_apic_nmi -{ - APIC_HEADER_DEF - u8 processor_id; /* ACPI processor id */ - MPS_INTI_FLAGS - u8 lint; /* LINTn to which NMI is connected */ +struct madt_local_apic_nmi { + APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ + MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ }; -struct madt_address_override -{ - APIC_HEADER_DEF - u16 reserved; /* Reserved, must be zero */ - u64 address; /* APIC physical address */ +struct madt_address_override { + APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ + u64 address; /* APIC physical address */ }; -struct madt_io_sapic -{ - APIC_HEADER_DEF - u8 io_sapic_id; /* I/O SAPIC ID */ - u8 reserved; /* Reserved, must be zero */ - u32 interrupt_base; /* Glocal interrupt for SAPIC start */ - u64 address; /* SAPIC physical address */ +struct madt_io_sapic { + APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ + u8 reserved; /* Reserved, must be zero */ + u32 interrupt_base; /* Glocal interrupt for SAPIC start */ + u64 address; /* SAPIC physical address */ }; -struct madt_local_sapic -{ - APIC_HEADER_DEF - u8 processor_id; /* ACPI processor id */ - u8 local_sapic_id; /* SAPIC ID */ - u8 local_sapic_eid; /* SAPIC EID */ - u8 reserved[3]; /* Reserved, must be zero */ - LOCAL_APIC_FLAGS - u32 processor_uID; /* Numeric UID - ACPI 3.0 */ - char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ +struct madt_local_sapic { + APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ + u8 local_sapic_id; /* SAPIC ID */ + u8 local_sapic_eid; /* SAPIC EID */ + u8 reserved[3]; /* Reserved, must be zero */ + LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ + char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ }; -struct madt_interrupt_source -{ - APIC_HEADER_DEF - MPS_INTI_FLAGS - u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ - u8 processor_id; /* Processor ID */ - u8 processor_eid; /* Processor EID */ - u8 io_sapic_vector; /* Vector value for PMI interrupts */ - u32 interrupt; /* Global system interrupt */ - u32 flags; /* Interrupt Source Flags */ +struct madt_interrupt_source { + APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ + u8 processor_id; /* Processor ID */ + u8 processor_eid; /* Processor EID */ + u8 io_sapic_vector; /* Vector value for PMI interrupts */ + u32 interrupt; /* Global system interrupt */ + u32 flags; /* Interrupt Source Flags */ }; - /* * Smart Battery */ -struct smart_battery_table -{ - ACPI_TABLE_HEADER_DEF - u32 warning_level; - u32 low_level; - u32 critical_level; +struct smart_battery_table { + ACPI_TABLE_HEADER_DEF u32 warning_level; + u32 low_level; + u32 critical_level; }; - #pragma pack() - /* * ACPI Table information. We save the table address, length, * and type of memory allocation (mapped or allocated) for each @@ -320,39 +276,35 @@ struct smart_battery_table /* Data about each known table type */ -struct acpi_table_support -{ - char *name; - char *signature; - void **global_ptr; - u8 sig_length; - u8 flags; +struct acpi_table_support { + char *name; + char *signature; + void **global_ptr; + u8 sig_length; + u8 flags; }; - /* * Get the ACPI version-specific tables */ -#include "actbl1.h" /* Acpi 1.0 table definitions */ -#include "actbl2.h" /* Acpi 2.0 table definitions */ +#include "actbl1.h" /* Acpi 1.0 table definitions */ +#include "actbl2.h" /* Acpi 2.0 table definitions */ -extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, - * needed for certain workarounds */ +extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, + * needed for certain workarounds */ #pragma pack(1) /* * High performance timer */ -struct hpet_table -{ - ACPI_TABLE_HEADER_DEF - u32 hardware_id; - struct acpi_generic_address base_address; - u8 hpet_number; - u16 clock_tick; - u8 attributes; +struct hpet_table { + ACPI_TABLE_HEADER_DEF u32 hardware_id; + struct acpi_generic_address base_address; + u8 hpet_number; + u16 clock_tick; + u8 attributes; }; #pragma pack() -#endif /* __ACTBL_H__ */ +#endif /* __ACTBL_H__ */ diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 93c175a4f44..67312c3a915 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -49,94 +49,87 @@ /* * ACPI 1.0 Root System Description Table (RSDT) */ -struct rsdt_descriptor_rev1 -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ +struct rsdt_descriptor_rev1 { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; - /* * ACPI 1.0 Firmware ACPI Control Structure (FACS) */ -struct facs_descriptor_rev1 -{ - char signature[4]; /* ASCII table signature */ - u32 length; /* Length of structure in bytes */ - u32 hardware_signature; /* Hardware configuration signature */ - u32 firmware_waking_vector; /* ACPI OS waking vector */ - u32 global_lock; /* Global Lock */ +struct facs_descriptor_rev1 { + char signature[4]; /* ASCII table signature */ + u32 length; /* Length of structure in bytes */ + u32 hardware_signature; /* Hardware configuration signature */ + u32 firmware_waking_vector; /* ACPI OS waking vector */ + u32 global_lock; /* Global Lock */ /* Flags (32 bits) */ - u8 S4bios_f : 1; /* 00: S4BIOS support is present */ - u8 : 7; /* 01-07: Reserved, must be zero */ - u8 reserved1[3]; /* 08-31: Reserved, must be zero */ + u8 S4bios_f:1; /* 00: S4BIOS support is present */ + u8:7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ - u8 reserved2[40]; /* Reserved, must be zero */ + u8 reserved2[40]; /* Reserved, must be zero */ }; - /* * ACPI 1.0 Fixed ACPI Description Table (FADT) */ -struct fadt_descriptor_rev1 -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 firmware_ctrl; /* Physical address of FACS */ - u32 dsdt; /* Physical address of DSDT */ - u8 model; /* System Interrupt Model */ - u8 reserved1; /* Reserved, must be zero */ - u16 sci_int; /* System vector of SCI interrupt */ - u32 smi_cmd; /* Port address of SMI command port */ - u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ - u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* Reserved, must be zero */ - u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ - u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ - u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ - u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ - u8 reserved3; /* Reserved, must be zero */ - u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ - u16 flush_size; /* Size of area read to flush caches */ - u16 flush_stride; /* Stride used in flushing caches */ - u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ - u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ - u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* Index to century in RTC CMOS RAM */ - u8 reserved4[3]; /* Reserved, must be zero */ +struct fadt_descriptor_rev1 { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u32 firmware_ctrl; /* Physical address of FACS */ + u32 dsdt; /* Physical address of DSDT */ + u8 model; /* System Interrupt Model */ + u8 reserved1; /* Reserved, must be zero */ + u16 sci_int; /* System vector of SCI interrupt */ + u32 smi_cmd; /* Port address of SMI command port */ + u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ + u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ + u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ + u8 reserved2; /* Reserved, must be zero */ + u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ + u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ + u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ + u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ + u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ + u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ + u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ + u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ + u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ + u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ + u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ + u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ + u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ + u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ + u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ + u8 reserved3; /* Reserved, must be zero */ + u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ + u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ + u16 flush_size; /* Size of area read to flush caches */ + u16 flush_stride; /* Stride used in flushing caches */ + u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ + u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ + u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ + u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ + u8 century; /* Index to century in RTC CMOS RAM */ + u8 reserved4[3]; /* Reserved, must be zero */ /* Flags (32 bits) */ - u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ - u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ - u8 proc_c1 : 1; /* 02: All processors support C1 state */ - u8 plvl2_up : 1; /* 03: C2 state works on MP system */ - u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ - u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ - u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ - u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ - u8 tmr_val_ext : 1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ - u8 : 7; /* 09-15: Reserved, must be zero */ - u8 reserved5[2]; /* 16-31: Reserved, must be zero */ + u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ + u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ + u8 proc_c1:1; /* 02: All processors support C1 state */ + u8 plvl2_up:1; /* 03: C2 state works on MP system */ + u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ + u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ + u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ + u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ + u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ + u8:7; /* 09-15: Reserved, must be zero */ + u8 reserved5[2]; /* 16-31: Reserved, must be zero */ }; #pragma pack() -#endif /* __ACTBL1_H__ */ - - +#endif /* __ACTBL1_H__ */ diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 84ce5abbd6f..50305ce2681 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -64,65 +64,56 @@ #define FADT2_REVISION_ID 3 #define FADT2_MINUS_REVISION_ID 2 - #pragma pack(1) /* * ACPI 2.0 Root System Description Table (RSDT) */ -struct rsdt_descriptor_rev2 -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ +struct rsdt_descriptor_rev2 { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; - /* * ACPI 2.0 Extended System Description Table (XSDT) */ -struct xsdt_descriptor_rev2 -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ +struct xsdt_descriptor_rev2 { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ }; - /* * ACPI 2.0 Firmware ACPI Control Structure (FACS) */ -struct facs_descriptor_rev2 -{ - char signature[4]; /* ASCII table signature */ - u32 length; /* Length of structure, in bytes */ - u32 hardware_signature; /* Hardware configuration signature */ - u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ - u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ +struct facs_descriptor_rev2 { + char signature[4]; /* ASCII table signature */ + u32 length; /* Length of structure, in bytes */ + u32 hardware_signature; /* Hardware configuration signature */ + u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */ + u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */ /* Flags (32 bits) */ - u8 S4bios_f : 1; /* 00: S4BIOS support is present */ - u8 : 7; /* 01-07: Reserved, must be zero */ - u8 reserved1[3]; /* 08-31: Reserved, must be zero */ + u8 S4bios_f:1; /* 00: S4BIOS support is present */ + u8:7; /* 01-07: Reserved, must be zero */ + u8 reserved1[3]; /* 08-31: Reserved, must be zero */ - u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ - u8 version; /* Version of this table */ - u8 reserved3[31]; /* Reserved, must be zero */ + u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */ + u8 version; /* Version of this table */ + u8 reserved3[31]; /* Reserved, must be zero */ }; - /* * ACPI 2.0+ Generic Address Structure (GAS) */ -struct acpi_generic_address -{ - u8 address_space_id; /* Address space where struct or register exists. */ - u8 register_bit_width; /* Size in bits of given register */ - u8 register_bit_offset; /* Bit offset within the register */ - u8 access_width; /* Minimum Access size (ACPI 3.0) */ - u64 address; /* 64-bit address of struct or register */ +struct acpi_generic_address { + u8 address_space_id; /* Address space where struct or register exists. */ + u8 register_bit_width; /* Size in bits of given register */ + u8 register_bit_offset; /* Bit offset within the register */ + u8 access_width; /* Minimum Access size (ACPI 3.0) */ + u64 address; /* 64-bit address of struct or register */ }; - #define FADT_REV2_COMMON \ u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ @@ -164,141 +155,123 @@ struct acpi_generic_address /* * ACPI 2.0+ Fixed ACPI Description Table (FADT) */ -struct fadt_descriptor_rev2 -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - FADT_REV2_COMMON - u8 reserved2; /* Reserved, must be zero */ +struct fadt_descriptor_rev2 { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ /* Flags (32 bits) */ - u8 wb_invd : 1; /* 00: The wbinvd instruction works properly */ - u8 wb_invd_flush : 1; /* 01: The wbinvd flushes but does not invalidate */ - u8 proc_c1 : 1; /* 02: All processors support C1 state */ - u8 plvl2_up : 1; /* 03: C2 state works on MP system */ - u8 pwr_button : 1; /* 04: Power button is handled as a generic feature */ - u8 sleep_button : 1; /* 05: Sleep button is handled as a generic feature, or not present */ - u8 fixed_rTC : 1; /* 06: RTC wakeup stat not in fixed register space */ - u8 rtcs4 : 1; /* 07: RTC wakeup stat not possible from S4 */ - u8 tmr_val_ext : 1; /* 08: tmr_val is 32 bits 0=24-bits */ - u8 dock_cap : 1; /* 09: Docking supported */ - u8 reset_reg_sup : 1; /* 10: System reset via the FADT RESET_REG supported */ - u8 sealed_case : 1; /* 11: No internal expansion capabilities and case is sealed */ - u8 headless : 1; /* 12: No local video capabilities or local input devices */ - u8 cpu_sw_sleep : 1; /* 13: Must execute native instruction after writing SLP_TYPx register */ - - u8 pci_exp_wak : 1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ - u8 use_platform_clock : 1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ - u8 S4rtc_sts_valid : 1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ - u8 remote_power_on_capable : 1; /* 17: System is compatible with remote power on (ACPI 3.0) */ - u8 force_apic_cluster_model : 1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ - u8 force_apic_physical_destination_mode : 1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ - u8 : 4; /* 20-23: Reserved, must be zero */ - u8 reserved3; /* 24-31: Reserved, must be zero */ - - struct acpi_generic_address reset_register; /* Reset register address in GAS format */ - u8 reset_value; /* Value to write to the reset_register port to reset the system */ - u8 reserved4[3]; /* These three bytes must be zero */ - u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ - u64 Xdsdt; /* 64-bit physical address of DSDT */ - struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ - struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ - struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ - struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ - struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ - struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ - struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ - struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ + u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ + u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ + u8 proc_c1:1; /* 02: All processors support C1 state */ + u8 plvl2_up:1; /* 03: C2 state works on MP system */ + u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ + u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ + u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ + u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ + u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */ + u8 dock_cap:1; /* 09: Docking supported */ + u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */ + u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */ + u8 headless:1; /* 12: No local video capabilities or local input devices */ + u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */ + + u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */ + u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */ + u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */ + u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */ + u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */ + u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */ + u8:4; /* 20-23: Reserved, must be zero */ + u8 reserved3; /* 24-31: Reserved, must be zero */ + + struct acpi_generic_address reset_register; /* Reset register address in GAS format */ + u8 reset_value; /* Value to write to the reset_register port to reset the system */ + u8 reserved4[3]; /* These three bytes must be zero */ + u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ + u64 Xdsdt; /* 64-bit physical address of DSDT */ + struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ + struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ + struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ + struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ + struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ + struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ + struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ + struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ }; - /* "Down-revved" ACPI 2.0 FADT descriptor */ -struct fadt_descriptor_rev2_minus -{ - ACPI_TABLE_HEADER_DEF /* ACPI common table header */ - FADT_REV2_COMMON - u8 reserved2; /* Reserved, must be zero */ - u32 flags; - struct acpi_generic_address reset_register; /* Reset register address in GAS format */ - u8 reset_value; /* Value to write to the reset_register port to reset the system. */ - u8 reserved7[3]; /* Reserved, must be zero */ +struct fadt_descriptor_rev2_minus { + ACPI_TABLE_HEADER_DEF /* ACPI common table header */ + FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */ + u32 flags; + struct acpi_generic_address reset_register; /* Reset register address in GAS format */ + u8 reset_value; /* Value to write to the reset_register port to reset the system. */ + u8 reserved7[3]; /* Reserved, must be zero */ }; - /* ECDT - Embedded Controller Boot Resources Table */ -struct ec_boot_resources -{ - ACPI_TABLE_HEADER_DEF - struct acpi_generic_address ec_control; /* Address of EC command/status register */ - struct acpi_generic_address ec_data; /* Address of EC data register */ - u32 uid; /* Unique ID - must be same as the EC _UID method */ - u8 gpe_bit; /* The GPE for the EC */ - u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ +struct ec_boot_resources { + ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ + struct acpi_generic_address ec_data; /* Address of EC data register */ + u32 uid; /* Unique ID - must be same as the EC _UID method */ + u8 gpe_bit; /* The GPE for the EC */ + u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ }; - /* SRAT - System Resource Affinity Table */ -struct static_resource_alloc -{ - u8 type; - u8 length; - u8 proximity_domain_lo; - u8 apic_id; +struct static_resource_alloc { + u8 type; + u8 length; + u8 proximity_domain_lo; + u8 apic_id; /* Flags (32 bits) */ - u8 enabled :1; /* 00: Use affinity structure */ - u8 :7; /* 01-07: Reserved, must be zero */ - u8 reserved3[3]; /* 08-31: Reserved, must be zero */ + u8 enabled:1; /* 00: Use affinity structure */ + u8:7; /* 01-07: Reserved, must be zero */ + u8 reserved3[3]; /* 08-31: Reserved, must be zero */ - u8 local_sapic_eid; - u8 proximity_domain_hi[3]; - u32 reserved4; /* Reserved, must be zero */ + u8 local_sapic_eid; + u8 proximity_domain_hi[3]; + u32 reserved4; /* Reserved, must be zero */ }; -struct memory_affinity -{ - u8 type; - u8 length; - u32 proximity_domain; - u16 reserved3; - u64 base_address; - u64 address_length; - u32 reserved4; +struct memory_affinity { + u8 type; + u8 length; + u32 proximity_domain; + u16 reserved3; + u64 base_address; + u64 address_length; + u32 reserved4; /* Flags (32 bits) */ - u8 enabled :1; /* 00: Use affinity structure */ - u8 hot_pluggable :1; /* 01: Memory region is hot pluggable */ - u8 non_volatile :1; /* 02: Memory is non-volatile */ - u8 :5; /* 03-07: Reserved, must be zero */ - u8 reserved5[3]; /* 08-31: Reserved, must be zero */ + u8 enabled:1; /* 00: Use affinity structure */ + u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */ + u8 non_volatile:1; /* 02: Memory is non-volatile */ + u8:5; /* 03-07: Reserved, must be zero */ + u8 reserved5[3]; /* 08-31: Reserved, must be zero */ - u64 reserved6; /* Reserved, must be zero */ + u64 reserved6; /* Reserved, must be zero */ }; -struct system_resource_affinity -{ - ACPI_TABLE_HEADER_DEF - u32 reserved1; /* Must be value '1' */ - u64 reserved2; /* Reserved, must be zero */ +struct system_resource_affinity { + ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ + u64 reserved2; /* Reserved, must be zero */ }; - /* SLIT - System Locality Distance Information Table */ -struct system_locality_info -{ - ACPI_TABLE_HEADER_DEF - u64 locality_count; - u8 entry[1][1]; +struct system_locality_info { + ACPI_TABLE_HEADER_DEF u64 locality_count; + u8 entry[1][1]; }; - #pragma pack() -#endif /* __ACTBL2_H__ */ - +#endif /* __ACTBL2_H__ */ diff --git a/include/acpi/actbl71.h b/include/acpi/actbl71.h index 7b4fb44261f..10ac05bb36b 100644 --- a/include/acpi/actbl71.h +++ b/include/acpi/actbl71.h @@ -27,7 +27,6 @@ #ifndef __ACTBL71_H__ #define __ACTBL71_H__ - /* 0.71 FADT address_space data item bitmasks defines */ /* If the associated bit is zero then it is in memory space else in io space */ @@ -40,105 +39,96 @@ /* Only for clarity in declarations */ -typedef u64 IO_ADDRESS; - +typedef u64 IO_ADDRESS; #pragma pack(1) -struct /* Root System Descriptor Pointer */ -{ - NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ - u8 checksum; /* to make sum of struct == 0 */ - NATIVE_CHAR oem_id [6]; /* OEM identification */ - u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ - u64 rsdt_physical_address; /* 64-bit physical address of RSDT */ +struct { /* Root System Descriptor Pointer */ + NATIVE_CHAR signature[8]; /* contains "RSD PTR " */ + u8 checksum; /* to make sum of struct == 0 */ + NATIVE_CHAR oem_id[6]; /* OEM identification */ + u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ + u64 rsdt_physical_address; /* 64-bit physical address of RSDT */ }; - /*****************************************/ /* IA64 Extensions to ACPI Spec Rev 0.71 */ /* for the Root System Description Table */ /*****************************************/ -struct -{ - struct acpi_table_header header; /* Table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - u64 table_offset_entry [1]; /* Array of pointers to other */ - /* tables' headers */ +struct { + struct acpi_table_header header; /* Table header */ + u32 reserved_pad; /* IA64 alignment, must be 0 */ + u64 table_offset_entry[1]; /* Array of pointers to other */ + /* tables' headers */ }; - /*******************************************/ /* IA64 Extensions to ACPI Spec Rev 0.71 */ /* for the Firmware ACPI Control Structure */ /*******************************************/ -struct -{ - NATIVE_CHAR signature[4]; /* signature "FACS" */ - u32 length; /* length of structure, in bytes */ - u32 hardware_signature; /* hardware configuration signature */ - u32 reserved4; /* must be 0 */ - u64 firmware_waking_vector; /* ACPI OS waking vector */ - u64 global_lock; /* Global Lock */ - u32 S4bios_f : 1; /* Indicates if S4BIOS support is present */ - u32 reserved1 : 31; /* must be 0 */ - u8 reserved3 [28]; /* reserved - must be zero */ +struct { + NATIVE_CHAR signature[4]; /* signature "FACS" */ + u32 length; /* length of structure, in bytes */ + u32 hardware_signature; /* hardware configuration signature */ + u32 reserved4; /* must be 0 */ + u64 firmware_waking_vector; /* ACPI OS waking vector */ + u64 global_lock; /* Global Lock */ + u32 S4bios_f:1; /* Indicates if S4BIOS support is present */ + u32 reserved1:31; /* must be 0 */ + u8 reserved3[28]; /* reserved - must be zero */ }; - /******************************************/ /* IA64 Extensions to ACPI Spec Rev 0.71 */ /* for the Fixed ACPI Description Table */ /******************************************/ -struct -{ - struct acpi_table_header header; /* table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - u64 firmware_ctrl; /* 64-bit Physical address of FACS */ - u64 dsdt; /* 64-bit Physical address of DSDT */ - u8 model; /* System Interrupt Model */ - u8 address_space; /* Address Space Bitmask */ - u16 sci_int; /* System vector of SCI interrupt */ - u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ - u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ - u8 reserved2; /* reserved - must be zero */ - u64 smi_cmd; /* Port address of SMI command port */ - u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ - u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ - u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ - u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* offset in gpe model where gpe1 events start */ - u8 reserved3; /* reserved */ - u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ - u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* index to century in RTC CMOS RAM */ - u8 reserved4; /* reserved */ - u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */ - u32 reserved5 : 1; /* reserved - must be zero */ - u32 proc_c1 : 1; /* all processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ - u32 dock_cap : 1; /* Supports Docking */ - u32 reserved6 : 22; /* reserved - must be zero */ +struct { + struct acpi_table_header header; /* table header */ + u32 reserved_pad; /* IA64 alignment, must be 0 */ + u64 firmware_ctrl; /* 64-bit Physical address of FACS */ + u64 dsdt; /* 64-bit Physical address of DSDT */ + u8 model; /* System Interrupt Model */ + u8 address_space; /* Address Space Bitmask */ + u16 sci_int; /* System vector of SCI interrupt */ + u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ + u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ + u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ + u8 reserved2; /* reserved - must be zero */ + u64 smi_cmd; /* Port address of SMI command port */ + u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ + u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ + u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ + u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ + u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ + u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ + u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ + u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ + u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ + u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ + u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ + u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ + u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ + u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ + u8 gpe1_base; /* offset in gpe model where gpe1 events start */ + u8 reserved3; /* reserved */ + u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ + u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ + u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ + u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ + u8 century; /* index to century in RTC CMOS RAM */ + u8 reserved4; /* reserved */ + u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */ + u32 reserved5:1; /* reserved - must be zero */ + u32 proc_c1:1; /* all processors support C1 state */ + u32 plvl2_up:1; /* C2 state works on MP system */ + u32 pwr_button:1; /* Power button is handled as a generic feature */ + u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */ + u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */ + u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */ + u32 tmr_val_ext:1; /* tmr_val is 32 bits */ + u32 dock_cap:1; /* Supports Docking */ + u32 reserved6:22; /* reserved - must be zero */ }; #pragma pack() -#endif /* __ACTBL71_H__ */ - +#endif /* __ACTBL71_H__ */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 1895b862ce0..254f4b06e7e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -46,35 +46,31 @@ /*! [Begin] no source code translation (keep the typedefs) */ - - /* * Data type ranges * Note: These macros are designed to be compiler independent as well as * working around problems that some 32-bit compilers have with 64-bit * constants. */ -#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ -#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ -#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ -#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ +#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ +#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ +#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ +#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ #define ACPI_ASCII_MAX 0x7F - #ifdef DEFINE_ALTERNATE_TYPES /* * Types used only in translated source, defined here to enable * cross-platform compilation only. */ -typedef int s32; -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef COMPILER_DEPENDENT_UINT64 u64; +typedef int s32; +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef COMPILER_DEPENDENT_UINT64 u64; #endif - /* * Data types - Fixed across all compilation models (16/32/64) * @@ -102,30 +98,29 @@ typedef COMPILER_DEPENDENT_UINT64 u64; /* * 64-bit type definitions */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; -typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; +typedef unsigned char UINT8; +typedef unsigned char BOOLEAN; +typedef unsigned short UINT16; +typedef int INT32; +typedef unsigned int UINT32; +typedef COMPILER_DEPENDENT_INT64 INT64; +typedef COMPILER_DEPENDENT_UINT64 UINT64; /*! [End] no source code translation !*/ -typedef s64 acpi_native_int; -typedef u64 acpi_native_uint; +typedef s64 acpi_native_int; +typedef u64 acpi_native_uint; -typedef u64 acpi_table_ptr; -typedef u64 acpi_io_address; -typedef u64 acpi_physical_address; -typedef u64 acpi_size; +typedef u64 acpi_table_ptr; +typedef u64 acpi_io_address; +typedef u64 acpi_physical_address; +typedef u64 acpi_size; -#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ -#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ +#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ +#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ #define ACPI_MAX_PTR ACPI_UINT64_MAX #define ACPI_SIZE_MAX ACPI_UINT64_MAX - #elif ACPI_MACHINE_WIDTH == 16 /*! [Begin] no source code translation (keep the typedefs) */ @@ -133,32 +128,31 @@ typedef u64 acpi_size; /* * 16-bit type definitions */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned int UINT16; -typedef long INT32; -typedef int INT16; -typedef unsigned long UINT32; - -struct -{ - UINT32 Lo; - UINT32 Hi; +typedef unsigned char UINT8; +typedef unsigned char BOOLEAN; +typedef unsigned int UINT16; +typedef long INT32; +typedef int INT16; +typedef unsigned long UINT32; + +struct { + UINT32 Lo; + UINT32 Hi; }; /*! [End] no source code translation !*/ -typedef u16 acpi_native_uint; -typedef s16 acpi_native_int; +typedef u16 acpi_native_uint; +typedef s16 acpi_native_int; -typedef u32 acpi_table_ptr; -typedef u32 acpi_io_address; -typedef char *acpi_physical_address; -typedef u16 acpi_size; +typedef u32 acpi_table_ptr; +typedef u32 acpi_io_address; +typedef char *acpi_physical_address; +typedef u16 acpi_size; #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 #define ACPI_MISALIGNED_TRANSFERS -#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ +#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ #define ACPI_MAX_PTR ACPI_UINT16_MAX #define ACPI_SIZE_MAX ACPI_UINT16_MAX @@ -168,7 +162,6 @@ typedef u16 acpi_size; */ #define ACPI_NO_INTEGER64_SUPPORT - #elif ACPI_MACHINE_WIDTH == 32 /*! [Begin] no source code translation (keep the typedefs) */ @@ -176,23 +169,23 @@ typedef u16 acpi_size; /* * 32-bit type definitions (default) */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; -typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; +typedef unsigned char UINT8; +typedef unsigned char BOOLEAN; +typedef unsigned short UINT16; +typedef int INT32; +typedef unsigned int UINT32; +typedef COMPILER_DEPENDENT_INT64 INT64; +typedef COMPILER_DEPENDENT_UINT64 UINT64; /*! [End] no source code translation !*/ -typedef s32 acpi_native_int; -typedef u32 acpi_native_uint; +typedef s32 acpi_native_int; +typedef u32 acpi_native_uint; -typedef u64 acpi_table_ptr; -typedef u32 acpi_io_address; -typedef u64 acpi_physical_address; -typedef u32 acpi_size; +typedef u64 acpi_table_ptr; +typedef u32 acpi_io_address; +typedef u64 acpi_physical_address; +typedef u32 acpi_size; #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 #define ACPI_MISALIGNED_TRANSFERS @@ -203,30 +196,27 @@ typedef u32 acpi_size; #error unknown ACPI_MACHINE_WIDTH #endif - /* * This type is used for bitfields in ACPI tables. The only type that is * even remotely portable is u8. Anything else is not portable, so * do not add any more bitfield types. */ -typedef u8 UINT8_BIT; -typedef acpi_native_uint ACPI_PTRDIFF; +typedef u8 UINT8_BIT; +typedef acpi_native_uint ACPI_PTRDIFF; /* * Pointer overlays to avoid lots of typecasting for * code that accepts both physical and logical pointers. */ -union acpi_pointers -{ - acpi_physical_address physical; - void *logical; - acpi_table_ptr value; +union acpi_pointers { + acpi_physical_address physical; + void *logical; + acpi_table_ptr value; }; -struct acpi_pointer -{ - u32 pointer_type; - union acpi_pointers pointer; +struct acpi_pointer { + u32 pointer_type; + union acpi_pointers pointer; }; /* pointer_types for above */ @@ -270,34 +260,29 @@ struct acpi_pointer #define NULL (void *) 0 #endif - /* * Local datatypes */ -typedef u32 acpi_status; /* All ACPI Exceptions */ -typedef u32 acpi_name; /* 4-byte ACPI name */ -typedef char * acpi_string; /* Null terminated ASCII string */ -typedef void * acpi_handle; /* Actually a ptr to an Node */ - -struct uint64_struct -{ - u32 lo; - u32 hi; +typedef u32 acpi_status; /* All ACPI Exceptions */ +typedef u32 acpi_name; /* 4-byte ACPI name */ +typedef char *acpi_string; /* Null terminated ASCII string */ +typedef void *acpi_handle; /* Actually a ptr to an Node */ + +struct uint64_struct { + u32 lo; + u32 hi; }; -union uint64_overlay -{ - u64 full; - struct uint64_struct part; +union uint64_overlay { + u64 full; + struct uint64_struct part; }; -struct uint32_struct -{ - u32 lo; - u32 hi; +struct uint32_struct { + u32 lo; + u32 hi; }; - /* * Acpi integer width. In ACPI version 1, integers are * 32 bits. In ACPI version 2, integers are 64 bits. @@ -309,26 +294,24 @@ struct uint32_struct /* 32-bit integers only, no 64-bit support */ -typedef u32 acpi_integer; +typedef u32 acpi_integer; #define ACPI_INTEGER_MAX ACPI_UINT32_MAX #define ACPI_INTEGER_BIT_SIZE 32 -#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ - -#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ +#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ +#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ #else /* 64-bit integers */ -typedef u64 acpi_integer; +typedef u64 acpi_integer; #define ACPI_INTEGER_MAX ACPI_UINT64_MAX #define ACPI_INTEGER_BIT_SIZE 64 -#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ - +#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ #if ACPI_MACHINE_WIDTH == 64 -#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ +#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ #endif #endif @@ -342,7 +325,6 @@ typedef u64 acpi_integer; */ #define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) - /* * Initialization sequence */ @@ -409,7 +391,7 @@ typedef u64 acpi_integer; /* * Table types. These values are passed to the table related APIs */ -typedef u32 acpi_table_type; +typedef u32 acpi_table_type; #define ACPI_TABLE_RSDP (acpi_table_type) 0 #define ACPI_TABLE_DSDT (acpi_table_type) 1 @@ -430,22 +412,22 @@ typedef u32 acpi_table_type; * NOTE: Types must be kept in sync with the global acpi_ns_properties * and acpi_ns_type_names arrays. */ -typedef u32 acpi_object_type; +typedef u32 acpi_object_type; #define ACPI_TYPE_ANY 0x00 -#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ +#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ #define ACPI_TYPE_STRING 0x02 #define ACPI_TYPE_BUFFER 0x03 -#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ +#define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ #define ACPI_TYPE_FIELD_UNIT 0x05 -#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ +#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ #define ACPI_TYPE_EVENT 0x07 -#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ +#define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ #define ACPI_TYPE_MUTEX 0x09 #define ACPI_TYPE_REGION 0x0A -#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ -#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ -#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ +#define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ +#define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ +#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ #define ACPI_TYPE_BUFFER_FIELD 0x0E #define ACPI_TYPE_DDB_HANDLE 0x0F #define ACPI_TYPE_DEBUG_OBJECT 0x10 @@ -462,16 +444,16 @@ typedef u32 acpi_object_type; #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 -#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ +#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ #define ACPI_TYPE_LOCAL_ALIAS 0x15 #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 #define ACPI_TYPE_LOCAL_NOTIFY 0x17 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 #define ACPI_TYPE_LOCAL_RESOURCE 0x19 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A -#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ +#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ -#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ +#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ /* * These are special object types that never appear in @@ -515,7 +497,7 @@ typedef u32 acpi_object_type; #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) -#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ +#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF /* @@ -528,7 +510,7 @@ typedef u32 acpi_object_type; /* * Event Types: Fixed & General Purpose */ -typedef u32 acpi_event_type; +typedef u32 acpi_event_type; /* * Fixed events @@ -556,7 +538,7 @@ typedef u32 acpi_event_type; * | +----- Set? * +----------- */ -typedef u32 acpi_event_status; +typedef u32 acpi_event_status; #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 @@ -573,7 +555,6 @@ typedef u32 acpi_event_status; #define ACPI_GPE_ENABLE 0 #define ACPI_GPE_DISABLE 1 - /* * GPE info flags - Per GPE * +-+-+-+---+---+-+ @@ -594,22 +575,22 @@ typedef u32 acpi_event_status; #define ACPI_GPE_TYPE_MASK (u8) 0x06 #define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06 #define ACPI_GPE_TYPE_WAKE (u8) 0x02 -#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ +#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */ #define ACPI_GPE_DISPATCH_MASK (u8) 0x18 #define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08 #define ACPI_GPE_DISPATCH_METHOD (u8) 0x10 -#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ +#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */ #define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20 #define ACPI_GPE_RUN_ENABLED (u8) 0x20 -#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ +#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */ #define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40 #define ACPI_GPE_WAKE_ENABLED (u8) 0x40 -#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ +#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */ -#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ +#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ #define ACPI_GPE_SYSTEM_MASK (u8) 0x80 #define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80 @@ -618,13 +599,12 @@ typedef u32 acpi_event_status; /* * Flags for GPE and Lock interfaces */ -#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ -#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ +#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */ +#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */ #define ACPI_NOT_ISR 0x1 #define ACPI_ISR 0x0 - /* Notify types */ #define ACPI_SYSTEM_NOTIFY 0x1 @@ -634,10 +614,9 @@ typedef u32 acpi_event_status; #define ACPI_MAX_SYS_NOTIFY 0x7f - /* Address Space (Operation Region) Types */ -typedef u8 acpi_adr_space_type; +typedef u8 acpi_adr_space_type; #define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 #define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 @@ -649,7 +628,6 @@ typedef u8 acpi_adr_space_type; #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 - /* * bit_register IDs * These are bitfields defined within the full ACPI registers @@ -683,74 +661,62 @@ typedef u8 acpi_adr_space_type; #define ACPI_BITREG_MAX 0x15 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 - /* * External ACPI object definition */ -union acpi_object -{ - acpi_object_type type; /* See definition of acpi_ns_type for values */ - struct - { - acpi_object_type type; - acpi_integer value; /* The actual number */ +union acpi_object { + acpi_object_type type; /* See definition of acpi_ns_type for values */ + struct { + acpi_object_type type; + acpi_integer value; /* The actual number */ } integer; - struct - { - acpi_object_type type; - u32 length; /* # of bytes in string, excluding trailing null */ - char *pointer; /* points to the string value */ + struct { + acpi_object_type type; + u32 length; /* # of bytes in string, excluding trailing null */ + char *pointer; /* points to the string value */ } string; - struct - { - acpi_object_type type; - u32 length; /* # of bytes in buffer */ - u8 *pointer; /* points to the buffer */ + struct { + acpi_object_type type; + u32 length; /* # of bytes in buffer */ + u8 *pointer; /* points to the buffer */ } buffer; - struct - { - acpi_object_type type; - u32 fill1; - acpi_handle handle; /* object reference */ + struct { + acpi_object_type type; + u32 fill1; + acpi_handle handle; /* object reference */ } reference; - struct - { - acpi_object_type type; - u32 count; /* # of elements in package */ - union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ + struct { + acpi_object_type type; + u32 count; /* # of elements in package */ + union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ } package; - struct - { - acpi_object_type type; - u32 proc_id; - acpi_io_address pblk_address; - u32 pblk_length; + struct { + acpi_object_type type; + u32 proc_id; + acpi_io_address pblk_address; + u32 pblk_length; } processor; - struct - { - acpi_object_type type; - u32 system_level; - u32 resource_order; + struct { + acpi_object_type type; + u32 system_level; + u32 resource_order; } power_resource; }; - /* * List of objects, used as a parameter list for control method evaluation */ -struct acpi_object_list -{ - u32 count; - union acpi_object *pointer; +struct acpi_object_list { + u32 count; + union acpi_object *pointer; }; - /* * Miscellaneous common Data Structures used by the interfaces */ @@ -758,13 +724,11 @@ struct acpi_object_list #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) -struct acpi_buffer -{ - acpi_size length; /* Length in bytes of the buffer */ - void *pointer; /* pointer to buffer */ +struct acpi_buffer { + acpi_size length; /* Length in bytes of the buffer */ + void *pointer; /* pointer to buffer */ }; - /* * name_type for acpi_get_name */ @@ -772,7 +736,6 @@ struct acpi_buffer #define ACPI_SINGLE_NAME 1 #define ACPI_NAME_TYPE_MAX 1 - /* * Structure and flags for acpi_get_system_info */ @@ -781,139 +744,106 @@ struct acpi_buffer #define ACPI_SYS_MODE_LEGACY 0x0002 #define ACPI_SYS_MODES_MASK 0x0003 - /* * ACPI Table Info. One per ACPI table _type_ */ -struct acpi_table_info -{ - u32 count; +struct acpi_table_info { + u32 count; }; - /* * System info returned by acpi_get_system_info() */ -struct acpi_system_info -{ - u32 acpi_ca_version; - u32 flags; - u32 timer_resolution; - u32 reserved1; - u32 reserved2; - u32 debug_level; - u32 debug_layer; - u32 num_table_types; - struct acpi_table_info table_info [NUM_ACPI_TABLE_TYPES]; +struct acpi_system_info { + u32 acpi_ca_version; + u32 flags; + u32 timer_resolution; + u32 reserved1; + u32 reserved2; + u32 debug_level; + u32 debug_layer; + u32 num_table_types; + struct acpi_table_info table_info[NUM_ACPI_TABLE_TYPES]; }; - /* * Types specific to the OS service interfaces */ -typedef u32 -(ACPI_SYSTEM_XFACE *acpi_osd_handler) ( - void *context); +typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); typedef void -(ACPI_SYSTEM_XFACE *acpi_osd_exec_callback) ( - void *context); + (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); /* * Various handlers and callback procedures */ -typedef -u32 (*acpi_event_handler) ( - void *context); +typedef u32(*acpi_event_handler) (void *context); typedef -void (*acpi_notify_handler) ( - acpi_handle device, - u32 value, - void *context); +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, u32 function, void *data); -typedef -acpi_status (*acpi_init_handler) ( - acpi_handle object, - u32 function); +typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function); #define ACPI_INIT_DEVICE_INI 1 typedef -acpi_status (*acpi_exception_handler) ( - acpi_status aml_status, - acpi_name name, - u16 opcode, - u32 aml_offset, - void *context); - +acpi_status(*acpi_exception_handler) (acpi_status aml_status, + acpi_name name, + u16 opcode, + u32 aml_offset, void *context); /* Address Spaces (For Operation Regions) */ typedef -acpi_status (*acpi_adr_space_handler) ( - u32 function, - acpi_physical_address address, - u32 bit_width, - acpi_integer *value, - void *handler_context, - void *region_context); +acpi_status(*acpi_adr_space_handler) (u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, + void *handler_context, + void *region_context); #define ACPI_DEFAULT_HANDLER NULL - typedef -acpi_status (*acpi_adr_space_setup) ( - acpi_handle region_handle, - u32 function, - void *handler_context, - void **region_context); +acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle, + u32 function, + void *handler_context, + void **region_context); #define ACPI_REGION_ACTIVATE 0 #define ACPI_REGION_DEACTIVATE 1 typedef -acpi_status (*acpi_walk_callback) ( - acpi_handle obj_handle, - u32 nesting_level, - void *context, - void **return_value); - +acpi_status(*acpi_walk_callback) (acpi_handle obj_handle, + u32 nesting_level, + void *context, void **return_value); /* Interrupt handler return values */ #define ACPI_INTERRUPT_NOT_HANDLED 0x00 #define ACPI_INTERRUPT_HANDLED 0x01 - /* Common string version of device HIDs and UIDs */ -struct acpi_device_id -{ - char value[ACPI_DEVICE_ID_LENGTH]; +struct acpi_device_id { + char value[ACPI_DEVICE_ID_LENGTH]; }; /* Common string version of device CIDs */ -struct acpi_compatible_id -{ - char value[ACPI_MAX_CID_LENGTH]; +struct acpi_compatible_id { + char value[ACPI_MAX_CID_LENGTH]; }; -struct acpi_compatible_id_list -{ - u32 count; - u32 size; - struct acpi_compatible_id id[1]; +struct acpi_compatible_id_list { + u32 count; + u32 size; + struct acpi_compatible_id id[1]; }; - /* Structure and flags for acpi_get_object_info */ #define ACPI_VALID_STA 0x0001 @@ -923,55 +853,45 @@ struct acpi_compatible_id_list #define ACPI_VALID_CID 0x0010 #define ACPI_VALID_SXDS 0x0020 - #define ACPI_COMMON_OBJ_INFO \ acpi_object_type type; /* ACPI object type */ \ - acpi_name name /* ACPI object Name */ - + acpi_name name /* ACPI object Name */ -struct acpi_obj_info_header -{ +struct acpi_obj_info_header { ACPI_COMMON_OBJ_INFO; }; - /* Structure returned from Get Object Info */ -struct acpi_device_info -{ +struct acpi_device_info { ACPI_COMMON_OBJ_INFO; - u32 valid; /* Indicates which fields below are valid */ - u32 current_status; /* _STA value */ - acpi_integer address; /* _ADR value if any */ - struct acpi_device_id hardware_id; /* _HID value if any */ - struct acpi_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 */ + u32 valid; /* Indicates which fields below are valid */ + u32 current_status; /* _STA value */ + acpi_integer address; /* _ADR value if any */ + struct acpi_device_id hardware_id; /* _HID value if any */ + struct acpi_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 -{ - u16 segment; - u16 bus; - u16 device; - u16 function; +struct acpi_pci_id { + u16 segment; + u16 bus; + u16 device; + u16 function; }; - -struct acpi_mem_space_context -{ - u32 length; - acpi_physical_address address; - acpi_physical_address mapped_physical_address; - u8 *mapped_logical_address; - acpi_size mapped_length; +struct acpi_mem_space_context { + u32 length; + acpi_physical_address address; + acpi_physical_address mapped_physical_address; + u8 *mapped_logical_address; + acpi_size mapped_length; }; - /* * Definitions for Resource Attributes */ @@ -1001,8 +921,8 @@ struct acpi_mem_space_context /* * IO Port Descriptor Decode */ -#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ -#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ +#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ +#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ /* * IRQ Attributes @@ -1054,32 +974,28 @@ struct acpi_mem_space_context #define ACPI_PRODUCER (u8) 0x00 #define ACPI_CONSUMER (u8) 0x01 - /* * Structures used to describe device resources */ -struct acpi_resource_irq -{ - u32 edge_level; - u32 active_high_low; - u32 shared_exclusive; - u32 number_of_interrupts; - u32 interrupts[1]; +struct acpi_resource_irq { + u32 edge_level; + u32 active_high_low; + u32 shared_exclusive; + u32 number_of_interrupts; + u32 interrupts[1]; }; -struct acpi_resource_dma -{ - u32 type; - u32 bus_master; - u32 transfer; - u32 number_of_channels; - u32 channels[1]; +struct acpi_resource_dma { + u32 type; + u32 bus_master; + u32 transfer; + u32 number_of_channels; + u32 channels[1]; }; -struct acpi_resource_start_dpf -{ - u32 compatibility_priority; - u32 performance_robustness; +struct acpi_resource_start_dpf { + u32 compatibility_priority; + u32 performance_robustness; }; /* @@ -1087,150 +1003,133 @@ struct acpi_resource_start_dpf * needed because it has no fields */ -struct acpi_resource_io -{ - u32 io_decode; - u32 min_base_address; - u32 max_base_address; - u32 alignment; - u32 range_length; +struct acpi_resource_io { + u32 io_decode; + u32 min_base_address; + u32 max_base_address; + u32 alignment; + u32 range_length; }; -struct acpi_resource_fixed_io -{ - u32 base_address; - u32 range_length; +struct acpi_resource_fixed_io { + u32 base_address; + u32 range_length; }; -struct acpi_resource_vendor -{ - u32 length; - u8 reserved[1]; +struct acpi_resource_vendor { + u32 length; + u8 reserved[1]; }; -struct acpi_resource_end_tag -{ - u8 checksum; +struct acpi_resource_end_tag { + u8 checksum; }; -struct acpi_resource_mem24 -{ - u32 read_write_attribute; - u32 min_base_address; - u32 max_base_address; - u32 alignment; - u32 range_length; +struct acpi_resource_mem24 { + u32 read_write_attribute; + u32 min_base_address; + u32 max_base_address; + u32 alignment; + u32 range_length; }; -struct acpi_resource_mem32 -{ - u32 read_write_attribute; - u32 min_base_address; - u32 max_base_address; - u32 alignment; - u32 range_length; +struct acpi_resource_mem32 { + u32 read_write_attribute; + u32 min_base_address; + u32 max_base_address; + u32 alignment; + u32 range_length; }; -struct acpi_resource_fixed_mem32 -{ - u32 read_write_attribute; - u32 range_base_address; - u32 range_length; +struct acpi_resource_fixed_mem32 { + u32 read_write_attribute; + u32 range_base_address; + u32 range_length; }; -struct acpi_memory_attribute -{ - u16 cache_attribute; - u16 read_write_attribute; +struct acpi_memory_attribute { + u16 cache_attribute; + u16 read_write_attribute; }; -struct acpi_io_attribute -{ - u16 range_attribute; - u16 translation_attribute; +struct acpi_io_attribute { + u16 range_attribute; + u16 translation_attribute; }; -struct acpi_bus_attribute -{ - u16 reserved1; - u16 reserved2; +struct acpi_bus_attribute { + u16 reserved1; + u16 reserved2; }; -union acpi_resource_attribute -{ - struct acpi_memory_attribute memory; - struct acpi_io_attribute io; - struct acpi_bus_attribute bus; +union acpi_resource_attribute { + struct acpi_memory_attribute memory; + struct acpi_io_attribute io; + struct acpi_bus_attribute bus; }; -struct acpi_resource_source -{ - u32 index; - u32 string_length; - char *string_ptr; +struct acpi_resource_source { + u32 index; + u32 string_length; + char *string_ptr; }; -struct acpi_resource_address16 -{ - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u32 granularity; - u32 min_address_range; - u32 max_address_range; - u32 address_translation_offset; - u32 address_length; - struct acpi_resource_source resource_source; +struct acpi_resource_address16 { + u32 resource_type; + u32 producer_consumer; + u32 decode; + u32 min_address_fixed; + u32 max_address_fixed; + union acpi_resource_attribute attribute; + u32 granularity; + u32 min_address_range; + u32 max_address_range; + u32 address_translation_offset; + u32 address_length; + struct acpi_resource_source resource_source; }; -struct acpi_resource_address32 -{ - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u32 granularity; - u32 min_address_range; - u32 max_address_range; - u32 address_translation_offset; - u32 address_length; - struct acpi_resource_source resource_source; +struct acpi_resource_address32 { + u32 resource_type; + u32 producer_consumer; + u32 decode; + u32 min_address_fixed; + u32 max_address_fixed; + union acpi_resource_attribute attribute; + u32 granularity; + u32 min_address_range; + u32 max_address_range; + u32 address_translation_offset; + u32 address_length; + struct acpi_resource_source resource_source; }; -struct acpi_resource_address64 -{ - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u64 granularity; - u64 min_address_range; - u64 max_address_range; - u64 address_translation_offset; - u64 address_length; - u64 type_specific_attributes; - struct acpi_resource_source resource_source; +struct acpi_resource_address64 { + u32 resource_type; + u32 producer_consumer; + u32 decode; + u32 min_address_fixed; + u32 max_address_fixed; + union acpi_resource_attribute attribute; + u64 granularity; + u64 min_address_range; + u64 max_address_range; + u64 address_translation_offset; + u64 address_length; + u64 type_specific_attributes; + struct acpi_resource_source resource_source; }; -struct acpi_resource_ext_irq -{ - u32 producer_consumer; - u32 edge_level; - u32 active_high_low; - u32 shared_exclusive; - u32 number_of_interrupts; - struct acpi_resource_source resource_source; - u32 interrupts[1]; +struct acpi_resource_ext_irq { + u32 producer_consumer; + u32 edge_level; + u32 active_high_low; + u32 shared_exclusive; + u32 number_of_interrupts; + struct acpi_resource_source resource_source; + u32 interrupts[1]; }; - /* ACPI_RESOURCE_TYPEs */ #define ACPI_RSTYPE_IRQ 0 @@ -1249,35 +1148,33 @@ struct acpi_resource_ext_irq #define ACPI_RSTYPE_ADDRESS64 13 #define ACPI_RSTYPE_EXT_IRQ 14 -typedef u32 acpi_resource_type; - -union acpi_resource_data -{ - struct acpi_resource_irq irq; - struct acpi_resource_dma dma; - struct acpi_resource_start_dpf start_dpf; - struct acpi_resource_io io; - struct acpi_resource_fixed_io fixed_io; - struct acpi_resource_vendor vendor_specific; - struct acpi_resource_end_tag end_tag; - struct acpi_resource_mem24 memory24; - struct acpi_resource_mem32 memory32; - struct acpi_resource_fixed_mem32 fixed_memory32; - struct acpi_resource_address16 address16; - struct acpi_resource_address32 address32; - struct acpi_resource_address64 address64; - struct acpi_resource_ext_irq extended_irq; +typedef u32 acpi_resource_type; + +union acpi_resource_data { + struct acpi_resource_irq irq; + struct acpi_resource_dma dma; + struct acpi_resource_start_dpf start_dpf; + struct acpi_resource_io io; + struct acpi_resource_fixed_io fixed_io; + struct acpi_resource_vendor vendor_specific; + struct acpi_resource_end_tag end_tag; + struct acpi_resource_mem24 memory24; + struct acpi_resource_mem32 memory32; + struct acpi_resource_fixed_mem32 fixed_memory32; + struct acpi_resource_address16 address16; + struct acpi_resource_address32 address32; + struct acpi_resource_address64 address64; + struct acpi_resource_ext_irq extended_irq; }; -struct acpi_resource -{ - acpi_resource_type id; - u32 length; - union acpi_resource_data data; +struct acpi_resource { + acpi_resource_type id; + u32 length; + union acpi_resource_data data; }; #define ACPI_RESOURCE_LENGTH 12 -#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ +#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ #define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) @@ -1293,19 +1190,16 @@ struct acpi_resource * END: of definitions for Resource Attributes */ - -struct acpi_pci_routing_table -{ - u32 length; - u32 pin; - acpi_integer address; /* here for 64-bit alignment */ - u32 source_index; - char source[4]; /* pad to 64 bits so sizeof() works in all cases */ +struct acpi_pci_routing_table { + u32 length; + u32 pin; + acpi_integer address; /* here for 64-bit alignment */ + u32 source_index; + char source[4]; /* pad to 64 bits so sizeof() works in all cases */ }; /* * END: of definitions for PCI Routing tables */ - -#endif /* __ACTYPES_H__ */ +#endif /* __ACTYPES_H__ */ diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 0e7b0a3e3b5..c1086452696 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -44,20 +44,17 @@ #ifndef _ACUTILS_H #define _ACUTILS_H - typedef -acpi_status (*acpi_pkg_callback) ( - u8 object_type, - union acpi_operand_object *source_object, - union acpi_generic_state *state, - void *context); - -struct acpi_pkg_info -{ - u8 *free_space; - acpi_size length; - u32 object_space; - u32 num_packages; +acpi_status(*acpi_pkg_callback) (u8 object_type, + union acpi_operand_object * source_object, + union acpi_generic_state * state, + void *context); + +struct acpi_pkg_info { + u8 *free_space; + acpi_size length; + u32 object_space; + u32 num_packages; }; #define REF_INCREMENT (u16) 0 @@ -71,163 +68,89 @@ struct acpi_pkg_info #define DB_DWORD_DISPLAY 4 #define DB_QWORD_DISPLAY 8 - /* * utglobal - Global data structures and procedures */ -void -acpi_ut_init_globals ( - void); +void acpi_ut_init_globals(void); #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -char * -acpi_ut_get_mutex_name ( - u32 mutex_id); +char *acpi_ut_get_mutex_name(u32 mutex_id); #endif -char * -acpi_ut_get_type_name ( - acpi_object_type type); - -char * -acpi_ut_get_node_name ( - void *object); +char *acpi_ut_get_type_name(acpi_object_type type); -char * -acpi_ut_get_descriptor_name ( - void *object); +char *acpi_ut_get_node_name(void *object); -char * -acpi_ut_get_object_type_name ( - union acpi_operand_object *obj_desc); +char *acpi_ut_get_descriptor_name(void *object); -char * -acpi_ut_get_region_name ( - u8 space_id); +char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); -char * -acpi_ut_get_event_name ( - u32 event_id); +char *acpi_ut_get_region_name(u8 space_id); -char -acpi_ut_hex_to_ascii_char ( - acpi_integer integer, - u32 position); +char *acpi_ut_get_event_name(u32 event_id); -u8 -acpi_ut_valid_object_type ( - acpi_object_type type); +char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position); +u8 acpi_ut_valid_object_type(acpi_object_type type); /* * utinit - miscellaneous initialization and shutdown */ -acpi_status -acpi_ut_hardware_initialize ( - void); - -void -acpi_ut_subsystem_shutdown ( - void); +acpi_status acpi_ut_hardware_initialize(void); -acpi_status -acpi_ut_validate_fadt ( - void); +void acpi_ut_subsystem_shutdown(void); +acpi_status acpi_ut_validate_fadt(void); /* * utclib - Local implementations of C library functions */ #ifndef ACPI_USE_SYSTEM_CLIBRARY -acpi_size -acpi_ut_strlen ( - const char *string); - -char * -acpi_ut_strcpy ( - char *dst_string, - const char *src_string); - -char * -acpi_ut_strncpy ( - char *dst_string, - const char *src_string, - acpi_size count); - -int -acpi_ut_memcmp ( - const char *buffer1, - const char *buffer2, - acpi_size count); - -int -acpi_ut_strncmp ( - const char *string1, - const char *string2, - acpi_size count); - -int -acpi_ut_strcmp ( - const char *string1, - const char *string2); - -char * -acpi_ut_strcat ( - char *dst_string, - const char *src_string); - -char * -acpi_ut_strncat ( - char *dst_string, - const char *src_string, - acpi_size count); - -u32 -acpi_ut_strtoul ( - const char *string, - char **terminator, - u32 base); - -char * -acpi_ut_strstr ( - char *string1, - char *string2); - -void * -acpi_ut_memcpy ( - void *dest, - const void *src, - acpi_size count); - -void * -acpi_ut_memset ( - void *dest, - acpi_native_uint value, - acpi_size count); - -int -acpi_ut_to_upper ( - int c); - -int -acpi_ut_to_lower ( - int c); +acpi_size acpi_ut_strlen(const char *string); + +char *acpi_ut_strcpy(char *dst_string, const char *src_string); + +char *acpi_ut_strncpy(char *dst_string, + const char *src_string, acpi_size count); + +int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count); + +int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count); + +int acpi_ut_strcmp(const char *string1, const char *string2); + +char *acpi_ut_strcat(char *dst_string, const char *src_string); + +char *acpi_ut_strncat(char *dst_string, + const char *src_string, acpi_size count); + +u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base); + +char *acpi_ut_strstr(char *string1, char *string2); + +void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count); + +void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count); + +int acpi_ut_to_upper(int c); + +int acpi_ut_to_lower(int c); extern const u8 _acpi_ctype[]; -#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ -#define _ACPI_XS 0x40 /* extra space */ -#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ -#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ -#define _ACPI_DI 0x04 /* '0'-'9' */ -#define _ACPI_LO 0x02 /* 'a'-'z' */ -#define _ACPI_PU 0x10 /* punctuation */ -#define _ACPI_SP 0x08 /* space */ -#define _ACPI_UP 0x01 /* 'A'-'Z' */ -#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ +#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ +#define _ACPI_XS 0x40 /* extra space */ +#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ +#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ +#define _ACPI_DI 0x04 /* '0'-'9' */ +#define _ACPI_LO 0x02 /* 'a'-'z' */ +#define _ACPI_PU 0x10 /* punctuation */ +#define _ACPI_SP 0x08 /* space */ +#define _ACPI_UP 0x01 /* 'A'-'Z' */ +#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) @@ -238,517 +161,323 @@ extern const u8 _acpi_ctype[]; #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) #define ACPI_IS_ASCII(c) ((c) < 0x80) -#endif /* ACPI_USE_SYSTEM_CLIBRARY */ - +#endif /* ACPI_USE_SYSTEM_CLIBRARY */ /* * utcopy - Object construction and conversion interfaces */ acpi_status -acpi_ut_build_simple_object( - union acpi_operand_object *obj, - union acpi_object *user_obj, - u8 *data_space, - u32 *buffer_space_used); +acpi_ut_build_simple_object(union acpi_operand_object *obj, + union acpi_object *user_obj, + u8 * data_space, u32 * buffer_space_used); acpi_status -acpi_ut_build_package_object ( - union acpi_operand_object *obj, - u8 *buffer, - u32 *space_used); +acpi_ut_build_package_object(union acpi_operand_object *obj, + u8 * buffer, u32 * space_used); acpi_status -acpi_ut_copy_iobject_to_eobject ( - union acpi_operand_object *obj, - struct acpi_buffer *ret_buffer); +acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj, + struct acpi_buffer *ret_buffer); acpi_status -acpi_ut_copy_eobject_to_iobject ( - union acpi_object *obj, - union acpi_operand_object **internal_obj); +acpi_ut_copy_eobject_to_iobject(union acpi_object *obj, + union acpi_operand_object **internal_obj); acpi_status -acpi_ut_copy_isimple_to_isimple ( - union acpi_operand_object *source_obj, - union acpi_operand_object *dest_obj); +acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj, + union acpi_operand_object *dest_obj); acpi_status -acpi_ut_copy_iobject_to_iobject ( - union acpi_operand_object *source_desc, - union acpi_operand_object **dest_desc, - struct acpi_walk_state *walk_state); - +acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, + union acpi_operand_object **dest_desc, + struct acpi_walk_state *walk_state); /* * utcreate - Object creation */ acpi_status -acpi_ut_update_object_reference ( - union acpi_operand_object *object, - u16 action); - +acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action); /* * utdebug - Debug interfaces */ -void -acpi_ut_init_stack_ptr_trace ( - void); +void acpi_ut_init_stack_ptr_trace(void); -void -acpi_ut_track_stack_ptr ( - void); +void acpi_ut_track_stack_ptr(void); void -acpi_ut_trace ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id); +acpi_ut_trace(u32 line_number, + const char *function_name, char *module_name, u32 component_id); void -acpi_ut_trace_ptr ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - void *pointer); +acpi_ut_trace_ptr(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, void *pointer); void -acpi_ut_trace_u32 ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - u32 integer); +acpi_ut_trace_u32(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, u32 integer); void -acpi_ut_trace_str ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - char *string); +acpi_ut_trace_str(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, char *string); void -acpi_ut_exit ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id); +acpi_ut_exit(u32 line_number, + const char *function_name, char *module_name, u32 component_id); void -acpi_ut_status_exit ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - acpi_status status); +acpi_ut_status_exit(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, acpi_status status); void -acpi_ut_value_exit ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - acpi_integer value); +acpi_ut_value_exit(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, acpi_integer value); void -acpi_ut_ptr_exit ( - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - u8 *ptr); +acpi_ut_ptr_exit(u32 line_number, + const char *function_name, + char *module_name, u32 component_id, u8 * ptr); -void -acpi_ut_report_info ( - char *module_name, - u32 line_number, - u32 component_id); +void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); -void -acpi_ut_report_error ( - char *module_name, - u32 line_number, - u32 component_id); +void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); void -acpi_ut_report_warning ( - char *module_name, - u32 line_number, - u32 component_id); +acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id); -void -acpi_ut_dump_buffer ( - u8 *buffer, - u32 count, - u32 display, - u32 component_id); +void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); void ACPI_INTERNAL_VAR_XFACE -acpi_ut_debug_print ( - u32 requested_debug_level, - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - char *format, - ...) ACPI_PRINTF_LIKE_FUNC; +acpi_ut_debug_print(u32 requested_debug_level, + u32 line_number, + const char *function_name, + char *module_name, + u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; void ACPI_INTERNAL_VAR_XFACE -acpi_ut_debug_print_raw ( - u32 requested_debug_level, - u32 line_number, - const char *function_name, - char *module_name, - u32 component_id, - char *format, - ...) ACPI_PRINTF_LIKE_FUNC; - +acpi_ut_debug_print_raw(u32 requested_debug_level, + u32 line_number, + const char *function_name, + char *module_name, + u32 component_id, + char *format, ...) ACPI_PRINTF_LIKE_FUNC; /* * utdelete - Object deletion and reference counts */ -void -acpi_ut_add_reference ( - union acpi_operand_object *object); +void acpi_ut_add_reference(union acpi_operand_object *object); -void -acpi_ut_remove_reference ( - union acpi_operand_object *object); +void acpi_ut_remove_reference(union acpi_operand_object *object); -void -acpi_ut_delete_internal_package_object ( - union acpi_operand_object *object); - -void -acpi_ut_delete_internal_simple_object ( - union acpi_operand_object *object); +void acpi_ut_delete_internal_package_object(union acpi_operand_object *object); -void -acpi_ut_delete_internal_object_list ( - union acpi_operand_object **obj_list); +void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object); +void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list); /* * uteval - object evaluation */ -acpi_status -acpi_ut_osi_implementation ( - struct acpi_walk_state *walk_state); +acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state); acpi_status -acpi_ut_evaluate_object ( - struct acpi_namespace_node *prefix_node, - char *path, - u32 expected_return_btypes, - union acpi_operand_object **return_desc); +acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, + char *path, + u32 expected_return_btypes, + union acpi_operand_object **return_desc); acpi_status -acpi_ut_evaluate_numeric_object ( - char *object_name, - struct acpi_namespace_node *device_node, - acpi_integer *address); +acpi_ut_evaluate_numeric_object(char *object_name, + struct acpi_namespace_node *device_node, + acpi_integer * address); acpi_status -acpi_ut_execute_HID ( - struct acpi_namespace_node *device_node, - struct acpi_device_id *hid); +acpi_ut_execute_HID(struct acpi_namespace_node *device_node, + struct acpi_device_id *hid); acpi_status -acpi_ut_execute_CID ( - struct acpi_namespace_node *device_node, - struct acpi_compatible_id_list **return_cid_list); +acpi_ut_execute_CID(struct acpi_namespace_node *device_node, + struct acpi_compatible_id_list **return_cid_list); acpi_status -acpi_ut_execute_STA ( - struct acpi_namespace_node *device_node, - u32 *status_flags); +acpi_ut_execute_STA(struct acpi_namespace_node *device_node, + u32 * status_flags); acpi_status -acpi_ut_execute_UID ( - struct acpi_namespace_node *device_node, - struct acpi_device_id *uid); +acpi_ut_execute_UID(struct acpi_namespace_node *device_node, + struct acpi_device_id *uid); acpi_status -acpi_ut_execute_sxds ( - struct acpi_namespace_node *device_node, - u8 *highest); - +acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); /* * utobject - internal object create/delete/cache routines */ -union acpi_operand_object * -acpi_ut_create_internal_object_dbg ( - char *module_name, - u32 line_number, - u32 component_id, - acpi_object_type type); - -void * -acpi_ut_allocate_object_desc_dbg ( - char *module_name, - u32 line_number, - u32 component_id); +union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, + u32 line_number, + u32 component_id, + acpi_object_type + type); + +void *acpi_ut_allocate_object_desc_dbg(char *module_name, + u32 line_number, u32 component_id); #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) -void -acpi_ut_delete_object_desc ( - union acpi_operand_object *object); +void acpi_ut_delete_object_desc(union acpi_operand_object *object); -u8 -acpi_ut_valid_internal_object ( - void *object); +u8 acpi_ut_valid_internal_object(void *object); -union acpi_operand_object * -acpi_ut_create_buffer_object ( - acpi_size buffer_size); +union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); -union acpi_operand_object * -acpi_ut_create_string_object ( - acpi_size string_size); +union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); acpi_status -acpi_ut_get_object_size( - union acpi_operand_object *obj, - acpi_size *obj_length); - +acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); /* * utstate - Generic state creation/cache routines */ void -acpi_ut_push_generic_state ( - union acpi_generic_state **list_head, - union acpi_generic_state *state); - -union acpi_generic_state * -acpi_ut_pop_generic_state ( - union acpi_generic_state **list_head); +acpi_ut_push_generic_state(union acpi_generic_state **list_head, + union acpi_generic_state *state); +union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state + **list_head); -union acpi_generic_state * -acpi_ut_create_generic_state ( - void); +union acpi_generic_state *acpi_ut_create_generic_state(void); -struct acpi_thread_state * -acpi_ut_create_thread_state ( - void); +struct acpi_thread_state *acpi_ut_create_thread_state(void); -union acpi_generic_state * -acpi_ut_create_update_state ( - union acpi_operand_object *object, - u16 action); +union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object + *object, u16 action); -union acpi_generic_state * -acpi_ut_create_pkg_state ( - void *internal_object, - void *external_object, - u16 index); +union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, + void *external_object, + u16 index); acpi_status -acpi_ut_create_update_state_and_push ( - union acpi_operand_object *object, - u16 action, - union acpi_generic_state **state_list); +acpi_ut_create_update_state_and_push(union acpi_operand_object *object, + u16 action, + union acpi_generic_state **state_list); #ifdef ACPI_FUTURE_USAGE acpi_status -acpi_ut_create_pkg_state_and_push ( - void *internal_object, - void *external_object, - u16 index, - union acpi_generic_state **state_list); -#endif /* ACPI_FUTURE_USAGE */ +acpi_ut_create_pkg_state_and_push(void *internal_object, + void *external_object, + u16 index, + union acpi_generic_state **state_list); +#endif /* ACPI_FUTURE_USAGE */ -union acpi_generic_state * -acpi_ut_create_control_state ( - void); - -void -acpi_ut_delete_generic_state ( - union acpi_generic_state *state); +union acpi_generic_state *acpi_ut_create_control_state(void); +void acpi_ut_delete_generic_state(union acpi_generic_state *state); /* * utmath */ acpi_status -acpi_ut_divide ( - acpi_integer in_dividend, - acpi_integer in_divisor, - acpi_integer *out_quotient, - acpi_integer *out_remainder); +acpi_ut_divide(acpi_integer in_dividend, + acpi_integer in_divisor, + acpi_integer * out_quotient, acpi_integer * out_remainder); acpi_status -acpi_ut_short_divide ( - acpi_integer in_dividend, - u32 divisor, - acpi_integer *out_quotient, - u32 *out_remainder); +acpi_ut_short_divide(acpi_integer in_dividend, + u32 divisor, + acpi_integer * out_quotient, u32 * out_remainder); /* * utmisc */ -acpi_status -acpi_ut_allocate_owner_id ( - acpi_owner_id *owner_id); +acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); -void -acpi_ut_release_owner_id ( - acpi_owner_id *owner_id); +void acpi_ut_release_owner_id(acpi_owner_id * owner_id); acpi_status -acpi_ut_walk_package_tree ( - union acpi_operand_object *source_object, - void *target_object, - acpi_pkg_callback walk_callback, - void *context); +acpi_ut_walk_package_tree(union acpi_operand_object *source_object, + void *target_object, + acpi_pkg_callback walk_callback, void *context); -void -acpi_ut_strupr ( - char *src_string); +void acpi_ut_strupr(char *src_string); -void -acpi_ut_print_string ( - char *string, - u8 max_length); +void acpi_ut_print_string(char *string, u8 max_length); -u8 -acpi_ut_valid_acpi_name ( - u32 name); +u8 acpi_ut_valid_acpi_name(u32 name); -u8 -acpi_ut_valid_acpi_character ( - char character); +u8 acpi_ut_valid_acpi_character(char character); acpi_status -acpi_ut_strtoul64 ( - char *string, - u32 base, - acpi_integer *ret_integer); +acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); /* Values for Base above (16=Hex, 10=Decimal) */ #define ACPI_ANY_BASE 0 -u8 * -acpi_ut_get_resource_end_tag ( - union acpi_operand_object *obj_desc); +u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); -u8 -acpi_ut_generate_checksum ( - u8 *buffer, - u32 length); +u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); -u32 -acpi_ut_dword_byte_swap ( - u32 value); +u32 acpi_ut_dword_byte_swap(u32 value); -void -acpi_ut_set_integer_width ( - u8 revision); +void acpi_ut_set_integer_width(u8 revision); #ifdef ACPI_DEBUG_OUTPUT void -acpi_ut_display_init_pathname ( - u8 type, - struct acpi_namespace_node *obj_handle, - char *path); +acpi_ut_display_init_pathname(u8 type, + struct acpi_namespace_node *obj_handle, + char *path); #endif - /* * utmutex - mutex support */ -acpi_status -acpi_ut_mutex_initialize ( - void); - -void -acpi_ut_mutex_terminate ( - void); +acpi_status acpi_ut_mutex_initialize(void); -acpi_status -acpi_ut_acquire_mutex ( - acpi_mutex_handle mutex_id); +void acpi_ut_mutex_terminate(void); -acpi_status -acpi_ut_release_mutex ( - acpi_mutex_handle mutex_id); +acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id); +acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id); /* * utalloc - memory allocation and object caching */ -acpi_status -acpi_ut_create_caches ( - void); +acpi_status acpi_ut_create_caches(void); -acpi_status -acpi_ut_delete_caches ( - void); +acpi_status acpi_ut_delete_caches(void); -acpi_status -acpi_ut_validate_buffer ( - struct acpi_buffer *buffer); +acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer); acpi_status -acpi_ut_initialize_buffer ( - struct acpi_buffer *buffer, - acpi_size required_length); - -void * -acpi_ut_allocate ( - acpi_size size, - u32 component, - char *module, - u32 line); - -void * -acpi_ut_callocate ( - acpi_size size, - u32 component, - char *module, - u32 line); +acpi_ut_initialize_buffer(struct acpi_buffer *buffer, + acpi_size required_length); + +void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); + +void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); #ifdef ACPI_DBG_TRACK_ALLOCATIONS -void * -acpi_ut_allocate_and_track ( - acpi_size size, - u32 component, - char *module, - u32 line); - -void * -acpi_ut_callocate_and_track ( - acpi_size size, - u32 component, - char *module, - u32 line); +void *acpi_ut_allocate_and_track(acpi_size size, + u32 component, char *module, u32 line); + +void *acpi_ut_callocate_and_track(acpi_size size, + u32 component, char *module, u32 line); void -acpi_ut_free_and_track ( - void *address, - u32 component, - char *module, - u32 line); +acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); #ifdef ACPI_FUTURE_USAGE -void -acpi_ut_dump_allocation_info ( - void); -#endif /* ACPI_FUTURE_USAGE */ +void acpi_ut_dump_allocation_info(void); +#endif /* ACPI_FUTURE_USAGE */ -void -acpi_ut_dump_allocations ( - u32 component, - char *module); +void acpi_ut_dump_allocations(u32 component, char *module); #endif -#endif /* _ACUTILS_H */ +#endif /* _ACUTILS_H */ diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 50a08890119..7fdf5299f50 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h @@ -59,11 +59,11 @@ #define AML_WORD_OP (u16) 0x0b #define AML_DWORD_OP (u16) 0x0c #define AML_STRING_OP (u16) 0x0d -#define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */ +#define AML_QWORD_OP (u16) 0x0e /* ACPI 2.0 */ #define AML_SCOPE_OP (u16) 0x10 #define AML_BUFFER_OP (u16) 0x11 #define AML_PACKAGE_OP (u16) 0x12 -#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ +#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ #define AML_METHOD_OP (u16) 0x14 #define AML_DUAL_NAME_PREFIX (u16) 0x2e #define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f @@ -109,8 +109,8 @@ #define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81 #define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82 #define AML_DEREF_OF_OP (u16) 0x83 -#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ -#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ +#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ +#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ #define AML_NOTIFY_OP (u16) 0x86 #define AML_SIZE_OF_OP (u16) 0x87 #define AML_INDEX_OP (u16) 0x88 @@ -120,21 +120,21 @@ #define AML_CREATE_BYTE_FIELD_OP (u16) 0x8c #define AML_CREATE_BIT_FIELD_OP (u16) 0x8d #define AML_TYPE_OP (u16) 0x8e -#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ +#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ #define AML_LAND_OP (u16) 0x90 #define AML_LOR_OP (u16) 0x91 #define AML_LNOT_OP (u16) 0x92 #define AML_LEQUAL_OP (u16) 0x93 #define AML_LGREATER_OP (u16) 0x94 #define AML_LLESS_OP (u16) 0x95 -#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ -#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ -#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ -#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ -#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ -#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ -#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ -#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ +#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ +#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ +#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ +#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ +#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ +#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ +#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ +#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ #define AML_IF_OP (u16) 0xa0 #define AML_ELSE_OP (u16) 0xa1 #define AML_WHILE_OP (u16) 0xa2 @@ -146,7 +146,7 @@ /* prefixed opcodes */ -#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ +#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ #define AML_MUTEX_OP (u16) 0x5b01 #define AML_EVENT_OP (u16) 0x5b02 @@ -154,7 +154,7 @@ #define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 #define AML_COND_REF_OF_OP (u16) 0x5b12 #define AML_CREATE_FIELD_OP (u16) 0x5b13 -#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ +#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ #define AML_LOAD_OP (u16) 0x5b20 #define AML_STALL_OP (u16) 0x5b21 #define AML_SLEEP_OP (u16) 0x5b22 @@ -169,7 +169,7 @@ #define AML_REVISION_OP (u16) 0x5b30 #define AML_DEBUG_OP (u16) 0x5b31 #define AML_FATAL_OP (u16) 0x5b32 -#define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */ +#define AML_TIMER_OP (u16) 0x5b33 /* ACPI 3.0 */ #define AML_REGION_OP (u16) 0x5b80 #define AML_FIELD_OP (u16) 0x5b81 #define AML_DEVICE_OP (u16) 0x5b82 @@ -178,8 +178,7 @@ #define AML_THERMAL_ZONE_OP (u16) 0x5b85 #define AML_INDEX_FIELD_OP (u16) 0x5b86 #define AML_BANK_FIELD_OP (u16) 0x5b87 -#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ - +#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ /* Bogus opcodes (they are actually two separate opcodes) */ @@ -187,7 +186,6 @@ #define AML_LLESSEQUAL_OP (u16) 0x9294 #define AML_LNOTEQUAL_OP (u16) 0x9293 - /* * Internal opcodes * Use only "Unknown" AML opcodes, don't attempt to use @@ -203,7 +201,6 @@ #define AML_INT_RETURN_VALUE_OP (u16) 0x0036 #define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037 - #define ARG_NONE 0x0 /* @@ -245,7 +242,7 @@ /* Single, simple types */ -#define ARGI_ANYTYPE 0x01 /* Don't care */ +#define ARGI_ANYTYPE 0x01 /* Don't care */ #define ARGI_PACKAGE 0x02 #define ARGI_EVENT 0x03 #define ARGI_MUTEX 0x04 @@ -256,8 +253,8 @@ #define ARGI_INTEGER 0x06 #define ARGI_STRING 0x07 #define ARGI_BUFFER 0x08 -#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */ -#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */ +#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */ +#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */ /* Reference objects */ @@ -265,30 +262,28 @@ #define ARGI_OBJECT_REF 0x0C #define ARGI_DEVICE_REF 0x0D #define ARGI_REFERENCE 0x0E -#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ -#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ -#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ +#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */ +#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */ +#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */ /* Multiple/complex types */ -#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator*/ -#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ -#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ -#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ +#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ +#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ +#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ +#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ #define ARGI_DATAREFOBJ 0x16 /* Note: types above can expand to 0x1F maximum */ #define ARGI_INVALID_OPCODE 0xFFFFFFFF - /* * hash offsets */ #define AML_EXTOP_HASH_OFFSET 22 #define AML_LNOT_HASH_OFFSET 19 - /* * opcode groups and types */ @@ -296,7 +291,6 @@ #define OPGRP_FIELD 0x02 #define OPGRP_BYTELIST 0x04 - /* * Opcode information */ @@ -322,31 +316,30 @@ /* Convenient flag groupings */ #define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL -#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ -#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ +#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ +#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */ #define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET -#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */ -#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ -#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ -#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */ +#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* monadic2_r */ +#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */ +#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */ +#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* dyadic2_r */ #define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL #define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS #define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL #define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL - /* * The opcode Type is used in a dispatch table, do not change * without updating the table. */ #define AML_TYPE_EXEC_0A_0T_1R 0x00 -#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ -#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ +#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ +#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* Monadic2 */ #define AML_TYPE_EXEC_1A_1T_0R 0x03 -#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ -#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ -#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ -#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ +#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* monadic2_r */ +#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* Dyadic1 */ +#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* Dyadic2 */ +#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* dyadic2_r */ #define AML_TYPE_EXEC_2A_2T_1R 0x08 #define AML_TYPE_EXEC_3A_0T_0R 0x09 #define AML_TYPE_EXEC_3A_1T_1R 0x0A @@ -399,40 +392,33 @@ #define AML_CLASS_METHOD_CALL 0x09 #define AML_CLASS_UNKNOWN 0x0A - /* Predefined Operation Region space_iDs */ -typedef enum -{ - REGION_MEMORY = 0, +typedef enum { + REGION_MEMORY = 0, REGION_IO, REGION_PCI_CONFIG, REGION_EC, REGION_SMBUS, REGION_CMOS, REGION_PCI_BAR, - REGION_DATA_TABLE, /* Internal use only */ - REGION_FIXED_HW = 0x7F - + REGION_DATA_TABLE, /* Internal use only */ + REGION_FIXED_HW = 0x7F } AML_REGION_TYPES; - /* Comparison operation codes for match_op operator */ -typedef enum -{ - MATCH_MTR = 0, - MATCH_MEQ = 1, - MATCH_MLE = 2, - MATCH_MLT = 3, - MATCH_MGE = 4, - MATCH_MGT = 5 - +typedef enum { + MATCH_MTR = 0, + MATCH_MEQ = 1, + MATCH_MLE = 2, + MATCH_MLT = 3, + MATCH_MGE = 4, + MATCH_MGT = 5 } AML_MATCH_OPERATOR; #define MAX_MATCH_OPERATOR 5 - /* * field_flags * @@ -450,60 +436,47 @@ typedef enum #define AML_FIELD_LOCK_RULE_MASK 0x10 #define AML_FIELD_UPDATE_RULE_MASK 0x60 - /* 1) Field Access Types */ -typedef enum -{ - AML_FIELD_ACCESS_ANY = 0x00, - AML_FIELD_ACCESS_BYTE = 0x01, - AML_FIELD_ACCESS_WORD = 0x02, - AML_FIELD_ACCESS_DWORD = 0x03, - AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ - AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */ - +typedef enum { + AML_FIELD_ACCESS_ANY = 0x00, + AML_FIELD_ACCESS_BYTE = 0x01, + AML_FIELD_ACCESS_WORD = 0x02, + AML_FIELD_ACCESS_DWORD = 0x03, + AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */ + AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */ } AML_ACCESS_TYPE; - /* 2) Field Lock Rules */ -typedef enum -{ - AML_FIELD_LOCK_NEVER = 0x00, - AML_FIELD_LOCK_ALWAYS = 0x10 - +typedef enum { + AML_FIELD_LOCK_NEVER = 0x00, + AML_FIELD_LOCK_ALWAYS = 0x10 } AML_LOCK_RULE; - /* 3) Field Update Rules */ -typedef enum -{ - AML_FIELD_UPDATE_PRESERVE = 0x00, - AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20, +typedef enum { + AML_FIELD_UPDATE_PRESERVE = 0x00, + AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20, AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40 - } AML_UPDATE_RULE; - /* * Field Access Attributes. * This byte is extracted from the AML via the * access_as keyword */ -typedef enum -{ - AML_FIELD_ATTRIB_SMB_QUICK = 0x02, - AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, - AML_FIELD_ATTRIB_SMB_BYTE = 0x06, - AML_FIELD_ATTRIB_SMB_WORD = 0x08, - AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, - AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, +typedef enum { + AML_FIELD_ATTRIB_SMB_QUICK = 0x02, + AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, + AML_FIELD_ATTRIB_SMB_BYTE = 0x06, + AML_FIELD_ATTRIB_SMB_WORD = 0x08, + AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, + AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D - } AML_ACCESS_ATTRIBUTE; - /* Bit fields in method_flags byte */ #define AML_METHOD_ARG_COUNT 0x07 @@ -516,5 +489,4 @@ typedef enum #define AML_METHOD_RESERVED1 0x02 #define AML_METHOD_RESERVED2 0x04 - -#endif /* __AMLCODE_H__ */ +#endif /* __AMLCODE_H__ */ diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index b20ec303df0..051786e4b21 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -42,29 +42,27 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #ifndef __AMLRESRC_H #define __AMLRESRC_H - #define ASL_RESNAME_ADDRESS "_ADR" #define ASL_RESNAME_ALIGNMENT "_ALN" #define ASL_RESNAME_ADDRESSSPACE "_ASI" #define ASL_RESNAME_ACCESSSIZE "_ASZ" #define ASL_RESNAME_TYPESPECIFICATTRIBUTES "_ATT" #define ASL_RESNAME_BASEADDRESS "_BAS" -#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ +#define ASL_RESNAME_BUSMASTER "_BM_" /* Master(1), Slave(0) */ #define ASL_RESNAME_DECODE "_DEC" #define ASL_RESNAME_DMA "_DMA" -#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ +#define ASL_RESNAME_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ #define ASL_RESNAME_GRANULARITY "_GRA" #define ASL_RESNAME_INTERRUPT "_INT" -#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ -#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ -#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ +#define ASL_RESNAME_INTERRUPTLEVEL "_LL_" /* active_lo(1), active_hi(0) */ +#define ASL_RESNAME_INTERRUPTSHARE "_SHR" /* Shareable(1), no_share(0) */ +#define ASL_RESNAME_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ #define ASL_RESNAME_LENGTH "_LEN" -#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ -#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ +#define ASL_RESNAME_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ +#define ASL_RESNAME_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ #define ASL_RESNAME_MAXADDR "_MAX" #define ASL_RESNAME_MINADDR "_MIN" #define ASL_RESNAME_MAXTYPE "_MAF" @@ -72,12 +70,11 @@ #define ASL_RESNAME_REGISTERBITOFFSET "_RBO" #define ASL_RESNAME_REGISTERBITWIDTH "_RBW" #define ASL_RESNAME_RANGETYPE "_RNG" -#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ +#define ASL_RESNAME_READWRITETYPE "_RW_" /* read_only(0), Writeable (1) */ #define ASL_RESNAME_TRANSLATION "_TRA" -#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ -#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ -#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ - +#define ASL_RESNAME_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ +#define ASL_RESNAME_TYPE "_TTP" /* Translation(1), Static (0) */ +#define ASL_RESNAME_XFERTYPE "_SIz" /* 8(0), 8_and16(1), 16(2) */ /* Default sizes for "small" resource descriptors */ @@ -89,15 +86,12 @@ #define ASL_RDESC_FIXED_IO_SIZE 0x03 #define ASL_RDESC_END_TAG_SIZE 0x01 - -struct asl_resource_node -{ - u32 buffer_length; - void *buffer; - struct asl_resource_node *next; +struct asl_resource_node { + u32 buffer_length; + void *buffer; + struct asl_resource_node *next; }; - /* * Resource descriptors defined in the ACPI specification. * @@ -106,214 +100,175 @@ struct asl_resource_node */ #pragma pack(1) -struct asl_irq_format_desc -{ - u8 descriptor_type; - u16 irq_mask; - u8 flags; +struct asl_irq_format_desc { + u8 descriptor_type; + u16 irq_mask; + u8 flags; }; - -struct asl_irq_noflags_desc -{ - u8 descriptor_type; - u16 irq_mask; +struct asl_irq_noflags_desc { + u8 descriptor_type; + u16 irq_mask; }; - -struct asl_dma_format_desc -{ - u8 descriptor_type; - u8 dma_channel_mask; - u8 flags; +struct asl_dma_format_desc { + u8 descriptor_type; + u8 dma_channel_mask; + u8 flags; }; - -struct asl_start_dependent_desc -{ - u8 descriptor_type; - u8 flags; +struct asl_start_dependent_desc { + u8 descriptor_type; + u8 flags; }; - -struct asl_start_dependent_noprio_desc -{ - u8 descriptor_type; +struct asl_start_dependent_noprio_desc { + u8 descriptor_type; }; - -struct asl_end_dependent_desc -{ - u8 descriptor_type; +struct asl_end_dependent_desc { + u8 descriptor_type; }; - -struct asl_io_port_desc -{ - u8 descriptor_type; - u8 information; - u16 address_min; - u16 address_max; - u8 alignment; - u8 length; +struct asl_io_port_desc { + u8 descriptor_type; + u8 information; + u16 address_min; + u16 address_max; + u8 alignment; + u8 length; }; - -struct asl_fixed_io_port_desc -{ - u8 descriptor_type; - u16 base_address; - u8 length; +struct asl_fixed_io_port_desc { + u8 descriptor_type; + u16 base_address; + u8 length; }; - -struct asl_small_vendor_desc -{ - u8 descriptor_type; - u8 vendor_defined[7]; +struct asl_small_vendor_desc { + u8 descriptor_type; + u8 vendor_defined[7]; }; - -struct asl_end_tag_desc -{ - u8 descriptor_type; - u8 checksum; +struct asl_end_tag_desc { + u8 descriptor_type; + u8 checksum; }; - /* LARGE descriptors */ -struct asl_memory_24_desc -{ - u8 descriptor_type; - u16 length; - u8 information; - u16 address_min; - u16 address_max; - u16 alignment; - u16 range_length; +struct asl_memory_24_desc { + u8 descriptor_type; + u16 length; + u8 information; + u16 address_min; + u16 address_max; + u16 alignment; + u16 range_length; }; - -struct asl_large_vendor_desc -{ - u8 descriptor_type; - u16 length; - u8 vendor_defined[1]; +struct asl_large_vendor_desc { + u8 descriptor_type; + u16 length; + u8 vendor_defined[1]; }; - -struct asl_memory_32_desc -{ - u8 descriptor_type; - u16 length; - u8 information; - u32 address_min; - u32 address_max; - u32 alignment; - u32 range_length; +struct asl_memory_32_desc { + u8 descriptor_type; + u16 length; + u8 information; + u32 address_min; + u32 address_max; + u32 alignment; + u32 range_length; }; - -struct asl_fixed_memory_32_desc -{ - u8 descriptor_type; - u16 length; - u8 information; - u32 base_address; - u32 range_length; +struct asl_fixed_memory_32_desc { + u8 descriptor_type; + u16 length; + u8 information; + u32 base_address; + u32 range_length; }; - -struct asl_extended_address_desc -{ - u8 descriptor_type; - u16 length; - u8 resource_type; - u8 flags; - u8 specific_flags; - u8 revision_iD; - u8 reserved; - u64 granularity; - u64 address_min; - u64 address_max; - u64 translation_offset; - u64 address_length; - u64 type_specific_attributes; - u8 optional_fields[2]; /* Used for length calculation only */ +struct asl_extended_address_desc { + u8 descriptor_type; + u16 length; + u8 resource_type; + u8 flags; + u8 specific_flags; + u8 revision_iD; + u8 reserved; + u64 granularity; + u64 address_min; + u64 address_max; + u64 translation_offset; + u64 address_length; + u64 type_specific_attributes; + u8 optional_fields[2]; /* Used for length calculation only */ }; -#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ - - -struct asl_qword_address_desc -{ - u8 descriptor_type; - u16 length; - u8 resource_type; - u8 flags; - u8 specific_flags; - u64 granularity; - u64 address_min; - u64 address_max; - u64 translation_offset; - u64 address_length; - u8 optional_fields[2]; +#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ + +struct asl_qword_address_desc { + u8 descriptor_type; + u16 length; + u8 resource_type; + u8 flags; + u8 specific_flags; + u64 granularity; + u64 address_min; + u64 address_max; + u64 translation_offset; + u64 address_length; + u8 optional_fields[2]; }; - -struct asl_dword_address_desc -{ - u8 descriptor_type; - u16 length; - u8 resource_type; - u8 flags; - u8 specific_flags; - u32 granularity; - u32 address_min; - u32 address_max; - u32 translation_offset; - u32 address_length; - u8 optional_fields[2]; +struct asl_dword_address_desc { + u8 descriptor_type; + u16 length; + u8 resource_type; + u8 flags; + u8 specific_flags; + u32 granularity; + u32 address_min; + u32 address_max; + u32 translation_offset; + u32 address_length; + u8 optional_fields[2]; }; - -struct asl_word_address_desc -{ - u8 descriptor_type; - u16 length; - u8 resource_type; - u8 flags; - u8 specific_flags; - u16 granularity; - u16 address_min; - u16 address_max; - u16 translation_offset; - u16 address_length; - u8 optional_fields[2]; +struct asl_word_address_desc { + u8 descriptor_type; + u16 length; + u8 resource_type; + u8 flags; + u8 specific_flags; + u16 granularity; + u16 address_min; + u16 address_max; + u16 translation_offset; + u16 address_length; + u8 optional_fields[2]; }; - -struct asl_extended_xrupt_desc -{ - u8 descriptor_type; - u16 length; - u8 flags; - u8 table_length; - u32 interrupt_number[1]; +struct asl_extended_xrupt_desc { + u8 descriptor_type; + u16 length; + u8 flags; + u8 table_length; + u32 interrupt_number[1]; /* res_source_index, res_source optional fields follow */ }; - -struct asl_general_register_desc -{ - u8 descriptor_type; - u16 length; - u8 address_space_id; - u8 bit_width; - u8 bit_offset; - u8 access_size; /* ACPI 3.0, was Reserved */ - u64 address; +struct asl_general_register_desc { + u8 descriptor_type; + u16 length; + u8 address_space_id; + u8 bit_width; + u8 bit_offset; + u8 access_size; /* ACPI 3.0, was Reserved */ + u64 address; }; /* restore default alignment */ @@ -322,32 +277,29 @@ struct asl_general_register_desc /* Union of all resource descriptors, so we can allocate the worst case */ -union asl_resource_desc -{ - struct asl_irq_format_desc irq; - struct asl_dma_format_desc dma; - struct asl_start_dependent_desc std; - struct asl_end_dependent_desc end; - struct asl_io_port_desc iop; - struct asl_fixed_io_port_desc fio; - struct asl_small_vendor_desc smv; - struct asl_end_tag_desc et; - - struct asl_memory_24_desc M24; - struct asl_large_vendor_desc lgv; - struct asl_memory_32_desc M32; - struct asl_fixed_memory_32_desc F32; - struct asl_qword_address_desc qas; - struct asl_dword_address_desc das; - struct asl_word_address_desc was; - struct asl_extended_address_desc eas; - struct asl_extended_xrupt_desc exx; - struct asl_general_register_desc grg; - u32 u32_item; - u16 u16_item; - u8 U8item; +union asl_resource_desc { + struct asl_irq_format_desc irq; + struct asl_dma_format_desc dma; + struct asl_start_dependent_desc std; + struct asl_end_dependent_desc end; + struct asl_io_port_desc iop; + struct asl_fixed_io_port_desc fio; + struct asl_small_vendor_desc smv; + struct asl_end_tag_desc et; + + struct asl_memory_24_desc M24; + struct asl_large_vendor_desc lgv; + struct asl_memory_32_desc M32; + struct asl_fixed_memory_32_desc F32; + struct asl_qword_address_desc qas; + struct asl_dword_address_desc das; + struct asl_word_address_desc was; + struct asl_extended_address_desc eas; + struct asl_extended_xrupt_desc exx; + struct asl_general_register_desc grg; + u32 u32_item; + u16 u16_item; + u8 U8item; }; - #endif - diff --git a/include/acpi/container.h b/include/acpi/container.h index d716df04d9d..a703f14e049 100644 --- a/include/acpi/container.h +++ b/include/acpi/container.h @@ -9,5 +9,4 @@ struct acpi_container { int state; }; -#endif /* __ACPI_CONTAINER_H */ - +#endif /* __ACPI_CONTAINER_H */ diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h index fd6730e4e56..91f4a12a99a 100644 --- a/include/acpi/pdc_intel.h +++ b/include/acpi/pdc_intel.h @@ -14,7 +14,6 @@ #define ACPI_PDC_SMP_T_SWCOORD (0x0080) #define ACPI_PDC_C_C1_FFH (0x0100) - #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ ACPI_PDC_C_C1_HALT) @@ -25,5 +24,4 @@ ACPI_PDC_SMP_C1PT | \ ACPI_PDC_C_C1_HALT) -#endif /* __PDC_INTEL_H__ */ - +#endif /* __PDC_INTEL_H__ */ diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index bae1fbed097..16609c1ab2e 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -44,7 +44,6 @@ #ifndef __ACENV_H__ #define __ACENV_H__ - /* * Configuration for ACPI tools and utilities */ @@ -134,7 +133,7 @@ #elif defined(WIN64) #include "acwin64.h" -#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ +#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ #include "acdos16.h" #elif defined(__FreeBSD__) @@ -180,7 +179,6 @@ /*! [End] no source code translation !*/ - /* * Debugger threading model * Use single threaded if the entire subsystem is contained in an application @@ -199,8 +197,7 @@ #else #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED #endif -#endif /* !DEBUGGER_THREADING */ - +#endif /* !DEBUGGER_THREADING */ /****************************************************************************** * @@ -222,7 +219,7 @@ #include #include -#endif /* ACPI_USE_STANDARD_HEADERS */ +#endif /* ACPI_USE_STANDARD_HEADERS */ /* * We will be linking to the standard Clib functions @@ -260,18 +257,18 @@ *****************************************************************************/ /* - * Use local definitions of C library macros and functions - * NOTE: The function implementations may not be as efficient - * as an inline or assembly code implementation provided by a - * native C library. - */ + * Use local definitions of C library macros and functions + * NOTE: The function implementations may not be as efficient + * as an inline or assembly code implementation provided by a + * native C library. + */ #ifndef va_arg #ifndef _VALIST #define _VALIST typedef char *va_list; -#endif /* _VALIST */ +#endif /* _VALIST */ /* * Storage alignment properties @@ -287,8 +284,7 @@ typedef char *va_list; #define va_end(ap) (void) 0 #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) -#endif /* va_arg */ - +#endif /* va_arg */ #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) @@ -306,8 +302,7 @@ typedef char *va_list; #define ACPI_TOUPPER acpi_ut_to_upper #define ACPI_TOLOWER acpi_ut_to_lower -#endif /* ACPI_USE_SYSTEM_CLIBRARY */ - +#endif /* ACPI_USE_SYSTEM_CLIBRARY */ /****************************************************************************** * @@ -348,8 +343,7 @@ typedef char *va_list; #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) -#endif /* ACPI_ASM_MACROS */ - +#endif /* ACPI_ASM_MACROS */ #ifdef ACPI_APPLICATION @@ -359,11 +353,10 @@ typedef char *va_list; #define BREAKPOINT3 #endif - /****************************************************************************** * * Compiler-specific information is contained in the compiler-specific * headers. * *****************************************************************************/ -#endif /* __ACENV_H__ */ +#endif /* __ACENV_H__ */ diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 39264127574..4c0e0ba09ba 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -60,4 +60,4 @@ */ #define ACPI_UNUSED_VAR __attribute__ ((unused)) -#endif /* __ACGCC_H__ */ +#endif /* __ACGCC_H__ */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 4fbc0fd52a2..c93e6562f0e 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -71,9 +71,7 @@ #define acpi_cache_t kmem_cache_t #endif - - -#else /* !__KERNEL__ */ +#else /* !__KERNEL__ */ #include #include @@ -94,10 +92,10 @@ #define __cdecl #define ACPI_FLUSH_CPU_CACHE() -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ */ /* Linux uses GCC */ #include "acgcc.h" -#endif /* __ACLINUX_H__ */ +#endif /* __ACLINUX_H__ */ diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 50cfea4ff6c..7a00d5089de 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -23,45 +23,44 @@ struct acpi_processor_cx; struct acpi_power_register { - u8 descriptor; - u16 length; - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 reserved; - u64 address; + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 reserved; + u64 address; } __attribute__ ((packed)); - struct acpi_processor_cx_policy { - u32 count; + u32 count; struct acpi_processor_cx *state; struct { - u32 time; - u32 ticks; - u32 count; - u32 bm; - } threshold; + u32 time; + u32 ticks; + u32 count; + u32 bm; + } threshold; }; struct acpi_processor_cx { - u8 valid; - u8 type; - u32 address; - u32 latency; - u32 latency_ticks; - u32 power; - u32 usage; + u8 valid; + u8 type; + u32 address; + u32 latency; + u32 latency_ticks; + u32 power; + u32 usage; struct acpi_processor_cx_policy promotion; struct acpi_processor_cx_policy demotion; }; struct acpi_processor_power { struct acpi_processor_cx *state; - unsigned long bm_check_timestamp; - u32 default_state; - u32 bm_activity; - int count; + unsigned long bm_check_timestamp; + u32 default_state; + u32 bm_activity; + int count; struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; /* the _PDC objects passed by the driver, if any */ @@ -71,85 +70,82 @@ struct acpi_processor_power { /* Performance Management */ struct acpi_pct_register { - u8 descriptor; - u16 length; - u8 space_id; - u8 bit_width; - u8 bit_offset; - u8 reserved; - u64 address; + u8 descriptor; + u16 length; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 reserved; + u64 address; } __attribute__ ((packed)); struct acpi_processor_px { - acpi_integer core_frequency; /* megahertz */ - acpi_integer power; /* milliWatts */ - acpi_integer transition_latency; /* microseconds */ - acpi_integer bus_master_latency; /* microseconds */ - acpi_integer control; /* control value */ - acpi_integer status; /* success indicator */ + acpi_integer core_frequency; /* megahertz */ + acpi_integer power; /* milliWatts */ + acpi_integer transition_latency; /* microseconds */ + acpi_integer bus_master_latency; /* microseconds */ + acpi_integer control; /* control value */ + acpi_integer status; /* success indicator */ }; struct acpi_processor_performance { - unsigned int state; - unsigned int platform_limit; + unsigned int state; + unsigned int platform_limit; struct acpi_pct_register control_register; struct acpi_pct_register status_register; - unsigned int state_count; + unsigned int state_count; struct acpi_processor_px *states; /* the _PDC objects passed by the driver, if any */ struct acpi_object_list *pdc; }; - - /* Throttling Control */ struct acpi_processor_tx { - u16 power; - u16 performance; + u16 power; + u16 performance; }; struct acpi_processor_throttling { - int state; - u32 address; - u8 duty_offset; - u8 duty_width; - int state_count; + int state; + u32 address; + u8 duty_offset; + u8 duty_width; + int state_count; struct acpi_processor_tx states[ACPI_PROCESSOR_MAX_THROTTLING]; }; /* Limit Interface */ struct acpi_processor_lx { - int px; /* performace state */ - int tx; /* throttle level */ + int px; /* performace state */ + int tx; /* throttle level */ }; struct acpi_processor_limit { - struct acpi_processor_lx state; /* current limit */ + struct acpi_processor_lx state; /* current limit */ struct acpi_processor_lx thermal; /* thermal limit */ - struct acpi_processor_lx user; /* user limit */ + struct acpi_processor_lx user; /* user limit */ }; - struct acpi_processor_flags { - u8 power:1; - u8 performance:1; - u8 throttling:1; - u8 limit:1; - u8 bm_control:1; - u8 bm_check:1; - u8 has_cst:1; - u8 power_setup_done:1; + u8 power:1; + u8 performance:1; + u8 throttling:1; + u8 limit:1; + u8 bm_control:1; + u8 bm_check:1; + u8 has_cst:1; + u8 power_setup_done:1; }; struct acpi_processor { - acpi_handle handle; - u32 acpi_id; - u32 id; - u32 pblk; - int performance_platform_limit; + acpi_handle handle; + u32 acpi_id; + u32 id; + u32 pblk; + int performance_platform_limit; struct acpi_processor_flags flags; struct acpi_processor_power power; struct acpi_processor_performance *performance; @@ -158,50 +154,49 @@ struct acpi_processor { }; struct acpi_processor_errata { - u8 smp; + u8 smp; struct { - u8 throttle:1; - u8 fdma:1; - u8 reserved:6; - u32 bmisx; - } piix4; + u8 throttle:1; + u8 fdma:1; + u8 reserved:6; + u32 bmisx; + } piix4; }; -extern int acpi_processor_register_performance ( - struct acpi_processor_performance * performance, - unsigned int cpu); -extern void acpi_processor_unregister_performance ( - struct acpi_processor_performance * performance, - unsigned int cpu); +extern int acpi_processor_register_performance(struct acpi_processor_performance + *performance, unsigned int cpu); +extern void acpi_processor_unregister_performance(struct + acpi_processor_performance + *performance, + unsigned int cpu); /* note: this locks both the calling module and the processor module if a _PPC object exists, rmmod is disallowed then */ int acpi_processor_notify_smm(struct module *calling_module); - - /* for communication between multiple parts of the processor kernel module */ -extern struct acpi_processor *processors[NR_CPUS]; +extern struct acpi_processor *processors[NR_CPUS]; extern struct acpi_processor_errata errata; int acpi_processor_set_pdc(struct acpi_processor *pr, - struct acpi_object_list *pdc_in); + struct acpi_object_list *pdc_in); #ifdef ARCH_HAS_POWER_PDC_INIT void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, - unsigned int cpu); + unsigned int cpu); void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, - unsigned int cpu); + unsigned int cpu); #else -static inline void acpi_processor_power_init_pdc( - struct acpi_processor_power *pow, unsigned int cpu) +static inline void acpi_processor_power_init_pdc(struct acpi_processor_power + *pow, unsigned int cpu) { pow->pdc = NULL; return; } -static inline void acpi_processor_power_init_bm_check( - struct acpi_processor_flags *flags, unsigned int cpu) +static inline void acpi_processor_power_init_bm_check(struct + acpi_processor_flags + *flags, unsigned int cpu) { flags->bm_check = 1; return; @@ -215,51 +210,62 @@ void acpi_processor_ppc_init(void); void acpi_processor_ppc_exit(void); int acpi_processor_ppc_has_changed(struct acpi_processor *pr); #else -static inline void acpi_processor_ppc_init(void) { return; } -static inline void acpi_processor_ppc_exit(void) { return; } -static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) { +static inline void acpi_processor_ppc_init(void) +{ + return; +} +static inline void acpi_processor_ppc_exit(void) +{ + return; +} +static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) +{ static unsigned int printout = 1; if (printout) { - printk(KERN_WARNING "Warning: Processor Platform Limit event detected, but not handled.\n"); - printk(KERN_WARNING "Consider compiling CPUfreq support into your kernel.\n"); + printk(KERN_WARNING + "Warning: Processor Platform Limit event detected, but not handled.\n"); + printk(KERN_WARNING + "Consider compiling CPUfreq support into your kernel.\n"); printout = 0; } return 0; } -#endif /* CONFIG_CPU_FREQ */ +#endif /* CONFIG_CPU_FREQ */ /* in processor_throttling.c */ -int acpi_processor_get_throttling_info (struct acpi_processor *pr); -int acpi_processor_set_throttling (struct acpi_processor *pr, int state); -ssize_t acpi_processor_write_throttling ( - struct file *file, - const char __user *buffer, - size_t count, - loff_t *data); +int acpi_processor_get_throttling_info(struct acpi_processor *pr); +int acpi_processor_set_throttling(struct acpi_processor *pr, int state); +ssize_t acpi_processor_write_throttling(struct file *file, + const char __user * buffer, + size_t count, loff_t * data); extern struct file_operations acpi_processor_throttling_fops; /* in processor_idle.c */ -int acpi_processor_power_init(struct acpi_processor *pr, struct acpi_device *device); -int acpi_processor_cst_has_changed (struct acpi_processor *pr); -int acpi_processor_power_exit(struct acpi_processor *pr, struct acpi_device *device); - +int acpi_processor_power_init(struct acpi_processor *pr, + struct acpi_device *device); +int acpi_processor_cst_has_changed(struct acpi_processor *pr); +int acpi_processor_power_exit(struct acpi_processor *pr, + struct acpi_device *device); /* in processor_thermal.c */ -int acpi_processor_get_limit_info (struct acpi_processor *pr); -ssize_t acpi_processor_write_limit ( - struct file *file, - const char __user *buffer, - size_t count, - loff_t *data); +int acpi_processor_get_limit_info(struct acpi_processor *pr); +ssize_t acpi_processor_write_limit(struct file *file, + const char __user * buffer, + size_t count, loff_t * data); extern struct file_operations acpi_processor_limit_fops; #ifdef CONFIG_CPU_FREQ void acpi_thermal_cpufreq_init(void); void acpi_thermal_cpufreq_exit(void); #else -static inline void acpi_thermal_cpufreq_init(void) { return; } -static inline void acpi_thermal_cpufreq_exit(void) { return; } +static inline void acpi_thermal_cpufreq_init(void) +{ + return; +} +static inline void acpi_thermal_cpufreq_exit(void) +{ + return; +} #endif - #endif -- cgit v1.2.3 From b21a41385118f9a6af3cd96ce71090c5ada52eb5 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 5 Aug 2005 21:45:40 -0500 Subject: [SCSI] add global timeout to the scsi mid-layer There are certain rogue devices (and the aic7xxx driver) that return BUSY or QUEUE_FULL forever. This code will apply a global timeout (of the total number of retries times the per command timer) to a given command. If it is exceeded, the command is completed regardless of its state. The patch also removes the unused field in the command: timeout and timeout_total. This solves the problem of detecting an endless loop in the mid-layer because of BUSY/QUEUE_FULL bouncing, but will not recover the device. In the aic7xxx case, the driver can be recovered by sending a bus reset, so possibly this should be tied into the error handler? Signed-off-by: James Bottomley --- include/scsi/scsi_cmnd.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 9957f16dcc5..bed4b7c9be9 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -51,12 +51,16 @@ struct scsi_cmnd { * printk's to use ->pid, so that we can kill this field. */ unsigned long serial_number; + /* + * This is set to jiffies as it was when the command was first + * allocated. It is used to time how long the command has + * been outstanding + */ + unsigned long jiffies_at_alloc; int retries; int allowed; int timeout_per_command; - int timeout_total; - int timeout; unsigned char cmd_len; unsigned char old_cmd_len; -- cgit v1.2.3 From 10c1b88987d618f4f89c10e11e574c76de73b5e7 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 14 Aug 2005 14:34:06 -0500 Subject: [SCSI] add ability to deny binding to SPI transport class This patch is necessary if we begin exposing underlying physical disks (which can attach to the SPI transport class) of the hardware RAID cards, since we don't want any SPI parameters binding to the RAID devices. Signed-off-by: James Bottomley --- include/scsi/scsi_transport_spi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h index d8ef86006e0..6bdc4afb248 100644 --- a/include/scsi/scsi_transport_spi.h +++ b/include/scsi/scsi_transport_spi.h @@ -120,6 +120,7 @@ struct spi_function_template { void (*set_hold_mcs)(struct scsi_target *, int); void (*get_signalling)(struct Scsi_Host *); void (*set_signalling)(struct Scsi_Host *, enum spi_signal_type); + int (*deny_binding)(struct scsi_target *); /* The driver sets these to tell the transport class it * wants the attributes displayed in sysfs. If the show_ flag * is not set, the attribute will be private to the transport -- cgit v1.2.3 From d0a7e574007fd547d72ec693bfa35778623d0738 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 14 Aug 2005 17:09:01 -0500 Subject: [SCSI] correct transport class abstraction to work outside SCSI I recently tried to construct a totally generic transport class and found there were certain features missing from the current abstract transport class. Most notable is that you have to hang the data on the class_device but most of the API is framed in terms of the generic device, not the class_device. These changes are two fold - Provide the class_device to all of the setup and configure APIs - Provide and extra API to take the device and the attribute class and return the corresponding class_device Signed-off-by: James Bottomley --- include/linux/attribute_container.h | 9 +++------ include/linux/transport_class.h | 11 ++++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index af1010b6dab..f54b05b052b 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h @@ -11,10 +11,12 @@ #include #include +#include struct attribute_container { struct list_head node; struct list_head containers; + spinlock_t containers_lock; struct class *class; struct class_device_attribute **attrs; int (*match)(struct attribute_container *, struct device *); @@ -62,12 +64,7 @@ int attribute_container_add_class_device_adapter(struct attribute_container *con struct class_device *classdev); void attribute_container_remove_attrs(struct class_device *classdev); void attribute_container_class_device_del(struct class_device *classdev); - - - - - - +struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *); struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); #endif diff --git a/include/linux/transport_class.h b/include/linux/transport_class.h index 87d98d1faef..1d6cc22e5f4 100644 --- a/include/linux/transport_class.h +++ b/include/linux/transport_class.h @@ -12,11 +12,16 @@ #include #include +struct transport_container; + struct transport_class { struct class class; - int (*setup)(struct device *); - int (*configure)(struct device *); - int (*remove)(struct device *); + int (*setup)(struct transport_container *, struct device *, + struct class_device *); + int (*configure)(struct transport_container *, struct device *, + struct class_device *); + int (*remove)(struct transport_container *, struct device *, + struct class_device *); }; #define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ -- cgit v1.2.3 From 888ba6c62bc61a995d283977eb3a6cbafd6f4ac6 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 24 Aug 2005 12:07:20 -0400 Subject: [ACPI] delete CONFIG_ACPI_BOOT it has been a synonym for CONFIG_ACPI since 2.6.12 Signed-off-by: Len Brown --- include/asm-i386/acpi.h | 4 ++-- include/asm-i386/fixmap.h | 2 +- include/asm-i386/io_apic.h | 4 ++-- include/asm-i386/mpspec.h | 4 ++-- include/asm-x86_64/acpi.h | 6 +++--- include/asm-x86_64/io_apic.h | 2 +- include/asm-x86_64/mpspec.h | 2 +- include/linux/acpi.h | 6 +++--- 8 files changed, 15 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index cf828ace13f..1f1ade923d6 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h @@ -103,7 +103,7 @@ __acpi_release_global_lock (unsigned int *lock) :"=r"(n_hi), "=r"(n_lo) \ :"0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern int acpi_lapic; extern int acpi_ioapic; extern int acpi_noirq; @@ -146,7 +146,7 @@ static inline void check_acpi_pci(void) { } #endif -#else /* CONFIG_ACPI_BOOT */ +#else /* !CONFIG_ACPI */ # define acpi_lapic 0 # define acpi_ioapic 0 diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index c94cac95838..cfb1c61d3b9 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h @@ -76,7 +76,7 @@ enum fixed_addresses { FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, #endif -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI FIX_ACPI_BEGIN, FIX_ACPI_END = FIX_ACPI_BEGIN + FIX_ACPI_PAGES - 1, #endif diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 002c203ccd6..51c4e5fe606 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h @@ -195,12 +195,12 @@ extern int skip_ioapic_setup; */ #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern int io_apic_get_unique_id (int ioapic, int apic_id); extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); -#endif /*CONFIG_ACPI_BOOT*/ +#endif /* CONFIG_ACPI */ extern int (*ioapic_renumber_irq)(int ioapic, int irq); diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index d9fafba075b..b9e9f66d272 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h @@ -26,14 +26,14 @@ extern unsigned long mp_lapic_addr; extern int pic_mode; extern int using_apic_timer; -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern void mp_register_lapic (u8 id, u8 enabled); extern void mp_register_lapic_address (u64 address); extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base); extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi); extern void mp_config_acpi_legacy_irqs (void); extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low); -#endif /*CONFIG_ACPI_BOOT*/ +#endif /* CONFIG_ACPI */ #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index dc8c981af27..7d537e1867c 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h @@ -101,7 +101,7 @@ __acpi_release_global_lock (unsigned int *lock) :"=r"(n_hi), "=r"(n_lo) \ :"0"(n_hi), "1"(n_lo)) -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern int acpi_lapic; extern int acpi_ioapic; extern int acpi_noirq; @@ -122,10 +122,10 @@ static inline void disable_acpi(void) extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); -#else /* !CONFIG_ACPI_BOOT */ +#else /* !CONFIG_ACPI */ #define acpi_lapic 0 #define acpi_ioapic 0 -#endif /* !CONFIG_ACPI_BOOT */ +#endif /* !CONFIG_ACPI */ extern int acpi_numa; extern int acpi_scan_nodes(unsigned long start, unsigned long end); diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index a8babd2bbe8..ee1bc69aec9 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h @@ -201,7 +201,7 @@ extern int skip_ioapic_setup; */ #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h index 331f6a3c72a..f267e10c023 100644 --- a/include/asm-x86_64/mpspec.h +++ b/include/asm-x86_64/mpspec.h @@ -179,7 +179,7 @@ extern int mpc_default_type; extern unsigned long mp_lapic_addr; extern int pic_mode; -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI extern void mp_register_lapic (u8 id, u8 enabled); extern void mp_register_lapic_address (u64 address); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index fd48db320f5..fa1ad1a60a0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -41,7 +41,7 @@ #include -#ifdef CONFIG_ACPI_BOOT +#ifdef CONFIG_ACPI enum acpi_irq_model_id { ACPI_IRQ_MODEL_PIC = 0, @@ -429,11 +429,11 @@ extern int pci_mmcfg_config_num; extern int sbf_port ; -#else /*!CONFIG_ACPI_BOOT*/ +#else /* !CONFIG_ACPI */ #define acpi_mp_config 0 -#endif /*!CONFIG_ACPI_BOOT*/ +#endif /* !CONFIG_ACPI */ int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); -- cgit v1.2.3 From 8466361ad5233d4356a4601e16b66c25277920d1 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 24 Aug 2005 12:09:07 -0400 Subject: [ACPI] delete CONFIG_ACPI_INTERPRETER it is a synonym for CONFIG_ACPI Signed-off-by: Len Brown --- include/linux/acpi.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'include') diff --git a/include/linux/acpi.h b/include/linux/acpi.h index fa1ad1a60a0..6882b32aa40 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -488,20 +488,9 @@ extern int ec_write(u8 addr, u8 val); #endif /*CONFIG_ACPI_EC*/ -#ifdef CONFIG_ACPI_INTERPRETER - extern int acpi_blacklisted(void); extern void acpi_bios_year(char *s); -#else /*!CONFIG_ACPI_INTERPRETER*/ - -static inline int acpi_blacklisted(void) -{ - return 0; -} - -#endif /*!CONFIG_ACPI_INTERPRETER*/ - #define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */ #ifdef CONFIG_ACPI -- cgit v1.2.3 From 76f58584824c61eb5b3bdbf019236815921d2e7c Mon Sep 17 00:00:00 2001 From: Len Brown Date: Wed, 24 Aug 2005 12:10:49 -0400 Subject: [ACPI] delete CONFIG_ACPI_BUS it is a synonym for CONFIG_ACPI Signed-off-by: Len Brown --- include/acpi/acpi_bus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 4f4b2baa717..0b54e9a4a8a 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -53,7 +53,7 @@ acpi_evaluate_reference(acpi_handle handle, struct acpi_object_list *arguments, struct acpi_handle_list *list); -#ifdef CONFIG_ACPI_BUS +#ifdef CONFIG_ACPI #include @@ -356,6 +356,6 @@ acpi_handle acpi_get_child(acpi_handle, acpi_integer); acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) -#endif /*CONFIG_ACPI_BUS */ +#endif /* CONFIG_ACPI */ #endif /*__ACPI_BUS_H__*/ -- cgit v1.2.3 From 6153df7b2f4d27c8bde054db1b947369a6f64d83 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 25 Aug 2005 12:27:09 -0400 Subject: [ACPI] delete CONFIG_ACPI_PCI Delete the ability to build an ACPI kernel that does not include PCI support. When such a machine is created and it requires a tuned kernel, send a patch. http://bugzilla.kernel.org/show_bug.cgi?id=1364 Signed-off-by: Len Brown --- include/acpi/acpi_drivers.h | 4 ---- include/asm-i386/acpi.h | 18 ++++++++---------- include/asm-x86_64/acpi.h | 25 +++++++++++-------------- include/linux/acpi.h | 4 ++-- 4 files changed, 21 insertions(+), 30 deletions(-) (limited to 'include') diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index e976cb109b1..c1b4e1f882e 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -47,8 +47,6 @@ PCI -------------------------------------------------------------------------- */ -#ifdef CONFIG_ACPI_PCI - #define ACPI_PCI_COMPONENT 0x00400000 /* ACPI PCI Interrupt Link (pci_link.c) */ @@ -78,8 +76,6 @@ int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *pci_acpi_scan_root(struct acpi_device *device, int domain, int bus); -#endif /*CONFIG_ACPI_PCI */ - /* -------------------------------------------------------------------------- Power Resource -------------------------------------------------------------------------- */ diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 1f1ade923d6..df4ed323aa4 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h @@ -146,13 +146,6 @@ static inline void check_acpi_pci(void) { } #endif -#else /* !CONFIG_ACPI */ -# define acpi_lapic 0 -# define acpi_ioapic 0 - -#endif - -#ifdef CONFIG_ACPI_PCI static inline void acpi_noirq_set(void) { acpi_noirq = 1; } static inline void acpi_disable_pci(void) { @@ -160,11 +153,16 @@ static inline void acpi_disable_pci(void) acpi_noirq_set(); } extern int acpi_irq_balance_set(char *str); -#else + +#else /* !CONFIG_ACPI */ + +#define acpi_lapic 0 +#define acpi_ioapic 0 static inline void acpi_noirq_set(void) { } static inline void acpi_disable_pci(void) { } -static inline int acpi_irq_balance_set(char *str) { return 0; } -#endif + +#endif /* !CONFIG_ACPI */ + #ifdef CONFIG_ACPI_SLEEP diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h index 7d537e1867c..aa1c7b2e438 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86_64/acpi.h @@ -121,17 +121,6 @@ static inline void disable_acpi(void) #define FIX_ACPI_PAGES 4 extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); - -#else /* !CONFIG_ACPI */ -#define acpi_lapic 0 -#define acpi_ioapic 0 -#endif /* !CONFIG_ACPI */ - -extern int acpi_numa; -extern int acpi_scan_nodes(unsigned long start, unsigned long end); -#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) - -#ifdef CONFIG_ACPI_PCI static inline void acpi_noirq_set(void) { acpi_noirq = 1; } static inline void acpi_disable_pci(void) { @@ -139,11 +128,19 @@ static inline void acpi_disable_pci(void) acpi_noirq_set(); } extern int acpi_irq_balance_set(char *str); -#else + +#else /* !CONFIG_ACPI */ + +#define acpi_lapic 0 +#define acpi_ioapic 0 static inline void acpi_noirq_set(void) { } static inline void acpi_disable_pci(void) { } -static inline int acpi_irq_balance_set(char *str) { return 0; } -#endif + +#endif /* !CONFIG_ACPI */ + +extern int acpi_numa; +extern int acpi_scan_nodes(unsigned long start, unsigned long end); +#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) #ifdef CONFIG_ACPI_SLEEP diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6882b32aa40..026c3c011dc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -445,7 +445,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); */ void acpi_unregister_gsi (u32 gsi); -#ifdef CONFIG_ACPI_PCI +#ifdef CONFIG_ACPI struct acpi_prt_entry { struct list_head node; @@ -479,7 +479,7 @@ struct acpi_pci_driver { int acpi_pci_register_driver(struct acpi_pci_driver *driver); void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); -#endif /*CONFIG_ACPI_PCI*/ +#endif /* CONFIG_ACPI */ #ifdef CONFIG_ACPI_EC -- cgit v1.2.3 From 392160335c798bbe94ab3aae6ea0c85d32b81bbc Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Wed, 15 Jun 2005 18:48:29 -0500 Subject: [SCSI] use scatter lists for all block pc requests and simplify hw handlers Original From: Mike Christie Add scsi_execute_req() as a replacement for scsi_wait_req() Fixed up various pieces (added REQ_SPECIAL and caught req use after free) Signed-off-by: James Bottomley --- include/scsi/scsi_request.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index 98719407d55..d64903a617c 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h @@ -54,6 +54,9 @@ extern void scsi_do_req(struct scsi_request *, const void *cmnd, void *buffer, unsigned bufflen, void (*done) (struct scsi_cmnd *), int timeout, int retries); +extern int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, + int data_direction, void *buffer, unsigned bufflen, + unsigned char *sense, int timeout, int retries); struct scsi_mode_data { __u32 length; -- cgit v1.2.3 From caca1779870b1bcc0fb07e48ebd2403901f356b8 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 16 Aug 2005 17:26:10 -0500 Subject: [SCSI] add missing attribute container function prototype attribute_container_classdev_to_container is an exported function of the attribute_container.c file. However, there's no prototype for it. Now I actually want to use it, so add one. Signed-off-by: James Bottomley --- include/linux/attribute_container.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index f54b05b052b..ee83fe64a10 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h @@ -64,6 +64,7 @@ int attribute_container_add_class_device_adapter(struct attribute_container *con struct class_device *classdev); void attribute_container_remove_attrs(struct class_device *classdev); void attribute_container_class_device_del(struct class_device *classdev); +struct attribute_container *attribute_container_classdev_to_container(struct class_device *); struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *); struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); -- cgit v1.2.3 From 1cf72699c1530c3e4ac3d58344f6a6a40a2f46d3 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 28 Aug 2005 11:27:01 -0500 Subject: [SCSI] convert the remaining mid-layer pieces to scsi_execute_req After this, we just have some drivers, all the ULDs and the SPI transport class using scsi_wait_req(). Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 13 +++++++++++-- include/scsi/scsi_request.h | 15 --------------- 2 files changed, 11 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 835af8ecbb7..9181068883c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -8,9 +8,17 @@ struct request_queue; struct scsi_cmnd; -struct scsi_mode_data; struct scsi_lun; +struct scsi_mode_data { + __u32 length; + __u16 block_descriptor_length; + __u8 medium_type; + __u8 device_specific; + __u8 header_length; + __u8 longlba:1; +}; + /* * sdev state: If you alter this, you also need to alter scsi_sysfs.c * (for the ascii descriptions) and the state model enforcer: @@ -228,7 +236,8 @@ extern int scsi_set_medium_removal(struct scsi_device *, char); extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, unsigned char *buffer, int len, int timeout, - int retries, struct scsi_mode_data *data); + int retries, struct scsi_mode_data *data, + char *sense); extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries); extern int scsi_device_set_state(struct scsi_device *sdev, diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index d64903a617c..f5dfdfec9fe 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h @@ -58,19 +58,4 @@ extern int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, unsigned char *sense, int timeout, int retries); -struct scsi_mode_data { - __u32 length; - __u16 block_descriptor_length; - __u8 medium_type; - __u8 device_specific; - __u8 header_length; - __u8 longlba:1; -}; - -extern int __scsi_mode_sense(struct scsi_request *SRpnt, int dbd, - int modepage, unsigned char *buffer, int len, - int timeout, int retries, - struct scsi_mode_data *data); - - #endif /* _SCSI_SCSI_REQUEST_H */ -- cgit v1.2.3 From 33aa687db90dd8541bd5e9a762eebf880eaee767 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 28 Aug 2005 11:31:14 -0500 Subject: [SCSI] convert SPI transport class to scsi_execute This one's slightly more difficult. The transport class uses REQ_FAILFAST, so another interface (scsi_execute) had to be invented to take the extra flag. Also, the sense functions are shifted around to allow spi_execute to place data directly into a struct scsi_sense_hdr. With this change, there's probably a lot of unnecessary sense buffer allocation going on which we can fix later. Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 13 +++++++++++++ include/scsi/scsi_eh.h | 8 ++++++++ include/scsi/scsi_request.h | 4 ---- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 9181068883c..5ad08b70763 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -256,6 +256,19 @@ extern void int_to_scsilun(unsigned int, struct scsi_lun *); extern const char *scsi_device_state_name(enum scsi_device_state); extern int scsi_is_sdev_device(const struct device *); extern int scsi_is_target_device(const struct device *); +extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, + int data_direction, void *buffer, unsigned bufflen, + unsigned char *sense, int timeout, int retries, + int flag); + +static inline int +scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, + int data_direction, void *buffer, unsigned bufflen, + unsigned char *sense, int timeout, int retries) +{ + return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, + timeout, retries, 0); +} static inline int scsi_device_online(struct scsi_device *sdev) { return sdev->sdev_state != SDEV_OFFLINE; diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 80557f879e3..b24d224281b 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@ -26,6 +26,14 @@ struct scsi_sense_hdr { /* See SPC-3 section 4.5 */ u8 additional_length; /* always 0 for fixed sense format */ }; +static inline int scsi_sense_valid(struct scsi_sense_hdr *sshdr) +{ + if (!sshdr) + return 0; + + return (sshdr->response_code & 0x70) == 0x70; +} + extern void scsi_add_timer(struct scsi_cmnd *, int, void (*)(struct scsi_cmnd *)); diff --git a/include/scsi/scsi_request.h b/include/scsi/scsi_request.h index f5dfdfec9fe..6a140020d7c 100644 --- a/include/scsi/scsi_request.h +++ b/include/scsi/scsi_request.h @@ -54,8 +54,4 @@ extern void scsi_do_req(struct scsi_request *, const void *cmnd, void *buffer, unsigned bufflen, void (*done) (struct scsi_cmnd *), int timeout, int retries); -extern int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, int timeout, int retries); - #endif /* _SCSI_SCSI_REQUEST_H */ -- cgit v1.2.3 From ea73a9f23906c374b697cd5b0d64f6dceced63de Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 28 Aug 2005 11:33:52 -0500 Subject: [SCSI] convert sd to scsi_execute_req (and update the scsi_execute_req API) This one removes struct scsi_request entirely from sd. In the process, I noticed we have no callers of scsi_wait_req who don't immediately normalise the sense, so I updated the API to make it take a struct scsi_sense_hdr instead of simply a big sense buffer. Signed-off-by: James Bottomley --- include/scsi/scsi_dbg.h | 2 ++ include/scsi/scsi_device.h | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_dbg.h b/include/scsi/scsi_dbg.h index 12e90934a7a..b090a11d7e1 100644 --- a/include/scsi/scsi_dbg.h +++ b/include/scsi/scsi_dbg.h @@ -3,8 +3,10 @@ struct scsi_cmnd; struct scsi_request; +struct scsi_sense_hdr; extern void scsi_print_command(struct scsi_cmnd *); +extern void scsi_print_sense_hdr(const char *, struct scsi_sense_hdr *); extern void __scsi_print_command(unsigned char *); extern void scsi_print_sense(const char *, struct scsi_cmnd *); extern void scsi_print_req_sense(const char *, struct scsi_request *); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 5ad08b70763..da63722c012 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -9,6 +9,7 @@ struct request_queue; struct scsi_cmnd; struct scsi_lun; +struct scsi_sense_hdr; struct scsi_mode_data { __u32 length; @@ -237,7 +238,7 @@ extern int scsi_set_medium_removal(struct scsi_device *, char); extern int scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, unsigned char *buffer, int len, int timeout, int retries, struct scsi_mode_data *data, - char *sense); + struct scsi_sense_hdr *); extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries); extern int scsi_device_set_state(struct scsi_device *sdev, @@ -260,15 +261,10 @@ extern int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, unsigned char *sense, int timeout, int retries, int flag); +extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, + int data_direction, void *buffer, unsigned bufflen, + struct scsi_sense_hdr *, int timeout, int retries); -static inline int -scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, int timeout, int retries) -{ - return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, - timeout, retries, 0); -} static inline int scsi_device_online(struct scsi_device *sdev) { return sdev->sdev_state != SDEV_OFFLINE; -- cgit v1.2.3 From a18ecf413ca9846becb760f7f990c2c62c15965e Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Mon, 15 Aug 2005 03:42:00 -0800 Subject: [ACPI] ACPICA 20050815 Implemented a full bytewise compare to determine if a table load request is attempting to load a duplicate table. The compare is performed if the table signatures and table lengths match. This will allow different tables with the same OEM Table ID and revision to be loaded. Although the BIOS is technically violating the ACPI spec when this happens -- it does happen -- so Linux must handle it. Signed-off-by: Robert Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acnames.h | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index f3810cc5d48..73c43a39663 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050729 +#define ACPI_CA_VERSION 0x20050815 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 79152fbc8f8..4f9063f3e95 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -71,16 +71,13 @@ /* Definitions of the predefined namespace names */ -#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ -#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ -#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */ +#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */ +#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */ + +#define ACPI_PREFIX_MIXED (u32) 0x69706341 /* "Acpi" */ +#define ACPI_PREFIX_LOWER (u32) 0x69706361 /* "acpi" */ #define ACPI_NS_ROOT_PATH "\\" #define ACPI_NS_SYSTEM_BUS "_SB_" -/*! [Begin] no source code translation (not handled by acpisrc) */ -#define ACPI_FUNCTION_PREFIX1 'ipcA' -#define ACPI_FUNCTION_PREFIX2 'ipca' -/*! [End] no source code translation !*/ - #endif /* __ACNAMES_H__ */ -- cgit v1.2.3 From d7ce78fd9a51ca0d6b9a8cf35baef884ddb9a95c Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 29 Aug 2005 22:46:43 -0700 Subject: [SPARC64]: Eliminate irq_cpustat_t. We can put the __softirq_pending mask in the cpudata, no need for the silly NR_CPUS array in kernel/softirq.c Signed-off-by: David S. Miller --- include/asm-sparc64/cpudata.h | 4 ++-- include/asm-sparc64/hardirq.h | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h index cc7198aaac5..9a3a81f1cc5 100644 --- a/include/asm-sparc64/cpudata.h +++ b/include/asm-sparc64/cpudata.h @@ -1,6 +1,6 @@ /* cpudata.h: Per-cpu parameters. * - * Copyright (C) 2003 David S. Miller (davem@redhat.com) + * Copyright (C) 2003, 2005 David S. Miller (davem@redhat.com) */ #ifndef _SPARC64_CPUDATA_H @@ -10,7 +10,7 @@ typedef struct { /* Dcache line 1 */ - unsigned int __pad0; /* bh_count moved to irq_stat for consistency. KAO */ + unsigned int __softirq_pending; /* must be 1st, see rtrap.S */ unsigned int multiplier; unsigned int counter; unsigned int idle_volume; diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h index d6db1aed764..f0cf71376ec 100644 --- a/include/asm-sparc64/hardirq.h +++ b/include/asm-sparc64/hardirq.h @@ -1,22 +1,16 @@ /* hardirq.h: 64-bit Sparc hard IRQ support. * - * Copyright (C) 1997, 1998 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1997, 1998, 2005 David S. Miller (davem@davemloft.net) */ #ifndef __SPARC64_HARDIRQ_H #define __SPARC64_HARDIRQ_H -#include -#include -#include -#include +#include -/* rtrap.S is sensitive to the offsets of these fields */ -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ +#define __ARCH_IRQ_STAT +#define local_softirq_pending() \ + (local_cpu_data().__softirq_pending) #define HARDIRQ_BITS 8 -- cgit v1.2.3 From 1623c81eece58740279b8de802fa5895221f2044 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 30 Aug 2005 03:37:42 -0400 Subject: [libata] allow ATAPI to be enabled with new atapi_enabled module option ATAPI is getting close to being ready. To increase exposure, we enable the code in the upstream kernel, but default it to off (present behavior). Users must pass atapi_enabled=1 as a module option (if module) or on the kernel command line (if built in) to turn on discovery of their ATAPI devices. --- include/linux/libata.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/libata.h b/include/linux/libata.h index fc05a989928..1eaba4077e1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -40,7 +40,6 @@ #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ #undef ATA_NDEBUG /* define to disable quick runtime checks */ -#undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */ #undef ATA_ENABLE_PATA /* define to enable PATA support in some * low-level drivers */ #undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ -- cgit v1.2.3 From 374b1873571bf80dc0c1fcceaaad067980f3b9de Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 30 Aug 2005 05:42:52 -0400 Subject: [libata] update several drivers to use pci_iomap()/pci_iounmap() --- include/linux/libata.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/libata.h b/include/linux/libata.h index fc05a989928..bd0f79dfb9c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -450,6 +450,7 @@ struct pci_bits { unsigned long val; }; +extern void ata_pci_host_stop (struct ata_host_set *host_set); extern struct ata_probe_ent * ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); -- cgit v1.2.3 From 53c165e0a6c8a4ff7df316557528fa7a52d20711 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Mon, 22 Aug 2005 10:06:19 -0500 Subject: [SCSI] correct attribute_container list usage One of the changes in the attribute_container code in the scsi-misc tree was to add a lock to protect the list of devices per container. This, unfortunately, leads to potential scheduling while atomic problems if there's a sleep in the function called by a trigger. The correct solution is to use the kernel klist infrastructure instead which allows lockless traversal of a list. Signed-off-by: James Bottomley --- include/linux/attribute_container.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h index ee83fe64a10..93bfb0beb62 100644 --- a/include/linux/attribute_container.h +++ b/include/linux/attribute_container.h @@ -11,12 +11,12 @@ #include #include +#include #include struct attribute_container { struct list_head node; - struct list_head containers; - spinlock_t containers_lock; + struct klist containers; struct class *class; struct class_device_attribute **attrs; int (*match)(struct attribute_container *, struct device *); -- cgit v1.2.3 From 61a7afa2c476a3be261cf88a95b0dea0c3bd29d4 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 16 Aug 2005 18:27:34 -0500 Subject: [SCSI] embryonic RAID class The idea behind a RAID class is to provide a uniform interface to all RAID subsystems (both hardware and software) in the kernel. To do that, I've made this class a transport class that's entirely subsystem independent (although the matching routines have to match per subsystem, as you'll see looking at the code). I put it in the scsi subdirectory purely because I needed somewhere to play with it, but it's not a scsi specific module. I used a fusion raid card as the test bed for this; with that kind of card, this is the type of class output you get: jejb@titanic> ls -l /sys/class/raid_devices/20\:0\:0\:0/ total 0 lrwxrwxrwx 1 root root 0 Aug 16 17:21 component-0 -> ../../../devices/pci0000:80/0000:80:04.0/host20/target20:1:0/20:1:0:0/ lrwxrwxrwx 1 root root 0 Aug 16 17:21 component-1 -> ../../../devices/pci0000:80/0000:80:04.0/host20/target20:1:1/20:1:1:0/ lrwxrwxrwx 1 root root 0 Aug 16 17:21 device -> ../../../devices/pci0000:80/0000:80:04.0/host20/target20:0:0/20:0:0:0/ -r--r--r-- 1 root root 16384 Aug 16 17:21 level -r--r--r-- 1 root root 16384 Aug 16 17:21 resync -r--r--r-- 1 root root 16384 Aug 16 17:21 state So it's really simple: for a SCSI device representing a hardware raid, it shows the raid level, the array state, the resync % complete (if the state is resyncing) and the underlying components of the RAID (these are exposed in fusion on the virtual channel 1). As you can see, this type of information can be exported by almost anything, including software raid. The more difficult trick, of course, is going to be getting it to perform configuration type actions with writable attributes. Signed-off-by: James Bottomley --- include/linux/raid_class.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 include/linux/raid_class.h (limited to 'include') diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h new file mode 100644 index 00000000000..a71123c2827 --- /dev/null +++ b/include/linux/raid_class.h @@ -0,0 +1,59 @@ +/* + */ +#include + +struct raid_template { + struct transport_container raid_attrs; +}; + +struct raid_function_template { + void *cookie; + int (*is_raid)(struct device *); + void (*get_resync)(struct device *); + void (*get_state)(struct device *); +}; + +enum raid_state { + RAID_ACTIVE = 1, + RAID_DEGRADED, + RAID_RESYNCING, + RAID_OFFLINE, +}; + +struct raid_data { + struct list_head component_list; + int component_count; + int level; + enum raid_state state; + int resync; +}; + +#define DEFINE_RAID_ATTRIBUTE(type, attr) \ +static inline void \ +raid_set_##attr(struct raid_template *r, struct device *dev, type value) { \ + struct class_device *cdev = \ + attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ + struct raid_data *rd; \ + BUG_ON(!cdev); \ + rd = class_get_devdata(cdev); \ + rd->attr = value; \ +} \ +static inline type \ +raid_get_##attr(struct raid_template *r, struct device *dev) { \ + struct class_device *cdev = \ + attribute_container_find_class_device(&r->raid_attrs.ac, dev);\ + struct raid_data *rd; \ + BUG_ON(!cdev); \ + rd = class_get_devdata(cdev); \ + return rd->attr; \ +} + +DEFINE_RAID_ATTRIBUTE(int, level) +DEFINE_RAID_ATTRIBUTE(int, resync) +DEFINE_RAID_ATTRIBUTE(enum raid_state, state) + +struct raid_template *raid_class_attach(struct raid_function_template *); +void raid_class_release(struct raid_template *); + +void raid_component_add(struct raid_template *, struct device *, + struct device *); -- cgit v1.2.3 From 8813dfbfc56b3f7c369b3115c2f70bcacd77ec51 Mon Sep 17 00:00:00 2001 From: "Alexey Y. Starikovskiy" Date: Thu, 25 Aug 2005 09:56:52 +0400 Subject: [ACPI] Error: Invalid owner_id: 00 Signed-off-by: Alexey Y. Starikovskiy Signed-off-by: Len Brown --- include/acpi/acdispat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 59306186f5e..c436e8be6ba 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -194,7 +194,7 @@ acpi_status acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, union acpi_operand_object *return_desc); -acpi_status +void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); acpi_status -- cgit v1.2.3 From 8a36895c0ddac143b7f0e87d46153f4f75d9fff7 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 31 Aug 2005 15:01:33 -0700 Subject: [SPARC64]: Use 'unsigned long' for port argument to I/O string ops. This kills warnings when building drivers/ide/ide-iops.c and puts us in-line with what other platforms do here. Signed-off-by: David S. Miller --- include/asm-sparc64/io.h | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h index afdcea90707..0056770e83a 100644 --- a/include/asm-sparc64/io.h +++ b/include/asm-sparc64/io.h @@ -100,18 +100,41 @@ static __inline__ void _outl(u32 l, unsigned long addr) #define inl_p(__addr) inl(__addr) #define outl_p(__l, __addr) outl(__l, __addr) -extern void outsb(void __iomem *addr, const void *src, unsigned long count); -extern void outsw(void __iomem *addr, const void *src, unsigned long count); -extern void outsl(void __iomem *addr, const void *src, unsigned long count); -extern void insb(void __iomem *addr, void *dst, unsigned long count); -extern void insw(void __iomem *addr, void *dst, unsigned long count); -extern void insl(void __iomem *addr, void *dst, unsigned long count); -#define ioread8_rep(a,d,c) insb(a,d,c) -#define ioread16_rep(a,d,c) insw(a,d,c) -#define ioread32_rep(a,d,c) insl(a,d,c) -#define iowrite8_rep(a,s,c) outsb(a,s,c) -#define iowrite16_rep(a,s,c) outsw(a,s,c) -#define iowrite32_rep(a,s,c) outsl(a,s,c) +extern void outsb(unsigned long, const void *, unsigned long); +extern void outsw(unsigned long, const void *, unsigned long); +extern void outsl(unsigned long, const void *, unsigned long); +extern void insb(unsigned long, void *, unsigned long); +extern void insw(unsigned long, void *, unsigned long); +extern void insl(unsigned long, void *, unsigned long); + +static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count) +{ + insb((unsigned long __force)port, buf, count); +} +static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count) +{ + insw((unsigned long __force)port, buf, count); +} + +static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count) +{ + insl((unsigned long __force)port, buf, count); +} + +static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count) +{ + outsb((unsigned long __force)port, buf, count); +} + +static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count) +{ + outsw((unsigned long __force)port, buf, count); +} + +static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count) +{ + outsl((unsigned long __force)port, buf, count); +} /* Memory functions, same as I/O accesses on Ultra. */ static inline u8 _readb(const volatile void __iomem *addr) -- cgit v1.2.3 From ff4cc3ac93e1d0369928fd60ec1fe82417afc576 Mon Sep 17 00:00:00 2001 From: Mike Kershaw Date: Thu, 1 Sep 2005 17:40:05 -0700 Subject: [TUNTAP]: Allow setting the linktype of the tap device from userspace Currently tun/tap only supports the EN10MB ARP type. For use with wireless and other networking types it should be possible to set the ARP type via an ioctl. Patch v2: Included check that the tap interface is down before changing the link type out from underneath it Signed-off-by: Mike Kershaw Signed-off-by: David S. Miller --- include/linux/if_tun.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 096a85a58ae..88aef7b86ef 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h @@ -77,6 +77,7 @@ struct tun_struct { #define TUNSETIFF _IOW('T', 202, int) #define TUNSETPERSIST _IOW('T', 203, int) #define TUNSETOWNER _IOW('T', 204, int) +#define TUNSETLINK _IOW('T', 205, int) /* TUNSETIFF ifr flags */ #define IFF_TUN 0x0001 -- cgit v1.2.3 From 732db659b83579b922c18dee9123e1529b5fb5d2 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Thu, 1 Sep 2005 17:40:26 -0700 Subject: [IPVS]: "extern inline" -> "static inline" "extern inline" doesn't make much sense. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/ip_vs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 7a3c43711a1..e426641c519 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h @@ -958,7 +958,7 @@ static __inline__ int ip_vs_todrop(void) */ #define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK) -extern __inline__ char ip_vs_fwd_tag(struct ip_vs_conn *cp) +static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp) { char fwd; -- cgit v1.2.3 From 64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 1 Sep 2005 17:43:05 -0700 Subject: [CRYPTO]: Added CRYPTO_TFM_REQ_MAY_SLEEP flag The crypto layer currently uses in_atomic() to determine whether it is allowed to sleep. This is incorrect since spin locks don't always cause in_atomic() to return true. Instead of that, this patch returns to an earlier idea of a per-tfm flag which determines whether sleeping is allowed. Unlike the earlier version, the default is to not allow sleeping. This ensures that no existing code can break. As usual, this flag may either be set through crypto_alloc_tfm(), or just before a specific crypto operation. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/linux/crypto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 5e2bcc636a0..3c89df6e776 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -45,6 +45,7 @@ #define CRYPTO_TFM_MODE_CTR 0x00000008 #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 +#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 -- cgit v1.2.3 From d80d99d643090c3cf2b1f9fb3fadd1256f7e384f Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 1 Sep 2005 17:48:23 -0700 Subject: [NET]: Add sk_stream_wmem_schedule This patch introduces sk_stream_wmem_schedule as a short-hand for the sk_forward_alloc checking on egress. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/net/sock.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/net/sock.h b/include/net/sock.h index 312cb25cbd1..e51e626e9af 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -709,6 +709,12 @@ static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb) sk_stream_mem_schedule(sk, skb->truesize, 1); } +static inline int sk_stream_wmem_schedule(struct sock *sk, int size) +{ + return size <= sk->sk_forward_alloc || + sk_stream_mem_schedule(sk, size, 0); +} + /* Used by processes to "lock" a socket state, so that * interrupts and bottom half handlers won't change it * from under us. It essentially blocks any incoming @@ -1203,8 +1209,7 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, skb = alloc_skb_fclone(size + hdr_len, gfp); if (skb) { skb->truesize += mem; - if (sk->sk_forward_alloc >= (int)skb->truesize || - sk_stream_mem_schedule(sk, skb->truesize, 0)) { + if (sk_stream_wmem_schedule(sk, skb->truesize)) { skb_reserve(skb, hdr_len); return skb; } @@ -1227,8 +1232,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk) { struct page *page = NULL; - if (sk->sk_forward_alloc >= (int)PAGE_SIZE || - sk_stream_mem_schedule(sk, PAGE_SIZE, 0)) + if (sk_stream_wmem_schedule(sk, PAGE_SIZE)) page = alloc_pages(sk->sk_allocation, 0); else { sk->sk_prot->enter_memory_pressure(); -- cgit v1.2.3 From ef015786152adaff5a6a8bf0c8ea2f70cee8059d Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 1 Sep 2005 17:48:59 -0700 Subject: [TCP]: Fix sk_forward_alloc underflow in tcp_sendmsg I've finally found a potential cause of the sk_forward_alloc underflows that people have been reporting sporadically. When tcp_sendmsg tacks on extra bits to an existing TCP_PAGE we don't check sk_forward_alloc even though a large amount of time may have elapsed since we allocated the page. In the mean time someone could've come along and liberated packets and reclaimed sk_forward_alloc memory. This patch makes tcp_sendmsg check sk_forward_alloc every time as we do in do_tcp_sendpages. Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- include/net/sock.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/net/sock.h b/include/net/sock.h index e51e626e9af..cf628261da5 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1232,9 +1232,8 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk) { struct page *page = NULL; - if (sk_stream_wmem_schedule(sk, PAGE_SIZE)) - page = alloc_pages(sk->sk_allocation, 0); - else { + page = alloc_pages(sk->sk_allocation, 0); + if (!page) { sk->sk_prot->enter_memory_pressure(); sk_stream_moderate_sndbuf(sk); } -- cgit v1.2.3 From a7a6cac204147634aba7487e4d618b028ff54c0d Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 1 Sep 2005 21:51:26 -0700 Subject: [SPARC]: Kill io_remap_page_range() It's been deprecated long enough and there are no in-tree users any longer. Signed-off-by: David S. Miller --- include/asm-sparc/pgtable.h | 3 --- include/asm-sparc64/pgtable.h | 3 --- 2 files changed, 6 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 40ed30a2b7c..8f4f6a95965 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -435,9 +435,6 @@ extern unsigned long *sparc_valid_addr_bitmap; #define kern_addr_valid(addr) \ (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap)) -extern int io_remap_page_range(struct vm_area_struct *vma, - unsigned long from, unsigned long to, - unsigned long size, pgprot_t prot, int space); extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h index 1ae00c5087f..a2b4f5ed462 100644 --- a/include/asm-sparc64/pgtable.h +++ b/include/asm-sparc64/pgtable.h @@ -410,9 +410,6 @@ extern unsigned long *sparc64_valid_addr_bitmap; #define kern_addr_valid(addr) \ (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) -extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, - unsigned long offset, - unsigned long size, pgprot_t prot, int space); extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); -- cgit v1.2.3 From 6475be16fd9b3c6746ca4d18959246b13c669ea8 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 1 Sep 2005 22:47:01 -0700 Subject: [TCP]: Keep TSO enabled even during loss events. All we need to do is resegment the queue so that we record SACK information accurately. The edges of the SACK blocks guide our resegmenting decisions. With help from Herbert Xu. Signed-off-by: David S. Miller --- include/net/tcp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/net/tcp.h b/include/net/tcp.h index d6bcf1317a6..97af77c4d09 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -454,6 +454,7 @@ extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); extern void tcp_xmit_retransmit_queue(struct sock *); extern void tcp_simple_retransmit(struct sock *); extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); +extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int); extern void tcp_send_probe0(struct sock *); extern void tcp_send_partial(struct sock *); -- cgit v1.2.3 From a94f18810f52d3a6de0a09bee0c7258b62eca262 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sat, 3 Sep 2005 00:09:12 -0400 Subject: [ACPI] revert owner-id-3.patch Signed-off-by: Len Brown --- include/acpi/acdispat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index c436e8be6ba..59306186f5e 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -194,7 +194,7 @@ acpi_status acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, union acpi_operand_object *return_desc); -void +acpi_status acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); acpi_status -- cgit v1.2.3 From aff8c2777d1a9edf97f26bf60579f9c931443eb1 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 2 Sep 2005 17:24:17 -0400 Subject: [ACPI] ACPICA 20050902 Fixed a problem with the internal Owner ID allocation and deallocation mechanisms for control method execution and recursive method invocation. This should eliminate the OWNER_ID_LIMIT exceptions and "Invalid OwnerId" messages seen on some systems. Recursive method invocation depth is currently limited to 255. (Alexey Starikovskiy) http://bugzilla.kernel.org/show_bug.cgi?id=4892 Completely eliminated all vestiges of support for the "module-level executable code" until this support is fully implemented and debugged. This should eliminate the NO_RETURN_VALUE exceptions seen during table load on some systems that invoke this support. http://bugzilla.kernel.org/show_bug.cgi?id=5162 Fixed a problem within the resource manager code where the transaction flags for a 64-bit address descriptor were handled incorrectly in the type-specific flag byte. Consolidated duplicate code within the address descriptor resource manager code, reducing overall subsystem code size. Signed-off-by: Robert Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdispat.h | 3 +-- include/acpi/actypes.h | 38 +++++++++++++++++--------------------- 3 files changed, 19 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 73c43a39663..427cff1a3f8 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20050815 +#define ACPI_CA_VERSION 0x20050902 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 59306186f5e..065f24a77cf 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -194,8 +194,7 @@ acpi_status acpi_ds_restart_control_method(struct acpi_walk_state *walk_state, union acpi_operand_object *return_desc); -acpi_status -acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); +void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state); acpi_status acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 254f4b06e7e..6213b27516e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -1074,14 +1074,21 @@ struct acpi_resource_source { char *string_ptr; }; +/* Fields common to all address descriptors, 16/32/64 bit */ + +#define ACPI_RESOURCE_ADDRESS_COMMON \ + u32 resource_type; \ + u32 producer_consumer; \ + u32 decode; \ + u32 min_address_fixed; \ + u32 max_address_fixed; \ + union acpi_resource_attribute attribute; + +struct acpi_resource_address { +ACPI_RESOURCE_ADDRESS_COMMON}; + struct acpi_resource_address16 { - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u32 granularity; + ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; @@ -1090,13 +1097,7 @@ struct acpi_resource_address16 { }; struct acpi_resource_address32 { - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u32 granularity; + ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; u32 min_address_range; u32 max_address_range; u32 address_translation_offset; @@ -1105,13 +1106,7 @@ struct acpi_resource_address32 { }; struct acpi_resource_address64 { - u32 resource_type; - u32 producer_consumer; - u32 decode; - u32 min_address_fixed; - u32 max_address_fixed; - union acpi_resource_attribute attribute; - u64 granularity; + ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; u64 min_address_range; u64 max_address_range; u64 address_translation_offset; @@ -1161,6 +1156,7 @@ union acpi_resource_data { struct acpi_resource_mem24 memory24; struct acpi_resource_mem32 memory32; struct acpi_resource_fixed_mem32 fixed_memory32; + struct acpi_resource_address address; /* Common 16/32/64 address fields */ struct acpi_resource_address16 address16; struct acpi_resource_address32 address32; struct acpi_resource_address64 address64; -- cgit v1.2.3 From 865e9f13c94891daed4f6a5f69c5d6ec04d4932f Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 3 Sep 2005 16:45:02 +0100 Subject: [MMC] ios for mmc chip select Adds a new ios for setting the chip select pin on MMC cards. Needed on SD controllers which use this pin for other things and therefore cannot have it pulled high at all times. Signed-off-by: Pierre Ossman Signed-off-by: Russell King --- include/linux/mmc/host.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 9a0893f3249..30f68c0c8c6 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -46,6 +46,12 @@ struct mmc_ios { #define MMC_BUSMODE_OPENDRAIN 1 #define MMC_BUSMODE_PUSHPULL 2 + unsigned char chip_select; /* SPI chip select */ + +#define MMC_CS_DONTCARE 0 +#define MMC_CS_HIGH 1 +#define MMC_CS_LOW 2 + unsigned char power_mode; /* power supply mode */ #define MMC_POWER_OFF 0 -- cgit v1.2.3 From 7801907b8c4a49f8ec033d13a938751114a97a55 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 4 Sep 2005 19:43:13 +0100 Subject: [ARM] Change irq_chip wake/type methods to set_wake/set_type This is part of Thomas Gleixner's generic IRQ patch, which converts ARM to use the generic IRQ subsystem. Here, we rename two of the irq_chip methods - wake becomes set_wake, and type becomes set_type. Signed-off-by: Russell King --- include/asm-arm/mach/irq.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index a43a353f6c7..bc9763db1d3 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -42,11 +42,11 @@ struct irqchip { /* * Set the type of the IRQ. */ - int (*type)(unsigned int, unsigned int); + int (*set_type)(unsigned int, unsigned int); /* * Set wakeup-enable on the selected IRQ */ - int (*wake)(unsigned int, unsigned int); + int (*set_wake)(unsigned int, unsigned int); #ifdef CONFIG_SMP /* -- cgit v1.2.3 From 664399e1fbdceb18da9c9c5534dedd62327c63e8 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 4 Sep 2005 19:45:00 +0100 Subject: [ARM] Wrap calls to descriptor handlers This is part of Thomas Gleixner's generic IRQ patch, which converts ARM to use the generic IRQ subsystem. Here, we wrap calls to desc->handler() in an inline function, desc_handle_irq(). This reduces the size of Thomas' patch since the changes become more localised. Signed-off-by: Russell King --- include/asm-arm/mach/irq.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index bc9763db1d3..0ce6ca588d8 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -91,6 +91,14 @@ struct irqdesc { extern struct irqdesc irq_desc[]; +/* + * Helpful inline function for calling irq descriptor handlers. + */ +static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) +{ + desc->handle(irq, desc, regs); +} + /* * This is internal. Do not use it. */ -- cgit v1.2.3 From 802f192e4a600f7ef84ca25c8b818c8830acef5a Mon Sep 17 00:00:00 2001 From: Bob Picco Date: Sat, 3 Sep 2005 15:54:26 -0700 Subject: [PATCH] SPARSEMEM EXTREME A new option for SPARSEMEM is ARCH_SPARSEMEM_EXTREME. Architecture platforms with a very sparse physical address space would likely want to select this option. For those architecture platforms that don't select the option, the code generated is equivalent to SPARSEMEM currently in -mm. I'll be posting a patch on ia64 ml which uses this new SPARSEMEM feature. ARCH_SPARSEMEM_EXTREME makes mem_section a one dimensional array of pointers to mem_sections. This two level layout scheme is able to achieve smaller memory requirements for SPARSEMEM with the tradeoff of an additional shift and load when fetching the memory section. The current SPARSEMEM -mm implementation is a one dimensional array of mem_sections which is the default SPARSEMEM configuration. The patch attempts isolates the implementation details of the physical layout of the sparsemem section array. ARCH_SPARSEMEM_EXTREME depends on 64BIT and is by default boolean false. I've boot tested under aim load ia64 configured for ARCH_SPARSEMEM_EXTREME. I've also boot tested a 4 way Opteron machine with !ARCH_SPARSEMEM_EXTREME and tested with aim. Signed-off-by: Andy Whitcroft Signed-off-by: Bob Picco Signed-off-by: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc64/lmb.h | 22 ++++++++++++++++++++++ include/linux/mmzone.h | 30 ++++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/lmb.h b/include/asm-ppc64/lmb.h index cb368bf0f26..de91e034bd9 100644 --- a/include/asm-ppc64/lmb.h +++ b/include/asm-ppc64/lmb.h @@ -56,4 +56,26 @@ extern void lmb_dump_all(void); extern unsigned long io_hole_start; +static inline unsigned long +lmb_size_bytes(struct lmb_region *type, unsigned long region_nr) +{ + return type->region[region_nr].size; +} +static inline unsigned long +lmb_size_pages(struct lmb_region *type, unsigned long region_nr) +{ + return lmb_size_bytes(type, region_nr) >> PAGE_SHIFT; +} +static inline unsigned long +lmb_start_pfn(struct lmb_region *type, unsigned long region_nr) +{ + return type->region[region_nr].base >> PAGE_SHIFT; +} +static inline unsigned long +lmb_end_pfn(struct lmb_region *type, unsigned long region_nr) +{ + return lmb_start_pfn(type, region_nr) + + lmb_size_pages(type, region_nr); +} + #endif /* _PPC64_LMB_H */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6c90461ed99..b97054bbc39 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -487,6 +487,28 @@ struct mem_section { unsigned long section_mem_map; }; +#ifdef CONFIG_ARCH_SPARSEMEM_EXTREME +/* + * Should we ever require GCC 4 or later then the flat array scheme + * can be eliminated and a uniform solution for EXTREME and !EXTREME can + * be arrived at. + */ +#define SECTION_ROOT_SHIFT (PAGE_SHIFT-3) +#define SECTION_ROOT_MASK ((1UL<> SECTION_ROOT_SHIFT) +#define NR_SECTION_ROOTS (NR_MEM_SECTIONS >> SECTION_ROOT_SHIFT) + +extern struct mem_section *mem_section[NR_SECTION_ROOTS]; + +static inline struct mem_section *__nr_to_section(unsigned long nr) +{ + if (!mem_section[SECTION_TO_ROOT(nr)]) + return NULL; + return &mem_section[SECTION_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; +} + +#else + extern struct mem_section mem_section[NR_MEM_SECTIONS]; static inline struct mem_section *__nr_to_section(unsigned long nr) @@ -494,6 +516,10 @@ static inline struct mem_section *__nr_to_section(unsigned long nr) return &mem_section[nr]; } +#define sparse_index_init(_sec, _nid) do {} while (0) + +#endif + /* * We use the lower bits of the mem_map pointer to store * a little bit of information. There should be at least @@ -513,12 +539,12 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section) static inline int valid_section(struct mem_section *section) { - return (section->section_mem_map & SECTION_MARKED_PRESENT); + return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); } static inline int section_has_mem_map(struct mem_section *section) { - return (section->section_mem_map & SECTION_HAS_MEM_MAP); + return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); } static inline int valid_section_nr(unsigned long nr) -- cgit v1.2.3 From 3e347261a80b57df792ab9464b5f0ed59add53a8 Mon Sep 17 00:00:00 2001 From: Bob Picco Date: Sat, 3 Sep 2005 15:54:28 -0700 Subject: [PATCH] sparsemem extreme implementation With cleanups from Dave Hansen SPARSEMEM_EXTREME makes mem_section a one dimensional array of pointers to mem_sections. This two level layout scheme is able to achieve smaller memory requirements for SPARSEMEM with the tradeoff of an additional shift and load when fetching the memory section. The current SPARSEMEM implementation is a one dimensional array of mem_sections which is the default SPARSEMEM configuration. The patch attempts isolates the implementation details of the physical layout of the sparsemem section array. SPARSEMEM_EXTREME requires bootmem to be functioning at the time of memory_present() calls. This is not always feasible, so architectures which do not need it may allocate everything statically by using SPARSEMEM_STATIC. Signed-off-by: Andy Whitcroft Signed-off-by: Bob Picco Signed-off-by: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmzone.h | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'include') diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index b97054bbc39..79cf578e21b 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -487,39 +487,29 @@ struct mem_section { unsigned long section_mem_map; }; -#ifdef CONFIG_ARCH_SPARSEMEM_EXTREME -/* - * Should we ever require GCC 4 or later then the flat array scheme - * can be eliminated and a uniform solution for EXTREME and !EXTREME can - * be arrived at. - */ -#define SECTION_ROOT_SHIFT (PAGE_SHIFT-3) -#define SECTION_ROOT_MASK ((1UL<> SECTION_ROOT_SHIFT) -#define NR_SECTION_ROOTS (NR_MEM_SECTIONS >> SECTION_ROOT_SHIFT) +#ifdef CONFIG_SPARSEMEM_EXTREME +#define SECTIONS_PER_ROOT (PAGE_SIZE / sizeof (struct mem_section)) +#else +#define SECTIONS_PER_ROOT 1 +#endif -extern struct mem_section *mem_section[NR_SECTION_ROOTS]; - -static inline struct mem_section *__nr_to_section(unsigned long nr) -{ - if (!mem_section[SECTION_TO_ROOT(nr)]) - return NULL; - return &mem_section[SECTION_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; -} +#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT) +#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT) +#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) +#ifdef CONFIG_SPARSEMEM_EXTREME +extern struct mem_section *mem_section[NR_SECTION_ROOTS]; #else - -extern struct mem_section mem_section[NR_MEM_SECTIONS]; +extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; +#endif static inline struct mem_section *__nr_to_section(unsigned long nr) { - return &mem_section[nr]; + if (!mem_section[SECTION_NR_TO_ROOT(nr)]) + return NULL; + return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; } -#define sparse_index_init(_sec, _nid) do {} while (0) - -#endif - /* * We use the lower bits of the mem_map pointer to store * a little bit of information. There should be at least -- cgit v1.2.3 From 28ae55c98e4d16eac9a05a8a259d7763ef3aeb18 Mon Sep 17 00:00:00 2001 From: Dave Hansen Date: Sat, 3 Sep 2005 15:54:29 -0700 Subject: [PATCH] sparsemem extreme: hotplug preparation This splits up sparse_index_alloc() into two pieces. This is needed because we'll allocate the memory for the second level in a different place from where we actually consume it to keep the allocation from happening underneath a lock Signed-off-by: Dave Hansen Signed-off-by: Bob Picco Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmzone.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 79cf578e21b..5ed471b58f4 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -588,6 +588,7 @@ static inline int pfn_valid(unsigned long pfn) void sparse_init(void); #else #define sparse_init() do {} while (0) +#define sparse_index_init(_sec, _nid) do {} while (0) #endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_NODES_SPAN_OTHER_NODES -- cgit v1.2.3 From fd4fd5aac1282825195c6816ed40a2a6d42db5bf Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sat, 3 Sep 2005 15:54:30 -0700 Subject: [PATCH] mm: consolidate get_order Someone mentioned that almost all the architectures used basically the same implementation of get_order. This patch consolidates them into asm-generic/page.h and includes that in the appropriate places. The exceptions are ia64 and ppc which have their own (presumably optimised) versions. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/page.h | 16 ++-------------- include/asm-arm/page.h | 16 ++-------------- include/asm-arm26/page.h | 16 ++-------------- include/asm-cris/page.h | 15 ++------------- include/asm-frv/page.h | 17 ++--------------- include/asm-generic/page.h | 26 ++++++++++++++++++++++++++ include/asm-h8300/page.h | 16 ++-------------- include/asm-i386/page.h | 16 ++-------------- include/asm-m32r/page.h | 21 ++------------------- include/asm-m68k/page.h | 16 ++-------------- include/asm-m68knommu/page.h | 16 ++-------------- include/asm-mips/page.h | 16 ++-------------- include/asm-parisc/page.h | 16 ++-------------- include/asm-ppc64/page.h | 17 +++-------------- include/asm-s390/page.h | 16 ++-------------- include/asm-sh/page.h | 20 ++------------------ include/asm-sh64/page.h | 20 ++------------------ include/asm-sparc/page.h | 16 ++-------------- include/asm-sparc64/page.h | 16 ++-------------- include/asm-um/page.h | 16 ++-------------- include/asm-v850/page.h | 21 ++------------------- include/asm-x86_64/page.h | 16 ++-------------- 22 files changed, 69 insertions(+), 312 deletions(-) create mode 100644 include/asm-generic/page.h (limited to 'include') diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h index 0577daffc72..fa0b41b164a 100644 --- a/include/asm-alpha/page.h +++ b/include/asm-alpha/page.h @@ -63,20 +63,6 @@ typedef unsigned long pgprot_t; #endif /* STRICT_MM_TYPECHECKS */ -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #ifdef USE_48_BIT_KSEG #define PAGE_OFFSET 0xffff800000000000UL #else @@ -112,4 +98,6 @@ extern __inline__ int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif /* _ALPHA_PAGE_H */ diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h index 019c45d7573..4da1d532cbe 100644 --- a/include/asm-arm/page.h +++ b/include/asm-arm/page.h @@ -163,20 +163,6 @@ typedef unsigned long pgprot_t; /* the upper-most page table pointer */ extern pmd_t *top_pmd; -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #include #endif /* !__ASSEMBLY__ */ @@ -186,4 +172,6 @@ static inline int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif diff --git a/include/asm-arm26/page.h b/include/asm-arm26/page.h index c334079b082..d3f23ac4d46 100644 --- a/include/asm-arm26/page.h +++ b/include/asm-arm26/page.h @@ -89,20 +89,6 @@ typedef unsigned long pgprot_t; #ifdef __KERNEL__ #ifndef __ASSEMBLY__ -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #include #endif /* !__ASSEMBLY__ */ @@ -112,4 +98,6 @@ static inline int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index bbf17bd3938..c99c478c482 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h @@ -70,19 +70,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; #ifndef __ASSEMBLY__ -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} #endif /* __ASSEMBLY__ */ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ @@ -90,5 +77,7 @@ static inline int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif /* _CRIS_PAGE_H */ diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h index f7914f1782b..4feba567e7f 100644 --- a/include/asm-frv/page.h +++ b/include/asm-frv/page.h @@ -45,21 +45,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) __attribute_const__; -static inline int get_order(unsigned long size) -{ - int order; - - size = (size - 1) >> (PAGE_SHIFT - 1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #define devmem_is_allowed(pfn) 1 #define __pa(vaddr) virt_to_phys((void *) vaddr) @@ -102,4 +87,6 @@ extern unsigned long max_pfn; #define WANT_PAGE_VIRTUAL 1 #endif +#include + #endif /* _ASM_PAGE_H */ diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h new file mode 100644 index 00000000000..a96b5d986b6 --- /dev/null +++ b/include/asm-generic/page.h @@ -0,0 +1,26 @@ +#ifndef _ASM_GENERIC_PAGE_H +#define _ASM_GENERIC_PAGE_H + +#ifdef __KERNEL__ +#ifndef __ASSEMBLY__ + +#include + +/* Pure 2^n version of get_order */ +static __inline__ __attribute_const__ int get_order(unsigned long size) +{ + int order; + + size = (size - 1) >> (PAGE_SHIFT - 1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + +#endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + +#endif /* _ASM_GENERIC_PAGE_H */ diff --git a/include/asm-h8300/page.h b/include/asm-h8300/page.h index e3b7960d445..e8c02b8c2d9 100644 --- a/include/asm-h8300/page.h +++ b/include/asm-h8300/page.h @@ -54,20 +54,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - extern unsigned long memory_start; extern unsigned long memory_end; @@ -101,4 +87,6 @@ extern unsigned long memory_end; #endif /* __KERNEL__ */ +#include + #endif /* _H8300_PAGE_H */ diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 8d93f732d72..10045fd8210 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -104,20 +104,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; */ extern unsigned int __VMALLOC_RESERVE; -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - extern int sysctl_legacy_va_layout; extern int page_is_ram(unsigned long pagenr); @@ -156,4 +142,6 @@ extern int page_is_ram(unsigned long pagenr); #endif /* __KERNEL__ */ +#include + #endif /* _I386_PAGE_H */ diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h index 1c6abb9f3f1..4ab57887636 100644 --- a/include/asm-m32r/page.h +++ b/include/asm-m32r/page.h @@ -61,25 +61,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* This handles the memory map.. */ -#ifndef __ASSEMBLY__ - -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size - 1) >> (PAGE_SHIFT - 1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - - return order; -} - -#endif /* __ASSEMBLY__ */ - #define __MEMORY_START CONFIG_MEMORY_START #define __MEMORY_SIZE CONFIG_MEMORY_SIZE @@ -111,5 +92,7 @@ static __inline__ int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif /* _ASM_M32R_PAGE_H */ diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 206313e2a81..f206dfbc1d4 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -107,20 +107,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #endif /* !__ASSEMBLY__ */ #include @@ -192,4 +178,6 @@ static inline void *__va(unsigned long x) #endif /* __KERNEL__ */ +#include + #endif /* _M68K_PAGE_H */ diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h index ff6a9265ed1..942dfbead27 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h @@ -48,20 +48,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - extern unsigned long memory_start; extern unsigned long memory_end; @@ -93,4 +79,6 @@ extern unsigned long memory_end; #endif /* __KERNEL__ */ +#include + #endif /* _M68KNOMMU_PAGE_H */ diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index 5cae35cd9ba..652b6d67a57 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -103,20 +103,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #endif /* !__ASSEMBLY__ */ /* to align the pointer to the (next) page boundary */ @@ -148,4 +134,6 @@ static __inline__ int get_order(unsigned long size) #define WANT_PAGE_VIRTUAL #endif +#include + #endif /* _ASM_PAGE_H */ diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index 4a12692f94b..44eae9f8274 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h @@ -74,20 +74,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define __pgd(x) ((pgd_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } ) -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - typedef struct __physmem_range { unsigned long start_pfn; unsigned long pages; /* PAGE_SIZE pages */ @@ -159,4 +145,6 @@ extern int npmem_ranges; #endif /* __KERNEL__ */ +#include + #endif /* _PARISC_PAGE_H */ diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h index a79a08df62b..a15422bcf30 100644 --- a/include/asm-ppc64/page.h +++ b/include/asm-ppc64/page.h @@ -172,20 +172,6 @@ typedef unsigned long pgprot_t; #endif -/* Pure 2^n version of get_order */ -static inline int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) extern int page_is_ram(unsigned long pfn); @@ -270,4 +256,7 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */ VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) #endif /* __KERNEL__ */ + +#include + #endif /* _PPC64_PAGE_H */ diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h index 2be287b9df8..2430c561e02 100644 --- a/include/asm-s390/page.h +++ b/include/asm-s390/page.h @@ -111,20 +111,6 @@ static inline void copy_page(void *to, void *from) #define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) #define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - /* * These are used to make use of C type-checking.. */ @@ -207,4 +193,6 @@ page_get_storage_key(unsigned long addr) #endif /* __KERNEL__ */ +#include + #endif /* _S390_PAGE_H */ diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 180467be8e7..324e6cc5ecf 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h @@ -122,24 +122,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#ifndef __ASSEMBLY__ - -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - -#endif - #endif /* __KERNEL__ */ +#include + #endif /* __ASM_SH_PAGE_H */ diff --git a/include/asm-sh64/page.h b/include/asm-sh64/page.h index d6167f1c0e9..c86df90f7cb 100644 --- a/include/asm-sh64/page.h +++ b/include/asm-sh64/page.h @@ -115,24 +115,8 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#ifndef __ASSEMBLY__ - -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - -#endif - #endif /* __KERNEL__ */ +#include + #endif /* __ASM_SH64_PAGE_H */ diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h index 383060e90d9..9122684f6c1 100644 --- a/include/asm-sparc/page.h +++ b/include/asm-sparc/page.h @@ -132,20 +132,6 @@ BTFIXUPDEF_SETHI(sparc_unmapped_base) #define TASK_UNMAPPED_BASE BTFIXUP_SETHI(sparc_unmapped_base) -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #else /* !(__ASSEMBLY__) */ #define __pgprot(x) (x) @@ -178,4 +164,6 @@ extern unsigned long pfn_base; #endif /* __KERNEL__ */ +#include + #endif /* _SPARC_PAGE_H */ diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index b87dbbd64bc..c9f8ef208ea 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h @@ -150,20 +150,6 @@ struct sparc_phys_banks { extern struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS]; -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #endif /* !(__ASSEMBLY__) */ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ @@ -171,4 +157,6 @@ static __inline__ int get_order(unsigned long size) #endif /* !(__KERNEL__) */ +#include + #endif /* !(_SPARC64_PAGE_H) */ diff --git a/include/asm-um/page.h b/include/asm-um/page.h index f58aedadeb4..bd850a24918 100644 --- a/include/asm-um/page.h +++ b/include/asm-um/page.h @@ -116,24 +116,12 @@ extern void *to_virt(unsigned long phys); #define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) -/* Pure 2^n version of get_order */ -static __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - extern struct page *arch_validate(struct page *page, int mask, int order); #define HAVE_ARCH_VALIDATE extern void arch_free_page(struct page *page, int order); #define HAVE_ARCH_FREE_PAGE +#include + #endif diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h index d6091622935..b4bc85e7b91 100644 --- a/include/asm-v850/page.h +++ b/include/asm-v850/page.h @@ -98,25 +98,6 @@ typedef unsigned long pgprot_t; #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK) -#ifndef __ASSEMBLY__ - -/* Pure 2^n version of get_order */ -extern __inline__ int get_order (unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - -#endif /* !__ASSEMBLY__ */ - - /* No current v850 processor has virtual memory. */ #define __virt_to_phys(addr) (addr) #define __phys_to_virt(addr) (addr) @@ -144,4 +125,6 @@ extern __inline__ int get_order (unsigned long size) #endif /* KERNEL */ +#include + #endif /* __V850_PAGE_H__ */ diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index 431318764af..fcf890aa8c8 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h @@ -92,20 +92,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; #include -/* Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) -{ - int order; - - size = (size-1) >> (PAGE_SHIFT-1); - order = -1; - do { - size >>= 1; - order++; - } while (size); - return order; -} - #endif /* __ASSEMBLY__ */ #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) @@ -141,4 +127,6 @@ extern __inline__ int get_order(unsigned long size) #endif /* __KERNEL__ */ +#include + #endif /* _X86_64_PAGE_H */ -- cgit v1.2.3 From 11d31886dbcb61039ed3789e583d21c6e70960fd Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 3 Sep 2005 15:54:34 -0700 Subject: [PATCH] swap: swap extent list is ordered There are several comments that swap's extent_list.prev points to the lowest extent: that's not so, it's extent_list.next which points to it, as you'd expect. And a couple of loops in add_swap_extent which go all the way through the list, when they should just add to the other end. Fix those up, and let map_swap_page search the list forwards: profiles shows it to be twice as quick that way - because prefetch works better on how the structs are typically kmalloc'ed? or because usually more is written to than read from swap, and swap is allocated ascendingly? Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index bfe3e763ccf..38f288475e6 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -116,8 +116,6 @@ enum { /* * The in-memory structure used to track swap areas. - * extent_list.prev points at the lowest-index extent. That list is - * sorted. */ struct swap_info_struct { unsigned int flags; -- cgit v1.2.3 From 53092a7402f227151a681b0c92ec8598c5618b1a Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 3 Sep 2005 15:54:34 -0700 Subject: [PATCH] swap: show span of swap extents The "Adding %dk swap" message shows the number of swap extents, as a guide to how fragmented the swapfile may be. But a useful further guide is what total extent they span across (sometimes scarily large). And there's no need to keep nr_extents in swap_info: it's unused after the initial message, so save a little space by keeping it on stack. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index 38f288475e6..f2b16ac0b53 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -123,7 +123,6 @@ struct swap_info_struct { struct file *swap_file; struct block_device *bdev; struct list_head extent_list; - int nr_extents; struct swap_extent *curr_swap_extent; unsigned old_block_size; unsigned short * swap_map; -- cgit v1.2.3 From 6eb396dc4a9781c5e7951143ab56ce5710687ab3 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 3 Sep 2005 15:54:35 -0700 Subject: [PATCH] swap: swap unsigned int consistency The swap header's unsigned int last_page determines the range of swap pages, but swap_info has been using int or unsigned long in some cases: use unsigned int throughout (except, in several places a local unsigned long is useful to avoid overflows when adding). Signed-off-by: Hugh Dickins Signed-off-by: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index f2b16ac0b53..93f0eca7f91 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -130,10 +130,10 @@ struct swap_info_struct { unsigned int highest_bit; unsigned int cluster_next; unsigned int cluster_nr; + unsigned int pages; + unsigned int max; + unsigned int inuse_pages; int prio; /* swap priority */ - int pages; - unsigned long max; - unsigned long inuse_pages; int next; /* next entry on swap list */ }; -- cgit v1.2.3 From 52b7efdbe5f5696fc80338560a3fc51e0b0a993c Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 3 Sep 2005 15:54:39 -0700 Subject: [PATCH] swap: scan_swap_map drop swap_device_lock get_swap_page has often shown up on latency traces, doing lengthy scans while holding two spinlocks. swap_list_lock is already dropped, now scan_swap_map drop swap_device_lock before scanning the swap_map. While scanning for an empty cluster, don't worry that racing tasks may allocate what was free and free what was allocated; but when allocating an entry, check it's still free after retaking the lock. Avoid dropping the lock in the expected common path. No barriers beyond the locks, just let the cookie crumble; highest_bit limit is volatile, but benign. Guard against swapoff: must check SWP_WRITEOK before allocating, must raise SWP_SCANNING reference count while in scan_swap_map, swapoff wait for that to fall - just use schedule_timeout, we don't want to burden scan_swap_map itself, and it's very unlikely that anyone can really still be in scan_swap_map once swapoff gets this far. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index 93f0eca7f91..db3b5de7c92 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -107,6 +107,8 @@ enum { SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), + /* add others here before... */ + SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ }; #define SWAP_CLUSTER_MAX 32 -- cgit v1.2.3 From 5d337b9194b1ce3b6fd5f3cb2799455ed2f9a3d1 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 3 Sep 2005 15:54:41 -0700 Subject: [PATCH] swap: swap_lock replace list+device The idea of a swap_device_lock per device, and a swap_list_lock over them all, is appealing; but in practice almost every holder of swap_device_lock must already hold swap_list_lock, which defeats the purpose of the split. The only exceptions have been swap_duplicate, valid_swaphandles and an untrodden path in try_to_unuse (plus a few places added in this series). valid_swaphandles doesn't show up high in profiles, but swap_duplicate does demand attention. However, with the hold time in get_swap_pages so much reduced, I've not yet found a load and set of swap device priorities to show even swap_duplicate benefitting from the split. Certainly the split is mere overhead in the common case of a single swap device. So, replace swap_list_lock and swap_device_lock by spinlock_t swap_lock (generally we seem to prefer an _ in the name, and not hide in a macro). If someone can show a regression in swap_duplicate, then probably we should add a hashlock for the swap_map entries alone (shorts being anatomic), so as to help the case of the single swap device too. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index db3b5de7c92..3c9ff004815 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -121,7 +121,7 @@ enum { */ struct swap_info_struct { unsigned int flags; - spinlock_t sdev_lock; + int prio; /* swap priority */ struct file *swap_file; struct block_device *bdev; struct list_head extent_list; @@ -135,7 +135,6 @@ struct swap_info_struct { unsigned int pages; unsigned int max; unsigned int inuse_pages; - int prio; /* swap priority */ int next; /* next entry on swap list */ }; @@ -221,13 +220,7 @@ extern int can_share_swap_page(struct page *); extern int remove_exclusive_swap_page(struct page *); struct backing_dev_info; -extern struct swap_list_t swap_list; -extern spinlock_t swaplock; - -#define swap_list_lock() spin_lock(&swaplock) -#define swap_list_unlock() spin_unlock(&swaplock) -#define swap_device_lock(p) spin_lock(&p->sdev_lock) -#define swap_device_unlock(p) spin_unlock(&p->sdev_lock) +extern spinlock_t swap_lock; /* linux/mm/thrash.c */ extern struct mm_struct * swap_token_mm; -- cgit v1.2.3 From 6e21c8f145f5052c1c2fb4a4b41bee01c848159b Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Sat, 3 Sep 2005 15:54:45 -0700 Subject: [PATCH] /proc//numa_maps to show on which nodes pages reside This patch was recently discussed on linux-mm: http://marc.theaimsgroup.com/?t=112085728500002&r=1&w=2 I inherited a large code base from Ray for page migration. There was a small patch in there that I find to be very useful since it allows the display of the locality of the pages in use by a process. I reworked that patch and came up with a /proc//numa_maps that gives more information about the vma's of a process. numa_maps is indexes by the start address found in /proc//maps. F.e. with this patch you can see the page use of the "getty" process: margin:/proc/12008 # cat maps 00000000-00004000 r--p 00000000 00:00 0 2000000000000000-200000000002c000 r-xp 00000000 08:04 516 /lib/ld-2.3.3.so 2000000000038000-2000000000040000 rw-p 00028000 08:04 516 /lib/ld-2.3.3.so 2000000000040000-2000000000044000 rw-p 2000000000040000 00:00 0 2000000000058000-2000000000260000 r-xp 00000000 08:04 54707842 /lib/tls/libc.so.6.1 2000000000260000-2000000000268000 ---p 00208000 08:04 54707842 /lib/tls/libc.so.6.1 2000000000268000-2000000000274000 rw-p 00200000 08:04 54707842 /lib/tls/libc.so.6.1 2000000000274000-2000000000280000 rw-p 2000000000274000 00:00 0 2000000000280000-20000000002b4000 r--p 00000000 08:04 9126923 /usr/lib/locale/en_US.utf8/LC_CTYPE 2000000000300000-2000000000308000 r--s 00000000 08:04 60071467 /usr/lib/gconv/gconv-modules.cache 2000000000318000-2000000000328000 rw-p 2000000000318000 00:00 0 4000000000000000-4000000000008000 r-xp 00000000 08:04 29576399 /sbin/mingetty 6000000000004000-6000000000008000 rw-p 00004000 08:04 29576399 /sbin/mingetty 6000000000008000-600000000002c000 rw-p 6000000000008000 00:00 0 [heap] 60000fff7fffc000-60000fff80000000 rw-p 60000fff7fffc000 00:00 0 60000ffffff44000-60000ffffff98000 rw-p 60000ffffff44000 00:00 0 [stack] a000000000000000-a000000000020000 ---p 00000000 00:00 0 [vdso] cat numa_maps 2000000000000000 default MaxRef=43 Pages=11 Mapped=11 N0=4 N1=3 N2=2 N3=2 2000000000038000 default MaxRef=1 Pages=2 Mapped=2 Anon=2 N0=2 2000000000040000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N0=1 2000000000058000 default MaxRef=43 Pages=61 Mapped=61 N0=14 N1=15 N2=16 N3=16 2000000000268000 default MaxRef=1 Pages=2 Mapped=2 Anon=2 N0=2 2000000000274000 default MaxRef=1 Pages=3 Mapped=3 Anon=3 N0=3 2000000000280000 default MaxRef=8 Pages=3 Mapped=3 N0=3 2000000000300000 default MaxRef=8 Pages=2 Mapped=2 N0=2 2000000000318000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N2=1 4000000000000000 default MaxRef=6 Pages=2 Mapped=2 N1=2 6000000000004000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N0=1 6000000000008000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N0=1 60000fff7fffc000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N0=1 60000ffffff44000 default MaxRef=1 Pages=1 Mapped=1 Anon=1 N0=1 getty uses ld.so. The first vma is the code segment which is used by 43 other processes and the pages are evenly distributed over the 4 nodes. The second vma is the process specific data portion for ld.so. This is only one page. The display format is: Links to information in /proc//map This can be "default" "interleave={}", "prefer=" or "bind={}" MaxRef= Pages= Mapped= Anon= Nx= The content of the proc-file is self-evident. If this would be tied into the sparsemem system then the contents of this file would not be too useful. Signed-off-by: Christoph Lameter Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mempolicy.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 8480aef10e6..94a46f38c53 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -150,6 +150,9 @@ void mpol_free_shared_policy(struct shared_policy *p); struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx); +struct mempolicy *get_vma_policy(struct task_struct *task, + struct vm_area_struct *vma, unsigned long addr); + extern void numa_default_policy(void); extern void numa_policy_init(void); -- cgit v1.2.3 From 242e54686257493f0b10ac557e730419d9af7d24 Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Sat, 3 Sep 2005 15:54:50 -0700 Subject: [PATCH] mm: remove atomic This bitop does not need to be atomic because it is performed when there will be no references to the page (ie. the page is being freed). Signed-off-by: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/page-flags.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f5a6695d4d2..99f7cc49506 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -194,6 +194,7 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta); #define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) #define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags) #define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) +#define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) -- cgit v1.2.3 From bce5f6ba340b09d8b29902add204bb95a6d3d88b Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Sat, 3 Sep 2005 15:54:50 -0700 Subject: [PATCH] VM: add capabilites check to set_zone_reclaim Add a capability check to sys_set_zone_reclaim(). This syscall is not something that should be available to a user. Signed-off-by: Martin Hicks Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/capability.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/capability.h b/include/linux/capability.h index 8d139f4acf2..6b4618902d3 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t; /* Allow enabling/disabling tagged queuing on SCSI controllers and sending arbitrary SCSI commands */ /* Allow setting encryption key on loopback filesystem */ +/* Allow setting zone reclaim policy */ #define CAP_SYS_ADMIN 21 -- cgit v1.2.3 From e83a9596712eb784e7e6604f43a2c140eb912743 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Sat, 3 Sep 2005 15:54:53 -0700 Subject: [PATCH] comment typo fix smp_entry_t -> swap_entry_t Signed-off-by: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swapops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/swapops.h b/include/linux/swapops.h index d4c7db35e70..87b9d14c710 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h @@ -4,7 +4,7 @@ * the low-order bits. * * We arrange the `type' and `offset' fields so that `type' is at the five - * high-order bits of the smp_entry_t and `offset' is right-aligned in the + * high-order bits of the swp_entry_t and `offset' is right-aligned in the * remaining bits. * * swp_entry_t's are *never* stored anywhere in their arch-dependent format. -- cgit v1.2.3 From 9b4ee40ebbbaf3f8c775b023d89ceedda1167d79 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Sat, 3 Sep 2005 15:54:57 -0700 Subject: [PATCH] mm: correct _PAGE_FILE comment _PAGE_FILE does not indicate whether a file is in page / swap cache, it is set just for non-linear PTE's. Correct the comment for i386, x86_64, UML. Also clearify _PAGE_NONE. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/pgtable.h | 10 +++++----- include/asm-um/pgtable.h | 8 +++++--- include/asm-x86_64/pgtable.h | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 77c6497f416..c797286b512 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -86,9 +86,7 @@ void paging_init(void); #endif /* - * The 4MB page is guessing.. Detailed in the infamous "Chapter H" - * of the Pentium details, but assuming intel did the straightforward - * thing, this bit set in the page directory entry just means that + * _PAGE_PSE set in the page directory entry just means that * the page directory entry points directly to a 4MB-aligned block of * memory. */ @@ -119,8 +117,10 @@ void paging_init(void); #define _PAGE_UNUSED2 0x400 #define _PAGE_UNUSED3 0x800 -#define _PAGE_FILE 0x040 /* set:pagecache unset:swap */ -#define _PAGE_PROTNONE 0x080 /* If not present */ +/* If _PAGE_PRESENT is clear, we use these: */ +#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */ +#define _PAGE_PROTNONE 0x080 /* if the user mapped it with PROT_NONE; + pte_present gives true */ #ifdef CONFIG_X86_PAE #define _PAGE_NX (1ULL<<_PAGE_BIT_NX) #else diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index a8804092031..e9336f616f9 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -16,13 +16,15 @@ #define _PAGE_PRESENT 0x001 #define _PAGE_NEWPAGE 0x002 -#define _PAGE_NEWPROT 0x004 -#define _PAGE_FILE 0x008 /* set:pagecache unset:swap */ -#define _PAGE_PROTNONE 0x010 /* If not present */ +#define _PAGE_NEWPROT 0x004 #define _PAGE_RW 0x020 #define _PAGE_USER 0x040 #define _PAGE_ACCESSED 0x080 #define _PAGE_DIRTY 0x100 +/* If _PAGE_PRESENT is clear, we use these: */ +#define _PAGE_FILE 0x008 /* nonlinear file mapping, saved PTE; unset:swap */ +#define _PAGE_PROTNONE 0x010 /* if the user mapped it with PROT_NONE; + pte_present gives true */ #ifdef CONFIG_3_LEVEL_PGTABLES #include "asm/pgtable-3level.h" diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 4e167b5ea8f..20476d12989 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -143,7 +143,7 @@ extern inline void pgd_clear (pgd_t * pgd) #define _PAGE_ACCESSED 0x020 #define _PAGE_DIRTY 0x040 #define _PAGE_PSE 0x080 /* 2MB page */ -#define _PAGE_FILE 0x040 /* set:pagecache, unset:swap */ +#define _PAGE_FILE 0x040 /* nonlinear file mapping, saved PTE; unset:swap */ #define _PAGE_GLOBAL 0x100 /* Global TLB entry */ #define _PAGE_PROTNONE 0x080 /* If not present */ -- cgit v1.2.3 From fd195c49fb17a21e232f50bddb2267150053cf34 Mon Sep 17 00:00:00 2001 From: Deepak Saxena Date: Sat, 3 Sep 2005 15:54:58 -0700 Subject: [PATCH] arm: allow for arch-specific IOREMAP_MAX_ORDER Version 6 of the ARM architecture introduces the concept of 16MB pages (supersections) and 36-bit (40-bit actually, but nobody uses this) physical addresses. 36-bit addressed memory and I/O and ARMv6 can only be mapped using supersections and the requirement on these is that both virtual and physical addresses be 16MB aligned. In trying to add support for ioremap() of 36-bit I/O, we run into the issue that get_vm_area() allows for a maximum of 512K alignment via the IOREMAP_MAX_ORDER constant. To work around this, we can: - Allocate a larger VM area than needed (size + (1ul << IOREMAP_MAX_ORDER)) and then align the pointer ourselves, but this ends up with 512K of wasted VM per ioremap(). - Provide a new __get_vm_area_aligned() API and make __get_vm_area() sit on top of this. I did this and it works but I don't like the idea adding another VM API just for this one case. - My preferred solution which is to allow the architecture to override the IOREMAP_MAX_ORDER constant with it's own version. Signed-off-by: Deepak Saxena Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/vmalloc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 6409d9cf596..b244f69ef68 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -10,6 +10,14 @@ #define VM_MAP 0x00000004 /* vmap()ed pages */ /* bits [20..32] reserved for arch specific ioremap internals */ +/* + * Maximum alignment for ioremap() regions. + * Can be overriden by arch-specific value. + */ +#ifndef IOREMAP_MAX_ORDER +#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ +#endif + struct vm_struct { void *addr; unsigned long size; -- cgit v1.2.3 From 32e51a8c976fc72c3e9bcece9767d9908816bf8e Mon Sep 17 00:00:00 2001 From: Adam Litke Date: Sat, 3 Sep 2005 15:54:59 -0700 Subject: [PATCH] hugetlb: add pte_huge() macro This patch adds a macro pte_huge(pte) for i386/x86_64 which is needed by a patch later in the series. Instead of repeating (_PAGE_PRESENT | _PAGE_PSE), I've added __LARGE_PTE to i386 to match x86_64. Signed-off-by: Adam Litke Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/pgtable.h | 4 +++- include/asm-x86_64/pgtable.h | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index c797286b512..f51fd2c956b 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -215,11 +215,13 @@ extern unsigned long pg0[]; * The following only work if pte_present() is true. * Undefined behaviour if not.. */ +#define __LARGE_PTE (_PAGE_PSE | _PAGE_PRESENT) static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } static inline int pte_dirty(pte_t pte) { return (pte).pte_low & _PAGE_DIRTY; } static inline int pte_young(pte_t pte) { return (pte).pte_low & _PAGE_ACCESSED; } static inline int pte_write(pte_t pte) { return (pte).pte_low & _PAGE_RW; } +static inline int pte_huge(pte_t pte) { return ((pte).pte_low & __LARGE_PTE) == __LARGE_PTE; } /* * The following only works if pte_present() is not true. @@ -236,7 +238,7 @@ static inline pte_t pte_mkexec(pte_t pte) { (pte).pte_low |= _PAGE_USER; return static inline pte_t pte_mkdirty(pte_t pte) { (pte).pte_low |= _PAGE_DIRTY; return pte; } static inline pte_t pte_mkyoung(pte_t pte) { (pte).pte_low |= _PAGE_ACCESSED; return pte; } static inline pte_t pte_mkwrite(pte_t pte) { (pte).pte_low |= _PAGE_RW; return pte; } -static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PRESENT | _PAGE_PSE; return pte; } +static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= __LARGE_PTE; return pte; } #ifdef CONFIG_X86_PAE # include diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index 20476d12989..a1ada852f00 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -247,6 +247,7 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) * The following only work if pte_present() is true. * Undefined behaviour if not.. */ +#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) static inline int pte_user(pte_t pte) { return pte_val(pte) & _PAGE_USER; } extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; } @@ -254,8 +255,8 @@ extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } extern inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } extern inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } +static inline int pte_huge(pte_t pte) { return (pte_val(pte) & __LARGE_PTE) == __LARGE_PTE; } -#define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; } extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } -- cgit v1.2.3 From 0e5c9f39f64d8a55c5db37a5ea43e37d3422fd92 Mon Sep 17 00:00:00 2001 From: "Chen, Kenneth W" Date: Sat, 3 Sep 2005 15:55:02 -0700 Subject: [PATCH] remove hugetlb_clean_stale_pgtable() and fix huge_pte_alloc() I don't think we need to call hugetlb_clean_stale_pgtable() anymore in 2.6.13 because of the rework with free_pgtables(). It now collect all the pte page at the time of munmap. It used to only collect page table pages when entire one pgd can be freed and left with staled pte pages. Not anymore with 2.6.13. This function will never be called and We should turn it into a BUG_ON. I also spotted two problems here, not Adam's fault :-) (1) in huge_pte_alloc(), it looks like a bug to me that pud is not checked before calling pmd_alloc() (2) in hugetlb_clean_stale_pgtable(), it also missed a call to pmd_free_tlb. I think a tlb flush is required to flush the mapping for the page table itself when we clear out the pmd pointing to a pte page. However, since hugetlb_clean_stale_pgtable() is never called, so it won't trigger the bug. Signed-off-by: Ken Chen Cc: Adam Litke Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/page.h | 1 - include/asm-x86_64/page.h | 1 - include/linux/hugetlb.h | 6 ------ 3 files changed, 8 deletions(-) (limited to 'include') diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 10045fd8210..73296d9924f 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -68,7 +68,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA -#define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE #endif #define pgd_val(x) ((x).pgd) diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h index fcf890aa8c8..135ffaa0393 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86_64/page.h @@ -28,7 +28,6 @@ #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) #define HPAGE_MASK (~(HPAGE_SIZE - 1)) #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) -#define ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE #ifdef __KERNEL__ #ifndef __ASSEMBLY__ diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f529d144281..e670b0d13fe 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -70,12 +70,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, void hugetlb_prefault_arch_hook(struct mm_struct *mm); #endif -#ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE -#define hugetlb_clean_stale_pgtable(pte) BUG() -#else -void hugetlb_clean_stale_pgtable(pte_t *pte); -#endif - #else /* !CONFIG_HUGETLB_PAGE */ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) -- cgit v1.2.3 From fa5b08d5f818063d18433194f20359ef2ae50254 Mon Sep 17 00:00:00 2001 From: Kyle Moffett Date: Sat, 3 Sep 2005 15:55:03 -0700 Subject: [PATCH] sab: consolidate kmem_bufctl_t This is used only in slab.c and each architecture gets to define whcih underlying type is to be used. Seems a bit silly - move it to slab.c and use the same type for all architectures: unsigned int. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/types.h | 2 -- include/asm-arm/types.h | 2 -- include/asm-arm26/types.h | 2 -- include/asm-cris/types.h | 2 -- include/asm-frv/types.h | 2 -- include/asm-h8300/types.h | 2 -- include/asm-i386/types.h | 2 -- include/asm-ia64/types.h | 2 -- include/asm-m32r/types.h | 2 -- include/asm-m68k/types.h | 2 -- include/asm-mips/types.h | 2 -- include/asm-parisc/types.h | 2 -- include/asm-ppc/types.h | 2 -- include/asm-ppc64/types.h | 1 - include/asm-s390/types.h | 2 -- include/asm-sh/types.h | 2 -- include/asm-sh64/types.h | 2 -- include/asm-sparc/types.h | 2 -- include/asm-sparc64/types.h | 2 -- include/asm-v850/types.h | 2 -- include/asm-x86_64/types.h | 2 -- include/asm-xtensa/types.h | 2 -- 22 files changed, 43 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h index 43264d21924..f5716139ec8 100644 --- a/include/asm-alpha/types.h +++ b/include/asm-alpha/types.h @@ -56,8 +56,6 @@ typedef unsigned long u64; typedef u64 dma_addr_t; typedef u64 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* _ALPHA_TYPES_H */ diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h index f4c92e4c8c0..22992ee0627 100644 --- a/include/asm-arm/types.h +++ b/include/asm-arm/types.h @@ -52,8 +52,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u32 dma64_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-arm26/types.h b/include/asm-arm26/types.h index 56cbe573a23..81bd357ada0 100644 --- a/include/asm-arm26/types.h +++ b/include/asm-arm26/types.h @@ -52,8 +52,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u32 dma64_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h index 8fa6d6c7afc..84557c9bac9 100644 --- a/include/asm-cris/types.h +++ b/include/asm-cris/types.h @@ -52,8 +52,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u32 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h index 1a5b6546bb4..50605df6d8a 100644 --- a/include/asm-frv/types.h +++ b/include/asm-frv/types.h @@ -65,8 +65,6 @@ typedef u64 u_quad_t; typedef u32 dma_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h index 21f4fc07ac0..bf91e0d4dde 100644 --- a/include/asm-h8300/types.h +++ b/include/asm-h8300/types.h @@ -58,8 +58,6 @@ typedef u32 dma_addr_t; #define HAVE_SECTOR_T typedef u64 sector_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ diff --git a/include/asm-i386/types.h b/include/asm-i386/types.h index 901b77c42b8..ced00fe8fe6 100644 --- a/include/asm-i386/types.h +++ b/include/asm-i386/types.h @@ -63,8 +63,6 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h index a677565aa95..902850d1242 100644 --- a/include/asm-ia64/types.h +++ b/include/asm-ia64/types.h @@ -67,8 +67,6 @@ typedef __u64 u64; typedef u64 dma_addr_t; -typedef unsigned short kmem_bufctl_t; - # endif /* __KERNEL__ */ #endif /* !__ASSEMBLY__ */ diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h index ca0a887d223..fcf24c64c3b 100644 --- a/include/asm-m32r/types.h +++ b/include/asm-m32r/types.h @@ -55,8 +55,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u64 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h index f391cbe39b9..b5a1febc97d 100644 --- a/include/asm-m68k/types.h +++ b/include/asm-m68k/types.h @@ -60,8 +60,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u32 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h index d2f0c76b00a..b949ab33e8e 100644 --- a/include/asm-mips/types.h +++ b/include/asm-mips/types.h @@ -99,8 +99,6 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h index 8fe7a44ea20..d21b9d0d63e 100644 --- a/include/asm-parisc/types.h +++ b/include/asm-parisc/types.h @@ -56,8 +56,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u64 dma64_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index a787bc03258..77dc24d7d2a 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -62,8 +62,6 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-ppc64/types.h b/include/asm-ppc64/types.h index 5b8c2cfa113..bf294c1761b 100644 --- a/include/asm-ppc64/types.h +++ b/include/asm-ppc64/types.h @@ -72,7 +72,6 @@ typedef struct { unsigned long env; } func_descr_t; -typedef unsigned int kmem_bufctl_t; #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h index 3fefd61416a..d0be3e47701 100644 --- a/include/asm-s390/types.h +++ b/include/asm-s390/types.h @@ -79,8 +79,6 @@ typedef unsigned long u64; typedef u32 dma_addr_t; -typedef unsigned int kmem_bufctl_t; - #ifndef __s390x__ typedef union { unsigned long long pair; diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h index c4dc126c562..cb7e183a0a6 100644 --- a/include/asm-sh/types.h +++ b/include/asm-sh/types.h @@ -58,8 +58,6 @@ typedef u64 sector_t; #define HAVE_SECTOR_T #endif -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-sh64/types.h b/include/asm-sh64/types.h index 41d4d2f82aa..8d41db2153b 100644 --- a/include/asm-sh64/types.h +++ b/include/asm-sh64/types.h @@ -65,8 +65,6 @@ typedef u32 dma_addr_t; #endif typedef u64 dma64_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #define BITS_PER_LONG 32 diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h index 9eabf6e61cc..42fc6ed9815 100644 --- a/include/asm-sparc/types.h +++ b/include/asm-sparc/types.h @@ -54,8 +54,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; typedef u32 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h index 6248ed1a9a7..d0ee7f10583 100644 --- a/include/asm-sparc64/types.h +++ b/include/asm-sparc64/types.h @@ -56,8 +56,6 @@ typedef unsigned long u64; typedef u32 dma_addr_t; typedef u64 dma64_addr_t; -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h index e7cfe5b33a1..dcef5719687 100644 --- a/include/asm-v850/types.h +++ b/include/asm-v850/types.h @@ -59,8 +59,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-x86_64/types.h b/include/asm-x86_64/types.h index 32bd1426b52..c86c2e6793e 100644 --- a/include/asm-x86_64/types.h +++ b/include/asm-x86_64/types.h @@ -51,8 +51,6 @@ typedef u64 dma_addr_t; typedef u64 sector_t; #define HAVE_SECTOR_T -typedef unsigned short kmem_bufctl_t; - #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h index ebac0046985..9d99a8e9e33 100644 --- a/include/asm-xtensa/types.h +++ b/include/asm-xtensa/types.h @@ -58,8 +58,6 @@ typedef unsigned long long u64; typedef u32 dma_addr_t; -typedef unsigned int kmem_bufctl_t; - #endif /* __KERNEL__ */ #endif -- cgit v1.2.3 From a600388d28419305aad3c4c0af52c223cf6fa0af Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:55:04 -0700 Subject: [PATCH] x86: ptep_clear optimization Add a new accessor for PTEs, which passes the full hint from the mmu_gather struct; this allows architectures with hardware pagetables to optimize away atomic PTE operations when destroying an address space. Removing the locked operation should allow better pipelining of memory access in this loop. I measured an average savings of 30-35 cycles per zap_pte_range on the first 500 destructions on Pentium-M, but I believe the optimization would win more on older processors which still assert the bus lock on xchg for an exclusive cacheline. Update: I made some new measurements, and this saves exactly 26 cycles over ptep_get_and_clear on Pentium M. On P4, with a PAE kernel, this saves 180 cycles per ptep_get_and_clear, for a whopping 92160 cycles savings for a full address space destruction. pte_clear_full is not yet used, but is provided for future optimizations (in particular, when running inside of a hypervisor that queues page table updates, the full hint allows us to avoid queueing unnecessary page table update for an address space in the process of being destroyed. This is not a huge win, but it does help a bit, and sets the stage for further hypervisor optimization of the mm layer on all architectures. Signed-off-by: Zachary Amsden Cc: Christoph Lameter Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/pgtable.h | 16 ++++++++++++++++ include/asm-i386/pgtable.h | 13 +++++++++++++ 2 files changed, 29 insertions(+) (limited to 'include') diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f4059356517..f86c1e54946 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -101,6 +101,22 @@ do { \ }) #endif +#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL +#define ptep_get_and_clear_full(__mm, __address, __ptep, __full) \ +({ \ + pte_t __pte; \ + __pte = ptep_get_and_clear((__mm), (__address), (__ptep)); \ + __pte; \ +}) +#endif + +#ifndef __HAVE_ARCH_PTE_CLEAR_FULL +#define pte_clear_full(__mm, __address, __ptep, __full) \ +do { \ + pte_clear((__mm), (__address), (__ptep)); \ +} while (0) +#endif + #ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH #define ptep_clear_flush(__vma, __address, __ptep) \ ({ \ diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index f51fd2c956b..d74185aee15 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -260,6 +260,18 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned return test_and_clear_bit(_PAGE_BIT_ACCESSED, &ptep->pte_low); } +static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) +{ + pte_t pte; + if (full) { + pte = *ptep; + *ptep = __pte(0); + } else { + pte = ptep_get_and_clear(mm, addr, ptep); + } + return pte; +} + static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { clear_bit(_PAGE_BIT_RW, &ptep->pte_low); @@ -417,6 +429,7 @@ extern void noexec_setup(const char *str); #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY #define __HAVE_ARCH_PTEP_GET_AND_CLEAR +#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL #define __HAVE_ARCH_PTEP_SET_WRPROTECT #define __HAVE_ARCH_PTE_SAME #include -- cgit v1.2.3 From 61e06037e764337da39dff307cbcdbe9cf288349 Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:55:06 -0700 Subject: [PATCH] x86_64: avoid some atomic operations during address space destruction Any architecture that has hardware updated A/D bits that require synchronization against other processors during PTE operations can benefit from doing non-atomic PTE updates during address space destruction. Originally done on i386, now ported to x86_64. Doing a read/write pair instead of an xchg() operation saves the implicit lock, which turns out to be a big win on 32-bit (esp w PAE). Signed-off-by: Zachary Amsden Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86_64/pgtable.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h index a1ada852f00..5e0f2fdab0d 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86_64/pgtable.h @@ -104,6 +104,19 @@ extern inline void pgd_clear (pgd_t * pgd) ((unsigned long) __va(pud_val(pud) & PHYSICAL_PAGE_MASK)) #define ptep_get_and_clear(mm,addr,xp) __pte(xchg(&(xp)->pte, 0)) + +static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) +{ + pte_t pte; + if (full) { + pte = *ptep; + *ptep = __pte(0); + } else { + pte = ptep_get_and_clear(mm, addr, ptep); + } + return pte; +} + #define pte_same(a, b) ((a).pte == (b).pte) #define PMD_SIZE (1UL << PMD_SHIFT) @@ -434,6 +447,7 @@ extern int kern_addr_valid(unsigned long addr); #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY #define __HAVE_ARCH_PTEP_GET_AND_CLEAR +#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL #define __HAVE_ARCH_PTEP_SET_WRPROTECT #define __HAVE_ARCH_PTE_SAME #include -- cgit v1.2.3 From c07e02db76940c75fc92f2f2c9adcdbb09ed70d0 Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Sat, 3 Sep 2005 15:55:11 -0700 Subject: [PATCH] VM: add page_state info to per-node meminfo Add page_state info to the per-node meminfo file in sysfs. This is mostly just for informational purposes. The lack of this information was brought up recently during a discussion regarding pagecache clearing, and I put this patch together to test out one of the suggestions. It seems like interesting info to have, so I'm submitting the patch. Signed-off-by: Martin Hicks Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/page-flags.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 99f7cc49506..f34767c5fc7 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -134,6 +134,7 @@ struct page_state { }; extern void get_page_state(struct page_state *ret); +extern void get_page_state_node(struct page_state *ret, int node); extern void get_full_page_state(struct page_state *ret); extern unsigned long __read_page_state(unsigned long offset); extern void __mod_page_state(unsigned long offset, unsigned long delta); -- cgit v1.2.3 From f4f1269cb36adfb452c04dcb3d40f51b8a1956bb Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:21 -0700 Subject: [PATCH] ppc32: Remove board support for ASH Support for the ASH board is no longer maintained and thus being removed Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm4xx.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index e807be96e98..d6852fa9852 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h @@ -19,10 +19,6 @@ #ifdef CONFIG_40x -#if defined(CONFIG_ASH) -#include -#endif - #if defined(CONFIG_BUBINGA) #include #endif -- cgit v1.2.3 From 89d7f53030baa2616eb2fe87cbc19bc73111a78e Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:24 -0700 Subject: [PATCH] ppc32: Remove board support for MCPN765 Support for the MCPN765 board is no longer maintained and thus being removed Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/serial.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/serial.h b/include/asm-ppc/serial.h index 6d47438be58..485a924e4d0 100644 --- a/include/asm-ppc/serial.h +++ b/include/asm-ppc/serial.h @@ -18,8 +18,6 @@ #include #elif defined(CONFIG_LOPEC) #include -#elif defined(CONFIG_MCPN765) -#include #elif defined(CONFIG_MVME5100) #include #elif defined(CONFIG_PAL4) -- cgit v1.2.3 From 37330c9146767fd4f5eb147b01cb500eabf773cf Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:26 -0700 Subject: [PATCH] ppc32: Remove board support for OAK Support for the OAK board is no longer maintained and thus being removed Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm4xx.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index d6852fa9852..7900d52d2a1 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h @@ -31,10 +31,6 @@ #include #endif -#if defined(CONFIG_OAK) -#include -#endif - #if defined(CONFIG_REDWOOD_4) #include #endif -- cgit v1.2.3 From ea08dcfa5439acaf33660e372d44fc049a90b121 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:28 -0700 Subject: [PATCH] ppc32: Remove board support for REDWOOD Support for the REDWOOD board is no longer maintained and thus being removed Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm4xx.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index 7900d52d2a1..e992369cb8e 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h @@ -31,10 +31,6 @@ #include #endif -#if defined(CONFIG_REDWOOD_4) -#include -#endif - #if defined(CONFIG_REDWOOD_5) #include #endif -- cgit v1.2.3 From f4ad35a34bdc27ae18f97d684ca0e693bbffd5f5 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:29 -0700 Subject: [PATCH] ppc32: Remove board support for SPD823TS Support for the SPD823TS board is no longer maintained and thus being removed Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/mpc8xx.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h index 7c31f2d564a..dc8e5989605 100644 --- a/include/asm-ppc/mpc8xx.h +++ b/include/asm-ppc/mpc8xx.h @@ -36,10 +36,6 @@ #include #endif -#if defined(CONFIG_SPD823TS) -#include -#endif - #if defined(CONFIG_IVMS8) || defined(CONFIG_IVML24) #include #endif -- cgit v1.2.3 From d27477c2259488825f2f425d24f209a1b6f8dc7d Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 3 Sep 2005 15:55:31 -0700 Subject: [PATCH] ppc32: fix asm-ppc/dma-mapping.h sparse warning GFP flags must be passed as unisgned int __nocast these days, else we'll get tons of sparse warnings in every driver. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/dma-mapping.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h index 6f74f59938d..92b8ee78dcc 100644 --- a/include/asm-ppc/dma-mapping.h +++ b/include/asm-ppc/dma-mapping.h @@ -60,7 +60,8 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) } static inline void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t * dma_handle, int gfp) + dma_addr_t * dma_handle, + unsigned int __nocast gfp) { #ifdef CONFIG_NOT_COHERENT_CACHE return __dma_alloc_coherent(size, dma_handle, gfp); -- cgit v1.2.3 From 8e8fff09756bdb799154d034c63033192d6f8f89 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:34 -0700 Subject: [PATCH] ppc32: Add ppc_sys descriptions for PowerQUICC II devices Added ppc_sys device and system definitions for PowerQUICC II devices. This will allow drivers for PQ2 to be proper platform device drivers. Which can be shared on PQ3 processors with the same peripherals. Signed-off-by: Matt McClintock Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/irq.h | 1 + include/asm-ppc/mpc8260.h | 18 ++++++++++++++++++ include/asm-ppc/ppc_sys.h | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index a9b33324f56..a244d93ca95 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -337,6 +337,7 @@ static __inline__ int irq_canonicalize(int irq) #define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET) #define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET) #define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET) +#define SIU_INT_USB ((uint)0x0b + CPM_IRQ_OFFSET) #define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET) #define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET) #define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET) diff --git a/include/asm-ppc/mpc8260.h b/include/asm-ppc/mpc8260.h index 89eb8a2ac69..9694eca16e9 100644 --- a/include/asm-ppc/mpc8260.h +++ b/include/asm-ppc/mpc8260.h @@ -67,6 +67,24 @@ #define IO_VIRT_ADDR IO_PHYS_ADDR #endif +enum ppc_sys_devices { + MPC82xx_CPM_FCC1, + MPC82xx_CPM_FCC2, + MPC82xx_CPM_FCC3, + MPC82xx_CPM_I2C, + MPC82xx_CPM_SCC1, + MPC82xx_CPM_SCC2, + MPC82xx_CPM_SCC3, + MPC82xx_CPM_SCC4, + MPC82xx_CPM_SPI, + MPC82xx_CPM_MCC1, + MPC82xx_CPM_MCC2, + MPC82xx_CPM_SMC1, + MPC82xx_CPM_SMC2, + MPC82xx_CPM_USB, + MPC82xx_SEC1, +}; + #ifndef __ASSEMBLY__ /* The "residual" data board information structure the boot loader * hands to us. diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 8ea62456623..01acf75735f 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h @@ -21,7 +21,9 @@ #include #include -#if defined(CONFIG_83xx) +#if defined(CONFIG_8260) +#include +#elif defined(CONFIG_83xx) #include #elif defined(CONFIG_85xx) #include -- cgit v1.2.3 From 2698ebcb4338f09206b5accd75bc5cf2ed3dc641 Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Sat, 3 Sep 2005 15:55:35 -0700 Subject: [PATCH] ppc32: add phy excluded features to ocp_func_emac_data This patch adds a field to struct ocp_func_emac_data that allows platform-specific unsupported PHY features to be passed in to the ibm_emac ethernet driver. This patch also adds some logic for the Bamboo eval board to populate this field based on the dip switches on the board. This is a workaround for the improperly biased RJ-45 sockets on the Rev. 0 Bamboo. Signed-off-by: Wade Farnsworth Signed-off-by: Matt Porter Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm_ocp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index 3f7b5669e6d..a33053503ed 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h @@ -67,6 +67,7 @@ struct ocp_func_emac_data { int phy_mode; /* PHY type or configurable mode */ u8 mac_addr[6]; /* EMAC mac address */ u32 phy_map; /* EMAC phy map */ + u32 phy_feat_exc; /* Excluded PHY features */ }; /* Sysfs support */ -- cgit v1.2.3 From 39cdc4bfb5c587c617ab6a28083c19101154e149 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:39 -0700 Subject: [PATCH] ppc32: Cleaned up global namespace of Book-E watchdog variables Renamed global variables used to convey if the watchdog is enabled and periodicity of the timer and moved the declarations into a header for these variables Signed-off-by: Matt McClintock Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/system.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 82395f30004..be6557746ab 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -87,6 +87,10 @@ extern void cacheable_memzero(void *p, unsigned int nb); extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); extern void bad_page_fault(struct pt_regs *, unsigned long, int); extern void die(const char *, struct pt_regs *, long); +#ifdef CONFIG_BOOKE_WDT +extern u32 booke_wdt_enabled; +extern u32 booke_wdt_period; +#endif /* CONFIG_BOOKE_WDT */ struct device_node; extern void note_scsi_host(struct device_node *, void *); -- cgit v1.2.3 From 5a6a4d4320aed1918bf79dfb6bd841317f33b8e9 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Sat, 3 Sep 2005 15:55:43 -0700 Subject: [PATCH] ppc32: Don't sleep in flush_dcache_icache_page() flush_dcache_icache_page() will be called on an instruction page fault. We can't sleep in the fault handler, so use kmap_atomic() instead of just kmap() for the Book-E case. Signed-off-by: Roland Dreier Acked-by: Matt Porter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/kmap_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h index 2589f182a6a..6d6fc78731e 100644 --- a/include/asm-ppc/kmap_types.h +++ b/include/asm-ppc/kmap_types.h @@ -17,6 +17,7 @@ enum km_type { KM_SOFTIRQ0, KM_SOFTIRQ1, KM_PPC_SYNC_PAGE, + KM_PPC_SYNC_ICACHE, KM_TYPE_NR }; -- cgit v1.2.3 From 88adfe70c667c9e8fe5ec68eba78af566b539e24 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:46 -0700 Subject: [PATCH] ppc32: ppc_sys system on chip identification additions Add the ability to identify an SOC by a name and id. There are cases in which the integer identifier is not sufficient to specify a specific SOC. In these cases we can use a string to further qualify the match. Signed-off-by: Vitaly Bordug Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ppc_sys.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 01acf75735f..048f7c8596e 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h @@ -52,6 +52,7 @@ extern struct ppc_sys_spec *cur_ppc_sys_spec; /* determine which specific SOC we are */ extern void identify_ppc_sys_by_id(u32 id) __init; extern void identify_ppc_sys_by_name(char *name) __init; +extern void identify_ppc_sys_by_name_and_id(char *name, u32 id) __init; /* describes all devices that may exist in a given family of processors */ extern struct platform_device ppc_sys_platform_devices[]; -- cgit v1.2.3 From 164ada643ddf4f492a206b9bf2f2b02918b618da Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:47 -0700 Subject: [PATCH] ppc32: add CONFIG_HZ While ppc32 has the CONFIG_HZ Kconfig option, it wasnt actually being used. Connect it up and set all platforms to 250Hz. This pretty much mimics the ppc64 patch from Anton Blanchard. Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/param.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h index b24a4e37196..6198b1657a4 100644 --- a/include/asm-ppc/param.h +++ b/include/asm-ppc/param.h @@ -1,8 +1,10 @@ #ifndef _ASM_PPC_PARAM_H #define _ASM_PPC_PARAM_H +#include + #ifdef __KERNEL__ -#define HZ 1000 /* internal timer frequency */ +#define HZ CONFIG_HZ /* internal timer frequency */ #define USER_HZ 100 /* for user interfaces in "ticks" */ #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ #endif /* __KERNEL__ */ -- cgit v1.2.3 From 28fa031e765b808520173f750bafbade832ba909 Mon Sep 17 00:00:00 2001 From: Eugene Surovegin Date: Sat, 3 Sep 2005 15:55:53 -0700 Subject: [PATCH] ppc32: move 4xx PHY_MODE_XXX defines to ibm_ocp.h Move 4xx PHY_MODE_XXX defines to asm-ppc/ibm_ocp.h. This is a preparation step for the new EMAC driver. Signed-off-by: Eugene Surovegin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm_ocp.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index a33053503ed..7fd4b6ce327 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h @@ -101,6 +101,19 @@ void ocp_show_emac_data(struct device *dev) \ device_create_file(dev, &dev_attr_emac_phy_map); \ } +/* + * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY) + */ +#define PHY_MODE_NA 0 +#define PHY_MODE_MII 1 +#define PHY_MODE_RMII 2 +#define PHY_MODE_SMII 3 +#define PHY_MODE_RGMII 4 +#define PHY_MODE_TBI 5 +#define PHY_MODE_GMII 6 +#define PHY_MODE_RTBI 7 +#define PHY_MODE_SGMII 8 + #ifdef CONFIG_40x /* * Helper function to copy MAC addresses from the bd_t to OCP EMAC -- cgit v1.2.3 From 3a0a401b40abe31b34673a190c57697e7eced149 Mon Sep 17 00:00:00 2001 From: Eugene Surovegin Date: Sat, 3 Sep 2005 15:55:53 -0700 Subject: [PATCH] ppc32: add dcr_base field to ocp_func_mal_data Add dcr_base field to ocp_func_mal_data. This is preparation step for the new EMAC driver. Signed-off-by: Eugene Surovegin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm_ocp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index 7fd4b6ce327..bd7656fa202 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h @@ -147,6 +147,7 @@ struct ocp_func_mal_data { int txde_irq; /* TX Descriptor Error IRQ */ int rxde_irq; /* RX Descriptor Error IRQ */ int serr_irq; /* MAL System Error IRQ */ + int dcr_base; /* MALx_CFG DCR number */ }; #define OCP_SYSFS_MAL_DATA() \ @@ -157,6 +158,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxeob_irq) \ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, txde_irq) \ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, rxde_irq) \ OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, serr_irq) \ +OCP_SYSFS_ADDTL(struct ocp_func_mal_data, "%d\n", mal, dcr_base) \ \ void ocp_show_mal_data(struct device *dev) \ { \ @@ -167,6 +169,7 @@ void ocp_show_mal_data(struct device *dev) \ device_create_file(dev, &dev_attr_mal_txde_irq); \ device_create_file(dev, &dev_attr_mal_rxde_irq); \ device_create_file(dev, &dev_attr_mal_serr_irq); \ + device_create_file(dev, &dev_attr_mal_dcr_base); \ } /* -- cgit v1.2.3 From e8834801bf9e2ee96c3ac29adf0ff6840afcd841 Mon Sep 17 00:00:00 2001 From: Eugene Surovegin Date: Sat, 3 Sep 2005 15:55:54 -0700 Subject: [PATCH] ppc32: export cacheable_memcpy() Add declaration and cacheable_memcpy(). I'll be needing this function in new 4xx EMAC driver I'm going to submit to netdev soon. IMHO, the better place for the declaration would be asm-powerpc/string.h, unfortunately, ppc64 doesn't have this function, so asm-ppc/system.h is the next best place. Signed-off-by: Eugene Surovegin Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/system.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index be6557746ab..513a334c581 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -84,6 +84,7 @@ extern void cvt_fd(float *from, double *to, unsigned long *fpscr); extern void cvt_df(double *from, float *to, unsigned long *fpscr); extern int call_rtas(const char *, int, int, unsigned long *, ...); extern void cacheable_memzero(void *p, unsigned int nb); +extern void *cacheable_memcpy(void *, const void *, unsigned int); extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long); extern void bad_page_fault(struct pt_regs *, unsigned long, int); extern void die(const char *, struct pt_regs *, long); -- cgit v1.2.3 From d01c08c9ae91c1526d4564b400b3e0e04b49d1ba Mon Sep 17 00:00:00 2001 From: "Mark A. Greer" Date: Sat, 3 Sep 2005 15:55:56 -0700 Subject: [PATCH] ppc32: mv64x60 updates & enhancements Updates and enhancement to the ppc32 mv64x60 code: - move code to get mem size from mem ctlr to bootwrapper - address some errata in the mv64360 pic code - some minor cleanups - export one of the bridge's regs via sysfs so user daemon can watch for extraction events Signed-off-by: Mark A. Greer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/mv64x60.h | 7 +++++++ include/asm-ppc/mv64x60_defs.h | 9 ++++++--- include/linux/mv643xx.h | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h index cc25b921ad4..835930d6faa 100644 --- a/include/asm-ppc/mv64x60.h +++ b/include/asm-ppc/mv64x60.h @@ -278,6 +278,13 @@ mv64x60_modify(struct mv64x60_handle *bh, u32 offs, u32 data, u32 mask) #define mv64x60_set_bits(bh, offs, bits) mv64x60_modify(bh, offs, ~0, bits) #define mv64x60_clr_bits(bh, offs, bits) mv64x60_modify(bh, offs, 0, bits) +#if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) +#define MV64XXX_DEV_NAME "mv64xxx" + +struct mv64xxx_pdata { + u32 hs_reg_valid; +}; +#endif /* Externally visible function prototypes */ int mv64x60_init(struct mv64x60_handle *bh, struct mv64x60_setup_info *si); diff --git a/include/asm-ppc/mv64x60_defs.h b/include/asm-ppc/mv64x60_defs.h index 2f428746c02..f8f7f16b9b5 100644 --- a/include/asm-ppc/mv64x60_defs.h +++ b/include/asm-ppc/mv64x60_defs.h @@ -333,7 +333,7 @@ /* ***************************************************************************** * - * SRAM Cotnroller Registers + * SRAM Controller Registers * ***************************************************************************** */ @@ -352,7 +352,7 @@ /* ***************************************************************************** * - * SDRAM/MEM Cotnroller Registers + * SDRAM/MEM Controller Registers * ***************************************************************************** */ @@ -375,6 +375,7 @@ /* SDRAM Control Registers */ #define MV64360_D_UNIT_CONTROL_LOW 0x1404 #define MV64360_D_UNIT_CONTROL_HIGH 0x1424 +#define MV64460_D_UNIT_MMASK 0x14b0 /* SDRAM Error Report Registers (64360) */ #define MV64360_SDRAM_ERR_DATA_LO 0x1444 @@ -388,7 +389,7 @@ /* ***************************************************************************** * - * Device/BOOT Cotnroller Registers + * Device/BOOT Controller Registers * ***************************************************************************** */ @@ -680,6 +681,8 @@ #define MV64x60_PCI1_SLAVE_P2P_IO_REMAP 0x0dec #define MV64x60_PCI1_SLAVE_CPU_REMAP 0x0df0 +#define MV64360_PCICFG_CPCI_HOTSWAP 0x68 + /* ***************************************************************************** * diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index 5773ea42f6e..0b08cd69220 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h @@ -980,7 +980,7 @@ /* I2C Registers */ /****************************************/ -#define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c" +#define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c" #define MV64XXX_I2C_OFFSET 0xc000 #define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 -- cgit v1.2.3 From 233ccd0d0452682edb51725410e0f8c0384e8b34 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Sat, 3 Sep 2005 15:55:59 -0700 Subject: [PATCH] ppc64: Add VMX save flag to VPA We need to indicate to the hypervisor that it needs to save our VMX registers when switching partitions on a shared-processor system, just as it needs to for FP and PMC registers. This could be made to be on-demand when VMX is used, but we don't do that for FP nor PMC right now either so let's not overcomplicate things. Signed-off-by: Olof Johansson Acked-by: Paul Mackerras Cc: Anton Blanchard Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc64/lppaca.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ppc64/lppaca.h b/include/asm-ppc64/lppaca.h index 70766b5f26c..9e2a6c0649a 100644 --- a/include/asm-ppc64/lppaca.h +++ b/include/asm-ppc64/lppaca.h @@ -108,7 +108,7 @@ struct lppaca volatile u32 virtual_decr; // Virtual DECR for shared procsx78-x7B u16 slb_count; // # of SLBs to maintain x7C-x7D u8 idle; // Indicate OS is idle x7E - u8 reserved5; // Reserved x7F + u8 vmxregs_in_use; // VMX registers in use x7F //============================================================================= -- cgit v1.2.3 From 979934da9e7a0005bd9c8b1d7d00febb59ff67f7 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 3 Sep 2005 15:56:04 -0700 Subject: [PATCH] mips: update IRQ handling for vr41xx This patch has updated IRQ handling for vr41xx. o added common IRQ dispatch o changed IRQ number in int-handler.S o added resource management to icu.c Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/vr41xx/vr41xx.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/asm-mips/vr41xx/vr41xx.h b/include/asm-mips/vr41xx/vr41xx.h index 7d41e44463f..bd2723c3090 100644 --- a/include/asm-mips/vr41xx/vr41xx.h +++ b/include/asm-mips/vr41xx/vr41xx.h @@ -7,7 +7,7 @@ * Copyright (C) 2001, 2002 Paul Mundt * Copyright (C) 2002 MontaVista Software, Inc. * Copyright (C) 2002 TimeSys Corp. - * Copyright (C) 2003-2004 Yoichi Yuasa + * Copyright (C) 2003-2005 Yoichi Yuasa * * 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 @@ -79,11 +79,11 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); #define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) #define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) #define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) -#define INT0_CASCADE_IRQ MIPS_CPU_IRQ(2) -#define INT1_CASCADE_IRQ MIPS_CPU_IRQ(3) -#define INT2_CASCADE_IRQ MIPS_CPU_IRQ(4) -#define INT3_CASCADE_IRQ MIPS_CPU_IRQ(5) -#define INT4_CASCADE_IRQ MIPS_CPU_IRQ(6) +#define INT0_IRQ MIPS_CPU_IRQ(2) +#define INT1_IRQ MIPS_CPU_IRQ(3) +#define INT2_IRQ MIPS_CPU_IRQ(4) +#define INT3_IRQ MIPS_CPU_IRQ(5) +#define INT4_IRQ MIPS_CPU_IRQ(6) #define TIMER_IRQ MIPS_CPU_IRQ(7) /* SYINT1 Interrupt Numbers */ @@ -97,7 +97,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); #define PIU_IRQ SYSINT1_IRQ(5) #define AIU_IRQ SYSINT1_IRQ(6) #define KIU_IRQ SYSINT1_IRQ(7) -#define GIUINT_CASCADE_IRQ SYSINT1_IRQ(8) +#define GIUINT_IRQ SYSINT1_IRQ(8) #define SIU_IRQ SYSINT1_IRQ(9) #define BUSERR_IRQ SYSINT1_IRQ(10) #define SOFTINT_IRQ SYSINT1_IRQ(11) @@ -128,7 +128,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock); #define GIU_IRQ_LAST GIU_IRQ(31) extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); -extern int vr41xx_cascade_irq(unsigned int irq, int (*get_irq_number)(int irq)); +extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *)); #define PIUINT_COMMAND 0x0040 #define PIUINT_DATA 0x0020 -- cgit v1.2.3 From 0fdda107e10133583f31c72326959555bfb61042 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:06 -0700 Subject: [PATCH] mips: remove VR4181 support There seem to be no more users or interest in the NEC Osprey evaluation system for the NEC VR4181 SOC which is an old part anyway, so remove the code. More information on the Osprey can be found at http://www.linux-mips.org/wiki/Osprey. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/vr4181/irq.h | 122 ------------ include/asm-mips/vr4181/vr4181.h | 413 --------------------------------------- 2 files changed, 535 deletions(-) delete mode 100644 include/asm-mips/vr4181/irq.h delete mode 100644 include/asm-mips/vr4181/vr4181.h (limited to 'include') diff --git a/include/asm-mips/vr4181/irq.h b/include/asm-mips/vr4181/irq.h deleted file mode 100644 index 4bf0ea970ed..00000000000 --- a/include/asm-mips/vr4181/irq.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Macros for vr4181 IRQ numbers. - * - * Copyright (C) 2001 MontaVista Software Inc. - * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net - * - * 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. - * - */ - -/* - * Strategy: - * - * Vr4181 has conceptually three levels of interrupt controllers: - * 1. the CPU itself with 8 intr level. - * 2. system interrupt controller, cascaded from int0 pin in CPU, 32 intrs - * 3. GPIO interrupts : forwarding external interrupts to sys intr controller - */ - -/* decide the irq block assignment */ -#define VR4181_NUM_CPU_IRQ 8 -#define VR4181_NUM_SYS_IRQ 32 -#define VR4181_NUM_GPIO_IRQ 16 - -#define VR4181_IRQ_BASE 0 - -#define VR4181_CPU_IRQ_BASE VR4181_IRQ_BASE -#define VR4181_SYS_IRQ_BASE (VR4181_CPU_IRQ_BASE + VR4181_NUM_CPU_IRQ) -#define VR4181_GPIO_IRQ_BASE (VR4181_SYS_IRQ_BASE + VR4181_NUM_SYS_IRQ) - -/* CPU interrupts */ - -/* - IP0 - Software interrupt - IP1 - Software interrupt - IP2 - All but battery, high speed modem, and real time clock - IP3 - RTC Long1 (system timer) - IP4 - RTC Long2 - IP5 - High Speed Modem (unused on VR4181) - IP6 - Unused - IP7 - Timer interrupt from CPO_COMPARE -*/ - -#define VR4181_IRQ_SW1 (VR4181_CPU_IRQ_BASE + 0) -#define VR4181_IRQ_SW2 (VR4181_CPU_IRQ_BASE + 1) -#define VR4181_IRQ_INT0 (VR4181_CPU_IRQ_BASE + 2) -#define VR4181_IRQ_INT1 (VR4181_CPU_IRQ_BASE + 3) -#define VR4181_IRQ_INT2 (VR4181_CPU_IRQ_BASE + 4) -#define VR4181_IRQ_INT3 (VR4181_CPU_IRQ_BASE + 5) -#define VR4181_IRQ_INT4 (VR4181_CPU_IRQ_BASE + 6) -#define VR4181_IRQ_TIMER (VR4181_CPU_IRQ_BASE + 7) - - -/* Cascaded from VR4181_IRQ_INT0 (ICU mapped interrupts) */ - -/* - IP2 - same as VR4181_IRQ_INT1 - IP8 - This is a cascade to GPIO IRQ's. Do not use. - IP16 - same as VR4181_IRQ_INT2 - IP18 - CompactFlash -*/ - -#define VR4181_IRQ_BATTERY (VR4181_SYS_IRQ_BASE + 0) -#define VR4181_IRQ_POWER (VR4181_SYS_IRQ_BASE + 1) -#define VR4181_IRQ_RTCL1 (VR4181_SYS_IRQ_BASE + 2) -#define VR4181_IRQ_ETIMER (VR4181_SYS_IRQ_BASE + 3) -#define VR4181_IRQ_RFU12 (VR4181_SYS_IRQ_BASE + 4) -#define VR4181_IRQ_PIU (VR4181_SYS_IRQ_BASE + 5) -#define VR4181_IRQ_AIU (VR4181_SYS_IRQ_BASE + 6) -#define VR4181_IRQ_KIU (VR4181_SYS_IRQ_BASE + 7) -#define VR4181_IRQ_GIU (VR4181_SYS_IRQ_BASE + 8) -#define VR4181_IRQ_SIU (VR4181_SYS_IRQ_BASE + 9) -#define VR4181_IRQ_RFU18 (VR4181_SYS_IRQ_BASE + 10) -#define VR4181_IRQ_SOFT (VR4181_SYS_IRQ_BASE + 11) -#define VR4181_IRQ_RFU20 (VR4181_SYS_IRQ_BASE + 12) -#define VR4181_IRQ_DOZEPIU (VR4181_SYS_IRQ_BASE + 13) -#define VR4181_IRQ_RFU22 (VR4181_SYS_IRQ_BASE + 14) -#define VR4181_IRQ_RFU23 (VR4181_SYS_IRQ_BASE + 15) -#define VR4181_IRQ_RTCL2 (VR4181_SYS_IRQ_BASE + 16) -#define VR4181_IRQ_LED (VR4181_SYS_IRQ_BASE + 17) -#define VR4181_IRQ_ECU (VR4181_SYS_IRQ_BASE + 18) -#define VR4181_IRQ_CSU (VR4181_SYS_IRQ_BASE + 19) -#define VR4181_IRQ_USB (VR4181_SYS_IRQ_BASE + 20) -#define VR4181_IRQ_DMA (VR4181_SYS_IRQ_BASE + 21) -#define VR4181_IRQ_LCD (VR4181_SYS_IRQ_BASE + 22) -#define VR4181_IRQ_RFU31 (VR4181_SYS_IRQ_BASE + 23) -#define VR4181_IRQ_RFU32 (VR4181_SYS_IRQ_BASE + 24) -#define VR4181_IRQ_RFU33 (VR4181_SYS_IRQ_BASE + 25) -#define VR4181_IRQ_RFU34 (VR4181_SYS_IRQ_BASE + 26) -#define VR4181_IRQ_RFU35 (VR4181_SYS_IRQ_BASE + 27) -#define VR4181_IRQ_RFU36 (VR4181_SYS_IRQ_BASE + 28) -#define VR4181_IRQ_RFU37 (VR4181_SYS_IRQ_BASE + 29) -#define VR4181_IRQ_RFU38 (VR4181_SYS_IRQ_BASE + 30) -#define VR4181_IRQ_RFU39 (VR4181_SYS_IRQ_BASE + 31) - -/* Cascaded from VR4181_IRQ_GIU */ -#define VR4181_IRQ_GPIO0 (VR4181_GPIO_IRQ_BASE + 0) -#define VR4181_IRQ_GPIO1 (VR4181_GPIO_IRQ_BASE + 1) -#define VR4181_IRQ_GPIO2 (VR4181_GPIO_IRQ_BASE + 2) -#define VR4181_IRQ_GPIO3 (VR4181_GPIO_IRQ_BASE + 3) -#define VR4181_IRQ_GPIO4 (VR4181_GPIO_IRQ_BASE + 4) -#define VR4181_IRQ_GPIO5 (VR4181_GPIO_IRQ_BASE + 5) -#define VR4181_IRQ_GPIO6 (VR4181_GPIO_IRQ_BASE + 6) -#define VR4181_IRQ_GPIO7 (VR4181_GPIO_IRQ_BASE + 7) -#define VR4181_IRQ_GPIO8 (VR4181_GPIO_IRQ_BASE + 8) -#define VR4181_IRQ_GPIO9 (VR4181_GPIO_IRQ_BASE + 9) -#define VR4181_IRQ_GPIO10 (VR4181_GPIO_IRQ_BASE + 10) -#define VR4181_IRQ_GPIO11 (VR4181_GPIO_IRQ_BASE + 11) -#define VR4181_IRQ_GPIO12 (VR4181_GPIO_IRQ_BASE + 12) -#define VR4181_IRQ_GPIO13 (VR4181_GPIO_IRQ_BASE + 13) -#define VR4181_IRQ_GPIO14 (VR4181_GPIO_IRQ_BASE + 14) -#define VR4181_IRQ_GPIO15 (VR4181_GPIO_IRQ_BASE + 15) - - -// Alternative to above GPIO IRQ defines -#define VR4181_IRQ_GPIO(pin) ((VR4181_IRQ_GPIO0) + (pin)) - -#define VR4181_IRQ_MAX (VR4181_IRQ_BASE + VR4181_NUM_CPU_IRQ + \ - VR4181_NUM_SYS_IRQ + VR4181_NUM_GPIO_IRQ) diff --git a/include/asm-mips/vr4181/vr4181.h b/include/asm-mips/vr4181/vr4181.h deleted file mode 100644 index 5c5d6074151..00000000000 --- a/include/asm-mips/vr4181/vr4181.h +++ /dev/null @@ -1,413 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1999 by Michael Klar - * - * Copyright 2001 MontaVista Software Inc. - * Author: jsun@mvista.com or jsun@junsun.net - * - */ -#ifndef __ASM_VR4181_VR4181_H -#define __ASM_VR4181_VR4181_H - -#include - -#include - -#ifndef __ASSEMBLY__ -#define __preg8 (volatile unsigned char*) -#define __preg16 (volatile unsigned short*) -#define __preg32 (volatile unsigned int*) -#else -#define __preg8 -#define __preg16 -#define __preg32 -#endif - -// Embedded CPU peripheral registers -// Note that many of the registers have different physical address for VR4181 - -// Bus Control Unit (BCU) -#define VR4181_BCUCNTREG1 __preg16(KSEG1 + 0x0A000000) /* BCU control register 1 (R/W) */ -#define VR4181_CMUCLKMSK __preg16(KSEG1 + 0x0A000004) /* Clock mask register (R/W) */ -#define VR4181_CMUCLKMSK_MSKCSUPCLK 0x0040 -#define VR4181_CMUCLKMSK_MSKAIUPCLK 0x0020 -#define VR4181_CMUCLKMSK_MSKPIUPCLK 0x0010 -#define VR4181_CMUCLKMSK_MSKADUPCLK 0x0008 -#define VR4181_CMUCLKMSK_MSKSIU18M 0x0004 -#define VR4181_CMUCLKMSK_MSKADU18M 0x0002 -#define VR4181_CMUCLKMSK_MSKUSB 0x0001 -#define VR4181_CMUCLKMSK_MSKSIU VR4181_CMUCLKMSK_MSKSIU18M -#define VR4181_BCUSPEEDREG __preg16(KSEG1 + 0x0A00000C) /* BCU access time parameter (R/W) */ -#define VR4181_BCURFCNTREG __preg16(KSEG1 + 0x0A000010) /* BCU refresh control register (R/W) */ -#define VR4181_REVIDREG __preg16(KSEG1 + 0x0A000014) /* Revision ID register (R) */ -#define VR4181_CLKSPEEDREG __preg16(KSEG1 + 0x0A000018) /* Clock speed register (R) */ -#define VR4181_EDOMCYTREG __preg16(KSEG1 + 0x0A000300) /* Memory cycle timing register (R/W) */ -#define VR4181_MEMCFG_REG __preg16(KSEG1 + 0x0A000304) /* Memory configuration register (R/W) */ -#define VR4181_MODE_REG __preg16(KSEG1 + 0x0A000308) /* SDRAM mode register (R/W) */ -#define VR4181_SDTIMINGREG __preg16(KSEG1 + 0x0A00030C) /* SDRAM timing register (R/W) */ - -// DMA Control Unit (DCU) -#define VR4181_MICDEST1REG1 __preg16(KSEG1 + 0x0A000020) /* Microphone destination 1 address register 1 (R/W) */ -#define VR4181_MICDEST1REG2 __preg16(KSEG1 + 0x0A000022) /* Microphone destination 1 address register 2 (R/W) */ -#define VR4181_MICDEST2REG1 __preg16(KSEG1 + 0x0A000024) /* Microphone destination 2 address register 1 (R/W) */ -#define VR4181_MICDEST2REG2 __preg16(KSEG1 + 0x0A000026) /* Microphone destination 2 address register 2 (R/W) */ -#define VR4181_SPKRRC1REG1 __preg16(KSEG1 + 0x0A000028) /* Speaker Source 1 address register 1 (R/W) */ -#define VR4181_SPKRRC1REG2 __preg16(KSEG1 + 0x0A00002A) /* Speaker Source 1 address register 2 (R/W) */ -#define VR4181_SPKRRC2REG1 __preg16(KSEG1 + 0x0A00002C) /* Speaker Source 2 address register 1 (R/W) */ -#define VR4181_SPKRRC2REG2 __preg16(KSEG1 + 0x0A00002E) /* Speaker Source 2 address register 2 (R/W) */ -#define VR4181_DMARSTREG __preg16(KSEG1 + 0x0A000040) /* DMA Reset register (R/W) */ -#define VR4181_AIUDMAMSKREG __preg16(KSEG1 + 0x0A000046) /* Audio DMA mask register (R/W) */ -#define VR4181_USBDMAMSKREG __preg16(KSEG1 + 0x0A000600) /* USB DMA Mask register (R/W) */ -#define VR4181_USBRXS1AREG1 __preg16(KSEG1 + 0x0A000602) /* USB Rx source 1 address register 1 (R/W) */ -#define VR4181_USBRXS1AREG2 __preg16(KSEG1 + 0x0A000604) /* USB Rx source 1 address register 2 (R/W) */ -#define VR4181_USBRXS2AREG1 __preg16(KSEG1 + 0x0A000606) /* USB Rx source 2 address register 1 (R/W) */ -#define VR4181_USBRXS2AREG2 __preg16(KSEG1 + 0x0A000608) /* USB Rx source 2 address register 2 (R/W) */ -#define VR4181_USBTXS1AREG1 __preg16(KSEG1 + 0x0A00060A) /* USB Tx source 1 address register 1 (R/W) */ -#define VR4181_USBTXS1AREG2 __preg16(KSEG1 + 0x0A00060C) /* USB Tx source 1 address register 2 (R/W) */ -#define VR4181_USBTXS2AREG1 __preg16(KSEG1 + 0x0A00060E) /* USB Tx source 2 address register 1 (R/W) */ -#define VR4181_USBTXS2AREG2 __preg16(KSEG1 + 0x0A000610) /* USB Tx source 2 address register 2 (R/W) */ -#define VR4181_USBRXD1AREG1 __preg16(KSEG1 + 0x0A00062A) /* USB Rx destination 1 address register 1 (R/W) */ -#define VR4181_USBRXD1AREG2 __preg16(KSEG1 + 0x0A00062C) /* USB Rx destination 1 address register 2 (R/W) */ -#define VR4181_USBRXD2AREG1 __preg16(KSEG1 + 0x0A00062E) /* USB Rx destination 2 address register 1 (R/W) */ -#define VR4181_USBRXD2AREG2 __preg16(KSEG1 + 0x0A000630) /* USB Rx destination 2 address register 2 (R/W) */ -#define VR4181_USBTXD1AREG1 __preg16(KSEG1 + 0x0A000632) /* USB Tx destination 1 address register 1 (R/W) */ -#define VR4181_USBTXD1AREG2 __preg16(KSEG1 + 0x0A000634) /* USB Tx destination 1 address register 2 (R/W) */ -#define VR4181_USBTXD2AREG1 __preg16(KSEG1 + 0x0A000636) /* USB Tx destination 2 address register 1 (R/W) */ -#define VR4181_USBTXD2AREG2 __preg16(KSEG1 + 0x0A000638) /* USB Tx destination 2 address register 2 (R/W) */ -#define VR4181_RxRCLENREG __preg16(KSEG1 + 0x0A000652) /* USB Rx record length register (R/W) */ -#define VR4181_TxRCLENREG __preg16(KSEG1 + 0x0A000654) /* USB Tx record length register (R/W) */ -#define VR4181_MICRCLENREG __preg16(KSEG1 + 0x0A000658) /* Microphone record length register (R/W) */ -#define VR4181_SPKRCLENREG __preg16(KSEG1 + 0x0A00065A) /* Speaker record length register (R/W) */ -#define VR4181_USBCFGREG __preg16(KSEG1 + 0x0A00065C) /* USB configuration register (R/W) */ -#define VR4181_MICDMACFGREG __preg16(KSEG1 + 0x0A00065E) /* Microphone DMA configuration register (R/W) */ -#define VR4181_SPKDMACFGREG __preg16(KSEG1 + 0x0A000660) /* Speaker DMA configuration register (R/W) */ -#define VR4181_DMAITRQREG __preg16(KSEG1 + 0x0A000662) /* DMA interrupt request register (R/W) */ -#define VR4181_DMACLTREG __preg16(KSEG1 + 0x0A000664) /* DMA control register (R/W) */ -#define VR4181_DMAITMKREG __preg16(KSEG1 + 0x0A000666) /* DMA interrupt mask register (R/W) */ - -// ISA Bridge -#define VR4181_ISABRGCTL __preg16(KSEG1 + 0x0B0002C0) /* ISA Bridge Control Register (R/W) */ -#define VR4181_ISABRGSTS __preg16(KSEG1 + 0x0B0002C2) /* ISA Bridge Status Register (R/W) */ -#define VR4181_XISACTL __preg16(KSEG1 + 0x0B0002C4) /* External ISA Control Register (R/W) */ - -// Clocked Serial Interface (CSI) -#define VR4181_CSIMODE __preg16(KSEG1 + 0x0B000900) /* CSI Mode Register (R/W) */ -#define VR4181_CSIRXDATA __preg16(KSEG1 + 0x0B000902) /* CSI Receive Data Register (R) */ -#define VR4181_CSITXDATA __preg16(KSEG1 + 0x0B000904) /* CSI Transmit Data Register (R/W) */ -#define VR4181_CSILSTAT __preg16(KSEG1 + 0x0B000906) /* CSI Line Status Register (R/W) */ -#define VR4181_CSIINTMSK __preg16(KSEG1 + 0x0B000908) /* CSI Interrupt Mask Register (R/W) */ -#define VR4181_CSIINTSTAT __preg16(KSEG1 + 0x0B00090a) /* CSI Interrupt Status Register (R/W) */ -#define VR4181_CSITXBLEN __preg16(KSEG1 + 0x0B00090c) /* CSI Transmit Burst Length Register (R/W) */ -#define VR4181_CSIRXBLEN __preg16(KSEG1 + 0x0B00090e) /* CSI Receive Burst Length Register (R/W) */ - -// Interrupt Control Unit (ICU) -#define VR4181_SYSINT1REG __preg16(KSEG1 + 0x0A000080) /* Level 1 System interrupt register 1 (R) */ -#define VR4181_MSYSINT1REG __preg16(KSEG1 + 0x0A00008C) /* Level 1 mask system interrupt register 1 (R/W) */ -#define VR4181_NMIREG __preg16(KSEG1 + 0x0A000098) /* NMI register (R/W) */ -#define VR4181_SOFTINTREG __preg16(KSEG1 + 0x0A00009A) /* Software interrupt register (R/W) */ -#define VR4181_SYSINT2REG __preg16(KSEG1 + 0x0A000200) /* Level 1 System interrupt register 2 (R) */ -#define VR4181_MSYSINT2REG __preg16(KSEG1 + 0x0A000206) /* Level 1 mask system interrupt register 2 (R/W) */ -#define VR4181_PIUINTREGro __preg16(KSEG1 + 0x0B000082) /* Level 2 PIU interrupt register (R) */ -#define VR4181_AIUINTREG __preg16(KSEG1 + 0x0B000084) /* Level 2 AIU interrupt register (R) */ -#define VR4181_MPIUINTREG __preg16(KSEG1 + 0x0B00008E) /* Level 2 mask PIU interrupt register (R/W) */ -#define VR4181_MAIUINTREG __preg16(KSEG1 + 0x0B000090) /* Level 2 mask AIU interrupt register (R/W) */ -#define VR4181_MKIUINTREG __preg16(KSEG1 + 0x0B000092) /* Level 2 mask KIU interrupt register (R/W) */ -#define VR4181_KIUINTREG __preg16(KSEG1 + 0x0B000198) /* Level 2 KIU interrupt register (R) */ - -// Power Management Unit (PMU) -#define VR4181_PMUINTREG __preg16(KSEG1 + 0x0B0000A0) /* PMU Status Register (R/W) */ -#define VR4181_PMUINT_POWERSW 0x1 /* Power switch */ -#define VR4181_PMUINT_BATT 0x2 /* Low batt during normal operation */ -#define VR4181_PMUINT_DEADMAN 0x4 /* Deadman's switch */ -#define VR4181_PMUINT_RESET 0x8 /* Reset switch */ -#define VR4181_PMUINT_RTCRESET 0x10 /* RTC Reset */ -#define VR4181_PMUINT_TIMEOUT 0x20 /* HAL Timer Reset */ -#define VR4181_PMUINT_BATTLOW 0x100 /* Battery low */ -#define VR4181_PMUINT_RTC 0x200 /* RTC Alarm */ -#define VR4181_PMUINT_DCD 0x400 /* DCD# */ -#define VR4181_PMUINT_GPIO0 0x1000 /* GPIO0 */ -#define VR4181_PMUINT_GPIO1 0x2000 /* GPIO1 */ -#define VR4181_PMUINT_GPIO2 0x4000 /* GPIO2 */ -#define VR4181_PMUINT_GPIO3 0x8000 /* GPIO3 */ - -#define VR4181_PMUCNTREG __preg16(KSEG1 + 0x0B0000A2) /* PMU Control Register (R/W) */ -#define VR4181_PMUWAITREG __preg16(KSEG1 + 0x0B0000A8) /* PMU Wait Counter Register (R/W) */ -#define VR4181_PMUDIVREG __preg16(KSEG1 + 0x0B0000AC) /* PMU Divide Mode Register (R/W) */ -#define VR4181_DRAMHIBCTL __preg16(KSEG1 + 0x0B0000B2) /* DRAM Hibernate Control Register (R/W) */ - -// Real Time Clock Unit (RTC) -#define VR4181_ETIMELREG __preg16(KSEG1 + 0x0B0000C0) /* Elapsed Time L Register (R/W) */ -#define VR4181_ETIMEMREG __preg16(KSEG1 + 0x0B0000C2) /* Elapsed Time M Register (R/W) */ -#define VR4181_ETIMEHREG __preg16(KSEG1 + 0x0B0000C4) /* Elapsed Time H Register (R/W) */ -#define VR4181_ECMPLREG __preg16(KSEG1 + 0x0B0000C8) /* Elapsed Compare L Register (R/W) */ -#define VR4181_ECMPMREG __preg16(KSEG1 + 0x0B0000CA) /* Elapsed Compare M Register (R/W) */ -#define VR4181_ECMPHREG __preg16(KSEG1 + 0x0B0000CC) /* Elapsed Compare H Register (R/W) */ -#define VR4181_RTCL1LREG __preg16(KSEG1 + 0x0B0000D0) /* RTC Long 1 L Register (R/W) */ -#define VR4181_RTCL1HREG __preg16(KSEG1 + 0x0B0000D2) /* RTC Long 1 H Register (R/W) */ -#define VR4181_RTCL1CNTLREG __preg16(KSEG1 + 0x0B0000D4) /* RTC Long 1 Count L Register (R) */ -#define VR4181_RTCL1CNTHREG __preg16(KSEG1 + 0x0B0000D6) /* RTC Long 1 Count H Register (R) */ -#define VR4181_RTCL2LREG __preg16(KSEG1 + 0x0B0000D8) /* RTC Long 2 L Register (R/W) */ -#define VR4181_RTCL2HREG __preg16(KSEG1 + 0x0B0000DA) /* RTC Long 2 H Register (R/W) */ -#define VR4181_RTCL2CNTLREG __preg16(KSEG1 + 0x0B0000DC) /* RTC Long 2 Count L Register (R) */ -#define VR4181_RTCL2CNTHREG __preg16(KSEG1 + 0x0B0000DE) /* RTC Long 2 Count H Register (R) */ -#define VR4181_RTCINTREG __preg16(KSEG1 + 0x0B0001DE) /* RTC Interrupt Register (R/W) */ - -// Deadman's Switch Unit (DSU) -#define VR4181_DSUCNTREG __preg16(KSEG1 + 0x0B0000E0) /* DSU Control Register (R/W) */ -#define VR4181_DSUSETREG __preg16(KSEG1 + 0x0B0000E2) /* DSU Dead Time Set Register (R/W) */ -#define VR4181_DSUCLRREG __preg16(KSEG1 + 0x0B0000E4) /* DSU Clear Register (W) */ -#define VR4181_DSUTIMREG __preg16(KSEG1 + 0x0B0000E6) /* DSU Elapsed Time Register (R/W) */ - -// General Purpose I/O Unit (GIU) -#define VR4181_GPMD0REG __preg16(KSEG1 + 0x0B000300) /* GPIO Mode 0 Register (R/W) */ -#define VR4181_GPMD1REG __preg16(KSEG1 + 0x0B000302) /* GPIO Mode 1 Register (R/W) */ -#define VR4181_GPMD2REG __preg16(KSEG1 + 0x0B000304) /* GPIO Mode 2 Register (R/W) */ -#define VR4181_GPMD3REG __preg16(KSEG1 + 0x0B000306) /* GPIO Mode 3 Register (R/W) */ -#define VR4181_GPDATHREG __preg16(KSEG1 + 0x0B000308) /* GPIO Data High Register (R/W) */ -#define VR4181_GPDATHREG_GPIO16 0x0001 -#define VR4181_GPDATHREG_GPIO17 0x0002 -#define VR4181_GPDATHREG_GPIO18 0x0004 -#define VR4181_GPDATHREG_GPIO19 0x0008 -#define VR4181_GPDATHREG_GPIO20 0x0010 -#define VR4181_GPDATHREG_GPIO21 0x0020 -#define VR4181_GPDATHREG_GPIO22 0x0040 -#define VR4181_GPDATHREG_GPIO23 0x0080 -#define VR4181_GPDATHREG_GPIO24 0x0100 -#define VR4181_GPDATHREG_GPIO25 0x0200 -#define VR4181_GPDATHREG_GPIO26 0x0400 -#define VR4181_GPDATHREG_GPIO27 0x0800 -#define VR4181_GPDATHREG_GPIO28 0x1000 -#define VR4181_GPDATHREG_GPIO29 0x2000 -#define VR4181_GPDATHREG_GPIO30 0x4000 -#define VR4181_GPDATHREG_GPIO31 0x8000 -#define VR4181_GPDATLREG __preg16(KSEG1 + 0x0B00030A) /* GPIO Data Low Register (R/W) */ -#define VR4181_GPDATLREG_GPIO0 0x0001 -#define VR4181_GPDATLREG_GPIO1 0x0002 -#define VR4181_GPDATLREG_GPIO2 0x0004 -#define VR4181_GPDATLREG_GPIO3 0x0008 -#define VR4181_GPDATLREG_GPIO4 0x0010 -#define VR4181_GPDATLREG_GPIO5 0x0020 -#define VR4181_GPDATLREG_GPIO6 0x0040 -#define VR4181_GPDATLREG_GPIO7 0x0080 -#define VR4181_GPDATLREG_GPIO8 0x0100 -#define VR4181_GPDATLREG_GPIO9 0x0200 -#define VR4181_GPDATLREG_GPIO10 0x0400 -#define VR4181_GPDATLREG_GPIO11 0x0800 -#define VR4181_GPDATLREG_GPIO12 0x1000 -#define VR4181_GPDATLREG_GPIO13 0x2000 -#define VR4181_GPDATLREG_GPIO14 0x4000 -#define VR4181_GPDATLREG_GPIO15 0x8000 -#define VR4181_GPINTEN __preg16(KSEG1 + 0x0B00030C) /* GPIO Interrupt Enable Register (R/W) */ -#define VR4181_GPINTMSK __preg16(KSEG1 + 0x0B00030E) /* GPIO Interrupt Mask Register (R/W) */ -#define VR4181_GPINTTYPH __preg16(KSEG1 + 0x0B000310) /* GPIO Interrupt Type High Register (R/W) */ -#define VR4181_GPINTTYPL __preg16(KSEG1 + 0x0B000312) /* GPIO Interrupt Type Low Register (R/W) */ -#define VR4181_GPINTSTAT __preg16(KSEG1 + 0x0B000314) /* GPIO Interrupt Status Register (R/W) */ -#define VR4181_GPHIBSTH __preg16(KSEG1 + 0x0B000316) /* GPIO Hibernate Pin State High Register (R/W) */ -#define VR4181_GPHIBSTL __preg16(KSEG1 + 0x0B000318) /* GPIO Hibernate Pin State Low Register (R/W) */ -#define VR4181_GPSICTL __preg16(KSEG1 + 0x0B00031A) /* GPIO Serial Interface Control Register (R/W) */ -#define VR4181_KEYEN __preg16(KSEG1 + 0x0B00031C) /* Keyboard Scan Pin Enable Register (R/W) */ -#define VR4181_PCS0STRA __preg16(KSEG1 + 0x0B000320) /* Programmable Chip Select [0] Start Address Register (R/W) */ -#define VR4181_PCS0STPA __preg16(KSEG1 + 0x0B000322) /* Programmable Chip Select [0] Stop Address Register (R/W) */ -#define VR4181_PCS0HIA __preg16(KSEG1 + 0x0B000324) /* Programmable Chip Select [0] High Address Register (R/W) */ -#define VR4181_PCS1STRA __preg16(KSEG1 + 0x0B000326) /* Programmable Chip Select [1] Start Address Register (R/W) */ -#define VR4181_PCS1STPA __preg16(KSEG1 + 0x0B000328) /* Programmable Chip Select [1] Stop Address Register (R/W) */ -#define VR4181_PCS1HIA __preg16(KSEG1 + 0x0B00032A) /* Programmable Chip Select [1] High Address Register (R/W) */ -#define VR4181_PCSMODE __preg16(KSEG1 + 0x0B00032C) /* Programmable Chip Select Mode Register (R/W) */ -#define VR4181_LCDGPMODE __preg16(KSEG1 + 0x0B00032E) /* LCD General Purpose Mode Register (R/W) */ -#define VR4181_MISCREG0 __preg16(KSEG1 + 0x0B000330) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG1 __preg16(KSEG1 + 0x0B000332) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG2 __preg16(KSEG1 + 0x0B000334) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG3 __preg16(KSEG1 + 0x0B000336) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG4 __preg16(KSEG1 + 0x0B000338) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG5 __preg16(KSEG1 + 0x0B00033A) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG6 __preg16(KSEG1 + 0x0B00033C) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG7 __preg16(KSEG1 + 0x0B00033D) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG8 __preg16(KSEG1 + 0x0B000340) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG9 __preg16(KSEG1 + 0x0B000342) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG10 __preg16(KSEG1 + 0x0B000344) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG11 __preg16(KSEG1 + 0x0B000346) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG12 __preg16(KSEG1 + 0x0B000348) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG13 __preg16(KSEG1 + 0x0B00034A) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG14 __preg16(KSEG1 + 0x0B00034C) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_MISCREG15 __preg16(KSEG1 + 0x0B00034E) /* Misc. R/W Battery Backed Registers for Non-Volatile Storage (R/W) */ -#define VR4181_SECIRQMASKL VR4181_GPINTEN -// No SECIRQMASKH for VR4181 - -// Touch Panel Interface Unit (PIU) -#define VR4181_PIUCNTREG __preg16(KSEG1 + 0x0B000122) /* PIU Control register (R/W) */ -#define VR4181_PIUCNTREG_PIUSEQEN 0x0004 -#define VR4181_PIUCNTREG_PIUPWR 0x0002 -#define VR4181_PIUCNTREG_PADRST 0x0001 - -#define VR4181_PIUINTREG __preg16(KSEG1 + 0x0B000124) /* PIU Interrupt cause register (R/W) */ -#define VR4181_PIUINTREG_OVP 0x8000 -#define VR4181_PIUINTREG_PADCMD 0x0040 -#define VR4181_PIUINTREG_PADADP 0x0020 -#define VR4181_PIUINTREG_PADPAGE1 0x0010 -#define VR4181_PIUINTREG_PADPAGE0 0x0008 -#define VR4181_PIUINTREG_PADDLOST 0x0004 -#define VR4181_PIUINTREG_PENCHG 0x0001 - -#define VR4181_PIUSIVLREG __preg16(KSEG1 + 0x0B000126) /* PIU Data sampling interval register (R/W) */ -#define VR4181_PIUSTBLREG __preg16(KSEG1 + 0x0B000128) /* PIU A/D converter start delay register (R/W) */ -#define VR4181_PIUCMDREG __preg16(KSEG1 + 0x0B00012A) /* PIU A/D command register (R/W) */ -#define VR4181_PIUASCNREG __preg16(KSEG1 + 0x0B000130) /* PIU A/D port scan register (R/W) */ -#define VR4181_PIUAMSKREG __preg16(KSEG1 + 0x0B000132) /* PIU A/D scan mask register (R/W) */ -#define VR4181_PIUCIVLREG __preg16(KSEG1 + 0x0B00013E) /* PIU Check interval register (R) */ -#define VR4181_PIUPB00REG __preg16(KSEG1 + 0x0B0002A0) /* PIU Page 0 Buffer 0 register (R/W) */ -#define VR4181_PIUPB01REG __preg16(KSEG1 + 0x0B0002A2) /* PIU Page 0 Buffer 1 register (R/W) */ -#define VR4181_PIUPB02REG __preg16(KSEG1 + 0x0B0002A4) /* PIU Page 0 Buffer 2 register (R/W) */ -#define VR4181_PIUPB03REG __preg16(KSEG1 + 0x0B0002A6) /* PIU Page 0 Buffer 3 register (R/W) */ -#define VR4181_PIUPB10REG __preg16(KSEG1 + 0x0B0002A8) /* PIU Page 1 Buffer 0 register (R/W) */ -#define VR4181_PIUPB11REG __preg16(KSEG1 + 0x0B0002AA) /* PIU Page 1 Buffer 1 register (R/W) */ -#define VR4181_PIUPB12REG __preg16(KSEG1 + 0x0B0002AC) /* PIU Page 1 Buffer 2 register (R/W) */ -#define VR4181_PIUPB13REG __preg16(KSEG1 + 0x0B0002AE) /* PIU Page 1 Buffer 3 register (R/W) */ -#define VR4181_PIUAB0REG __preg16(KSEG1 + 0x0B0002B0) /* PIU A/D scan Buffer 0 register (R/W) */ -#define VR4181_PIUAB1REG __preg16(KSEG1 + 0x0B0002B2) /* PIU A/D scan Buffer 1 register (R/W) */ -#define VR4181_PIUAB2REG __preg16(KSEG1 + 0x0B0002B4) /* PIU A/D scan Buffer 2 register (R/W) */ -#define VR4181_PIUAB3REG __preg16(KSEG1 + 0x0B0002B6) /* PIU A/D scan Buffer 3 register (R/W) */ -#define VR4181_PIUPB04REG __preg16(KSEG1 + 0x0B0002BC) /* PIU Page 0 Buffer 4 register (R/W) */ -#define VR4181_PIUPB14REG __preg16(KSEG1 + 0x0B0002BE) /* PIU Page 1 Buffer 4 register (R/W) */ - -// Audio Interface Unit (AIU) -#define VR4181_SODATREG __preg16(KSEG1 + 0x0B000166) /* Speaker Output Data Register (R/W) */ -#define VR4181_SCNTREG __preg16(KSEG1 + 0x0B000168) /* Speaker Output Control Register (R/W) */ -#define VR4181_MIDATREG __preg16(KSEG1 + 0x0B000170) /* Mike Input Data Register (R/W) */ -#define VR4181_MCNTREG __preg16(KSEG1 + 0x0B000172) /* Mike Input Control Register (R/W) */ -#define VR4181_DVALIDREG __preg16(KSEG1 + 0x0B000178) /* Data Valid Register (R/W) */ -#define VR4181_SEQREG __preg16(KSEG1 + 0x0B00017A) /* Sequential Register (R/W) */ -#define VR4181_INTREG __preg16(KSEG1 + 0x0B00017C) /* Interrupt Register (R/W) */ -#define VR4181_SDMADATREG __preg16(KSEG1 + 0x0B000160) /* Speaker DMA Data Register (R/W) */ -#define VR4181_MDMADATREG __preg16(KSEG1 + 0x0B000162) /* Microphone DMA Data Register (R/W) */ -#define VR4181_DAVREF_SETUP __preg16(KSEG1 + 0x0B000164) /* DAC Vref setup register (R/W) */ -#define VR4181_SCNVC_END __preg16(KSEG1 + 0x0B00016E) /* Speaker sample rate control (R/W) */ -#define VR4181_MIDATREG __preg16(KSEG1 + 0x0B000170) /* Microphone Input Data Register (R/W) */ -#define VR4181_MCNTREG __preg16(KSEG1 + 0x0B000172) /* Microphone Input Control Register (R/W) */ -#define VR4181_MCNVC_END __preg16(KSEG1 + 0x0B00017E) /* Microphone sample rate control (R/W) */ - -// Keyboard Interface Unit (KIU) -#define VR4181_KIUDAT0 __preg16(KSEG1 + 0x0B000180) /* KIU Data0 Register (R/W) */ -#define VR4181_KIUDAT1 __preg16(KSEG1 + 0x0B000182) /* KIU Data1 Register (R/W) */ -#define VR4181_KIUDAT2 __preg16(KSEG1 + 0x0B000184) /* KIU Data2 Register (R/W) */ -#define VR4181_KIUDAT3 __preg16(KSEG1 + 0x0B000186) /* KIU Data3 Register (R/W) */ -#define VR4181_KIUDAT4 __preg16(KSEG1 + 0x0B000188) /* KIU Data4 Register (R/W) */ -#define VR4181_KIUDAT5 __preg16(KSEG1 + 0x0B00018A) /* KIU Data5 Register (R/W) */ -#define VR4181_KIUSCANREP __preg16(KSEG1 + 0x0B000190) /* KIU Scan/Repeat Register (R/W) */ -#define VR4181_KIUSCANREP_KEYEN 0x8000 -#define VR4181_KIUSCANREP_SCANSTP 0x0008 -#define VR4181_KIUSCANREP_SCANSTART 0x0004 -#define VR4181_KIUSCANREP_ATSTP 0x0002 -#define VR4181_KIUSCANREP_ATSCAN 0x0001 -#define VR4181_KIUSCANS __preg16(KSEG1 + 0x0B000192) /* KIU Scan Status Register (R) */ -#define VR4181_KIUWKS __preg16(KSEG1 + 0x0B000194) /* KIU Wait Keyscan Stable Register (R/W) */ -#define VR4181_KIUWKI __preg16(KSEG1 + 0x0B000196) /* KIU Wait Keyscan Interval Register (R/W) */ -#define VR4181_KIUINT __preg16(KSEG1 + 0x0B000198) /* KIU Interrupt Register (R/W) */ -#define VR4181_KIUINT_KDATLOST 0x0004 -#define VR4181_KIUINT_KDATRDY 0x0002 -#define VR4181_KIUINT_SCANINT 0x0001 -#define VR4181_KIUDAT6 __preg16(KSEG1 + 0x0B00018C) /* Scan Line 6 Key Data Register (R) */ -#define VR4181_KIUDAT7 __preg16(KSEG1 + 0x0B00018E) /* Scan Line 7 Key Data Register (R) */ - -// CompactFlash Controller -#define VR4181_PCCARDINDEX __preg8(KSEG1 + 0x0B0008E0) /* PC Card Controller Index Register */ -#define VR4181_PCCARDDATA __preg8(KSEG1 + 0x0B0008E1) /* PC Card Controller Data Register */ -#define VR4181_INTSTATREG __preg16(KSEG1 + 0x0B0008F8) /* Interrupt Status Register (R/W) */ -#define VR4181_INTMSKREG __preg16(KSEG1 + 0x0B0008FA) /* Interrupt Mask Register (R/W) */ -#define VR4181_CFG_REG_1 __preg16(KSEG1 + 0x0B0008FE) /* Configuration Register 1 */ - -// LED Control Unit (LED) -#define VR4181_LEDHTSREG __preg16(KSEG1 + 0x0B000240) /* LED H Time Set register (R/W) */ -#define VR4181_LEDLTSREG __preg16(KSEG1 + 0x0B000242) /* LED L Time Set register (R/W) */ -#define VR4181_LEDCNTREG __preg16(KSEG1 + 0x0B000248) /* LED Control register (R/W) */ -#define VR4181_LEDASTCREG __preg16(KSEG1 + 0x0B00024A) /* LED Auto Stop Time Count register (R/W) */ -#define VR4181_LEDINTREG __preg16(KSEG1 + 0x0B00024C) /* LED Interrupt register (R/W) */ - -// Serial Interface Unit (SIU / SIU1 and SIU2) -#define VR4181_SIURB __preg8(KSEG1 + 0x0C000010) /* Receiver Buffer Register (Read) DLAB = 0 (R) */ -#define VR4181_SIUTH __preg8(KSEG1 + 0x0C000010) /* Transmitter Holding Register (Write) DLAB = 0 (W) */ -#define VR4181_SIUDLL __preg8(KSEG1 + 0x0C000010) /* Divisor Latch (Least Significant Byte) DLAB = 1 (R/W) */ -#define VR4181_SIUIE __preg8(KSEG1 + 0x0C000011) /* Interrupt Enable DLAB = 0 (R/W) */ -#define VR4181_SIUDLM __preg8(KSEG1 + 0x0C000011) /* Divisor Latch (Most Significant Byte) DLAB = 1 (R/W) */ -#define VR4181_SIUIID __preg8(KSEG1 + 0x0C000012) /* Interrupt Identification Register (Read) (R) */ -#define VR4181_SIUFC __preg8(KSEG1 + 0x0C000012) /* FIFO Control Register (Write) (W) */ -#define VR4181_SIULC __preg8(KSEG1 + 0x0C000013) /* Line Control Register (R/W) */ -#define VR4181_SIUMC __preg8(KSEG1 + 0x0C000014) /* MODEM Control Register (R/W) */ -#define VR4181_SIULS __preg8(KSEG1 + 0x0C000015) /* Line Status Register (R/W) */ -#define VR4181_SIUMS __preg8(KSEG1 + 0x0C000016) /* MODEM Status Register (R/W) */ -#define VR4181_SIUSC __preg8(KSEG1 + 0x0C000017) /* Scratch Register (R/W) */ -#define VR4181_SIURESET __preg8(KSEG1 + 0x0C000019) /* SIU Reset Register (R/W) */ -#define VR4181_SIUACTMSK __preg8(KSEG1 + 0x0C00001C) /* SIU Activity Mask (R/W) */ -#define VR4181_SIUACTTMR __preg8(KSEG1 + 0x0C00001E) /* SIU Activity Timer (R/W) */ -#define VR4181_SIURB_2 __preg8(KSEG1 + 0x0C000000) /* Receive Buffer Register (Read) (R) */ -#define VR4181_SIUTH_2 __preg8(KSEG1 + 0x0C000000) /* Transmitter Holding Register (Write) (W) */ -#define VR4181_SIUDLL_2 __preg8(KSEG1 + 0x0C000000) /* Divisor Latch (Least Significant Byte) (R/W) */ -#define VR4181_SIUIE_2 __preg8(KSEG1 + 0x0C000001) /* Interrupt Enable (DLAB = 0) (R/W) */ -#define VR4181_SIUDLM_2 __preg8(KSEG1 + 0x0C000001) /* Divisor Latch (Most Significant Byte) (DLAB = 1) (R/W) */ -#define VR4181_SIUIID_2 __preg8(KSEG1 + 0x0C000002) /* Interrupt Identification Register (Read) (R) */ -#define VR4181_SIUFC_2 __preg8(KSEG1 + 0x0C000002) /* FIFO Control Register (Write) (W) */ -#define VR4181_SIULC_2 __preg8(KSEG1 + 0x0C000003) /* Line Control Register (R/W) */ -#define VR4181_SIUMC_2 __preg8(KSEG1 + 0x0C000004) /* Modem Control Register (R/W) */ -#define VR4181_SIULS_2 __preg8(KSEG1 + 0x0C000005) /* Line Status Register (R/W) */ -#define VR4181_SIUMS_2 __preg8(KSEG1 + 0x0C000006) /* Modem Status Register (R/W) */ -#define VR4181_SIUSC_2 __preg8(KSEG1 + 0x0C000007) /* Scratch Register (R/W) */ -#define VR4181_SIUIRSEL_2 __preg8(KSEG1 + 0x0C000008) /* SIU IrDA Selectot (R/W) */ -#define VR4181_SIURESET_2 __preg8(KSEG1 + 0x0C000009) /* SIU Reset Register (R/W) */ -#define VR4181_SIUCSEL_2 __preg8(KSEG1 + 0x0C00000A) /* IrDA Echo-back Control (R/W) */ -#define VR4181_SIUACTMSK_2 __preg8(KSEG1 + 0x0C00000C) /* SIU Activity Mask Register (R/W) */ -#define VR4181_SIUACTTMR_2 __preg8(KSEG1 + 0x0C00000E) /* SIU Activity Timer Register (R/W) */ - - -// USB Module -#define VR4181_USBINFIFO __preg16(KSEG1 + 0x0B000780) /* USB Bulk Input FIFO (Bulk In End Point) (W) */ -#define VR4181_USBOUTFIFO __preg16(KSEG1 + 0x0B000782) /* USB Bulk Output FIFO (Bulk Out End Point) (R) */ -#define VR4181_USBCTLFIFO __preg16(KSEG1 + 0x0B000784) /* USB Control FIFO (Control End Point) (W) */ -#define VR4181_USBSTAT __preg16(KSEG1 + 0x0B000786) /* Interrupt Status Register (R/W) */ -#define VR4181_USBINTMSK __preg16(KSEG1 + 0x0B000788) /* Interrupt Mask Register (R/W) */ -#define VR4181_USBCTLREG __preg16(KSEG1 + 0x0B00078A) /* Control Register (R/W) */ -#define VR4181_USBSTPREG __preg16(KSEG1 + 0x0B00078C) /* USB Transfer Stop Register (R/W) */ - -// LCD Controller -#define VR4181_HRTOTALREG __preg16(KSEG1 + 0x0A000400) /* Horizontal total Register (R/W) */ -#define VR4181_HRVISIBREG __preg16(KSEG1 + 0x0A000402) /* Horizontal Visible Register (R/W) */ -#define VR4181_LDCLKSTREG __preg16(KSEG1 + 0x0A000404) /* Load clock start Register (R/W) */ -#define VR4181_LDCLKNDREG __preg16(KSEG1 + 0x0A000406) /* Load clock end Register (R/W) */ -#define VR4181_VRTOTALREG __preg16(KSEG1 + 0x0A000408) /* Vertical Total Register (R/W) */ -#define VR4181_VRVISIBREG __preg16(KSEG1 + 0x0A00040A) /* Vertical Visible Register (R/W) */ -#define VR4181_FVSTARTREG __preg16(KSEG1 + 0x0A00040C) /* FLM vertical start Register (R/W) */ -#define VR4181_FVENDREG __preg16(KSEG1 + 0x0A00040E) /* FLM vertical end Register (R/W) */ -#define VR4181_LCDCTRLREG __preg16(KSEG1 + 0x0A000410) /* LCD control Register (R/W) */ -#define VR4181_LCDINRQREG __preg16(KSEG1 + 0x0A000412) /* LCD Interrupt request Register (R/W) */ -#define VR4181_LCDCFGREG0 __preg16(KSEG1 + 0x0A000414) /* LCD Configuration Register 0 (R/W) */ -#define VR4181_LCDCFGREG1 __preg16(KSEG1 + 0x0A000416) /* LCD Configuration Register 1 (R/W) */ -#define VR4181_FBSTAD1REG __preg16(KSEG1 + 0x0A000418) /* Frame Buffer Start Address 1 Register (R/W) */ -#define VR4181_FBSTAD2REG __preg16(KSEG1 + 0x0A00041A) /* Frame Buffer Start Address 2 Register (R/W) */ -#define VR4181_FBNDAD1REG __preg16(KSEG1 + 0x0A000420) /* Frame Buffer End Address 1 Register (R/W) */ -#define VR4181_FBNDAD2REG __preg16(KSEG1 + 0x0A000422) /* Frame Buffer End Address 2 register (R/W) */ -#define VR4181_FHSTARTREG __preg16(KSEG1 + 0x0A000424) /* FLM horizontal Start Register (R/W) */ -#define VR4181_FHENDREG __preg16(KSEG1 + 0x0A000426) /* FLM horizontal End Register (R/W) */ -#define VR4181_PWRCONREG1 __preg16(KSEG1 + 0x0A000430) /* Power Control register 1 (R/W) */ -#define VR4181_PWRCONREG2 __preg16(KSEG1 + 0x0A000432) /* Power Control register 2 (R/W) */ -#define VR4181_LCDIMSKREG __preg16(KSEG1 + 0x0A000434) /* LCD Interrupt Mask register (R/W) */ -#define VR4181_CPINDCTREG __preg16(KSEG1 + 0x0A00047E) /* Color palette Index and control Register (R/W) */ -#define VR4181_CPALDATREG __preg32(KSEG1 + 0x0A000480) /* Color palette data register (32bits Register) (R/W) */ - -// physical address spaces -#define VR4181_LCD 0x0a000000 -#define VR4181_INTERNAL_IO_2 0x0b000000 -#define VR4181_INTERNAL_IO_1 0x0c000000 -#define VR4181_ISA_MEM 0x10000000 -#define VR4181_ISA_IO 0x14000000 -#define VR4181_ROM 0x18000000 - -// This is the base address for IO port decoding to which the 16 bit IO port address -// is added. Defining it to 0 will usually cause a kernel oops any time port IO is -// attempted, which can be handy for turning up parts of the kernel that make -// incorrect architecture assumptions (by assuming that everything acts like a PC), -// but we need it correctly defined to use the PCMCIA/CF controller: -#define VR4181_PORT_BASE (KSEG1 + VR4181_ISA_IO) -#define VR4181_ISAMEM_BASE (KSEG1 + VR4181_ISA_MEM) - -#endif /* __ASM_VR4181_VR4181_H */ -- cgit v1.2.3 From 003b54925e2ac78306f74ac433126ad5de387f7a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:08 -0700 Subject: [PATCH] mips: remove HP Laserjet remains Remove the one file which managed to survive the removel of HP Laserjet support. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/hp-lj/asic.h | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 include/asm-mips/hp-lj/asic.h (limited to 'include') diff --git a/include/asm-mips/hp-lj/asic.h b/include/asm-mips/hp-lj/asic.h deleted file mode 100644 index fc2ca656da0..00000000000 --- a/include/asm-mips/hp-lj/asic.h +++ /dev/null @@ -1,7 +0,0 @@ - -typedef enum { IllegalAsic, UnknownAsic, AndrosAsic, HarmonyAsic } AsicId; - -AsicId GetAsicId(void); - -const char* const GetAsicName(void); - -- cgit v1.2.3 From af690a948cc545d1eca19acab23016b96e178dcf Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:09 -0700 Subject: [PATCH] DEC PMAG BA frame buffer update Rewrite PMAG BA frame buffer driver for 2.6. Acked-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/pmag-ba-fb.h | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/video/pmag-ba-fb.h b/include/video/pmag-ba-fb.h index cebef073b9a..fceb6c0f658 100644 --- a/include/video/pmag-ba-fb.h +++ b/include/video/pmag-ba-fb.h @@ -1,24 +1,27 @@ /* - * linux/drivers/video/pmag-ba-fb.h + * linux/include/video/pmag-ba-fb.h * - * TurboChannel PMAG-BA framebuffer card support, - * Copyright (C) 1999,2000,2001 by - * Michael Engel , - * Karsten Merker - * This file is subject to the terms and conditions of the GNU General - * Public License. See the file COPYING in the main directory of this - * archive for more details. - */ - -/* - * Bt459 RAM DAC register base offset (rel. to TC slot base address) + * TURBOchannel PMAG-BA Color Frame Buffer (CFB) card support, + * Copyright (C) 1999, 2000, 2001 by + * Michael Engel , + * Karsten Merker + * Copyright (c) 2005 Maciej W. Rozycki + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. */ -#define PMAG_BA_BT459_OFFSET 0x00200000 - -/* - * Begin of PMAG-BA framebuffer memory relative to TC slot address, - * resolution is 1024x864x8 - */ +/* IOmem resource offsets. */ +#define PMAG_BA_FBMEM 0x000000 /* frame buffer */ +#define PMAG_BA_BT459 0x200000 /* Bt459 RAMDAC */ +#define PMAG_BA_IRQ 0x300000 /* IRQ acknowledge */ +#define PMAG_BA_ROM 0x380000 /* REX option ROM */ +#define PMAG_BA_BT438 0x380000 /* Bt438 clock chip reset */ +#define PMAG_BA_SIZE 0x400000 /* address space size */ -#define PMAG_BA_ONBOARD_FBMEM_OFFSET 0x00000000 +/* Bt459 register offsets, byte-wide registers. */ +#define BT459_ADDR_LO 0x0 /* address low */ +#define BT459_ADDR_HI 0x4 /* address high */ +#define BT459_DATA 0x8 /* data window register */ +#define BT459_CMAP 0xc /* color map window register */ -- cgit v1.2.3 From 7901c7998267d9d8c3f1b226a8c8cfd7f8e48a01 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:11 -0700 Subject: [PATCH] DEC PMAGB B framebuffer update Revive HX frame buffer support for 2.6. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/pmagb-b-fb.h | 74 +++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/video/pmagb-b-fb.h b/include/video/pmagb-b-fb.h index 87b81a55513..7539b9087a8 100644 --- a/include/video/pmagb-b-fb.h +++ b/include/video/pmagb-b-fb.h @@ -1,32 +1,58 @@ /* - * linux/drivers/video/pmagb-b-fb.h + * linux/include/video/pmagb-b-fb.h * - * TurboChannel PMAGB-B framebuffer card support, - * Copyright (C) 1999, 2000, 2001 by - * Michael Engel and - * Karsten Merker - * This file is subject to the terms and conditions of the GNU General - * Public License. See the file COPYING in the main directory of this - * archive for more details. + * TURBOchannel PMAGB-B Smart Frame Buffer (SFB) card support, + * Copyright (C) 1999, 2000, 2001 by + * Michael Engel and + * Karsten Merker + * Copyright (c) 2005 Maciej W. Rozycki + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. */ +/* IOmem resource offsets. */ +#define PMAGB_B_ROM 0x000000 /* REX option ROM */ +#define PMAGB_B_SFB 0x100000 /* SFB ASIC */ +#define PMAGB_B_GP0 0x140000 /* general purpose output 0 */ +#define PMAGB_B_GP1 0x180000 /* general purpose output 1 */ +#define PMAGB_B_BT459 0x1c0000 /* Bt459 RAMDAC */ +#define PMAGB_B_FBMEM 0x200000 /* frame buffer */ +#define PMAGB_B_SIZE 0x400000 /* address space size */ -/* - * Bt459 RAM DAC register base offset (rel. to TC slot base address) - */ -#define PMAGB_B_BT459_OFFSET 0x001C0000 +/* IOmem register offsets. */ +#define SFB_REG_VID_HOR 0x64 /* video horizontal setup */ +#define SFB_REG_VID_VER 0x68 /* video vertical setup */ +#define SFB_REG_VID_BASE 0x6c /* video base address */ +#define SFB_REG_TCCLK_COUNT 0x78 /* TURBOchannel clock count */ +#define SFB_REG_VIDCLK_COUNT 0x7c /* video clock count */ -/* - * Begin of PMAGB-B framebuffer memory, resolution is configurable: - * 1024x864x8 or 1280x1024x8, settable by jumper on the card - */ -#define PMAGB_B_ONBOARD_FBMEM_OFFSET 0x00201000 +/* Video horizontal setup register constants. All bits are r/w. */ +#define SFB_VID_HOR_BP_SHIFT 0x15 /* back porch */ +#define SFB_VID_HOR_BP_MASK 0x7f +#define SFB_VID_HOR_SYN_SHIFT 0x0e /* sync pulse */ +#define SFB_VID_HOR_SYN_MASK 0x7f +#define SFB_VID_HOR_FP_SHIFT 0x09 /* front porch */ +#define SFB_VID_HOR_FP_MASK 0x1f +#define SFB_VID_HOR_PIX_SHIFT 0x00 /* active video */ +#define SFB_VID_HOR_PIX_MASK 0x1ff -/* - * Bt459 register offsets, byte-wide registers - */ +/* Video vertical setup register constants. All bits are r/w. */ +#define SFB_VID_VER_BP_SHIFT 0x16 /* back porch */ +#define SFB_VID_VER_BP_MASK 0x3f +#define SFB_VID_VER_SYN_SHIFT 0x10 /* sync pulse */ +#define SFB_VID_VER_SYN_MASK 0x3f +#define SFB_VID_VER_FP_SHIFT 0x0b /* front porch */ +#define SFB_VID_VER_FP_MASK 0x1f +#define SFB_VID_VER_SL_SHIFT 0x00 /* active scan lines */ +#define SFB_VID_VER_SL_MASK 0x7ff + +/* Video base address register constants. All bits are r/w. */ +#define SFB_VID_BASE_MASK 0x1ff /* video base row address */ -#define BT459_ADR_LOW BT459_OFFSET + 0x00 /* addr. low */ -#define BT459_ADR_HIGH BT459_OFFSET + 0x04 /* addr. high */ -#define BT459_DATA BT459_OFFSET + 0x08 /* r/w data */ -#define BT459_CMAP BT459_OFFSET + 0x0C /* color map */ +/* Bt459 register offsets, byte-wide registers. */ +#define BT459_ADDR_LO 0x0 /* address low */ +#define BT459_ADDR_HI 0x4 /* address high */ +#define BT459_DATA 0x8 /* data window register */ +#define BT459_CMAP 0xc /* color map window register */ -- cgit v1.2.3 From 07119621e62de0a2c8db6e4896e762c498bfdd17 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:11 -0700 Subject: [PATCH] mips: add support for Qemu system architecture Add support for the virtual MIPS system that is emulated by Qemu. See http://www.linux-mips.org/wiki/Qemu for a detailed current status. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/mach-qemu/cpu-feature-overrides.h | 31 ++++++++++++++++++++++ include/asm-mips/mach-qemu/param.h | 13 +++++++++ include/asm-mips/qemu.h | 24 +++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 include/asm-mips/mach-qemu/cpu-feature-overrides.h create mode 100644 include/asm-mips/mach-qemu/param.h create mode 100644 include/asm-mips/qemu.h (limited to 'include') diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h new file mode 100644 index 00000000000..f4e370e2716 --- /dev/null +++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.h @@ -0,0 +1,31 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2003 Ralf Baechle + */ +#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H +#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H + +/* + * QEMU only comes with a hazard-free MIPS32 processor, so things are easy. + */ +#define cpu_has_mips16 0 +#define cpu_has_divec 0 +#define cpu_has_cache_cdex_p 0 +#define cpu_has_prefetch 0 +#define cpu_has_mcheck 0 +#define cpu_has_ejtag 0 + +#define cpu_has_llsc 1 +#define cpu_has_vtag_icache 0 +#define cpu_has_dc_aliases (PAGE_SIZE < 0x4000) +#define cpu_has_ic_fills_f_dc 0 + +#define cpu_has_dsp 0 + +#define cpu_has_nofpuex 0 +#define cpu_has_64bits 0 + +#endif /* __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H */ diff --git a/include/asm-mips/mach-qemu/param.h b/include/asm-mips/mach-qemu/param.h new file mode 100644 index 00000000000..cb30ee490ae --- /dev/null +++ b/include/asm-mips/mach-qemu/param.h @@ -0,0 +1,13 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 by Ralf Baechle + */ +#ifndef __ASM_MACH_QEMU_PARAM_H +#define __ASM_MACH_QEMU_PARAM_H + +#define HZ 100 /* Internal kernel timer frequency */ + +#endif /* __ASM_MACH_QEMU_PARAM_H */ diff --git a/include/asm-mips/qemu.h b/include/asm-mips/qemu.h new file mode 100644 index 00000000000..905c3958590 --- /dev/null +++ b/include/asm-mips/qemu.h @@ -0,0 +1,24 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2005 by Ralf Baechle (ralf@linux-mips.org) + */ +#ifndef __ASM_QEMU_H +#define __ASM_QEMU_H + +/* + * Interrupt numbers + */ +#define Q_PIC_IRQ_BASE 0 +#define Q_COUNT_COMPARE_IRQ 16 + +/* + * Qemu clock rate. Unlike on real MIPS this has no relation to the + * instruction issue rate, so the choosen value is pure fiction, just needs + * to match the value in Qemu itself. + */ +#define QEMU_C0_COUNTER_CLOCK 100000000 + +#endif /* __ASM_QEMU_H */ -- cgit v1.2.3 From dc4ec916f6ea0c2818e9b81c4e9b33231f5f70e4 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:12 -0700 Subject: [PATCH] MIPS Technologies PCI ID bits - MIPS Denmark does no longer exist; the PCI vendor ID is now owned by MIPS Technologies. - Add ID for SOC-it, MIPS's system controller. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pci_ids.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d513c163400..95c941f8c74 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2147,6 +2147,9 @@ #define PCI_DEVICE_ID_ENE_1420 0x1420 #define PCI_VENDOR_ID_CHELSIO 0x1425 +#define PCI_VENDOR_ID_MIPS 0x153f +#define PCI_DEVICE_ID_SOC_IT 0x0001 + #define PCI_VENDOR_ID_SYBA 0x1592 #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 #define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 -- cgit v1.2.3 From 875d43e72b5bf22161a81de7554f88eccf8a51ae Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:16 -0700 Subject: [PATCH] mips: clean up 32/64-bit configuration Start cleaning 32-bit vs. 64-bit configuration. Signed-off-by: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/a.out.h | 4 ++-- include/asm-mips/addrspace.h | 2 +- include/asm-mips/asmmacro.h | 4 ++-- include/asm-mips/atomic.h | 4 ++-- include/asm-mips/bitops.h | 8 ++++---- include/asm-mips/bugs.h | 2 +- include/asm-mips/checksum.h | 4 ++-- include/asm-mips/cpu-features.h | 4 ++-- include/asm-mips/dec/prom.h | 12 ++++++------ include/asm-mips/delay.h | 6 +++--- include/asm-mips/elf.h | 16 ++++++++-------- include/asm-mips/local.h | 4 ++-- include/asm-mips/mach-generic/spaces.h | 8 ++++---- include/asm-mips/mach-ip22/spaces.h | 8 ++++---- include/asm-mips/mach-ip32/cpu-feature-overrides.h | 2 +- include/asm-mips/mmu_context.h | 6 +++--- include/asm-mips/module.h | 4 ++-- include/asm-mips/msgbuf.h | 12 ++++++------ include/asm-mips/paccess.h | 4 ++-- include/asm-mips/pgalloc.h | 4 ++-- include/asm-mips/pgtable.h | 4 ++-- include/asm-mips/processor.h | 4 ++-- include/asm-mips/ptrace.h | 2 +- include/asm-mips/reg.h | 6 +++--- include/asm-mips/resource.h | 2 +- include/asm-mips/sgiarcs.h | 8 ++++---- include/asm-mips/siginfo.h | 4 ++-- include/asm-mips/sim.h | 8 ++++---- include/asm-mips/stackframe.h | 22 +++++++++++----------- include/asm-mips/string.h | 8 ++++---- include/asm-mips/system.h | 4 ++-- include/asm-mips/thread_info.h | 4 ++-- include/asm-mips/types.h | 2 +- include/asm-mips/uaccess.h | 8 ++++---- include/asm-mips/unistd.h | 2 +- 35 files changed, 103 insertions(+), 103 deletions(-) (limited to 'include') diff --git a/include/asm-mips/a.out.h b/include/asm-mips/a.out.h index e42b3093e90..2b3dc3bed4d 100644 --- a/include/asm-mips/a.out.h +++ b/include/asm-mips/a.out.h @@ -35,10 +35,10 @@ struct exec #ifdef __KERNEL__ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define STACK_TOP TASK_SIZE #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define STACK_TOP (current->thread.mflags & MF_32BIT_ADDR ? TASK_SIZE32 : TASK_SIZE) #endif diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 2caa8c42720..7dc2619f500 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h @@ -48,7 +48,7 @@ #define CPHYSADDR(a) ((_ACAST32_ (a)) & 0x1fffffff) #define XPHYSADDR(a) ((_ACAST64_ (a)) & 0x000000ffffffffff) -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT /* * Memory segments (64bit kernel mode addresses) diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 37a460aa037..40ceedcf454 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h @@ -11,10 +11,10 @@ #include #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #include #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #include #endif diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 7d89e87bc8c..c0bd8d014e1 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h @@ -334,7 +334,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) */ #define atomic_add_negative(i,v) (atomic_add_return(i, (v)) < 0) -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT typedef struct { volatile __s64 counter; } atomic64_t; @@ -639,7 +639,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) */ #define atomic64_add_negative(i,v) (atomic64_add_return(i, (v)) < 0) -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ /* * atomic*_return operations are serializing but not the non-*_return diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 779d2187a6a..bc136dcfdbe 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h @@ -533,14 +533,14 @@ static inline unsigned long ffz(unsigned long word) int b = 0, s; word = ~word; -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT s = 16; if (word << 16 != 0) s = 0; b += s; word >>= s; s = 8; if (word << 24 != 0) s = 0; b += s; word >>= s; s = 4; if (word << 28 != 0) s = 0; b += s; word >>= s; s = 2; if (word << 30 != 0) s = 0; b += s; word >>= s; s = 1; if (word << 31 != 0) s = 0; b += s; #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT s = 32; if (word << 32 != 0) s = 0; b += s; word >>= s; s = 16; if (word << 48 != 0) s = 0; b += s; word >>= s; s = 8; if (word << 56 != 0) s = 0; b += s; word >>= s; @@ -683,7 +683,7 @@ found_middle: */ static inline int sched_find_first_bit(const unsigned long *b) { -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT if (unlikely(b[0])) return __ffs(b[0]); if (unlikely(b[1])) @@ -694,7 +694,7 @@ static inline int sched_find_first_bit(const unsigned long *b) return __ffs(b[3]) + 96; return __ffs(b[4]) + 128; #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT if (unlikely(b[0])) return __ffs(b[0]); if (unlikely(b[1])) diff --git a/include/asm-mips/bugs.h b/include/asm-mips/bugs.h index 18cced19cca..b14b961c210 100644 --- a/include/asm-mips/bugs.h +++ b/include/asm-mips/bugs.h @@ -15,7 +15,7 @@ extern void check_bugs64(void); static inline void check_bugs(void) { check_bugs32(); -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT check_bugs64(); #endif } diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index c25cc92b995..c1ea5a8714f 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h @@ -128,7 +128,7 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, { __asm__( ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t" -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT "addu\t%0, %2\n\t" "sltu\t$1, %0, %2\n\t" "addu\t%0, $1\n\t" @@ -141,7 +141,7 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr, "sltu\t$1, %0, %4\n\t" "addu\t%0, $1\n\t" #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT "daddu\t%0, %2\n\t" "daddu\t%0, %3\n\t" "daddu\t%0, %4\n\t" diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 1df2c299de8..9a2de642eee 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h @@ -106,7 +106,7 @@ #define PLAT_TRAMPOLINE_STUFF_LINE 0UL #endif -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT # ifndef cpu_has_nofpuex # define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX) # endif @@ -124,7 +124,7 @@ # endif #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT # ifndef cpu_has_nofpuex # define cpu_has_nofpuex 0 # endif diff --git a/include/asm-mips/dec/prom.h b/include/asm-mips/dec/prom.h index b63e2f2317d..a05d6d3395f 100644 --- a/include/asm-mips/dec/prom.h +++ b/include/asm-mips/dec/prom.h @@ -48,15 +48,15 @@ */ #define REX_PROM_MAGIC 0x30464354 -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ -#else /* !CONFIG_MIPS64 */ +#else /* !CONFIG_64BIT */ #define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC) -#endif /* !CONFIG_MIPS64 */ +#endif /* !CONFIG_64BIT */ /* @@ -105,7 +105,7 @@ extern int (*__pmax_read)(int, void *, int); extern int (*__pmax_close)(int); -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT /* * On MIPS64 we have to call PROM functions via a helper @@ -138,7 +138,7 @@ int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32; #define prom_getenv(x) _prom_getenv(__prom_getenv, x) #define prom_printf(x...) _prom_printf(__prom_printf, x) -#else /* !CONFIG_MIPS64 */ +#else /* !CONFIG_64BIT */ /* * On plain MIPS we just call PROM functions directly. @@ -160,7 +160,7 @@ int _prom_printf(int (*)(char *, ...), char *, ...) __DEC_PROM_O32; #define pmax_read __pmax_read #define pmax_close __pmax_close -#endif /* !CONFIG_MIPS64 */ +#endif /* !CONFIG_64BIT */ extern void prom_meminit(u32); diff --git a/include/asm-mips/delay.h b/include/asm-mips/delay.h index d0f68447e5a..a606dbee041 100644 --- a/include/asm-mips/delay.h +++ b/include/asm-mips/delay.h @@ -57,11 +57,11 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj) * The common rates of 1000 and 128 are rounded wrongly by the * catchall case for 64-bit. Excessive precission? Probably ... */ -#if defined(CONFIG_MIPS64) && (HZ == 128) +#if defined(CONFIG_64BIT) && (HZ == 128) usecs *= 0x0008637bd05af6c7UL; /* 2**64 / (1000000 / HZ) */ -#elif defined(CONFIG_MIPS64) && (HZ == 1000) +#elif defined(CONFIG_64BIT) && (HZ == 1000) usecs *= 0x004189374BC6A7f0UL; /* 2**64 / (1000000 / HZ) */ -#elif defined(CONFIG_MIPS64) +#elif defined(CONFIG_64BIT) usecs *= (0x8000000000000000UL / (500000 / HZ)); #else /* 32-bit junk follows here */ usecs *= (unsigned long) (((0x8000000000000000ULL / (500000 / HZ)) + diff --git a/include/asm-mips/elf.h b/include/asm-mips/elf.h index 7b92c8045cc..e4881144001 100644 --- a/include/asm-mips/elf.h +++ b/include/asm-mips/elf.h @@ -125,7 +125,7 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT /* * This is used to ensure we don't load something for the wrong architecture. @@ -153,9 +153,9 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; */ #define ELF_CLASS ELFCLASS32 -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT /* * This is used to ensure we don't load something for the wrong architecture. */ @@ -177,7 +177,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; */ #define ELF_CLASS ELFCLASS64 -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ /* * These are used to set parameters in the core dumps. @@ -193,7 +193,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; #ifdef __KERNEL__ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define SET_PERSONALITY(ex, ibcs2) \ do { \ @@ -202,9 +202,9 @@ do { \ set_personality(PER_LINUX); \ } while (0) -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define SET_PERSONALITY(ex, ibcs2) \ do { current->thread.mflags &= ~MF_ABI_MASK; \ @@ -222,7 +222,7 @@ do { current->thread.mflags &= ~MF_ABI_MASK; \ set_personality(PER_LINUX); \ } while (0) -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ extern void dump_regs(elf_greg_t *, struct pt_regs *regs); extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h index 7eb6bf661b8..c38844f615f 100644 --- a/include/asm-mips/local.h +++ b/include/asm-mips/local.h @@ -5,7 +5,7 @@ #include #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT typedef atomic_t local_t; @@ -20,7 +20,7 @@ typedef atomic_t local_t; #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT typedef atomic64_t local_t; diff --git a/include/asm-mips/mach-generic/spaces.h b/include/asm-mips/mach-generic/spaces.h index 63c0a81c783..5a2c1efb4eb 100644 --- a/include/asm-mips/mach-generic/spaces.h +++ b/include/asm-mips/mach-generic/spaces.h @@ -12,7 +12,7 @@ #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define CAC_BASE 0x80000000 #define IO_BASE 0xa0000000 @@ -32,9 +32,9 @@ #define HIGHMEM_START 0x20000000UL #endif -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT /* * This handles the memory map. @@ -67,6 +67,6 @@ #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ #endif /* __ASM_MACH_GENERIC_SPACES_H */ diff --git a/include/asm-mips/mach-ip22/spaces.h b/include/asm-mips/mach-ip22/spaces.h index 30d42fcafe3..e96166f27c4 100644 --- a/include/asm-mips/mach-ip22/spaces.h +++ b/include/asm-mips/mach-ip22/spaces.h @@ -12,7 +12,7 @@ #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define CAC_BASE 0x80000000 #define IO_BASE 0xa0000000 @@ -32,9 +32,9 @@ #define HIGHMEM_START 0x20000000UL #endif -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define PAGE_OFFSET 0xffffffff80000000UL #ifndef HIGHMEM_START @@ -50,6 +50,6 @@ #define TO_CAC(x) (CAC_BASE | ((x) & TO_PHYS_MASK)) #define TO_UNCAC(x) (UNCAC_BASE | ((x) & TO_PHYS_MASK)) -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ #endif /* __ASM_MACH_IP22_SPACES_H */ diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h index b932237f219..04713973c6c 100644 --- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h +++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h @@ -18,7 +18,7 @@ * so, for 64bit IP32 kernel we just don't use ll/sc. * This does not affect luserland. */ -#if defined(CONFIG_CPU_R5000) && defined(CONFIG_MIPS64) +#if defined(CONFIG_CPU_R5000) && defined(CONFIG_64BIT) #define cpu_has_llsc 0 #else #define cpu_has_llsc 1 diff --git a/include/asm-mips/mmu_context.h b/include/asm-mips/mmu_context.h index 48b77c9fb4f..45cd72d172e 100644 --- a/include/asm-mips/mmu_context.h +++ b/include/asm-mips/mmu_context.h @@ -28,17 +28,17 @@ extern unsigned long pgd_current[]; #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ pgd_current[smp_processor_id()] = (unsigned long)(pgd) -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define TLBMISS_HANDLER_SETUP() \ write_c0_context((unsigned long) smp_processor_id() << 23); \ TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) #endif -#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) #define TLBMISS_HANDLER_SETUP() \ write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \ TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) #endif -#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) #define TLBMISS_HANDLER_SETUP() \ write_c0_context((unsigned long) smp_processor_id() << 23); \ TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) diff --git a/include/asm-mips/module.h b/include/asm-mips/module.h index 90ee24aad95..0be58b2aeb9 100644 --- a/include/asm-mips/module.h +++ b/include/asm-mips/module.h @@ -25,7 +25,7 @@ typedef struct Elf64_Sxword r_addend; /* Addend. */ } Elf64_Mips_Rela; -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define Elf_Shdr Elf32_Shdr #define Elf_Sym Elf32_Sym @@ -33,7 +33,7 @@ typedef struct #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define Elf_Shdr Elf64_Shdr #define Elf_Sym Elf64_Sym diff --git a/include/asm-mips/msgbuf.h b/include/asm-mips/msgbuf.h index 513b2824838..a1533959742 100644 --- a/include/asm-mips/msgbuf.h +++ b/include/asm-mips/msgbuf.h @@ -15,25 +15,25 @@ struct msqid64_ds { struct ipc64_perm msg_perm; -#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused1; #endif __kernel_time_t msg_stime; /* last msgsnd time */ -#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused1; #endif -#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused2; #endif __kernel_time_t msg_rtime; /* last msgrcv time */ -#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused2; #endif -#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused3; #endif __kernel_time_t msg_ctime; /* last change time */ -#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) +#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN) unsigned long __unused3; #endif unsigned long msg_cbytes; /* current number of bytes on queue */ diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h index 36cec9e3169..309bc3099f6 100644 --- a/include/asm-mips/paccess.h +++ b/include/asm-mips/paccess.h @@ -16,10 +16,10 @@ #include #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define __PA_ADDR ".word" #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define __PA_ADDR ".dword" #endif diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h index 2d63f5ba403..ce57288d43b 100644 --- a/include/asm-mips/pgalloc.h +++ b/include/asm-mips/pgalloc.h @@ -85,7 +85,7 @@ static inline void pte_free(struct page *pte) #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define pgd_populate(mm, pmd, pte) BUG() /* @@ -97,7 +97,7 @@ static inline void pte_free(struct page *pte) #define __pmd_free_tlb(tlb,x) do { } while (0) #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd)) diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h index e76ccd6e3a5..dbe13da0bda 100644 --- a/include/asm-mips/pgtable.h +++ b/include/asm-mips/pgtable.h @@ -11,10 +11,10 @@ #include #include -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #include #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #include #endif diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 13c54d5b3b4..d6466aa09fb 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -33,7 +33,7 @@ extern void (*cpu_wait)(void); extern unsigned int vced_count, vcei_count; -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT /* * User space process size: 2GB. This is hardcoded into a few places, * so don't change it unless you know what you are doing. @@ -47,7 +47,7 @@ extern unsigned int vced_count, vcei_count; #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT /* * User space process size: 1TB. This is hardcoded into a few places, * so don't change it unless you know what you are doing. TASK_SIZE diff --git a/include/asm-mips/ptrace.h b/include/asm-mips/ptrace.h index d3c46d63382..2b5c624c3d4 100644 --- a/include/asm-mips/ptrace.h +++ b/include/asm-mips/ptrace.h @@ -28,7 +28,7 @@ * system call/exception. As usual the registers k0/k1 aren't being saved. */ struct pt_regs { -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT /* Pad bytes for argument save space on the stack. */ unsigned long pad0[6]; #endif diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h index 7b33bbca958..a1ebd3aa93a 100644 --- a/include/asm-mips/reg.h +++ b/include/asm-mips/reg.h @@ -14,7 +14,7 @@ #include -#if defined(CONFIG_MIPS32) || defined(WANT_COMPAT_REG_H) +#if defined(CONFIG_32BIT) || defined(WANT_COMPAT_REG_H) #define EF_R0 6 #define EF_R1 7 @@ -70,7 +70,7 @@ #endif -#if CONFIG_MIPS64 +#if CONFIG_64BIT #define EF_R0 0 #define EF_R1 1 @@ -124,6 +124,6 @@ #define EF_SIZE 304 /* size in bytes */ -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ #endif /* __ASM_MIPS_REG_H */ diff --git a/include/asm-mips/resource.h b/include/asm-mips/resource.h index fd3c6d17a5f..1fba00c2207 100644 --- a/include/asm-mips/resource.h +++ b/include/asm-mips/resource.h @@ -27,7 +27,7 @@ * but we keep the old value on MIPS32, * for compatibility: */ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT # define RLIM_INFINITY 0x7fffffffUL #endif diff --git a/include/asm-mips/sgiarcs.h b/include/asm-mips/sgiarcs.h index 59450335f04..722b77a8c5e 100644 --- a/include/asm-mips/sgiarcs.h +++ b/include/asm-mips/sgiarcs.h @@ -367,7 +367,7 @@ struct linux_smonblock { * Macros for calling a 32-bit ARC implementation from 64-bit code */ -#if defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) +#if defined(CONFIG_64BIT) && defined(CONFIG_ARC32) #define __arc_clobbers \ "$2","$3" /* ... */, "$8","$9","$10","$11", \ @@ -476,10 +476,10 @@ struct linux_smonblock { __res; \ }) -#endif /* defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) */ +#endif /* defined(CONFIG_64BIT) && defined(CONFIG_ARC32) */ -#if (defined(CONFIG_MIPS32) && defined(CONFIG_ARC32)) || \ - (defined(CONFIG_MIPS64) && defined(CONFIG_ARC64)) +#if (defined(CONFIG_32BIT) && defined(CONFIG_ARC32)) || \ + (defined(CONFIG_64BIT) && defined(CONFIG_ARC64)) #define ARC_CALL0(dest) \ ({ long __res; \ diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h index a0e26e6c994..698becab5a9 100644 --- a/include/asm-mips/siginfo.h +++ b/include/asm-mips/siginfo.h @@ -25,10 +25,10 @@ struct siginfo; /* * Careful to keep union _sifields from shifting ... */ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) #endif -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) #endif diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h index 6333169be32..3ccfe09fa74 100644 --- a/include/asm-mips/sim.h +++ b/include/asm-mips/sim.h @@ -16,7 +16,7 @@ #define __str2(x) #x #define __str(x) __str2(x) -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define save_static_function(symbol) \ __asm__ ( \ @@ -42,9 +42,9 @@ __asm__ ( \ #define nabi_no_regargs -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define save_static_function(symbol) \ __asm__ ( \ @@ -78,6 +78,6 @@ __asm__ ( \ unsigned long __dummy6, \ unsigned long __dummy7, -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ #endif /* _ASM_SIM_H */ diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 86283c25fd5..fb42f99f852 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h @@ -26,7 +26,7 @@ .macro SAVE_TEMP mfhi v1 -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT LONG_S $8, PT_R8(sp) LONG_S $9, PT_R9(sp) #endif @@ -56,7 +56,7 @@ #ifdef CONFIG_SMP .macro get_saved_sp /* SMP variation */ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT mfc0 k0, CP0_CONTEXT lui k1, %hi(kernelsp) srl k0, k0, 23 @@ -64,7 +64,7 @@ addu k1, k0 LONG_L k1, %lo(kernelsp)(k1) #endif -#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) MFC0 k1, CP0_CONTEXT dsra k1, 23 lui k0, %hi(pgd_current) @@ -74,7 +74,7 @@ daddu k1, k0 LONG_L k1, %lo(kernelsp)(k1) #endif -#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) MFC0 k1, CP0_CONTEXT dsrl k1, 23 dsll k1, k1, 3 @@ -83,20 +83,20 @@ .endm .macro set_saved_sp stackp temp temp2 -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT mfc0 \temp, CP0_CONTEXT srl \temp, 23 sll \temp, 2 LONG_S \stackp, kernelsp(\temp) #endif -#if defined(CONFIG_MIPS64) && !defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) lw \temp, TI_CPU(gp) dsll \temp, 3 lui \temp2, %hi(kernelsp) daddu \temp, \temp2 LONG_S \stackp, %lo(kernelsp)(\temp) #endif -#if defined(CONFIG_MIPS64) && defined(CONFIG_BUILD_ELF64) +#if defined(CONFIG_64BIT) && defined(CONFIG_BUILD_ELF64) lw \temp, TI_CPU(gp) dsll \temp, 3 LONG_S \stackp, kernelsp(\temp) @@ -140,7 +140,7 @@ LONG_S $6, PT_R6(sp) MFC0 v1, CP0_EPC LONG_S $7, PT_R7(sp) -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT LONG_S $8, PT_R8(sp) LONG_S $9, PT_R9(sp) #endif @@ -169,7 +169,7 @@ .macro RESTORE_TEMP LONG_L $24, PT_LO(sp) -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT LONG_L $8, PT_R8(sp) LONG_L $9, PT_R9(sp) #endif @@ -217,7 +217,7 @@ LONG_L $31, PT_R31(sp) LONG_L $28, PT_R28(sp) LONG_L $25, PT_R25(sp) -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT LONG_L $8, PT_R8(sp) LONG_L $9, PT_R9(sp) #endif @@ -262,7 +262,7 @@ LONG_L $31, PT_R31(sp) LONG_L $28, PT_R28(sp) LONG_L $25, PT_R25(sp) -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT LONG_L $8, PT_R8(sp) LONG_L $9, PT_R9(sp) #endif diff --git a/include/asm-mips/string.h b/include/asm-mips/string.h index b18345504f8..5a06f6d1389 100644 --- a/include/asm-mips/string.h +++ b/include/asm-mips/string.h @@ -16,7 +16,7 @@ * Most of the inline functions are rather naive implementations so I just * didn't bother updating them for 64-bit ... */ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #ifndef IN_STRING_C @@ -130,7 +130,7 @@ strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count) return __res; } -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ #define __HAVE_ARCH_MEMSET extern void *memset(void *__s, int __c, size_t __count); @@ -141,7 +141,7 @@ extern void *memcpy(void *__to, __const__ void *__from, size_t __n); #define __HAVE_ARCH_MEMMOVE extern void *memmove(void *__dest, __const__ void *__src, size_t __n); -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define __HAVE_ARCH_MEMSCAN static __inline__ void *memscan(void *__addr, int __c, size_t __size) { @@ -161,6 +161,6 @@ static __inline__ void *memscan(void *__addr, int __c, size_t __size) return __addr; } -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ #endif /* _ASM_STRING_H */ diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 169f3d4265b..6663efd49b2 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -208,7 +208,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) return retval; } -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) { __u64 retval; @@ -330,7 +330,7 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old, return retval; } -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, unsigned long new) { diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index 42fcd6f2c20..a70cb0854c8 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h @@ -62,10 +62,10 @@ register struct thread_info *__current_thread_info __asm__("$28"); #define current_thread_info() __current_thread_info /* thread information allocation */ -#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_MIPS32) +#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT) #define THREAD_SIZE_ORDER (1) #endif -#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_MIPS64) +#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_64BIT) #define THREAD_SIZE_ORDER (2) #endif #ifdef CONFIG_PAGE_SIZE_8KB diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h index b949ab33e8e..421b3aea14c 100644 --- a/include/asm-mips/types.h +++ b/include/asm-mips/types.h @@ -78,7 +78,7 @@ typedef unsigned long long u64; #endif #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ - || defined(CONFIG_MIPS64) + || defined(CONFIG_64BIT) typedef u64 dma_addr_t; #else typedef u32 dma_addr_t; diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index 07114898e06..a543ead72ec 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -22,7 +22,7 @@ * * For historical reasons, these macros are grossly misnamed. */ -#ifdef CONFIG_MIPS32 +#ifdef CONFIG_32BIT #define __UA_LIMIT 0x80000000UL @@ -32,9 +32,9 @@ #define __UA_t0 "$8" #define __UA_t1 "$9" -#endif /* CONFIG_MIPS32 */ +#endif /* CONFIG_32BIT */ -#ifdef CONFIG_MIPS64 +#ifdef CONFIG_64BIT #define __UA_LIMIT (- TASK_SIZE) @@ -44,7 +44,7 @@ #define __UA_t0 "$12" #define __UA_t1 "$13" -#endif /* CONFIG_MIPS64 */ +#endif /* CONFIG_64BIT */ /* * USER_DS is a bitmask that has the bits set that may not be set in a valid diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h index 6d21cc964f7..ad4d4805630 100644 --- a/include/asm-mips/unistd.h +++ b/include/asm-mips/unistd.h @@ -1124,7 +1124,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ # ifndef __mips64 # define __ARCH_WANT_STAT64 # endif -# ifdef CONFIG_MIPS32 +# ifdef CONFIG_32BIT # define __ARCH_WANT_SYS_TIME # endif # ifdef CONFIG_MIPS32_O32 -- cgit v1.2.3 From 42a3b4f25af8f8d77feddf27f839fa0628dbff1a Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:17 -0700 Subject: [PATCH] mips: nuke trailing whitespace Signed-off-by: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/asmmacro.h | 4 +- include/asm-mips/bitops.h | 4 +- include/asm-mips/ddb5xxx/ddb5477.h | 6 +-- include/asm-mips/fpregdef.h | 4 +- include/asm-mips/fpu.h | 8 ++-- include/asm-mips/ip32/mace.h | 8 ++-- include/asm-mips/lasat/serial.h | 4 +- include/asm-mips/mach-au1x00/au1000.h | 2 +- include/asm-mips/mach-db1x00/db1x00.h | 2 +- include/asm-mips/mach-jazz/floppy.h | 2 +- include/asm-mips/mach-pb1x00/pb1500.h | 4 +- include/asm-mips/r4kcache.h | 68 ++++++++++++++++---------------- include/asm-mips/rtc.h | 2 +- include/asm-mips/sgi/gio.h | 2 +- include/asm-mips/sgi/hpc3.h | 4 +- include/asm-mips/sgi/ioc.h | 4 +- include/asm-mips/sgi/ip22.h | 2 +- include/asm-mips/sgi/mc.h | 6 +-- include/asm-mips/sibyte/carmel.h | 12 +++--- include/asm-mips/sibyte/sb1250_defs.h | 38 +++++++++--------- include/asm-mips/sibyte/sb1250_dma.h | 42 ++++++++++---------- include/asm-mips/sibyte/sb1250_genbus.h | 24 +++++------ include/asm-mips/sibyte/sb1250_int.h | 24 +++++------ include/asm-mips/sibyte/sb1250_l2c.h | 22 +++++------ include/asm-mips/sibyte/sb1250_ldt.h | 32 +++++++-------- include/asm-mips/sibyte/sb1250_mac.h | 26 ++++++------ include/asm-mips/sibyte/sb1250_mc.h | 28 ++++++------- include/asm-mips/sibyte/sb1250_regs.h | 68 ++++++++++++++++---------------- include/asm-mips/sibyte/sb1250_scd.h | 36 ++++++++--------- include/asm-mips/sibyte/sb1250_smbus.h | 24 +++++------ include/asm-mips/sibyte/sb1250_syncser.h | 12 +++--- include/asm-mips/sibyte/sb1250_uart.h | 30 +++++++------- include/asm-mips/sigcontext.h | 4 +- include/asm-mips/socket.h | 2 +- include/asm-mips/statfs.h | 2 +- include/asm-mips/titan_dep.h | 2 +- include/asm-mips/tx4927/tx4927.h | 52 ++++++++++++------------ include/asm-mips/tx4927/tx4927_pci.h | 4 +- include/asm-mips/vr41xx/vrc4173.h | 4 +- include/asm-mips/war.h | 4 +- include/asm-mips/xxs1500.h | 2 +- 41 files changed, 315 insertions(+), 315 deletions(-) (limited to 'include') diff --git a/include/asm-mips/asmmacro.h b/include/asm-mips/asmmacro.h index 40ceedcf454..30b18ea6cb1 100644 --- a/include/asm-mips/asmmacro.h +++ b/include/asm-mips/asmmacro.h @@ -7,10 +7,10 @@ */ #ifndef _ASM_ASMMACRO_H #define _ASM_ASMMACRO_H - + #include #include - + #ifdef CONFIG_32BIT #include #endif diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index bc136dcfdbe..eb8d79dba11 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h @@ -20,13 +20,13 @@ #define SZLONG_MASK 31UL #define __LL "ll " #define __SC "sc " -#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) +#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x)) #elif (_MIPS_SZLONG == 64) #define SZLONG_LOG 6 #define SZLONG_MASK 63UL #define __LL "lld " #define __SC "scd " -#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) +#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x)) #endif #ifdef __KERNEL__ diff --git a/include/asm-mips/ddb5xxx/ddb5477.h b/include/asm-mips/ddb5xxx/ddb5477.h index ae3e2a38fd5..a438548e6ef 100644 --- a/include/asm-mips/ddb5xxx/ddb5477.h +++ b/include/asm-mips/ddb5xxx/ddb5477.h @@ -247,7 +247,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq); * All PCI irq but INTC are active low. */ -/* +/* * irq number block assignment */ @@ -285,7 +285,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq); #define VRC5477_IRQ_IOPCI_INTB (17 + VRC5477_IRQ_BASE) /* USB-P */ #define VRC5477_IRQ_IOPCI_INTC (18 + VRC5477_IRQ_BASE) /* AC97 */ #define VRC5477_IRQ_IOPCI_INTD (19 + VRC5477_IRQ_BASE) /* Reserved */ -#define VRC5477_IRQ_UART1 (20 + VRC5477_IRQ_BASE) +#define VRC5477_IRQ_UART1 (20 + VRC5477_IRQ_BASE) #define VRC5477_IRQ_SPT0 (21 + VRC5477_IRQ_BASE) /* special purpose timer 0 */ #define VRC5477_IRQ_GPT0 (22 + VRC5477_IRQ_BASE) /* general purpose timer 0 */ #define VRC5477_IRQ_GPT1 (23 + VRC5477_IRQ_BASE) /* general purpose timer 1 */ @@ -301,7 +301,7 @@ extern void ll_vrc5477_irq_disable(int vrc5477_irq); /* * i2859 irq assignment */ -#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE) +#define I8259_IRQ_RESERVED_0 (0 + I8259_IRQ_BASE) #define I8259_IRQ_KEYBOARD (1 + I8259_IRQ_BASE) /* M1543 default */ #define I8259_IRQ_CASCADE (2 + I8259_IRQ_BASE) #define I8259_IRQ_UART_B (3 + I8259_IRQ_BASE) /* M1543 default, may conflict with RTC according to schematic diagram */ diff --git a/include/asm-mips/fpregdef.h b/include/asm-mips/fpregdef.h index 1d9aa097918..2b5fddc8f48 100644 --- a/include/asm-mips/fpregdef.h +++ b/include/asm-mips/fpregdef.h @@ -13,7 +13,7 @@ #define _ASM_FPREGDEF_H #include - + #if _MIPS_SIM == _MIPS_SIM_ABI32 /* @@ -56,7 +56,7 @@ #define fcr31 $31 /* FPU status register */ #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ - + #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 #define fv0 $f0 /* return value */ diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index 6cb38d5c040..ea24e733b1b 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h @@ -82,7 +82,7 @@ do { \ static inline int is_fpu_owner(void) { - return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); + return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); } static inline void own_fpu(void) @@ -90,7 +90,7 @@ static inline void own_fpu(void) if (cpu_has_fpu) { __enable_fpu(); KSTK_STATUS(current) |= ST0_CU1; - set_thread_flag(TIF_USEDFPU); + set_thread_flag(TIF_USEDFPU); } } @@ -98,7 +98,7 @@ static inline void lose_fpu(void) { if (cpu_has_fpu) { KSTK_STATUS(current) &= ~ST0_CU1; - clear_thread_flag(TIF_USEDFPU); + clear_thread_flag(TIF_USEDFPU); __disable_fpu(); } } @@ -127,7 +127,7 @@ static inline void restore_fp(struct task_struct *tsk) static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) { if (cpu_has_fpu) { - if ((tsk == current) && is_fpu_owner()) + if ((tsk == current) && is_fpu_owner()) _save_fp(current); return tsk->thread.fpu.hard.fpr; } diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h index 2b7b0fdeac1..432011b16c2 100644 --- a/include/asm-mips/ip32/mace.h +++ b/include/asm-mips/ip32/mace.h @@ -94,7 +94,7 @@ struct mace_video { unsigned long xxx; /* later... */ }; -/* +/* * Ethernet interface */ struct mace_ethernet { @@ -129,7 +129,7 @@ struct mace_ethernet { volatile unsigned long rx_fifo; }; -/* +/* * Peripherals */ @@ -251,7 +251,7 @@ struct mace_timers { timer_reg audio_out2; timer_reg video_in1; timer_reg video_in2; - timer_reg video_out; + timer_reg video_out; }; struct mace_perif { @@ -272,7 +272,7 @@ struct mace_perif { }; -/* +/* * ISA peripherals */ diff --git a/include/asm-mips/lasat/serial.h b/include/asm-mips/lasat/serial.h index 21d0fb7cee6..9e88c7669c7 100644 --- a/include/asm-mips/lasat/serial.h +++ b/include/asm-mips/lasat/serial.h @@ -1,13 +1,13 @@ #include /* Lasat 100 boards serial configuration */ -#define LASAT_BASE_BAUD_100 ( 7372800 / 16 ) +#define LASAT_BASE_BAUD_100 ( 7372800 / 16 ) #define LASAT_UART_REGS_BASE_100 0x1c8b0000 #define LASAT_UART_REGS_SHIFT_100 2 #define LASATINT_UART_100 8 /* * LASAT 200 boards serial configuration */ -#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) +#define LASAT_BASE_BAUD_200 (100000000 / 16 / 12) #define LASAT_UART_REGS_BASE_200 (Vrc5074_PHYS_BASE + 0x0300) #define LASAT_UART_REGS_SHIFT_200 3 #define LASATINT_UART_200 13 diff --git a/include/asm-mips/mach-au1x00/au1000.h b/include/asm-mips/mach-au1x00/au1000.h index 2b36ea34691..148bae2fa7d 100644 --- a/include/asm-mips/mach-au1x00/au1000.h +++ b/include/asm-mips/mach-au1x00/au1000.h @@ -1383,7 +1383,7 @@ extern au1xxx_irq_map_t au1xxx_irq_map[]; #define PCI_IO_START 0 #define PCI_IO_END 0 #define PCI_MEM_START 0 -#define PCI_MEM_END 0 +#define PCI_MEM_END 0 #define PCI_FIRST_DEVFN 0 #define PCI_LAST_DEVFN 0 #endif diff --git a/include/asm-mips/mach-db1x00/db1x00.h b/include/asm-mips/mach-db1x00/db1x00.h index 4691398a414..efafe65258b 100644 --- a/include/asm-mips/mach-db1x00/db1x00.h +++ b/include/asm-mips/mach-db1x00/db1x00.h @@ -23,7 +23,7 @@ * * ######################################################################## * - * + * */ #ifndef __ASM_DB1X00_H #define __ASM_DB1X00_H diff --git a/include/asm-mips/mach-jazz/floppy.h b/include/asm-mips/mach-jazz/floppy.h index 8cf0d042c86..c9dad99b123 100644 --- a/include/asm-mips/mach-jazz/floppy.h +++ b/include/asm-mips/mach-jazz/floppy.h @@ -92,7 +92,7 @@ static inline int fd_request_irq(void) return request_irq(FLOPPY_IRQ, floppy_interrupt, SA_INTERRUPT | SA_SAMPLE_RANDOM, "floppy", NULL); } - + static inline void fd_free_irq(void) { free_irq(FLOPPY_IRQ, NULL); diff --git a/include/asm-mips/mach-pb1x00/pb1500.h b/include/asm-mips/mach-pb1x00/pb1500.h index d6c779747b3..ff6d40c87a2 100644 --- a/include/asm-mips/mach-pb1x00/pb1500.h +++ b/include/asm-mips/mach-pb1x00/pb1500.h @@ -33,11 +33,11 @@ #define PCI_BOARD_REG 0xAE000010 #define PCMCIA_BOARD_REG 0xAE000010 #define PC_DEASSERT_RST 0x80 - #define PC_DRV_EN 0x10 + #define PC_DRV_EN 0x10 #define PB1500_G_CONTROL 0xAE000014 #define PB1500_RST_VDDI 0xAE00001C #define PB1500_LEDS 0xAE000018 - + #define PB1500_HEX_LED 0xAF000004 #define PB1500_HEX_LED_BLANK 0xAF000008 diff --git a/include/asm-mips/r4kcache.h b/include/asm-mips/r4kcache.h index da03a32c1ca..5bea49feec6 100644 --- a/include/asm-mips/r4kcache.h +++ b/include/asm-mips/r4kcache.h @@ -171,11 +171,11 @@ static inline void blast_dcache16(void) unsigned long start = INDEX_BASE; unsigned long end = start + current_cpu_data.dcache.waysize; unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit; - unsigned long ws_end = current_cpu_data.dcache.ways << + unsigned long ws_end = current_cpu_data.dcache.ways << current_cpu_data.dcache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) + for (ws = 0; ws < ws_end; ws += ws_inc) for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Writeback_Inv_D); } @@ -200,8 +200,8 @@ static inline void blast_dcache16_page_indexed(unsigned long page) current_cpu_data.dcache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x200) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Writeback_Inv_D); } @@ -214,8 +214,8 @@ static inline void blast_icache16(void) current_cpu_data.icache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x200) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Invalidate_I); } @@ -239,8 +239,8 @@ static inline void blast_icache16_page_indexed(unsigned long page) current_cpu_data.icache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x200) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Invalidate_I); } @@ -249,11 +249,11 @@ static inline void blast_scache16(void) unsigned long start = INDEX_BASE; unsigned long end = start + current_cpu_data.scache.waysize; unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; - unsigned long ws_end = current_cpu_data.scache.ways << + unsigned long ws_end = current_cpu_data.scache.ways << current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) + for (ws = 0; ws < ws_end; ws += ws_inc) for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -278,8 +278,8 @@ static inline void blast_scache16_page_indexed(unsigned long page) current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x200) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x200) cache16_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -318,8 +318,8 @@ static inline void blast_dcache32(void) current_cpu_data.dcache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x400) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Writeback_Inv_D); } @@ -343,8 +343,8 @@ static inline void blast_dcache32_page_indexed(unsigned long page) current_cpu_data.dcache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x400) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Writeback_Inv_D); } @@ -357,8 +357,8 @@ static inline void blast_icache32(void) current_cpu_data.icache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x400) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Invalidate_I); } @@ -383,7 +383,7 @@ static inline void blast_icache32_page_indexed(unsigned long page) unsigned long ws, addr; for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x400) + for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Invalidate_I); } @@ -392,11 +392,11 @@ static inline void blast_scache32(void) unsigned long start = INDEX_BASE; unsigned long end = start + current_cpu_data.scache.waysize; unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; - unsigned long ws_end = current_cpu_data.scache.ways << + unsigned long ws_end = current_cpu_data.scache.ways << current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) + for (ws = 0; ws < ws_end; ws += ws_inc) for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -421,8 +421,8 @@ static inline void blast_scache32_page_indexed(unsigned long page) current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x400) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x400) cache32_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -461,8 +461,8 @@ static inline void blast_icache64(void) current_cpu_data.icache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x800) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x800) cache64_unroll32(addr|ws,Index_Invalidate_I); } @@ -487,7 +487,7 @@ static inline void blast_icache64_page_indexed(unsigned long page) unsigned long ws, addr; for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x800) + for (addr = start; addr < end; addr += 0x800) cache64_unroll32(addr|ws,Index_Invalidate_I); } @@ -496,11 +496,11 @@ static inline void blast_scache64(void) unsigned long start = INDEX_BASE; unsigned long end = start + current_cpu_data.scache.waysize; unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; - unsigned long ws_end = current_cpu_data.scache.ways << + unsigned long ws_end = current_cpu_data.scache.ways << current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) + for (ws = 0; ws < ws_end; ws += ws_inc) for (addr = start; addr < end; addr += 0x800) cache64_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -525,8 +525,8 @@ static inline void blast_scache64_page_indexed(unsigned long page) current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x800) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x800) cache64_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -561,11 +561,11 @@ static inline void blast_scache128(void) unsigned long start = INDEX_BASE; unsigned long end = start + current_cpu_data.scache.waysize; unsigned long ws_inc = 1UL << current_cpu_data.scache.waybit; - unsigned long ws_end = current_cpu_data.scache.ways << + unsigned long ws_end = current_cpu_data.scache.ways << current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) + for (ws = 0; ws < ws_end; ws += ws_inc) for (addr = start; addr < end; addr += 0x1000) cache128_unroll32(addr|ws,Index_Writeback_Inv_SD); } @@ -590,8 +590,8 @@ static inline void blast_scache128_page_indexed(unsigned long page) current_cpu_data.scache.waybit; unsigned long ws, addr; - for (ws = 0; ws < ws_end; ws += ws_inc) - for (addr = start; addr < end; addr += 0x1000) + for (ws = 0; ws < ws_end; ws += ws_inc) + for (addr = start; addr < end; addr += 0x1000) cache128_unroll32(addr|ws,Index_Writeback_Inv_SD); } diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h index 31c0c2347f4..3c4b637fd92 100644 --- a/include/asm-mips/rtc.h +++ b/include/asm-mips/rtc.h @@ -1,5 +1,5 @@ /* - * include/asm-mips/rtc.h + * include/asm-mips/rtc.h * * (Really an interface for drivers/char/genrtc.c) * diff --git a/include/asm-mips/sgi/gio.h b/include/asm-mips/sgi/gio.h index a38d66f9987..889cf028c95 100644 --- a/include/asm-mips/sgi/gio.h +++ b/include/asm-mips/sgi/gio.h @@ -16,7 +16,7 @@ * * The Indigo and Indy have two GIO bus connectors. Indigo2 (all models) have * three physical connectors, but only two slots, GFX and EXP0. - * + * * There is 10MB of GIO address space for GIO64 slot devices * slot# slot type address range size * ----- --------- ----------------------- ----- diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h index a5b988d7327..ac3dfc7af5b 100644 --- a/include/asm-mips/sgi/hpc3.h +++ b/include/asm-mips/sgi/hpc3.h @@ -221,7 +221,7 @@ struct hpc3_regs { #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */ u32 _unused1[0x14000/4 - 5]; /* padding */ - + /* Now direct PIO per-HPC3 peripheral access to external regs. */ volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */ u32 _unused2[0x7c00/4]; @@ -304,7 +304,7 @@ struct hpc3_regs { volatile u32 bbram[8192-50-14]; /* Battery backed ram */ }; -/* +/* * It is possible to have two HPC3's within the address space on * one machine, though only having one is more likely on an Indy. */ diff --git a/include/asm-mips/sgi/ioc.h b/include/asm-mips/sgi/ioc.h index 169187f53fb..f3e3dc9bb73 100644 --- a/include/asm-mips/sgi/ioc.h +++ b/include/asm-mips/sgi/ioc.h @@ -16,7 +16,7 @@ #include #include -/* +/* * All registers are 8-bit wide alligned on 32-bit boundary. Bad things * happen if you try word access them. You have been warned. */ @@ -138,7 +138,7 @@ struct sgioc_regs { u8 _sysid[3]; volatile u8 sysid; #define SGIOC_SYSID_FULLHOUSE 0x01 -#define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5) +#define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5) #define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1) u32 _unused2; u8 _read[3]; diff --git a/include/asm-mips/sgi/ip22.h b/include/asm-mips/sgi/ip22.h index 97d73adb4e4..bbfc05c3cab 100644 --- a/include/asm-mips/sgi/ip22.h +++ b/include/asm-mips/sgi/ip22.h @@ -12,7 +12,7 @@ #ifndef _SGI_IP22_H #define _SGI_IP22_H -/* +/* * These are the virtual IRQ numbers, we divide all IRQ's into * 'spaces', the 'space' determines where and how to enable/disable * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrups diff --git a/include/asm-mips/sgi/mc.h b/include/asm-mips/sgi/mc.h index fd98f930607..c52f7834c7c 100644 --- a/include/asm-mips/sgi/mc.h +++ b/include/asm-mips/sgi/mc.h @@ -182,14 +182,14 @@ struct sgimc_regs { volatile u32 dtlb_hi3; u32 _unused33; volatile u32 dtlb_lo3; - + u32 _unused34[0x0392]; - + u32 _unused35; volatile u32 rpsscounter; /* Chirps at 100ns */ u32 _unused36[0x1000/4-2*4]; - + u32 _unused37; volatile u32 maddronly; /* Address DMA goes at */ u32 _unused38; diff --git a/include/asm-mips/sibyte/carmel.h b/include/asm-mips/sibyte/carmel.h index 7ac5da13ce8..b5e7dae19f0 100644 --- a/include/asm-mips/sibyte/carmel.h +++ b/include/asm-mips/sibyte/carmel.h @@ -25,12 +25,12 @@ #define SIBYTE_BOARD_NAME "Carmel" -#define GPIO_PHY_INTERRUPT 2 -#define GPIO_NONMASKABLE_INT 3 -#define GPIO_CF_INSERTED 6 -#define GPIO_MONTEREY_RESET 7 -#define GPIO_QUADUART_INT 8 -#define GPIO_CF_INT 9 +#define GPIO_PHY_INTERRUPT 2 +#define GPIO_NONMASKABLE_INT 3 +#define GPIO_CF_INSERTED 6 +#define GPIO_MONTEREY_RESET 7 +#define GPIO_QUADUART_INT 8 +#define GPIO_CF_INT 9 #define GPIO_FPGA_CCLK 10 #define GPIO_FPGA_DOUT 11 #define GPIO_FPGA_DIN 12 diff --git a/include/asm-mips/sibyte/sb1250_defs.h b/include/asm-mips/sibyte/sb1250_defs.h index 96088fb074a..40ef97c76c8 100644 --- a/include/asm-mips/sibyte/sb1250_defs.h +++ b/include/asm-mips/sibyte/sb1250_defs.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * - * Global constants and macros File: sb1250_defs.h - * + * + * Global constants and macros File: sb1250_defs.h + * * This file contains macros and definitions used by the other * include files. * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -105,7 +105,7 @@ #define SIBYTE_HDR_FMASK_112x_ALL 0x0000f00 #define SIBYTE_HDR_FMASK_112x_PASS1 0x0000100 -/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ +/* Bit mask for chip/revision. (use _ALL for all revisions of a chip). */ #define SIBYTE_HDR_FMASK(chip, pass) \ (SIBYTE_HDR_FMASK_ ## chip ## _ ## pass) #define SIBYTE_HDR_FMASK_ALLREVS(chip) \ @@ -150,31 +150,31 @@ /* ********************************************************************* * Naming schemes for constants in these files: - * - * M_xxx MASK constant (identifies bits in a register). + * + * M_xxx MASK constant (identifies bits in a register). * For multi-bit fields, all bits in the field will * be set. * * K_xxx "Code" constant (value for data in a multi-bit * field). The value is right justified. * - * V_xxx "Value" constant. This is the same as the + * V_xxx "Value" constant. This is the same as the * corresponding "K_xxx" constant, except it is * shifted to the correct position in the register. * * S_xxx SHIFT constant. This is the number of bits that - * a field value (code) needs to be shifted + * a field value (code) needs to be shifted * (towards the left) to put the value in the right * position for the register. * - * A_xxx ADDRESS constant. This will be a physical + * A_xxx ADDRESS constant. This will be a physical * address. Use the PHYS_TO_K1 macro to generate * a K1SEG address. * * R_xxx RELATIVE offset constant. This is an offset from * an A_xxx constant (usually the first register in * a group). - * + * * G_xxx(X) GET value. This macro obtains a multi-bit field * from a register, masks it, and shifts it to * the bottom of the register (retrieving a K_xxx @@ -189,7 +189,7 @@ /* - * Cast to 64-bit number. Presumably the syntax is different in + * Cast to 64-bit number. Presumably the syntax is different in * assembly language. * * Note: you'll need to define uint32_t and uint64_t in your headers. diff --git a/include/asm-mips/sibyte/sb1250_dma.h b/include/asm-mips/sibyte/sb1250_dma.h index f1b08d32338..3cdb48f50ed 100644 --- a/include/asm-mips/sibyte/sb1250_dma.h +++ b/include/asm-mips/sibyte/sb1250_dma.h @@ -1,24 +1,24 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * DMA definitions File: sb1250_dma.h - * + * * This module contains constants and macros useful for * programming the SB1250's DMA controllers, both the data mover * and the Ethernet DMA. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -28,7 +28,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -43,9 +43,9 @@ * DMA Registers ********************************************************************* */ -/* +/* * Ethernet and Serial DMA Configuration Register 0 (Table 7-4) - * Registers: DMA_CONFIG0_MAC_x_RX_CH_0 + * Registers: DMA_CONFIG0_MAC_x_RX_CH_0 * Registers: DMA_CONFIG0_MAC_x_TX_CH_0 * Registers: DMA_CONFIG0_SER_x_RX * Registers: DMA_CONFIG0_SER_x_TX @@ -98,7 +98,7 @@ /* * Ethernet and Serial DMA Configuration Register 1 (Table 7-5) - * Registers: DMA_CONFIG1_MAC_x_RX_CH_0 + * Registers: DMA_CONFIG1_MAC_x_RX_CH_0 * Registers: DMA_CONFIG1_DMA_x_TX_CH_0 * Registers: DMA_CONFIG1_SER_x_RX * Registers: DMA_CONFIG1_SER_x_TX @@ -152,11 +152,11 @@ /* * DMA Descriptor Count Registers (Table 7-8) */ - + /* No bitfields */ -/* +/* * Current Descriptor Address Register (Table 7-11) */ @@ -275,14 +275,14 @@ #define V_DMA_DSCRB_STATUS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_STATUS) #define G_DMA_DSCRB_STATUS(x) _SB_GETVALUE(x,S_DMA_DSCRB_STATUS,M_DMA_DSCRB_STATUS) -/* +/* * Ethernet Descriptor Status Bits (Table 7-15) */ #define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51) #define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52) -#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) +#if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) /* Note: BADTCPCS is actually in DSCR_B options field */ #define M_DMA_ETHRX_BADTCPCS _SB_MAKEMASK1(0) #endif /* 1250 PASS2 || 112x PASS1 */ @@ -324,7 +324,7 @@ #define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63) -/* +/* * Ethernet Transmit Options (Table 7-17) */ @@ -377,7 +377,7 @@ * Data Mover Registers ********************************************************************* */ -/* +/* * Data Mover Descriptor Base Address Register (Table 7-22) * Register: DM_DSCR_BASE_0 * Register: DM_DSCR_BASE_1 @@ -414,7 +414,7 @@ #define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62) #define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63) -/* +/* * Data Mover Descriptor Count Register (Table 7-25) */ diff --git a/include/asm-mips/sibyte/sb1250_genbus.h b/include/asm-mips/sibyte/sb1250_genbus.h index 0d9dfac3d7d..f1f509f295c 100644 --- a/include/asm-mips/sibyte/sb1250_genbus.h +++ b/include/asm-mips/sibyte/sb1250_genbus.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * Generic Bus Constants File: sb1250_genbus.h - * - * This module contains constants and macros useful for + * + * This module contains constants and macros useful for * manipulating the SB1250's Generic Bus interface - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ diff --git a/include/asm-mips/sibyte/sb1250_int.h b/include/asm-mips/sibyte/sb1250_int.h index c3f74df211f..e173e2ea4c9 100644 --- a/include/asm-mips/sibyte/sb1250_int.h +++ b/include/asm-mips/sibyte/sb1250_int.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * Interrupt Mapper definitions File: sb1250_int.h - * + * * This module contains constants for manipulating the SB1250's * interrupt mapper and definitions for the interrupt sources. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -43,7 +43,7 @@ /* * Interrupt sources (Table 4-8, UM 0.2) - * + * * First, the interrupt numbers. */ diff --git a/include/asm-mips/sibyte/sb1250_l2c.h b/include/asm-mips/sibyte/sb1250_l2c.h index 799db828d96..8afe8e01581 100644 --- a/include/asm-mips/sibyte/sb1250_l2c.h +++ b/include/asm-mips/sibyte/sb1250_l2c.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * L2 Cache constants and macros File: sb1250_l2c.h - * + * * This module contains constants useful for manipulating the * level 2 cache. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ diff --git a/include/asm-mips/sibyte/sb1250_ldt.h b/include/asm-mips/sibyte/sb1250_ldt.h index d8753885df1..f2617ded0a8 100644 --- a/include/asm-mips/sibyte/sb1250_ldt.h +++ b/include/asm-mips/sibyte/sb1250_ldt.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * LDT constants File: sb1250_ldt.h - * - * This module contains constants and macros to describe - * the LDT interface on the SB1250. - * + * + * This module contains constants and macros to describe + * the LDT interface on the SB1250. + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -155,7 +155,7 @@ /* * LDT Status Register (Table 8-14). Note that these constants - * assume you've read the command and status register + * assume you've read the command and status register * together (32-bit read at offset 0x04) * * These bits also apply to the secondary status @@ -183,8 +183,8 @@ #define M_LDT_STATUS_DETPARERR _SB_MAKEMASK1_32(31) /* - * Bridge Control Register (Table 8-16). Note that these - * constants assume you've read the register as a 32-bit + * Bridge Control Register (Table 8-16). Note that these + * constants assume you've read the register as a 32-bit * read (offset 0x3C) */ diff --git a/include/asm-mips/sibyte/sb1250_mac.h b/include/asm-mips/sibyte/sb1250_mac.h index 81f603f03a9..18e74e43f4a 100644 --- a/include/asm-mips/sibyte/sb1250_mac.h +++ b/include/asm-mips/sibyte/sb1250_mac.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * MAC constants and macros File: sb1250_mac.h - * + * * This module contains constants and macros for the SB1250's * ethernet controllers. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -311,7 +311,7 @@ /* * These constants are used to configure the fields within the Frame - * Configuration Register. + * Configuration Register. */ #define K_MAC_IFG_RX_10 _SB_MAKE64(0) /* See table 176, not used */ @@ -393,7 +393,7 @@ * Register: MAC_INT_MASK_2 */ -/* +/* * Use these constants to shift the appropriate channel * into the CH0 position so the same tests can be used * on each channel. diff --git a/include/asm-mips/sibyte/sb1250_mc.h b/include/asm-mips/sibyte/sb1250_mc.h index 93a48334b87..1dd41c92799 100644 --- a/include/asm-mips/sibyte/sb1250_mc.h +++ b/include/asm-mips/sibyte/sb1250_mc.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * - * Memory Controller constants File: sb1250_mc.h - * + * + * Memory Controller constants File: sb1250_mc.h + * * This module contains constants and macros useful for * programming the memory controller. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -166,7 +166,7 @@ #define K_MC_REF_RATE_100MHz 0x62 #define K_MC_REF_RATE_133MHz 0x81 -#define K_MC_REF_RATE_200MHz 0xC4 +#define K_MC_REF_RATE_200MHz 0xC4 #define V_MC_REF_RATE_100MHz V_MC_REF_RATE(K_MC_REF_RATE_100MHz) #define V_MC_REF_RATE_133MHz V_MC_REF_RATE(K_MC_REF_RATE_133MHz) @@ -228,7 +228,7 @@ V_MC_ADDR_DRIVE_DEFAULT | \ V_MC_DATA_DRIVE_DEFAULT | \ V_MC_CLOCK_DRIVE_DEFAULT | \ - V_MC_REF_RATE_DEFAULT + V_MC_REF_RATE_DEFAULT diff --git a/include/asm-mips/sibyte/sb1250_regs.h b/include/asm-mips/sibyte/sb1250_regs.h index 5d496c6faba..9db80cd13a7 100644 --- a/include/asm-mips/sibyte/sb1250_regs.h +++ b/include/asm-mips/sibyte/sb1250_regs.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * Register Definitions File: sb1250_regs.h - * + * * This module contains the addresses of the on-chip peripherals * on the SB1250. - * + * * SB1250 specification level: 01/02/2002 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -40,20 +40,20 @@ /* ********************************************************************* * Some general notes: - * + * * For the most part, when there is more than one peripheral * of the same type on the SOC, the constants below will be * offsets from the base of each peripheral. For example, * the MAC registers are described as offsets from the first * MAC register, and there will be a MAC_REGISTER() macro - * to calculate the base address of a given MAC. - * + * to calculate the base address of a given MAC. + * * The information in this file is based on the SB1250 SOC * manual version 0.2, July 2000. ********************************************************************* */ -/* ********************************************************************* +/* ********************************************************************* * Memory Controller Registers ********************************************************************* */ @@ -101,7 +101,7 @@ #define R_MC_TEST_ECC 0x0000000420 #define R_MC_MCLK_CFG 0x0000000500 -/* ********************************************************************* +/* ********************************************************************* * L2 Cache Control Registers ********************************************************************* */ @@ -126,7 +126,7 @@ #define A_L2_EEC_ADDRESS A_L2_ECC_TAG -/* ********************************************************************* +/* ********************************************************************* * PCI Interface Registers ********************************************************************* */ @@ -134,7 +134,7 @@ #define A_PCI_TYPE01_HEADER 0x00DE000800 -/* ********************************************************************* +/* ********************************************************************* * Ethernet DMA and MACs ********************************************************************* */ @@ -184,7 +184,7 @@ (R_MAC_DMA_CHANNEL_BASE(txrx,chan) + \ (reg)) -/* +/* * DMA channel registers, relative to A_MAC_DMA_CHANNEL_BASE */ @@ -259,7 +259,7 @@ #define MAC_CHMAP_COUNT 4 -/* ********************************************************************* +/* ********************************************************************* * DUART Registers ********************************************************************* */ @@ -363,7 +363,7 @@ #endif /* 1250 PASS2 || 112x PASS1 */ -/* ********************************************************************* +/* ********************************************************************* * Synchronous Serial Registers ********************************************************************* */ @@ -397,7 +397,7 @@ (reg)) -/* +/* * DMA channel registers, relative to A_SER_DMA_CHANNEL_BASE */ @@ -457,7 +457,7 @@ #define R_SER_RMON_RX_ERRORS 0x000001F0 #define R_SER_RMON_RX_BADADDR 0x000001F8 -/* ********************************************************************* +/* ********************************************************************* * Generic Bus Registers ********************************************************************* */ @@ -513,7 +513,7 @@ #define R_IO_PCMCIA_CFG 0x0A60 #define R_IO_PCMCIA_STATUS 0x0A70 -/* ********************************************************************* +/* ********************************************************************* * GPIO Registers ********************************************************************* */ @@ -537,7 +537,7 @@ #define R_GPIO_PIN_CLR 0x30 #define R_GPIO_PIN_SET 0x38 -/* ********************************************************************* +/* ********************************************************************* * SMBus Registers ********************************************************************* */ @@ -573,7 +573,7 @@ #define R_SMB_CONTROL 0x0000000060 #define R_SMB_PEC 0x0000000070 -/* ********************************************************************* +/* ********************************************************************* * Timer Registers ********************************************************************* */ @@ -641,7 +641,7 @@ #endif /* 1250 PASS2 || 112x PASS1 */ -/* ********************************************************************* +/* ********************************************************************* * System Control Registers ********************************************************************* */ @@ -649,7 +649,7 @@ #define A_SCD_SYSTEM_CFG 0x0010020008 #define A_SCD_SYSTEM_MANUF 0x0010038000 -/* ********************************************************************* +/* ********************************************************************* * System Address Trap Registers ********************************************************************* */ @@ -672,7 +672,7 @@ #endif /* 1250 PASS2 || 112x PASS1 */ -/* ********************************************************************* +/* ********************************************************************* * System Interrupt Mapper Registers ********************************************************************* */ @@ -701,7 +701,7 @@ #define R_IMR_INTERRUPT_MAP_BASE 0x0200 #define R_IMR_INTERRUPT_MAP_COUNT 64 -/* ********************************************************************* +/* ********************************************************************* * System Performance Counter Registers ********************************************************************* */ @@ -711,7 +711,7 @@ #define A_SCD_PERF_CNT_2 0x00100204E0 #define A_SCD_PERF_CNT_3 0x00100204E8 -/* ********************************************************************* +/* ********************************************************************* * System Bus Watcher Registers ********************************************************************* */ @@ -726,13 +726,13 @@ #define A_BUS_L2_ERRORS 0x00100208C0 #define A_BUS_MEM_IO_ERRORS 0x00100208C8 -/* ********************************************************************* +/* ********************************************************************* * System Debug Controller Registers ********************************************************************* */ #define A_SCD_JTAG_BASE 0x0010000000 -/* ********************************************************************* +/* ********************************************************************* * System Trace Buffer Registers ********************************************************************* */ @@ -755,7 +755,7 @@ #define A_SCD_TRACE_SEQUENCE_6 0x0010020A90 #define A_SCD_TRACE_SEQUENCE_7 0x0010020A98 -/* ********************************************************************* +/* ********************************************************************* * System Generic DMA Registers ********************************************************************* */ diff --git a/include/asm-mips/sibyte/sb1250_scd.h b/include/asm-mips/sibyte/sb1250_scd.h index 22e8041959e..dbbd682fb47 100644 --- a/include/asm-mips/sibyte/sb1250_scd.h +++ b/include/asm-mips/sibyte/sb1250_scd.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * SCD Constants and Macros File: sb1250_scd.h - * + * * This module contains constants and macros useful for * manipulating the System Control and Debug module on the 1250. - * + * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -130,40 +130,40 @@ /* System Manufacturing Register * Register: SCD_SYSTEM_MANUF */ - + /* Wafer ID: bits 31:0 */ #define S_SYS_WAFERID1_200 _SB_MAKE64(0) #define M_SYS_WAFERID1_200 _SB_MAKEMASK(32,S_SYS_WAFERID1_200) #define V_SYS_WAFERID1_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID1_200) #define G_SYS_WAFERID1_200(x) _SB_GETVALUE(x,S_SYS_WAFERID1_200,M_SYS_WAFERID1_200) - + #define S_SYS_BIN _SB_MAKE64(32) #define M_SYS_BIN _SB_MAKEMASK(4,S_SYS_BIN) #define V_SYS_BIN _SB_MAKEVALUE(x,S_SYS_BIN) #define G_SYS_BIN _SB_GETVALUE(x,S_SYS_BIN,M_SYS_BIN) - + /* Wafer ID: bits 39:36 */ #define S_SYS_WAFERID2_200 _SB_MAKE64(36) #define M_SYS_WAFERID2_200 _SB_MAKEMASK(4,S_SYS_WAFERID2_200) #define V_SYS_WAFERID2_200(x) _SB_MAKEVALUE(x,S_SYS_WAFERID2_200) #define G_SYS_WAFERID2_200(x) _SB_GETVALUE(x,S_SYS_WAFERID2_200,M_SYS_WAFERID2_200) - + /* Wafer ID: bits 39:0 */ #define S_SYS_WAFERID_300 _SB_MAKE64(0) #define M_SYS_WAFERID_300 _SB_MAKEMASK(40,S_SYS_WAFERID_300) #define V_SYS_WAFERID_300(x) _SB_MAKEVALUE(x,S_SYS_WAFERID_300) #define G_SYS_WAFERID_300(x) _SB_GETVALUE(x,S_SYS_WAFERID_300,M_SYS_WAFERID_300) - + #define S_SYS_XPOS _SB_MAKE64(40) #define M_SYS_XPOS _SB_MAKEMASK(6,S_SYS_XPOS) #define V_SYS_XPOS(x) _SB_MAKEVALUE(x,S_SYS_XPOS) #define G_SYS_XPOS(x) _SB_GETVALUE(x,S_SYS_XPOS,M_SYS_XPOS) - + #define S_SYS_YPOS _SB_MAKE64(46) #define M_SYS_YPOS _SB_MAKEMASK(6,S_SYS_YPOS) #define V_SYS_YPOS(x) _SB_MAKEVALUE(x,S_SYS_YPOS) #define G_SYS_YPOS(x) _SB_GETVALUE(x,S_SYS_YPOS,M_SYS_YPOS) - + /* * System Config Register (Table 4-2) * Register: SCD_SYSTEM_CFG diff --git a/include/asm-mips/sibyte/sb1250_smbus.h b/include/asm-mips/sibyte/sb1250_smbus.h index 287cbfe9efa..335c53e9293 100644 --- a/include/asm-mips/sibyte/sb1250_smbus.h +++ b/include/asm-mips/sibyte/sb1250_smbus.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * SMBUS Constants File: sb1250_smbus.h - * - * This module contains constants and macros useful for + * + * This module contains constants and macros useful for * manipulating the SB1250's SMbus devices. - * + * * SB1250 specification level: 01/02/2002 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ diff --git a/include/asm-mips/sibyte/sb1250_syncser.h b/include/asm-mips/sibyte/sb1250_syncser.h index 8d5e8edd3c4..fa2760d38b8 100644 --- a/include/asm-mips/sibyte/sb1250_syncser.h +++ b/include/asm-mips/sibyte/sb1250_syncser.h @@ -7,17 +7,17 @@ * manipulating the SB1250's Synchronous Serial * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg * ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ diff --git a/include/asm-mips/sibyte/sb1250_uart.h b/include/asm-mips/sibyte/sb1250_uart.h index 7655d6945cc..923ea4f44e0 100644 --- a/include/asm-mips/sibyte/sb1250_uart.h +++ b/include/asm-mips/sibyte/sb1250_uart.h @@ -1,23 +1,23 @@ /* ********************************************************************* * SB1250 Board Support Package - * + * * UART Constants File: sb1250_uart.h - * - * This module contains constants and macros useful for + * + * This module contains constants and macros useful for * manipulating the SB1250's UARTs * * SB1250 specification level: User's manual 1/02/02 - * + * * Author: Mitch Lichtenberg - * - ********************************************************************* + * + ********************************************************************* * * Copyright 2000,2001,2002,2003 * Broadcom Corporation. All rights reserved. - * - * 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 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -27,7 +27,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA ********************************************************************* */ @@ -37,7 +37,7 @@ #include "sb1250_defs.h" -/* ********************************************************************** +/* ********************************************************************** * DUART Registers ********************************************************************** */ @@ -145,7 +145,7 @@ #define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK) #define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK) -#define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7) +#define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7) /* * DUART Status Register (Table 10-6) @@ -165,7 +165,7 @@ /* * DUART Baud Rate Register (Table 10-7) - * Register: DUART_CLK_SEL_A + * Register: DUART_CLK_SEL_A * Register: DUART_CLK_SEL_B */ @@ -332,7 +332,7 @@ (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1) #if SIBYTE_HDR_FEATURE(1250, PASS2) || SIBYTE_HDR_FEATURE(112x, PASS1) -/* +/* * Full Interrupt Control Register */ diff --git a/include/asm-mips/sigcontext.h b/include/asm-mips/sigcontext.h index 18939e84b6f..f7fbebaa074 100644 --- a/include/asm-mips/sigcontext.h +++ b/include/asm-mips/sigcontext.h @@ -10,7 +10,7 @@ #define _ASM_SIGCONTEXT_H #include - + #if _MIPS_SIM == _MIPS_SIM_ABI32 /* @@ -38,7 +38,7 @@ struct sigcontext { }; #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ - + #if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 /* diff --git a/include/asm-mips/socket.h b/include/asm-mips/socket.h index d478a86294e..753b6620e6f 100644 --- a/include/asm-mips/socket.h +++ b/include/asm-mips/socket.h @@ -82,7 +82,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ * @SOCK_STREAM - stream (connection) socket * @SOCK_RAW - raw socket * @SOCK_RDM - reliably-delivered message - * @SOCK_SEQPACKET - sequential packet socket + * @SOCK_SEQPACKET - sequential packet socket * @SOCK_PACKET - linux specific way of getting packets at the dev level. * For writing rarp and other similar things on the user level. */ diff --git a/include/asm-mips/statfs.h b/include/asm-mips/statfs.h index 5076fec6578..c3ddf973c1c 100644 --- a/include/asm-mips/statfs.h +++ b/include/asm-mips/statfs.h @@ -57,7 +57,7 @@ struct statfs64 { }; #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ - + #if _MIPS_SIM == _MIPS_SIM_ABI64 struct statfs64 { /* Same as struct statfs */ diff --git a/include/asm-mips/titan_dep.h b/include/asm-mips/titan_dep.h index fd9599e40a0..fee1908c65d 100644 --- a/include/asm-mips/titan_dep.h +++ b/include/asm-mips/titan_dep.h @@ -228,4 +228,4 @@ extern unsigned long ocd_base; #define RM9K_READ_8(ofs, val) *(val) = *(volatile u8 *)(RM9000x2_BASE_ADDR+ofs) #define RM9K_READ_16(ofs, val) *(val) = *(volatile u16 *)(RM9000x2_BASE_ADDR+ofs) -#endif +#endif diff --git a/include/asm-mips/tx4927/tx4927.h b/include/asm-mips/tx4927/tx4927.h index 5d939db6e22..3bb7f0087d6 100644 --- a/include/asm-mips/tx4927/tx4927.h +++ b/include/asm-mips/tx4927/tx4927.h @@ -45,14 +45,14 @@ /* TX4927 SDRAM controller (64-bit registers) */ -#define TX4927_SDRAMC_BASE 0x8000 -#define TX4927_SDRAMC_SDCCR0 0x8000 +#define TX4927_SDRAMC_BASE 0x8000 +#define TX4927_SDRAMC_SDCCR0 0x8000 #define TX4927_SDRAMC_SDCCR1 0x8008 #define TX4927_SDRAMC_SDCCR2 0x8010 #define TX4927_SDRAMC_SDCCR3 0x8018 #define TX4927_SDRAMC_SDCTR 0x8040 #define TX4927_SDRAMC_SDCMD 0x8058 -#define TX4927_SDRAMC_LIMIT 0x8fff +#define TX4927_SDRAMC_LIMIT 0x8fff /* TX4927 external bus controller (64-bit registers) */ @@ -289,8 +289,8 @@ /* TX4927 serial port 0 (32-bit registers) */ -#define TX4927_SIO0_BASE 0xf300 -#define TX4927_SIO0_SILCR0 0xf300 +#define TX4927_SIO0_BASE 0xf300 +#define TX4927_SIO0_SILCR0 0xf300 #define TX4927_SIO0_SILCR0_RESERVED_16_31 BM_16_31 #define TX4927_SIO0_SILCR0_RWUB BM_15_15 #define TX4927_SIO0_SILCR0_TWUB BM_14_14 @@ -309,7 +309,7 @@ #define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT (~BM_00_01) #define TX4927_SIO0_SILCR0_UMODE_DATA_8_BIT_MC BM_01_01 #define TX4927_SIO0_SILCR0_UMODE_DATA_7_BIT_MC BM_00_01 -#define TX4927_SIO0_SIDICR0 0xf304 +#define TX4927_SIO0_SIDICR0 0xf304 #define TX4927_SIO0_SIDICR0_RESERVED_16_31 BM_16_31 #define TX4927_SIO0_SIDICR0_TDE BM_15_15 #define TX4927_SIO0_SIDICR0_RDE BM_14_14 @@ -330,7 +330,7 @@ #define TX4927_SIO0_SIDICR0_STIE_TRDY BM_02_02 #define TX4927_SIO0_SIDICR0_STIE_TXALS BM_01_01 #define TX4927_SIO0_SIDICR0_STIE_UBRKD BM_00_00 -#define TX4927_SIO0_SIDISR0 0xf308 +#define TX4927_SIO0_SIDISR0 0xf308 #define TX4927_SIO0_SIDISR0_RESERVED_16_31 BM_16_31 #define TX4927_SIO0_SIDISR0_UBRK BM_15_15 #define TX4927_SIO0_SIDISR0_UVALID BM_14_14 @@ -344,7 +344,7 @@ #define TX4927_SIO0_SIDISR0_STIS BM_06_06 #define TX4927_SIO0_SIDISR0_RESERVED_05_05 BM_05_05 #define TX4927_SIO0_SIDISR0_RFDN BM_00_04 -#define TX4927_SIO0_SISCISR0 0xf30c +#define TX4927_SIO0_SISCISR0 0xf30c #define TX4927_SIO0_SISCISR0_RESERVED_06_31 BM_06_31 #define TX4927_SIO0_SISCISR0_OERS BM_05_05 #define TX4927_SIO0_SISCISR0_CTSS BM_04_04 @@ -352,7 +352,7 @@ #define TX4927_SIO0_SISCISR0_TRDY BM_02_02 #define TX4927_SIO0_SISCISR0_TXALS BM_01_01 #define TX4927_SIO0_SISCISR0_UBRKD BM_00_00 -#define TX4927_SIO0_SIFCR0 0xf310 +#define TX4927_SIO0_SIFCR0 0xf310 #define TX4927_SIO0_SIFCR0_RESERVED_16_31 BM_16_31 #define TX4927_SIO0_SIFCR0_SWRST BM_16_31 #define TX4927_SIO0_SIFCR0_RESERVED_09_14 BM_09_14 @@ -370,7 +370,7 @@ #define TX4927_SIO0_SIFCR0_TFRST BM_02_02 #define TX4927_SIO0_SIFCR0_RFRST BM_01_01 #define TX4927_SIO0_SIFCR0_FRSTE BM_00_00 -#define TX4927_SIO0_SIFLCR0 0xf314 +#define TX4927_SIO0_SIFLCR0 0xf314 #define TX4927_SIO0_SIFLCR0_RESERVED_13_31 BM_13_31 #define TX4927_SIO0_SIFLCR0_RCS BM_12_12 #define TX4927_SIO0_SIFLCR0_TES BM_11_11 @@ -381,7 +381,7 @@ #define TX4927_SIO0_SIFLCR0_RESERVED_05_06 BM_05_06 #define TX4927_SIO0_SIFLCR0_RTSTL BM_01_04 #define TX4927_SIO0_SIFLCR0_TBRK BM_00_00 -#define TX4927_SIO0_SIBGR0 0xf318 +#define TX4927_SIO0_SIBGR0 0xf318 #define TX4927_SIO0_SIBGR0_RESERVED_10_31 BM_10_31 #define TX4927_SIO0_SIBGR0_BCLK BM_08_09 #define TX4927_SIO0_SIBGR0_BCLK_T0 (~BM_08_09) @@ -389,28 +389,28 @@ #define TX4927_SIO0_SIBGR0_BCLK_T4 BM_09_09 #define TX4927_SIO0_SIBGR0_BCLK_T6 BM_08_09 #define TX4927_SIO0_SIBGR0_BRD BM_00_07 -#define TX4927_SIO0_SITFIF00 0xf31c +#define TX4927_SIO0_SITFIF00 0xf31c #define TX4927_SIO0_SITFIF00_RESERVED_08_31 BM_08_31 #define TX4927_SIO0_SITFIF00_TXD BM_00_07 -#define TX4927_SIO0_SIRFIFO0 0xf320 +#define TX4927_SIO0_SIRFIFO0 0xf320 #define TX4927_SIO0_SIRFIFO0_RESERVED_08_31 BM_08_31 #define TX4927_SIO0_SIRFIFO0_RXD BM_00_07 -#define TX4927_SIO0_SIRFIFO0 0xf320 -#define TX4927_SIO0_LIMIT 0xf3ff +#define TX4927_SIO0_SIRFIFO0 0xf320 +#define TX4927_SIO0_LIMIT 0xf3ff /* TX4927 serial port 1 (32-bit registers) */ -#define TX4927_SIO1_BASE 0xf400 -#define TX4927_SIO1_SILCR1 0xf400 -#define TX4927_SIO1_SIDICR1 0xf404 -#define TX4927_SIO1_SIDISR1 0xf408 -#define TX4927_SIO1_SISCISR1 0xf40c -#define TX4927_SIO1_SIFCR1 0xf410 -#define TX4927_SIO1_SIFLCR1 0xf414 -#define TX4927_SIO1_SIBGR1 0xf418 -#define TX4927_SIO1_SITFIF01 0xf41c -#define TX4927_SIO1_SIRFIFO1 0xf420 -#define TX4927_SIO1_LIMIT 0xf4ff +#define TX4927_SIO1_BASE 0xf400 +#define TX4927_SIO1_SILCR1 0xf400 +#define TX4927_SIO1_SIDICR1 0xf404 +#define TX4927_SIO1_SIDISR1 0xf408 +#define TX4927_SIO1_SISCISR1 0xf40c +#define TX4927_SIO1_SIFCR1 0xf410 +#define TX4927_SIO1_SIFLCR1 0xf414 +#define TX4927_SIO1_SIBGR1 0xf418 +#define TX4927_SIO1_SITFIF01 0xf41c +#define TX4927_SIO1_SIRFIFO1 0xf420 +#define TX4927_SIO1_LIMIT 0xf4ff /* TX4927 parallel port (32-bit registers) */ diff --git a/include/asm-mips/tx4927/tx4927_pci.h b/include/asm-mips/tx4927/tx4927_pci.h index 17043349224..165f6b8b217 100644 --- a/include/asm-mips/tx4927/tx4927_pci.h +++ b/include/asm-mips/tx4927/tx4927_pci.h @@ -5,8 +5,8 @@ * * Copyright (C) 2000-2001 Toshiba Corporation */ -#ifndef __ASM_TX4927_TX4927_PCI_H -#define __ASM_TX4927_TX4927_PCI_H +#ifndef __ASM_TX4927_TX4927_PCI_H +#define __ASM_TX4927_TX4927_PCI_H #define TX4927_CCFG_TOE 0x00004000 diff --git a/include/asm-mips/vr41xx/vrc4173.h b/include/asm-mips/vr41xx/vrc4173.h index 58e193c51b4..bb7a85c186e 100644 --- a/include/asm-mips/vr41xx/vrc4173.h +++ b/include/asm-mips/vr41xx/vrc4173.h @@ -21,8 +21,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __NEC_VRC4173_H -#define __NEC_VRC4173_H +#ifndef __NEC_VRC4173_H +#define __NEC_VRC4173_H #include #include diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h index c4a70412134..04ee53b34c2 100644 --- a/include/asm-mips/war.h +++ b/include/asm-mips/war.h @@ -113,7 +113,7 @@ */ #define BCM1250_M3_WAR 1 -/* +/* * This is a DUART workaround related to glitches around register accesses */ #define SIBYTE_1956_WAR 1 @@ -122,7 +122,7 @@ /* * Fill buffers not flushed on CACHE instructions - * + * * Hit_Invalidate_I cacheops invalidate an icache line but the refill * for that line can get stale data from the fill buffer instead of * accessing memory if the previous icache miss was also to that line. diff --git a/include/asm-mips/xxs1500.h b/include/asm-mips/xxs1500.h index 75c0ddfeca1..4d84a90b0f2 100644 --- a/include/asm-mips/xxs1500.h +++ b/include/asm-mips/xxs1500.h @@ -22,7 +22,7 @@ * * ######################################################################## * - * + * */ #ifndef __ASM_XXS1500_H #define __ASM_XXS1500_H -- cgit v1.2.3 From 4ce588cd563e6b817adb0c7d03b3ed9c74cadc27 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 3 Sep 2005 15:56:19 -0700 Subject: [PATCH] mips: fix coherency configuration Fix the MIPS coherency configuration such that we always keep the mapping state in when we need to on non-coherent platforms. Signed-off-by: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/pci.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index d70dc355c1f..092900f1165 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -94,7 +94,7 @@ struct pci_dev; */ extern unsigned int PCI_DMA_BUS_IS_PHYS; -#ifdef CONFIG_MAPPED_DMA_IO +#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE /* pci_unmap_{single,page} is not a nop, thus... */ #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME; @@ -104,7 +104,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS; #define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) #define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) -#else /* CONFIG_MAPPED_DMA_IO */ +#else /* CONFIG_DMA_NEED_PCI_MAP_STATE */ /* pci_unmap_{page,single} is a nop so... */ #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) @@ -114,7 +114,7 @@ extern unsigned int PCI_DMA_BUS_IS_PHYS; #define pci_unmap_len(PTR, LEN_NAME) (0) #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) -#endif /* CONFIG_MAPPED_DMA_IO */ +#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */ /* This is always fine. */ #define pci_dac_dma_supported(pci_dev, mask) (1) -- cgit v1.2.3 From e2de84920d9489f7fd87fa4b04d996d569def4fa Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 3 Sep 2005 15:56:19 -0700 Subject: [PATCH] mips: add pcibios_select_root Add pcibios_select_root to MIPS. Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/pci.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 092900f1165..049f01f648e 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -167,4 +167,17 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev) /* Do platform specific device initialization at pci_enable_device() time */ extern int pcibios_plat_dev_init(struct pci_dev *dev); +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; +} + #endif /* _ASM_PCI_H */ -- cgit v1.2.3 From e63ea56fe2669c20f4668d89522500f4ab439b04 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 3 Sep 2005 15:56:20 -0700 Subject: [PATCH] mips: add pcibios_bus_to_resource This patch has added pcibios_bus_to_resource to MIPS. Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/pci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index 049f01f648e..c9a00ca1c01 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -142,6 +142,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev, extern void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res); +extern void pcibios_bus_to_resource(struct pci_dev *dev, + struct resource *res, struct pci_bus_region *region); #ifdef CONFIG_PCI_DOMAINS -- cgit v1.2.3 From 766160c29fadbafad1d6eb5e965922c7e78beb88 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 3 Sep 2005 15:56:22 -0700 Subject: [PATCH] mips: fix build warnings This patch has fixed the following warnings. arch/mips/kernel/genex.S:250:5: warning: "CONFIG_64BIT" is not defined arch/mips/math-emu/cp1emu.c:1128:5: warning: "__mips64" is not defined arch/mips/math-emu/cp1emu.c:1206:5: warning: "__mips64" is not defined arch/mips/math-emu/cp1emu.c:1270:5: warning: "__mips64" is not defined arch/mips/math-emu/cp1emu.c:323:5: warning: "__mips64" is not defined arch/mips/math-emu/cp1emu.c:808:5: warning: "__mips64" is not defined arch/mips/math-emu/cp1emu.c:953:5: warning: "__mips64" is not defined arch/mips/mm/tlbex.c:519:5: warning: "CONFIG_64BIT" is not defined include/asm/reg.h:73:5: warning: "CONFIG_64BIT" is not defined Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-mips/reg.h b/include/asm-mips/reg.h index a1ebd3aa93a..6173004cc88 100644 --- a/include/asm-mips/reg.h +++ b/include/asm-mips/reg.h @@ -70,7 +70,7 @@ #endif -#if CONFIG_64BIT +#ifdef CONFIG_64BIT #define EF_R0 0 #define EF_R1 1 -- cgit v1.2.3 From 6fe7f2578fb4903af79abeb29bb9b9ab5eace1b5 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Sat, 3 Sep 2005 15:56:23 -0700 Subject: [PATCH] mips: remove timex.h for vr41xx vr41xx doesn't need mach-vr41xx/timex.h. This patch has removed mach-vr41xx/timex.h. Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/mach-vr41xx/timex.h | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 include/asm-mips/mach-vr41xx/timex.h (limited to 'include') diff --git a/include/asm-mips/mach-vr41xx/timex.h b/include/asm-mips/mach-vr41xx/timex.h deleted file mode 100644 index 8d71485d003..00000000000 --- a/include/asm-mips/mach-vr41xx/timex.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2003 by Ralf Baechle - */ -/* - * Changes: - * Yoichi Yuasa - * - CLOCK_TICK_RATE is changed into 32768 from 6144000. - */ -#ifndef __ASM_MACH_VR41XX_TIMEX_H -#define __ASM_MACH_VR41XX_TIMEX_H - -#define CLOCK_TICK_RATE 32768 - -#endif /* __ASM_MACH_VR41XX_TIMEX_H */ -- cgit v1.2.3 From 7ae65fd334232468a9d6b523a4fc141cd6ec5ea4 Mon Sep 17 00:00:00 2001 From: Matt Tolentino Date: Sat, 3 Sep 2005 15:56:27 -0700 Subject: [PATCH] x86: fix EFI memory map parsing The memory descriptors that comprise the EFI memory map are not fixed in stone such that the size could change in the future. This uses the memory descriptor size obtained from EFI to iterate over the memory map entries during boot. This enables the removal of an x86 specific pad (and ifdef) in the EFI header. I also couldn't stomach the broken up nature of the function to put EFI runtime calls into virtual mode any longer so I fixed that up a bit as well. For reference, this patch only impacts x86. Signed-off-by: Matt Tolentino Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/setup.h | 2 +- include/linux/efi.h | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index 7a32184d54b..826a8ca50ac 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h @@ -44,7 +44,7 @@ extern unsigned char boot_params[PARAM_SIZE]; #define EFI_SYSTAB ((efi_system_table_t *) *((unsigned long *)(PARAM+0x1c4))) #define EFI_MEMDESC_SIZE (*((unsigned long *) (PARAM+0x1c8))) #define EFI_MEMDESC_VERSION (*((unsigned long *) (PARAM+0x1cc))) -#define EFI_MEMMAP ((efi_memory_desc_t *) *((unsigned long *)(PARAM+0x1d0))) +#define EFI_MEMMAP ((void *) *((unsigned long *)(PARAM+0x1d0))) #define EFI_MEMMAP_SIZE (*((unsigned long *) (PARAM+0x1d4))) #define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) #define RAMDISK_FLAGS (*(unsigned short *) (PARAM+0x1F8)) diff --git a/include/linux/efi.h b/include/linux/efi.h index 73781ec165b..c7c5dd31618 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -91,11 +91,6 @@ typedef struct { #define EFI_PAGE_SHIFT 12 -/* - * For current x86 implementations of EFI, there is - * additional padding in the mem descriptors. This is not - * the case in ia64. Need to have this fixed in the f/w. - */ typedef struct { u32 type; u32 pad; @@ -103,9 +98,6 @@ typedef struct { u64 virt_addr; u64 num_pages; u64 attribute; -#if defined (__i386__) - u64 pad1; -#endif } efi_memory_desc_t; typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); @@ -240,10 +232,12 @@ typedef struct { } efi_system_table_t; struct efi_memory_map { - efi_memory_desc_t *phys_map; - efi_memory_desc_t *map; + void *phys_map; + void *map; + void *map_end; int nr_map; unsigned long desc_version; + unsigned long desc_size; }; /* -- cgit v1.2.3 From 911a62d42365076209e2c327e7688db296e35d62 Mon Sep 17 00:00:00 2001 From: Venkatesh Pallipadi Date: Sat, 3 Sep 2005 15:56:31 -0700 Subject: [PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs i386 generic subarchitecture requires explicit dmi strings or command line to enable bigsmp mode. The patch below removes that restriction, and uses bigsmp as soon as it finds more than 8 logical CPUs, Intel processors and xAPIC support. Signed-off-by: Venkatesh Pallipadi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/apicdef.h | 1 + include/asm-i386/mach-generic/mach_apic.h | 2 ++ include/asm-i386/mpspec.h | 1 + 3 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h index a96a8f48fbf..03185cef8e0 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-i386/apicdef.h @@ -16,6 +16,7 @@ #define GET_APIC_VERSION(x) ((x)&0xFF) #define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF) #define APIC_INTEGRATED(x) ((x)&0xF0) +#define APIC_XAPIC(x) ((x) >= 0x14) #define APIC_TASKPRI 0x80 #define APIC_TPRI_MASK 0xFF #define APIC_ARBPRI 0x90 diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h index b13767a4e93..d9dc039da94 100644 --- a/include/asm-i386/mach-generic/mach_apic.h +++ b/include/asm-i386/mach-generic/mach_apic.h @@ -28,4 +28,6 @@ #define enable_apic_mode (genapic->enable_apic_mode) #define phys_pkg_id (genapic->phys_pkg_id) +extern void generic_bigsmp_probe(void); + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index d9fafba075b..d84a9c326c2 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h @@ -11,6 +11,7 @@ extern int mp_bus_id_to_local [MAX_MP_BUSSES]; extern int quad_local_to_mp_bus_id [NR_CPUS/4][4]; extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES]; +extern unsigned int def_to_bigsmp; extern unsigned int boot_cpu_physical_apicid; extern int smp_found_config; extern void find_smp_config (void); -- cgit v1.2.3 From 56f1d5d52a21b93bc2984c920b17e0d80df5d1b2 Mon Sep 17 00:00:00 2001 From: "Natalie.Protasevich@unisys.com" Date: Sat, 3 Sep 2005 15:56:34 -0700 Subject: [PATCH] ES7000 platform update (i386) This is subarch update for ES7000. I've modified platform check code and removed unnecessary OEM table parsing for newer systems that don't use OEM information during boot. Parsing the table in fact is causing problems, and the platform doesn't get recognized. The patch only affects the ES7000 subach. Signed-off-by: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/mach-es7000/mach_mpparse.h | 30 +++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h index 85809e0898d..28a84f6185a 100644 --- a/include/asm-i386/mach-es7000/mach_mpparse.h +++ b/include/asm-i386/mach-es7000/mach_mpparse.h @@ -1,6 +1,8 @@ #ifndef __ASM_MACH_MPPARSE_H #define __ASM_MACH_MPPARSE_H +#include + static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, struct mpc_config_translation *translation) { @@ -12,8 +14,9 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, { } -extern int parse_unisys_oem (char *oemptr, int oem_entries); -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr, int *length); +extern int parse_unisys_oem (char *oemptr); +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); +extern void setup_unisys(); static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) @@ -22,18 +25,33 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, struct mp_config_oemtable *oem_table = (struct mp_config_oemtable *)mpc->mpc_oemptr; if (!strncmp(oem, "UNISYS", 6)) - return parse_unisys_oem((char *)oem_table, oem_table->oem_length); + return parse_unisys_oem((char *)oem_table); } return 0; } +static inline int es7000_check_dsdt() +{ + struct acpi_table_header *header = NULL; + if(!acpi_get_table_header_early(ACPI_DSDT, &header)) + acpi_table_print(header, 0); + if (!strncmp(header->oem_id, "UNISYS", 6)) + return 1; + return 0; +} + /* Hook from generic ACPI tables.c */ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { unsigned long oem_addr; - int oem_entries; - if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries)) - return parse_unisys_oem((char *)oem_addr, oem_entries); + if (!find_unisys_acpi_oem_table(&oem_addr)) { + if (es7000_check_dsdt()) + return parse_unisys_oem((char *)oem_addr); + else { + setup_unisys(); + return 1; + } + } return 0; } -- cgit v1.2.3 From 4bb0d3ec3e5b1e9e2399cdc641b3b6521ac9cdaa Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:36 -0700 Subject: [PATCH] i386: inline asm cleanup i386 Inline asm cleanup. Use cr/dr accessor functions. Also, a potential bugfix. Also, some CR accessors really should be volatile. Reads from CR0 (numeric state may change in an exception handler), writes to CR4 (flipping CR4.TSD) and reads from CR2 (page fault) prevent instruction re-ordering. I did not add memory clobber to CR3 / CR4 / CR0 updates, as it was not there to begin with, and in no case should kernel memory be clobbered, except when doing a TLB flush, which already has memory clobber. I noticed that page invalidation does not have a memory clobber. I can't find a bug as a result, but there is definitely a potential for a bug here: #define __flush_tlb_single(addr) \ __asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/agp.h | 2 +- include/asm-i386/bugs.h | 5 ++++- include/asm-i386/processor.h | 22 +++++++++------------- include/asm-i386/system.h | 28 +++++++++++++++++++++++++--- include/asm-i386/xor.h | 26 +++++++++++++------------- 5 files changed, 52 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/asm-i386/agp.h b/include/asm-i386/agp.h index b82f5f3ab88..9075083bab7 100644 --- a/include/asm-i386/agp.h +++ b/include/asm-i386/agp.h @@ -19,7 +19,7 @@ int unmap_page_from_agp(struct page *page); /* Could use CLFLUSH here if the cpu supports it. But then it would need to be called for each cacheline of the whole page so it may not be worth it. Would need a page for it. */ -#define flush_agp_cache() asm volatile("wbinvd":::"memory") +#define flush_agp_cache() wbinvd() /* Convert a physical address to an address suitable for the GART. */ #define phys_to_gart(x) (x) diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index 6789fc275da..ea54540638d 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h @@ -118,7 +118,10 @@ static void __init check_hlt(void) printk("disabled\n"); return; } - __asm__ __volatile__("hlt ; hlt ; hlt ; hlt"); + halt(); + halt(); + halt(); + halt(); printk("OK.\n"); } diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index d0d8b016009..7e17d3b4f65 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -203,9 +203,7 @@ static inline unsigned int cpuid_edx(unsigned int op) return edx; } -#define load_cr3(pgdir) \ - asm volatile("movl %0,%%cr3": :"r" (__pa(pgdir))) - +#define load_cr3(pgdir) write_cr3(__pa(pgdir)) /* * Intel CPU features in CR4 @@ -232,22 +230,20 @@ extern unsigned long mmu_cr4_features; static inline void set_in_cr4 (unsigned long mask) { + unsigned cr4; mmu_cr4_features |= mask; - __asm__("movl %%cr4,%%eax\n\t" - "orl %0,%%eax\n\t" - "movl %%eax,%%cr4\n" - : : "irg" (mask) - :"ax"); + cr4 = read_cr4(); + cr4 |= mask; + write_cr4(cr4); } static inline void clear_in_cr4 (unsigned long mask) { + unsigned cr4; mmu_cr4_features &= ~mask; - __asm__("movl %%cr4,%%eax\n\t" - "andl %0,%%eax\n\t" - "movl %%eax,%%cr4\n" - : : "irg" (~mask) - :"ax"); + cr4 = read_cr4(); + cr4 &= ~mask; + write_cr4(cr4); } /* diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 3db717a244f..8048a5e018c 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -107,13 +107,33 @@ static inline unsigned long _get_base(char * addr) #define clts() __asm__ __volatile__ ("clts") #define read_cr0() ({ \ unsigned int __dummy; \ - __asm__( \ + __asm__ __volatile__( \ "movl %%cr0,%0\n\t" \ :"=r" (__dummy)); \ __dummy; \ }) #define write_cr0(x) \ - __asm__("movl %0,%%cr0": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); + +#define read_cr2() ({ \ + unsigned int __dummy; \ + __asm__ __volatile__( \ + "movl %%cr2,%0\n\t" \ + :"=r" (__dummy)); \ + __dummy; \ +}) +#define write_cr2(x) \ + __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); + +#define read_cr3() ({ \ + unsigned int __dummy; \ + __asm__ ( \ + "movl %%cr3,%0\n\t" \ + :"=r" (__dummy)); \ + __dummy; \ +}) +#define write_cr3(x) \ + __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); #define read_cr4() ({ \ unsigned int __dummy; \ @@ -123,7 +143,7 @@ static inline unsigned long _get_base(char * addr) __dummy; \ }) #define write_cr4(x) \ - __asm__("movl %0,%%cr4": :"r" (x)); + __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); #define stts() write_cr0(8 | read_cr0()) #endif /* __KERNEL__ */ @@ -447,6 +467,8 @@ struct alt_instr { #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") /* used in the idle loop; sti takes one instruction cycle to complete */ #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") +/* used when interrupts are already enabled or to shutdown the processor */ +#define halt() __asm__ __volatile__("hlt": : :"memory") #define irqs_disabled() \ ({ \ diff --git a/include/asm-i386/xor.h b/include/asm-i386/xor.h index f80e2dbe1b5..23c86cef3b2 100644 --- a/include/asm-i386/xor.h +++ b/include/asm-i386/xor.h @@ -535,14 +535,14 @@ static struct xor_block_template xor_block_p5_mmx = { #define XMMS_SAVE do { \ preempt_disable(); \ + cr0 = read_cr0(); \ + clts(); \ __asm__ __volatile__ ( \ - "movl %%cr0,%0 ;\n\t" \ - "clts ;\n\t" \ - "movups %%xmm0,(%1) ;\n\t" \ - "movups %%xmm1,0x10(%1) ;\n\t" \ - "movups %%xmm2,0x20(%1) ;\n\t" \ - "movups %%xmm3,0x30(%1) ;\n\t" \ - : "=&r" (cr0) \ + "movups %%xmm0,(%0) ;\n\t" \ + "movups %%xmm1,0x10(%0) ;\n\t" \ + "movups %%xmm2,0x20(%0) ;\n\t" \ + "movups %%xmm3,0x30(%0) ;\n\t" \ + : \ : "r" (xmm_save) \ : "memory"); \ } while(0) @@ -550,14 +550,14 @@ static struct xor_block_template xor_block_p5_mmx = { #define XMMS_RESTORE do { \ __asm__ __volatile__ ( \ "sfence ;\n\t" \ - "movups (%1),%%xmm0 ;\n\t" \ - "movups 0x10(%1),%%xmm1 ;\n\t" \ - "movups 0x20(%1),%%xmm2 ;\n\t" \ - "movups 0x30(%1),%%xmm3 ;\n\t" \ - "movl %0,%%cr0 ;\n\t" \ + "movups (%0),%%xmm0 ;\n\t" \ + "movups 0x10(%0),%%xmm1 ;\n\t" \ + "movups 0x20(%0),%%xmm2 ;\n\t" \ + "movups 0x30(%0),%%xmm3 ;\n\t" \ : \ - : "r" (cr0), "r" (xmm_save) \ + : "r" (xmm_save) \ : "memory"); \ + write_cr0(cr0); \ preempt_enable(); \ } while(0) -- cgit v1.2.3 From 245067d1674d451855692fcd4647daf9fd47f82d Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:37 -0700 Subject: [PATCH] i386: cleanup serialize msr i386 arch cleanup. Introduce the serialize macro to serialize processor state. Why the microcode update needs it I am not quite sure, since wrmsr() is already a serializing instruction, but it is a microcode update, so I will keep the semantic the same, since this could be a timing workaround. As far as I can tell, this has always been there since the original microcode update source. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/processor.h | 5 +++++ include/asm-x86_64/processor.h | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'include') diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 7e17d3b4f65..a0489b22270 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -277,6 +277,11 @@ static inline void clear_in_cr4 (unsigned long mask) outb((data), 0x23); \ } while (0) +static inline void serialize_cpu(void) +{ + __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); +} + static inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 85549e656ee..194160f6a43 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h @@ -437,6 +437,11 @@ static inline void prefetchw(void *x) outb((data), 0x23); \ } while (0) +static inline void serialize_cpu(void) +{ + __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); +} + static inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { -- cgit v1.2.3 From 4d37e7e3fd851428dede4d05d3e69d03795a744a Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:38 -0700 Subject: [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management i386 inline assembler cleanup. This change encapsulates descriptor and task register management. Also, it is possible to improve assembler generation in two cases; savesegment may store the value in a register instead of a memory location, which allows GCC to optimize stack variables into registers, and MOV MEM, SEG is always a 16-bit write to memory, making the casting in math-emu unnecessary. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/desc.h | 10 ++++++++++ include/asm-i386/system.h | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index 11e67811a99..9a0b85a52e7 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h @@ -30,6 +30,16 @@ extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; #define load_TR_desc() __asm__ __volatile__("ltr %%ax"::"a" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %%ax"::"a" (GDT_ENTRY_LDT*8)) +#define load_gdt(dtr) __asm__ __volatile("lgdt %0"::"m" (*dtr)) +#define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr)) +#define load_tr(tr) __asm__ __volatile("ltr %0"::"mr" (tr)) +#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"mr" (ldt)) + +#define store_gdt(dtr) __asm__ ("sgdt %0":"=m" (*dtr)) +#define store_idt(dtr) __asm__ ("sidt %0":"=m" (*dtr)) +#define store_tr(tr) __asm__ ("str %0":"=mr" (tr)) +#define store_ldt(ldt) __asm__ ("sldt %0":"=mr" (ldt)) + /* * This is the ldt that every process will get unless we need * something other than this. diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 8048a5e018c..37fd2f8c719 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -93,13 +93,13 @@ static inline unsigned long _get_base(char * addr) ".align 4\n\t" \ ".long 1b,3b\n" \ ".previous" \ - : :"m" (value)) + : :"rm" (value)) /* * Save a segment register away */ #define savesegment(seg, value) \ - asm volatile("mov %%" #seg ",%0":"=m" (value)) + asm volatile("mov %%" #seg ",%0":"=rm" (value)) /* * Clear and set 'TS' bit respectively -- cgit v1.2.3 From 2f2984eb4afb2a4298e3186cb49cc7e88dd6d929 Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:38 -0700 Subject: [PATCH] i386: generate better code around descriptor update and access functions GCC can generate better code around descriptor update and access functions when there is not an explicit "eax" register constraint. Testing: You won't boot if this is messed up, since the TSS descriptor will be corrupted. Verified the assembler and booted. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/desc.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index 9a0b85a52e7..ccb11c03283 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h @@ -27,8 +27,8 @@ struct Xgt_desc_struct { extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; -#define load_TR_desc() __asm__ __volatile__("ltr %%ax"::"a" (GDT_ENTRY_TSS*8)) -#define load_LDT_desc() __asm__ __volatile__("lldt %%ax"::"a" (GDT_ENTRY_LDT*8)) +#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) +#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) #define load_gdt(dtr) __asm__ __volatile("lgdt %0"::"m" (*dtr)) #define load_idt(dtr) __asm__ __volatile("lidt %0"::"m" (*dtr)) @@ -49,14 +49,14 @@ extern void set_intr_gate(unsigned int irq, void * addr); #define _set_tssldt_desc(n,addr,limit,type) \ __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \ - "movw %%ax,2(%2)\n\t" \ - "rorl $16,%%eax\n\t" \ - "movb %%al,4(%2)\n\t" \ + "movw %w1,2(%2)\n\t" \ + "rorl $16,%1\n\t" \ + "movb %b1,4(%2)\n\t" \ "movb %4,5(%2)\n\t" \ "movb $0,6(%2)\n\t" \ - "movb %%ah,7(%2)\n\t" \ - "rorl $16,%%eax" \ - : "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type)) + "movb %h1,7(%2)\n\t" \ + "rorl $16,%1" \ + : "=m"(*(n)) : "q" (addr), "r"(n), "ir"(limit), "i"(type)) static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, void *addr) { -- cgit v1.2.3 From c9b02a24130e3ff14a553d966a79f46cf806b037 Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:40 -0700 Subject: [PATCH] i386: use set_pte macros in a couple places where they were missing Also, setting PDPEs in PAE mode does not require atomic operations, since the PDPEs are cached by the processor, and only reloaded on an explicit or implicit reload of CR3. Since the four PDPEs must always be present in an active root, and the kernel PDPE is never updated, we are safe even from SMIs and interrupts / NMIs using task gates (which reload CR3). Actually, much of this is moot, since the user PDPEs are never updated either, and the only usage of task gates is by the doublefault handler. It appears the only place PGDs get updated in PAE mode is in init_low_mappings() / zap_low_mapping() for initial page table creation and recovery from ACPI sleep state, and these sites are safe by inspection. Getting rid of the cmpxchg8b saves code space and 720 cycles in pgd_alloc on P4. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/pgtable-3level.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h index d609f9c2c1f..2e3f4a344a2 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-i386/pgtable-3level.h @@ -64,7 +64,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) #define set_pmd(pmdptr,pmdval) \ set_64bit((unsigned long long *)(pmdptr),pmd_val(pmdval)) #define set_pud(pudptr,pudval) \ - set_64bit((unsigned long long *)(pudptr),pud_val(pudval)) + (*(pudptr) = (pudval)) /* * Pentium-II erratum A13: in PAE mode we explicitly have to flush -- cgit v1.2.3 From 4f0cb8d978ab4b6e3b40147f619f48316d9d7f63 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sat, 3 Sep 2005 15:56:41 -0700 Subject: [PATCH] i386: fix incorrect TSS entry for LDT Noticed by Chuck Ebbert: the .ldt entry of the TSS was set up incorrectly. It never mattered since this was a leftover from old times, so remove it. Signed-off-by: Ingo Molnar Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/processor.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index a0489b22270..992224bff54 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -475,7 +475,6 @@ struct thread_struct { .esp0 = sizeof(init_stack) + (long)&init_stack, \ .ss0 = __KERNEL_DS, \ .ss1 = __KERNEL_CS, \ - .ldt = GDT_ENTRY_LDT, \ .io_bitmap_base = INVALID_IO_BITMAP_OFFSET, \ .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 }, \ } -- cgit v1.2.3 From f2ab4461249df85b20930a7a57b54f39c5ae291a Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:42 -0700 Subject: [PATCH] x86: more asm cleanups Some more assembler cleanups I noticed along the way. Signed-off-by: Zachary Amsden Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/msr.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index c76fce8badb..62b76cd9695 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h @@ -47,6 +47,21 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val) : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT));\ ret__; }) +/* rdmsr with exception handling */ +#define rdmsr_safe(msr,a,b) ({ int ret__; \ + asm volatile("2: rdmsr ; xorl %0,%0\n" \ + "1:\n\t" \ + ".section .fixup,\"ax\"\n\t" \ + "3: movl %4,%0 ; jmp 1b\n\t" \ + ".previous\n\t" \ + ".section __ex_table,\"a\"\n" \ + " .align 4\n\t" \ + " .long 2b,3b\n\t" \ + ".previous" \ + : "=r" (ret__), "=a" (*(a)), "=d" (*(b)) \ + : "c" (msr), "i" (-EFAULT));\ + ret__; }) + #define rdtsc(low,high) \ __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high)) -- cgit v1.2.3 From 0998e4228aca046fbd747c3fed909791d52e88eb Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:43 -0700 Subject: [PATCH] x86: privilege cleanup Privilege checking cleanup. Originally, these diffs were much greater, but recent cleanups in Linux have already done much of the cleanup. I added some explanatory comments in places where the reasoning behind certain tests is rather subtle. Also, in traps.c, we can skip the user_mode check in handle_BUG(). The reason is, there are only two call chains - one via die_if_kernel() and one via do_page_fault(), both entering from die(). Both of these paths already ensure that a kernel mode failure has happened. Also, the original check here, if (user_mode(regs)) was insufficient anyways, since it would not rule out BUG faults from V8086 mode execution. Saving the %ss segment in show_regs() rather than assuming a fixed value also gives better information about the current kernel state in the register dump. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/ptrace.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h index 05532875e39..7e0f2945d17 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-i386/ptrace.h @@ -61,6 +61,13 @@ struct pt_regs { struct task_struct; extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); +/* + * user_mode_vm(regs) determines whether a register set came from user mode. + * This is true if V8086 mode was enabled OR if the register set was from + * protected mode with RPL-3 CS value. This tricky test checks that with + * one comparison. Many places in the kernel can bypass this full check + * if they have already ruled out V8086 mode, so user_mode(regs) can be used. + */ static inline int user_mode(struct pt_regs *regs) { return (regs->xcs & 3) != 0; -- cgit v1.2.3 From a5201129307f414890f9a4410e38da205f5d7359 Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:44 -0700 Subject: [PATCH] x86: make IOPL explicit The pushf/popf in switch_to are ONLY used to switch IOPL. Making this explicit in C code is more clear. This pushf/popf pair was added as a bugfix for leaking IOPL to unprivileged processes when using sysenter/sysexit based system calls (sysexit does not restore flags). When requesting an IOPL change in sys_iopl(), it is just as easy to change the current flags and the flags in the stack image (in case an IRET is required), but there is no reason to force an IRET if we came in from the SYSENTER path. This change is the minimal solution for supporting a paravirtualized Linux kernel that allows user processes to run with I/O privilege. Other solutions require radical rewrites of part of the low level fault / system call handling code, or do not fully support sysenter based system calls. Unfortunately, this added one field to the thread_struct. But as a bonus, on P4, the fastest time measured for switch_to() went from 312 to 260 cycles, a win of about 17% in the fast case through this performance critical path. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/processor.h | 16 ++++++++++++++++ include/asm-i386/system.h | 4 +--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 992224bff54..37bef8ed7be 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -455,6 +455,7 @@ struct thread_struct { unsigned int saved_fs, saved_gs; /* IO permissions */ unsigned long *io_bitmap_ptr; + unsigned long iopl; /* max allowed port in the bitmap, in bytes: */ unsigned long io_bitmap_max; }; @@ -511,6 +512,21 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa : /* no output */ \ :"r" (value)) +/* + * Set IOPL bits in EFLAGS from given mask + */ +static inline void set_iopl_mask(unsigned mask) +{ + unsigned int reg; + __asm__ __volatile__ ("pushfl;" + "popl %0;" + "andl %1, %0;" + "orl %2, %0;" + "pushl %0;" + "popfl" + : "=&r" (reg) + : "i" (~X86_EFLAGS_IOPL), "r" (mask)); +} /* Forward declaration, a strange C thing */ struct task_struct; diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 37fd2f8c719..acd5c26b69b 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -14,8 +14,7 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc #define switch_to(prev,next,last) do { \ unsigned long esi,edi; \ - asm volatile("pushfl\n\t" \ - "pushl %%ebp\n\t" \ + asm volatile("pushl %%ebp\n\t" \ "movl %%esp,%0\n\t" /* save ESP */ \ "movl %5,%%esp\n\t" /* restore ESP */ \ "movl $1f,%1\n\t" /* save EIP */ \ @@ -23,7 +22,6 @@ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struc "jmp __switch_to\n" \ "1:\t" \ "popl %%ebp\n\t" \ - "popfl" \ :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ "=a" (last),"=S" (esi),"=D" (edi) \ :"m" (next->thread.esp),"m" (next->thread.eip), \ -- cgit v1.2.3 From f2f30ebca6c0c95e987cb9a1fd1495770a75432e Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:47 -0700 Subject: [PATCH] x86: introduce a write acessor for updating the current LDT Introduce a write acessor for updating the current LDT. This is required for hypervisors like Xen that do not allow LDT pages to be directly written. Testing - here's a fun little LDT test that can be trivially modified to test limits as well. /* * Copyright (c) 2005, Zachary Amsden (zach@vmware.com) * This is licensed under the GPL. */ #include #include #include #include #include #include #include #define __KERNEL__ #include void main(void) { struct user_desc desc; char *code; unsigned long long tsc; code = (char *)mmap(0, 8192, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); desc.entry_number = 0; desc.base_addr = code; desc.limit = 1; desc.seg_32bit = 1; desc.contents = MODIFY_LDT_CONTENTS_CODE; desc.read_exec_only = 0; desc.limit_in_pages = 1; desc.seg_not_present = 0; desc.useable = 1; if (modify_ldt(1, &desc, sizeof(desc)) != 0) { perror("modify_ldt"); } printf("code base is 0x%08x\n", (unsigned)code); code[0x0ffe] = 0x0f; /* rdtsc */ code[0x0fff] = 0x31; code[0x1000] = 0xcb; /* lret */ __asm__ __volatile("lcall $7,$0xffe" : "=A" (tsc)); printf("TSC is 0x%016llx\n", tsc); } Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/desc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index ccb11c03283..6df1a53c190 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h @@ -96,6 +96,13 @@ static inline void set_ldt_desc(unsigned int cpu, void *addr, unsigned int size) (info)->seg_not_present == 1 && \ (info)->useable == 0 ) +static inline void write_ldt_entry(void *ldt, int entry, __u32 entry_a, __u32 entry_b) +{ + __u32 *lp = (__u32 *)((char *)ldt + entry*8); + *lp = entry_a; + *(lp+1) = entry_b; +} + #if TLS_SIZE != 24 # error update this code. #endif -- cgit v1.2.3 From 748f2edb52712aa3d926470a888608dc500d17e8 Mon Sep 17 00:00:00 2001 From: George Anzinger Date: Sat, 3 Sep 2005 15:56:48 -0700 Subject: [PATCH] x86 NMI: better support for debuggers This patch adds a notify to the die_nmi notify that the system is about to be taken down. If the notify is handled with a NOTIFY_STOP return, the system is given a new lease on life. We also change the nmi watchdog to carry on if die_nmi returns. This give debug code a chance to a) catch watchdog timeouts and b) possibly allow the system to continue, realizing that the time out may be due to debugger activities such as single stepping which is usually done with "other" cpus held. Signed-off-by: George Anzinger Cc: Keith Owens Signed-off-by: George Anzinger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/kdebug.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h index b3f8d5f59d5..316138e8991 100644 --- a/include/asm-i386/kdebug.h +++ b/include/asm-i386/kdebug.h @@ -41,9 +41,16 @@ enum die_val { DIE_PAGE_FAULT, }; -static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) +static inline int notify_die(enum die_val val, const char *str, + struct pt_regs *regs, long err, int trap, int sig) { - struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; + struct die_args args = { + .regs = regs, + .str = str, + .err = err, + .trapnr = trap, + .signr = sig + }; return notifier_call_chain(&i386die_chain, val, &args); } -- cgit v1.2.3 From d7271b14b2e9e5905aba0fbf5c4dc4f8980c0cb2 Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 3 Sep 2005 15:56:50 -0700 Subject: [PATCH] i386: encapsulate copying of pgd entries Add a clone operation for pgd updates. This helps complete the encapsulation of updates to page tables (or pages about to become page tables) into accessor functions rather than using memcpy() to duplicate them. This is both generally good for consistency and also necessary for running in a hypervisor which requires explicit updates to page table entries. The new function is: clone_pgd_range(pgd_t *dst, pgd_t *src, int count); dst - pointer to pgd range anwhere on a pgd page src - "" count - the number of pgds to copy. dst and src can be on the same page, but the range must not overlap and must not cross a page boundary. Note that I ommitted using this call to copy pgd entries into the software suspend page root, since this is not technically a live paging structure, rather it is used on resume from suspend. CC'ing Pavel in case he has any feedback on this. Thanks to Chris Wright for noticing that this could be more optimal in PAE compiles by eliminating the memset. Signed-off-by: Zachary Amsden Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/pgtable.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index d74185aee15..47bc1ffa3d4 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h @@ -277,6 +277,21 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, clear_bit(_PAGE_BIT_RW, &ptep->pte_low); } +/* + * clone_pgd_range(pgd_t *dst, pgd_t *src, int count); + * + * dst - pointer to pgd range anwhere on a pgd page + * src - "" + * count - the number of pgds to copy. + * + * dst and src can be on the same page, but the range must not overlap, + * and must not cross a page boundary. + */ +static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count) +{ + memcpy(dst, src, count * sizeof(pgd_t)); +} + /* * Macro to mark a page protection value as "uncacheable". On processors which do not support * it, this is a no-op. -- cgit v1.2.3 From 4ad8d38342430f8b52f7a8458dce90caf8c8ca64 Mon Sep 17 00:00:00 2001 From: Zwane Mwaikambo Date: Sat, 3 Sep 2005 15:56:51 -0700 Subject: [PATCH] i386 boottime for_each_cpu broken for_each_cpu walks through all processors in cpu_possible_map, which is defined as cpu_callout_map on i386 and isn't initialised until all processors have been booted. This breaks things which do for_each_cpu iterations early during boot. So, define cpu_possible_map as a bitmap with NR_CPUS bits populated. This was triggered by a patch i'm working on which does alloc_percpu before bringing up secondary processors. From: Alexander Nyberg i386-boottime-for_each_cpu-broken.patch i386-boottime-for_each_cpu-broken-fix.patch The SMP version of __alloc_percpu checks the cpu_possible_map before allocating memory for a certain cpu. With the above patches the BSP cpuid is never set in cpu_possible_map which breaks CONFIG_SMP on uniprocessor machines (as soon as someone tries to dereference something allocated via __alloc_percpu, which in fact is never allocated since the cpu is not set in cpu_possible_map). Signed-off-by: Zwane Mwaikambo Signed-off-by: Alexander Nyberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/smp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index a283738b80b..13250199976 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h @@ -59,7 +59,7 @@ extern void cpu_uninit(void); extern cpumask_t cpu_callout_map; extern cpumask_t cpu_callin_map; -#define cpu_possible_map cpu_callout_map +extern cpumask_t cpu_possible_map; /* We don't mark CPUs online until __cpu_up(), so we need another measure */ static inline int num_booting_cpus(void) -- cgit v1.2.3 From ca078bae813dd46c0f9b102fdfb4a3384641ff48 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Sat, 3 Sep 2005 15:56:57 -0700 Subject: [PATCH] swsusp: switch pm_message_t to struct This adds type-checking to pm_message_t, so that people can't confuse it with int or u32. It also allows us to fix "disk yoyo" during suspend (disk spinning down/up/down). [We've tried that before; since that cpufreq problems were fixed and I've tried make allyes config and fixed resulting damage.] Signed-off-by: Pavel Machek Signed-off-by: Alexander Nyberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pm.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/pm.h b/include/linux/pm.h index 7aeb208ed71..5cfb07648ec 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t state); struct device; -typedef u32 __bitwise pm_message_t; +typedef struct pm_message { + int event; +} pm_message_t; /* * There are 4 important states driver can be in: @@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t; * or something similar soon. */ -#define PMSG_FREEZE ((__force pm_message_t) 3) -#define PMSG_SUSPEND ((__force pm_message_t) 3) -#define PMSG_ON ((__force pm_message_t) 0) +#define PM_EVENT_ON 0 +#define PM_EVENT_FREEZE 1 +#define PM_EVENT_SUSPEND 2 + +#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) +#define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) +#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) struct dev_pm_info { pm_message_t power_state; -- cgit v1.2.3 From c3c433e4f33afe255389ba3b1a003dc8deb3de9a Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Sat, 3 Sep 2005 15:57:07 -0700 Subject: [PATCH] add suspend/resume for timer The timers lack .suspend/.resume methods. Because of this, jiffies got a big compensation after a S3 resume. And then softlockup watchdog reports an oops. This occured with HPET enabled, but it's also possible for other timers. Signed-off-by: Shaohua Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/timer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h index dcf1e07db08..aed16437479 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-i386/timer.h @@ -1,6 +1,7 @@ #ifndef _ASMi386_TIMER_H #define _ASMi386_TIMER_H #include +#include /** * struct timer_ops - used to define a timer source @@ -23,6 +24,8 @@ struct timer_opts { unsigned long long (*monotonic_clock)(void); void (*delay)(unsigned long); unsigned long (*read_timer)(void); + int (*suspend)(pm_message_t state); + int (*resume)(void); }; struct init_timer_opts { -- cgit v1.2.3 From 2855b97020f6d4a4dfb005fb77c0b79c8cb9d13f Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 3 Sep 2005 15:57:09 -0700 Subject: [PATCH] m68k: move cache functions into separate file Move a few cache functions into its own file and fix flush_icache_range() so it can handle both kernel and user addresses correctly (assuming context is set correctly). Turn copy_to_user_page/copy_from_user_page into inline functions and add a missing cache flush. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-m68k/cacheflush.h | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/asm-m68k/cacheflush.h b/include/asm-m68k/cacheflush.h index e4773946f10..8aba971b136 100644 --- a/include/asm-m68k/cacheflush.h +++ b/include/asm-m68k/cacheflush.h @@ -130,20 +130,25 @@ static inline void __flush_page_to_ram(void *vaddr) #define flush_dcache_mmap_lock(mapping) do { } while (0) #define flush_dcache_mmap_unlock(mapping) do { } while (0) #define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page)) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) - -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ - } while (0) - -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - do { \ - flush_cache_page(vma, vaddr, page_to_pfn(page));\ - memcpy(dst, src, len); \ - } while (0) +extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, + unsigned long addr, int len); extern void flush_icache_range(unsigned long address, unsigned long endaddr); +static inline void copy_to_user_page(struct vm_area_struct *vma, + struct page *page, unsigned long vaddr, + void *dst, void *src, int len) +{ + flush_cache_page(vma, vaddr, page_to_pfn(page)); + memcpy(dst, src, len); + flush_icache_user_range(vma, page, vaddr, len); +} +static inline void copy_from_user_page(struct vm_area_struct *vma, + struct page *page, unsigned long vaddr, + void *dst, void *src, int len) +{ + flush_cache_page(vma, vaddr, page_to_pfn(page)); + memcpy(dst, src, len); +} + #endif /* _M68K_CACHEFLUSH_H */ -- cgit v1.2.3 From 072dffda1d35c391fe893ec9b1d098145e668fef Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Sat, 3 Sep 2005 15:57:10 -0700 Subject: [PATCH] m68k: cleanup inline mem functions Use the builtin functions for memset/memclr/memcpy, special optimizations for page operations have dedicated functions now. Uninline memmove/memchr and move all functions into a single file and clean it up a little. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-m68k/string.h | 403 +--------------------------------------------- 1 file changed, 7 insertions(+), 396 deletions(-) (limited to 'include') diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h index 44def078132..6c59215b285 100644 --- a/include/asm-m68k/string.h +++ b/include/asm-m68k/string.h @@ -80,43 +80,6 @@ static inline char * strchr(const char * s, int c) return( (char *) s); } -#if 0 -#define __HAVE_ARCH_STRPBRK -static inline char *strpbrk(const char *cs,const char *ct) -{ - const char *sc1,*sc2; - - for( sc1 = cs; *sc1 != '\0'; ++sc1) - for( sc2 = ct; *sc2 != '\0'; ++sc2) - if (*sc1 == *sc2) - return((char *) sc1); - return( NULL ); -} -#endif - -#if 0 -#define __HAVE_ARCH_STRSPN -static inline size_t strspn(const char *s, const char *accept) -{ - const char *p; - const char *a; - size_t count = 0; - - for (p = s; *p != '\0'; ++p) - { - for (a = accept; *a != '\0'; ++a) - if (*p == *a) - break; - if (*a == '\0') - return count; - else - ++count; - } - - return count; -} -#endif - /* strstr !! */ #define __HAVE_ARCH_STRLEN @@ -173,370 +136,18 @@ static inline int strncmp(const char * cs,const char * ct,size_t count) } #define __HAVE_ARCH_MEMSET -/* - * This is really ugly, but its highly optimizatiable by the - * compiler and is meant as compensation for gcc's missing - * __builtin_memset(). For the 680[23]0 it might be worth considering - * the optimal number of misaligned writes compared to the number of - * tests'n'branches needed to align the destination address. The - * 680[46]0 doesn't really care due to their copy-back caches. - * 10/09/96 - Jes Sorensen - */ -static inline void * __memset_g(void * s, int c, size_t count) -{ - void *xs = s; - size_t temp; - - if (!count) - return xs; - - c &= 0xff; - c |= c << 8; - c |= c << 16; - - if (count < 36){ - long *ls = s; - - switch(count){ - case 32: case 33: case 34: case 35: - *ls++ = c; - case 28: case 29: case 30: case 31: - *ls++ = c; - case 24: case 25: case 26: case 27: - *ls++ = c; - case 20: case 21: case 22: case 23: - *ls++ = c; - case 16: case 17: case 18: case 19: - *ls++ = c; - case 12: case 13: case 14: case 15: - *ls++ = c; - case 8: case 9: case 10: case 11: - *ls++ = c; - case 4: case 5: case 6: case 7: - *ls++ = c; - break; - default: - break; - } - s = ls; - if (count & 0x02){ - short *ss = s; - *ss++ = c; - s = ss; - } - if (count & 0x01){ - char *cs = s; - *cs++ = c; - s = cs; - } - return xs; - } - - if ((long) s & 1) - { - char *cs = s; - *cs++ = c; - s = cs; - count--; - } - if (count > 2 && (long) s & 2) - { - short *ss = s; - *ss++ = c; - s = ss; - count -= 2; - } - temp = count >> 2; - if (temp) - { - long *ls = s; - temp--; - do - *ls++ = c; - while (temp--); - s = ls; - } - if (count & 2) - { - short *ss = s; - *ss++ = c; - s = ss; - } - if (count & 1) - { - char *cs = s; - *cs = c; - } - return xs; -} - -/* - * __memset_page assumes that data is longword aligned. Most, if not - * all, of these page sized memsets are performed on page aligned - * areas, thus we do not need to check if the destination is longword - * aligned. Of course we suffer a serious performance loss if this is - * not the case but I think the risk of this ever happening is - * extremely small. We spend a lot of time clearing pages in - * get_empty_page() so I think it is worth it anyway. Besides, the - * 680[46]0 do not really care about misaligned writes due to their - * copy-back cache. - * - * The optimized case for the 680[46]0 is implemented using the move16 - * instruction. My tests showed that this implementation is 35-45% - * faster than the original implementation using movel, the only - * caveat is that the destination address must be 16-byte aligned. - * 01/09/96 - Jes Sorensen - */ -static inline void * __memset_page(void * s,int c,size_t count) -{ - unsigned long data, tmp; - void *xs = s; - - c = c & 255; - data = c | (c << 8); - data |= data << 16; - -#ifdef CPU_M68040_OR_M68060_ONLY - - if (((unsigned long) s) & 0x0f) - __memset_g(s, c, count); - else{ - unsigned long *sp = s; - *sp++ = data; - *sp++ = data; - *sp++ = data; - *sp++ = data; - - __asm__ __volatile__("1:\t" - ".chip 68040\n\t" - "move16 %2@+,%0@+\n\t" - ".chip 68k\n\t" - "subqw #8,%2\n\t" - "subqw #8,%2\n\t" - "dbra %1,1b\n\t" - : "=a" (sp), "=d" (tmp) - : "a" (s), "0" (sp), "1" ((count - 16) / 16 - 1) - ); - } - -#else - __asm__ __volatile__("1:\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "movel %2,%0@+\n\t" - "dbra %1,1b\n\t" - : "=a" (s), "=d" (tmp) - : "d" (data), "0" (s), "1" (count / 32 - 1) - ); -#endif - - return xs; -} - -extern void *memset(void *,int,__kernel_size_t); - -#define __memset_const(s,c,count) \ -((count==PAGE_SIZE) ? \ - __memset_page((s),(c),(count)) : \ - __memset_g((s),(c),(count))) - -#define memset(s, c, count) \ -(__builtin_constant_p(count) ? \ - __memset_const((s),(c),(count)) : \ - __memset_g((s),(c),(count))) +extern void *memset(void *, int, __kernel_size_t); +#define memset(d, c, n) __builtin_memset(d, c, n) #define __HAVE_ARCH_MEMCPY -extern void * memcpy(void *, const void *, size_t ); -/* - * __builtin_memcpy() does not handle page-sized memcpys very well, - * thus following the same assumptions as for page-sized memsets, this - * function copies page-sized areas using an unrolled loop, without - * considering alignment. - * - * For the 680[46]0 only kernels we use the move16 instruction instead - * as it writes through the data-cache, invalidating the cache-lines - * touched. In this way we do not use up the entire data-cache (well, - * half of it on the 68060) by copying a page. An unrolled loop of two - * move16 instructions seem to the fastest. The only caveat is that - * both source and destination must be 16-byte aligned, if not we fall - * back to the generic memcpy function. - Jes - */ -static inline void * __memcpy_page(void * to, const void * from, size_t count) -{ - unsigned long tmp; - void *xto = to; - -#ifdef CPU_M68040_OR_M68060_ONLY - - if (((unsigned long) to | (unsigned long) from) & 0x0f) - return memcpy(to, from, count); - - __asm__ __volatile__("1:\t" - ".chip 68040\n\t" - "move16 %1@+,%0@+\n\t" - "move16 %1@+,%0@+\n\t" - ".chip 68k\n\t" - "dbra %2,1b\n\t" - : "=a" (to), "=a" (from), "=d" (tmp) - : "0" (to), "1" (from) , "2" (count / 32 - 1) - ); -#else - __asm__ __volatile__("1:\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "movel %1@+,%0@+\n\t" - "dbra %2,1b\n\t" - : "=a" (to), "=a" (from), "=d" (tmp) - : "0" (to), "1" (from) , "2" (count / 32 - 1) - ); -#endif - return xto; -} - -#define __memcpy_const(to, from, n) \ -((n==PAGE_SIZE) ? \ - __memcpy_page((to),(from),(n)) : \ - __builtin_memcpy((to),(from),(n))) - -#define memcpy(to, from, n) \ -(__builtin_constant_p(n) ? \ - __memcpy_const((to),(from),(n)) : \ - memcpy((to),(from),(n))) +extern void *memcpy(void *, const void *, __kernel_size_t); +#define memcpy(d, s, n) __builtin_memcpy(d, s, n) #define __HAVE_ARCH_MEMMOVE -static inline void * memmove(void * dest,const void * src, size_t n) -{ - void *xdest = dest; - size_t temp; - - if (!n) - return xdest; - - if (dest < src) - { - if ((long) dest & 1) - { - char *cdest = dest; - const char *csrc = src; - *cdest++ = *csrc++; - dest = cdest; - src = csrc; - n--; - } - if (n > 2 && (long) dest & 2) - { - short *sdest = dest; - const short *ssrc = src; - *sdest++ = *ssrc++; - dest = sdest; - src = ssrc; - n -= 2; - } - temp = n >> 2; - if (temp) - { - long *ldest = dest; - const long *lsrc = src; - temp--; - do - *ldest++ = *lsrc++; - while (temp--); - dest = ldest; - src = lsrc; - } - if (n & 2) - { - short *sdest = dest; - const short *ssrc = src; - *sdest++ = *ssrc++; - dest = sdest; - src = ssrc; - } - if (n & 1) - { - char *cdest = dest; - const char *csrc = src; - *cdest = *csrc; - } - } - else - { - dest = (char *) dest + n; - src = (const char *) src + n; - if ((long) dest & 1) - { - char *cdest = dest; - const char *csrc = src; - *--cdest = *--csrc; - dest = cdest; - src = csrc; - n--; - } - if (n > 2 && (long) dest & 2) - { - short *sdest = dest; - const short *ssrc = src; - *--sdest = *--ssrc; - dest = sdest; - src = ssrc; - n -= 2; - } - temp = n >> 2; - if (temp) - { - long *ldest = dest; - const long *lsrc = src; - temp--; - do - *--ldest = *--lsrc; - while (temp--); - dest = ldest; - src = lsrc; - } - if (n & 2) - { - short *sdest = dest; - const short *ssrc = src; - *--sdest = *--ssrc; - dest = sdest; - src = ssrc; - } - if (n & 1) - { - char *cdest = dest; - const char *csrc = src; - *--cdest = *--csrc; - } - } - return xdest; -} +extern void *memmove(void *, const void *, __kernel_size_t); #define __HAVE_ARCH_MEMCMP -extern int memcmp(const void * ,const void * ,size_t ); -#define memcmp(cs, ct, n) \ -(__builtin_constant_p(n) ? \ - __builtin_memcmp((cs),(ct),(n)) : \ - memcmp((cs),(ct),(n))) - -#define __HAVE_ARCH_MEMCHR -static inline void *memchr(const void *cs, int c, size_t count) -{ - /* Someone else can optimize this, I don't care - tonym@mac.linux-m68k.org */ - unsigned char *ret = (unsigned char *)cs; - for(;count>0;count--,ret++) - if(*ret == c) return ret; - - return NULL; -} +extern int memcmp(const void *, const void *, __kernel_size_t); +#define memcmp(d, s, n) __builtin_memcmp(d, s, n) #endif /* _M68K_STRING_H_ */ -- cgit v1.2.3 From ed75e8d58010fdc06e2c3a81bfbebae92314c7e3 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Sat, 3 Sep 2005 15:57:18 -0700 Subject: [PATCH] UML Support - Ptrace: adds the host SYSEMU support, for UML and general usage Jeff Dike , Paolo 'Blaisorblade' Giarrusso , Bodo Stroesser Adds a new ptrace(2) mode, called PTRACE_SYSEMU, resembling PTRACE_SYSCALL except that the kernel does not execute the requested syscall; this is useful to improve performance for virtual environments, like UML, which want to run the syscall on their own. In fact, using PTRACE_SYSCALL means stopping child execution twice, on entry and on exit, and each time you also have two context switches; with SYSEMU you avoid the 2nd stop and so save two context switches per syscall. Also, some architectures don't have support in the host for changing the syscall number via ptrace(), which is currently needed to skip syscall execution (UML turns any syscall into getpid() to avoid it being executed on the host). Fixing that is hard, while SYSEMU is easier to implement. * This version of the patch includes some suggestions of Jeff Dike to avoid adding any instructions to the syscall fast path, plus some other little changes, by myself, to make it work even when the syscall is executed with SYSENTER (but I'm unsure about them). It has been widely tested for quite a lot of time. * Various fixed were included to handle the various switches between various states, i.e. when for instance a syscall entry is traced with one of PT_SYSCALL / _SYSEMU / _SINGLESTEP and another one is used on exit. Basically, this is done by remembering which one of them was used even after the call to ptrace_notify(). * We're combining TIF_SYSCALL_EMU with TIF_SYSCALL_TRACE or TIF_SINGLESTEP to make do_syscall_trace() notice that the current syscall was started with SYSEMU on entry, so that no notification ought to be done in the exit path; this is a bit of a hack, so this problem is solved in another way in next patches. * Also, the effects of the patch: "Ptrace - i386: fix Syscall Audit interaction with singlestep" are cancelled; they are restored back in the last patch of this series. Detailed descriptions of the patches doing this kind of processing follow (but I've already summed everything up). * Fix behaviour when changing interception kind #1. In do_syscall_trace(), we check the status of the TIF_SYSCALL_EMU flag only after doing the debugger notification; but the debugger might have changed the status of this flag because he continued execution with PTRACE_SYSCALL, so this is wrong. This patch fixes it by saving the flag status before calling ptrace_notify(). * Fix behaviour when changing interception kind #2: avoid intercepting syscall on return when using SYSCALL again. A guest process switching from using PTRACE_SYSEMU to PTRACE_SYSCALL crashes. The problem is in arch/i386/kernel/entry.S. The current SYSEMU patch inhibits the syscall-handler to be called, but does not prevent do_syscall_trace() to be called after this for syscall completion interception. The appended patch fixes this. It reuses the flag TIF_SYSCALL_EMU to remember "we come from PTRACE_SYSEMU and now are in PTRACE_SYSCALL", since the flag is unused in the depicted situation. * Fix behaviour when changing interception kind #3: avoid intercepting syscall on return when using SINGLESTEP. When testing 2.6.9 and the skas3.v6 patch, with my latest patch and had problems with singlestepping on UML in SKAS with SYSEMU. It looped receiving SIGTRAPs without moving forward. EIP of the traced process was the same for all SIGTRAPs. What's missing is to handle switching from PTRACE_SYSCALL_EMU to PTRACE_SINGLESTEP in a way very similar to what is done for the change from PTRACE_SYSCALL_EMU to PTRACE_SYSCALL_TRACE. I.e., after calling ptrace(PTRACE_SYSEMU), on the return path, the debugger is notified and then wake ups the process; the syscall is executed (or skipped, when do_syscall_trace() returns 0, i.e. when using PTRACE_SYSEMU), and do_syscall_trace() is called again. Since we are on the return path of a SYSEMU'd syscall, if the wake up is performed through ptrace(PTRACE_SYSCALL), we must still avoid notifying the parent of the syscall exit. Now, this behaviour is extended even to resuming with PTRACE_SINGLESTEP. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/thread_info.h | 5 ++++- include/linux/ptrace.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index 95add81237e..e2cb9fa6f56 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -139,6 +139,7 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ #define TIF_IRET 5 /* return with iret */ +#define TIF_SYSCALL_EMU 6 /* syscall emulation active */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SECCOMP 8 /* secure computing */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ @@ -150,13 +151,15 @@ register unsigned long current_stack_pointer asm("esp") __attribute_used__; #define _TIF_NEED_RESCHED (1< Date: Sat, 3 Sep 2005 15:57:20 -0700 Subject: [PATCH] Uml support: add PTRACE_SYSEMU_SINGLESTEP option to i386 This patch implements the new ptrace option PTRACE_SYSEMU_SINGLESTEP, which can be used by UML to singlestep a process: it will receive SINGLESTEP interceptions for normal instructions and syscalls, but syscall execution will be skipped just like with PTRACE_SYSEMU. Signed-off-by: Bodo Stroesser Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ptrace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 7528afb6b2a..2afdafb6212 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -21,6 +21,7 @@ #define PTRACE_SYSCALL 24 #define PTRACE_SYSEMU 31 +#define PTRACE_SYSEMU_SINGLESTEP 32 /* 0x4200-0x4300 are reserved for architecture-independent additions. */ #define PTRACE_SETOPTIONS 0x4200 -- cgit v1.2.3 From 1e40cd383ccc7c9f8b338c56ce28c326e25eb2fe Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Sat, 3 Sep 2005 15:57:25 -0700 Subject: [PATCH] uml: fixes performance regression in activate_mm and thus exec() Normally, activate_mm() is called from exec(), and thus it used to be a no-op because we use a completely new "MM context" on the host (for instance, a new process), and so we didn't need to flush any "TLB entries" (which for us are the set of memory mappings for the host process from the virtual "RAM" file). Kernel threads, instead, are usually handled in a different way. So, when for AIO we call use_mm(), things used to break and so Benjamin implemented activate_mm(). However, that is only needed for AIO, and could slow down exec() inside UML, so be smart: detect being called for AIO (via PF_BORROWED_MM) and do the full flush only in that situation. Comment also the caller so that people won't go breaking UML without noticing. I also rely on the caller's locks for testing current->flags. Signed-off-by: Paolo 'Blaisorblade' Giarrusso CC: Benjamin LaHaise Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/mmu_context.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h index 095bb627b96..2edb4f1f789 100644 --- a/include/asm-um/mmu_context.h +++ b/include/asm-um/mmu_context.h @@ -20,7 +20,15 @@ extern void force_flush_all(void); static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) { - if (old != new) + /* + * This is called by fs/exec.c and fs/aio.c. In the first case, for an + * exec, we don't need to do anything as we're called from userspace + * and thus going to use a new host PID. In the second, we're called + * from a kernel thread, and thus need to go doing the mmap's on the + * host. Since they're very expensive, we want to avoid that as far as + * possible. + */ + if (old != new && (current->flags & PF_BORROWED_MM)) force_flush_all(); } -- cgit v1.2.3 From 08964c565b2fe49e338ffbe4907adcc19647ef16 Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sat, 3 Sep 2005 15:57:41 -0700 Subject: [PATCH] uml: merge duplicated page table code There is a lot of code which is duplicated between the 2 and 3 level implementation, with the only difference that the 3-level implementation is a bit more generalized (instead of accessing directly pte_t.pte, it uses the appropriate access macros). So this code is joined together. As obvious, a "core code nice cleanup" is not a "stability-friendly patch" so usual care applies. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Jeff Dike Cc: Paolo Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/pgtable-2level.h | 27 ------------------------ include/asm-um/pgtable-3level.h | 36 -------------------------------- include/asm-um/pgtable.h | 46 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 63 deletions(-) (limited to 'include') diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h index 9b3abc01d60..ffe017f6b64 100644 --- a/include/asm-um/pgtable-2level.h +++ b/include/asm-um/pgtable-2level.h @@ -35,35 +35,8 @@ static inline int pgd_newpage(pgd_t pgd) { return 0; } static inline void pgd_mkuptodate(pgd_t pgd) { } -#define pte_present(x) (pte_val(x) & (_PAGE_PRESENT | _PAGE_PROTNONE)) - -static inline pte_t pte_mknewprot(pte_t pte) -{ - pte_val(pte) |= _PAGE_NEWPROT; - return(pte); -} - -static inline pte_t pte_mknewpage(pte_t pte) -{ - pte_val(pte) |= _PAGE_NEWPAGE; - return(pte); -} - -static inline void set_pte(pte_t *pteptr, pte_t pteval) -{ - /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so - * fix_range knows to unmap it. _PAGE_NEWPROT is specific to - * mapped pages. - */ - *pteptr = pte_mknewpage(pteval); - if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); -} -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) - #define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval)) -#define pte_page(x) pfn_to_page(pte_pfn(x)) -#define pte_none(x) !(pte_val(x) & ~_PAGE_NEWPAGE) #define pte_pfn(x) phys_to_pfn(pte_val(x)) #define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) #define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index 65e8bfc55fc..32cd6236f24 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h @@ -57,35 +57,6 @@ static inline int pgd_newpage(pgd_t pgd) static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } - -#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) - -static inline pte_t pte_mknewprot(pte_t pte) -{ - pte_set_bits(pte, _PAGE_NEWPROT); - return(pte); -} - -static inline pte_t pte_mknewpage(pte_t pte) -{ - pte_set_bits(pte, _PAGE_NEWPAGE); - return(pte); -} - -static inline void set_pte(pte_t *pteptr, pte_t pteval) -{ - pte_copy(*pteptr, pteval); - - /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so - * fix_range knows to unmap it. _PAGE_NEWPROT is specific to - * mapped pages. - */ - - *pteptr = pte_mknewpage(*pteptr); - if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); -} -#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) - #define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) @@ -113,13 +84,6 @@ static inline void pud_clear (pud_t * pud) { } #define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \ pmd_index(address)) -#define pte_page(x) pfn_to_page(pte_pfn(x)) - -static inline int pte_none(pte_t pte) -{ - return pte_is_zero(pte); -} - static inline unsigned long pte_pfn(pte_t pte) { return phys_to_pfn(pte_val(pte)); diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h index e9336f616f9..b48e0966ecd 100644 --- a/include/asm-um/pgtable.h +++ b/include/asm-um/pgtable.h @@ -153,10 +153,24 @@ extern unsigned long pg0[1024]; #define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) +#define pte_page(x) pfn_to_page(pte_pfn(x)) #define pte_address(x) (__va(pte_val(x) & PAGE_MASK)) #define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT)) #define phys_addr(p) ((p) & ~REGION_MASK) +#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) + +/* + * ================================= + * Flags checking section. + * ================================= + */ + +static inline int pte_none(pte_t pte) +{ + return pte_is_zero(pte); +} + /* * The following only work if pte_present() is true. * Undefined behaviour if not.. @@ -212,6 +226,18 @@ static inline int pte_newprot(pte_t pte) return(pte_present(pte) && (pte_get_bits(pte, _PAGE_NEWPROT))); } +/* + * ================================= + * Flags setting section. + * ================================= + */ + +static inline pte_t pte_mknewprot(pte_t pte) +{ + pte_set_bits(pte, _PAGE_NEWPROT); + return(pte); +} + static inline pte_t pte_rdprotect(pte_t pte) { pte_clear_bits(pte, _PAGE_USER); @@ -280,6 +306,26 @@ static inline pte_t pte_mkuptodate(pte_t pte) return(pte); } +static inline pte_t pte_mknewpage(pte_t pte) +{ + pte_set_bits(pte, _PAGE_NEWPAGE); + return(pte); +} + +static inline void set_pte(pte_t *pteptr, pte_t pteval) +{ + pte_copy(*pteptr, pteval); + + /* If it's a swap entry, it needs to be marked _PAGE_NEWPAGE so + * fix_range knows to unmap it. _PAGE_NEWPROT is specific to + * mapped pages. + */ + + *pteptr = pte_mknewpage(*pteptr); + if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); +} +#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) + extern phys_t page_to_phys(struct page *page); /* -- cgit v1.2.3 From 7ef939054139ef857cebbec07cbd12d7cf7beedd Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sat, 3 Sep 2005 15:57:52 -0700 Subject: [PATCH] uml: fix x86_64 page leak We were leaking pmd pages when 3_LEVEL_PGTABLES was enabled. This fixes that. Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/pgalloc.h | 12 +++++++----- include/asm-um/pgtable-3level.h | 9 +++------ 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h index 8fcb2fc0a89..ea49411236d 100644 --- a/include/asm-um/pgalloc.h +++ b/include/asm-um/pgalloc.h @@ -42,11 +42,13 @@ static inline void pte_free(struct page *pte) #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) #ifdef CONFIG_3_LEVEL_PGTABLES -/* - * In the 3-level case we free the pmds as part of the pgd. - */ -#define pmd_free(x) do { } while (0) -#define __pmd_free_tlb(tlb,x) do { } while (0) + +extern __inline__ void pmd_free(pmd_t *pmd) +{ + free_page((unsigned long)pmd); +} + +#define __pmd_free_tlb(tlb,x) tlb_remove_page((tlb),virt_to_page(x)) #endif #define check_pgt_cache() do { } while (0) diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h index 32cd6236f24..786c2572728 100644 --- a/include/asm-um/pgtable-3level.h +++ b/include/asm-um/pgtable-3level.h @@ -69,14 +69,11 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) return pmd; } -static inline void pmd_free(pmd_t *pmd){ - free_page((unsigned long) pmd); +extern inline void pud_clear (pud_t *pud) +{ + set_pud(pud, __pud(0)); } -#define __pmd_free_tlb(tlb,x) do { } while (0) - -static inline void pud_clear (pud_t * pud) { } - #define pud_page(pud) \ ((struct page *) __va(pud_val(pud) & PAGE_MASK)) -- cgit v1.2.3 From d99cf715a0751b0c819cdd8616c8870c1dd51910 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 3 Sep 2005 15:57:53 -0700 Subject: [PATCH] xtensa: replace 'extern inline' with 'static inline' "extern inline" doesn't make sense. Signed-off-by: Adrian Bunk Signed-off-by: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-xtensa/atomic.h | 12 ++++++------ include/asm-xtensa/checksum.h | 4 ++-- include/asm-xtensa/delay.h | 2 +- include/asm-xtensa/io.h | 14 +++++++------- include/asm-xtensa/mmu_context.h | 18 +++++++++--------- include/asm-xtensa/page.h | 2 +- include/asm-xtensa/pci.h | 4 ++-- include/asm-xtensa/pgtable.h | 6 +++--- include/asm-xtensa/semaphore.h | 10 +++++----- include/asm-xtensa/string.h | 8 ++++---- include/asm-xtensa/system.h | 10 +++++----- include/asm-xtensa/tlbflush.h | 40 ++++++++++++++++++++-------------------- include/asm-xtensa/uaccess.h | 10 +++++----- 13 files changed, 70 insertions(+), 70 deletions(-) (limited to 'include') diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h index d72bcb32ba4..24f86f0e43c 100644 --- a/include/asm-xtensa/atomic.h +++ b/include/asm-xtensa/atomic.h @@ -66,7 +66,7 @@ typedef struct { volatile int counter; } atomic_t; * * Atomically adds @i to @v. */ -extern __inline__ void atomic_add(int i, atomic_t * v) +static inline void atomic_add(int i, atomic_t * v) { unsigned int vval; @@ -90,7 +90,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v) * * Atomically subtracts @i from @v. */ -extern __inline__ void atomic_sub(int i, atomic_t *v) +static inline void atomic_sub(int i, atomic_t *v) { unsigned int vval; @@ -111,7 +111,7 @@ extern __inline__ void atomic_sub(int i, atomic_t *v) * We use atomic_{add|sub}_return to define other functions. */ -extern __inline__ int atomic_add_return(int i, atomic_t * v) +static inline int atomic_add_return(int i, atomic_t * v) { unsigned int vval; @@ -130,7 +130,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v) return vval; } -extern __inline__ int atomic_sub_return(int i, atomic_t * v) +static inline int atomic_sub_return(int i, atomic_t * v) { unsigned int vval; @@ -224,7 +224,7 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v) #define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0) -extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) +static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { unsigned int all_f = -1; unsigned int vval; @@ -243,7 +243,7 @@ extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v) ); } -extern __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v) +static inline void atomic_set_mask(unsigned int mask, atomic_t *v) { unsigned int vval; diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h index 1a00fad1992..81a797ae3ab 100644 --- a/include/asm-xtensa/checksum.h +++ b/include/asm-xtensa/checksum.h @@ -47,14 +47,14 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i * If you use these functions directly please don't forget the * verify_area(). */ -extern __inline__ +static inline unsigned int csum_partial_copy_nocheck ( const char *src, char *dst, int len, int sum) { return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL); } -extern __inline__ +static inline unsigned int csum_partial_copy_from_user ( const char *src, char *dst, int len, int sum, int *err_ptr) { diff --git a/include/asm-xtensa/delay.h b/include/asm-xtensa/delay.h index 0a123d53a63..1bc601ec362 100644 --- a/include/asm-xtensa/delay.h +++ b/include/asm-xtensa/delay.h @@ -18,7 +18,7 @@ extern unsigned long loops_per_jiffy; -extern __inline__ void __delay(unsigned long loops) +static inline void __delay(unsigned long loops) { /* 2 cycles per loop. */ __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b" diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h index 2c471c42ecf..c5c13985bbe 100644 --- a/include/asm-xtensa/io.h +++ b/include/asm-xtensa/io.h @@ -41,12 +41,12 @@ static inline unsigned int _swapl (unsigned int v) * These are trivial on the 1:1 Linux/Xtensa mapping */ -extern inline unsigned long virt_to_phys(volatile void * address) +static inline unsigned long virt_to_phys(volatile void * address) { return PHYSADDR((unsigned long)address); } -extern inline void * phys_to_virt(unsigned long address) +static inline void * phys_to_virt(unsigned long address) { return (void*) CACHED_ADDR(address); } @@ -55,12 +55,12 @@ extern inline void * phys_to_virt(unsigned long address) * IO bus memory addresses are also 1:1 with the physical address */ -extern inline unsigned long virt_to_bus(volatile void * address) +static inline unsigned long virt_to_bus(volatile void * address) { return PHYSADDR((unsigned long)address); } -extern inline void * bus_to_virt (unsigned long address) +static inline void * bus_to_virt (unsigned long address) { return (void *) CACHED_ADDR(address); } @@ -69,17 +69,17 @@ extern inline void * bus_to_virt (unsigned long address) * Change "struct page" to physical address. */ -extern inline void *ioremap(unsigned long offset, unsigned long size) +static inline void *ioremap(unsigned long offset, unsigned long size) { return (void *) CACHED_ADDR_IO(offset); } -extern inline void *ioremap_nocache(unsigned long offset, unsigned long size) +static inline void *ioremap_nocache(unsigned long offset, unsigned long size) { return (void *) BYPASS_ADDR_IO(offset); } -extern inline void iounmap(void *addr) +static inline void iounmap(void *addr) { } diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h index 1b0801548cd..364a7b057bf 100644 --- a/include/asm-xtensa/mmu_context.h +++ b/include/asm-xtensa/mmu_context.h @@ -199,13 +199,13 @@ extern pgd_t *current_pgd; #define ASID_FIRST_VERSION \ ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED) -extern inline void set_rasid_register (unsigned long val) +static inline void set_rasid_register (unsigned long val) { __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t" " isync\n" : : "a" (val)); } -extern inline unsigned long get_rasid_register (void) +static inline unsigned long get_rasid_register (void) { unsigned long tmp; __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp)); @@ -215,7 +215,7 @@ extern inline unsigned long get_rasid_register (void) #if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1)) -extern inline void +static inline void get_new_mmu_context(struct mm_struct *mm, unsigned long asid) { extern void flush_tlb_all(void); @@ -234,7 +234,7 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid) /* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are really the best, but if you insist... */ -extern inline int validate_asid (unsigned long asid) +static inline int validate_asid (unsigned long asid) { switch (asid) { case XCHAL_MMU_ASID_INVALID: @@ -247,7 +247,7 @@ extern inline int validate_asid (unsigned long asid) return 1; /* valid */ } -extern inline void +static inline void get_new_mmu_context(struct mm_struct *mm, unsigned long asid) { extern void flush_tlb_all(void); @@ -274,14 +274,14 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long asid) * instance. */ -extern inline int +static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm) { mm->context = NO_CONTEXT; return 0; } -extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, +static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { unsigned long asid = asid_cache; @@ -301,7 +301,7 @@ extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, * Destroy context related info for an mm_struct that is about * to be put to rest. */ -extern inline void destroy_context(struct mm_struct *mm) +static inline void destroy_context(struct mm_struct *mm) { /* Nothing to do. */ } @@ -310,7 +310,7 @@ extern inline void destroy_context(struct mm_struct *mm) * After we have set current->mm to a new value, this activates * the context for the new mm so we see the new mappings. */ -extern inline void +static inline void activate_mm(struct mm_struct *prev, struct mm_struct *next) { /* Unconditionally get a new ASID. */ diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h index b495e5b5a94..8ded36f255a 100644 --- a/include/asm-xtensa/page.h +++ b/include/asm-xtensa/page.h @@ -55,7 +55,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; * Pure 2^n version of get_order */ -extern __inline__ int get_order(unsigned long size) +static inline int get_order(unsigned long size) { int order; #ifndef XCHAL_HAVE_NSU diff --git a/include/asm-xtensa/pci.h b/include/asm-xtensa/pci.h index 6817742301c..24eb7fc25da 100644 --- a/include/asm-xtensa/pci.h +++ b/include/asm-xtensa/pci.h @@ -22,12 +22,12 @@ extern struct pci_controller* pcibios_alloc_controller(void); -extern inline void pcibios_set_master(struct pci_dev *dev) +static inline void pcibios_set_master(struct pci_dev *dev) { /* No special bus mastering setup handling */ } -extern inline void pcibios_penalize_isa_irq(int irq) +static inline void pcibios_penalize_isa_irq(int irq) { /* We don't do dynamic PCI IRQ allocation */ } diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h index 0bb6416ae26..883ebc2d75d 100644 --- a/include/asm-xtensa/pgtable.h +++ b/include/asm-xtensa/pgtable.h @@ -260,7 +260,7 @@ static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pt #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) -extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) +static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)); } @@ -278,14 +278,14 @@ static inline void update_pte(pte_t *ptep, pte_t pteval) #endif } -extern inline void +static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) { update_pte(ptep, pteval); } -extern inline void +static inline void set_pmd(pmd_t *pmdp, pmd_t pmdval) { *pmdp = pmdval; diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h index c8a7574a9a5..db740b8bc6f 100644 --- a/include/asm-xtensa/semaphore.h +++ b/include/asm-xtensa/semaphore.h @@ -47,7 +47,7 @@ struct semaphore { #define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -extern inline void sema_init (struct semaphore *sem, int val) +static inline void sema_init (struct semaphore *sem, int val) { /* * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val); @@ -79,7 +79,7 @@ asmlinkage void __up(struct semaphore * sem); extern spinlock_t semaphore_wake_lock; -extern __inline__ void down(struct semaphore * sem) +static inline void down(struct semaphore * sem) { #if WAITQUEUE_DEBUG CHECK_MAGIC(sem->__magic); @@ -89,7 +89,7 @@ extern __inline__ void down(struct semaphore * sem) __down(sem); } -extern __inline__ int down_interruptible(struct semaphore * sem) +static inline int down_interruptible(struct semaphore * sem) { int ret = 0; #if WAITQUEUE_DEBUG @@ -101,7 +101,7 @@ extern __inline__ int down_interruptible(struct semaphore * sem) return ret; } -extern __inline__ int down_trylock(struct semaphore * sem) +static inline int down_trylock(struct semaphore * sem) { int ret = 0; #if WAITQUEUE_DEBUG @@ -117,7 +117,7 @@ extern __inline__ int down_trylock(struct semaphore * sem) * Note! This is subtle. We jump to wake people up only if * the semaphore was negative (== somebody was waiting on it). */ -extern __inline__ void up(struct semaphore * sem) +static inline void up(struct semaphore * sem) { #if WAITQUEUE_DEBUG CHECK_MAGIC(sem->__magic); diff --git a/include/asm-xtensa/string.h b/include/asm-xtensa/string.h index 3f81b27d980..5fb8c27cbef 100644 --- a/include/asm-xtensa/string.h +++ b/include/asm-xtensa/string.h @@ -16,7 +16,7 @@ #define _XTENSA_STRING_H #define __HAVE_ARCH_STRCPY -extern __inline__ char *strcpy(char *__dest, const char *__src) +static inline char *strcpy(char *__dest, const char *__src) { register char *__xdest = __dest; unsigned long __dummy; @@ -35,7 +35,7 @@ extern __inline__ char *strcpy(char *__dest, const char *__src) } #define __HAVE_ARCH_STRNCPY -extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) +static inline char *strncpy(char *__dest, const char *__src, size_t __n) { register char *__xdest = __dest; unsigned long __dummy; @@ -60,7 +60,7 @@ extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n) } #define __HAVE_ARCH_STRCMP -extern __inline__ int strcmp(const char *__cs, const char *__ct) +static inline int strcmp(const char *__cs, const char *__ct) { register int __res; unsigned long __dummy; @@ -82,7 +82,7 @@ extern __inline__ int strcmp(const char *__cs, const char *__ct) } #define __HAVE_ARCH_STRNCMP -extern __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n) +static inline int strncmp(const char *__cs, const char *__ct, size_t __n) { register int __res; unsigned long __dummy; diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h index 690fe325e67..f09393232e5 100644 --- a/include/asm-xtensa/system.h +++ b/include/asm-xtensa/system.h @@ -56,7 +56,7 @@ static inline int irqs_disabled(void) #define clear_cpenable() __clear_cpenable() -extern __inline__ void __clear_cpenable(void) +static inline void __clear_cpenable(void) { #if XCHAL_HAVE_CP unsigned long i = 0; @@ -64,7 +64,7 @@ extern __inline__ void __clear_cpenable(void) #endif } -extern __inline__ void enable_coprocessor(int i) +static inline void enable_coprocessor(int i) { #if XCHAL_HAVE_CP int cp; @@ -74,7 +74,7 @@ extern __inline__ void enable_coprocessor(int i) #endif } -extern __inline__ void disable_coprocessor(int i) +static inline void disable_coprocessor(int i) { #if XCHAL_HAVE_CP int cp; @@ -123,7 +123,7 @@ do { \ * cmpxchg */ -extern __inline__ unsigned long +static inline unsigned long __cmpxchg_u32(volatile int *p, int old, int new) { __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" @@ -173,7 +173,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) * where no register reference will cause an overflow. */ -extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val) +static inline unsigned long xchg_u32(volatile int * m, unsigned long val) { unsigned long tmp; __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t" diff --git a/include/asm-xtensa/tlbflush.h b/include/asm-xtensa/tlbflush.h index 23bfe9db45f..43f6ec859af 100644 --- a/include/asm-xtensa/tlbflush.h +++ b/include/asm-xtensa/tlbflush.h @@ -39,7 +39,7 @@ extern void flush_tlb_range(struct vm_area_struct*,unsigned long,unsigned long); * page-table pages. */ -extern inline void flush_tlb_pgtables(struct mm_struct *mm, +static inline void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) { } @@ -51,26 +51,26 @@ extern inline void flush_tlb_pgtables(struct mm_struct *mm, #define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2) #define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2) -extern inline unsigned long itlb_probe(unsigned long addr) +static inline unsigned long itlb_probe(unsigned long addr) { unsigned long tmp; __asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr)); return tmp; } -extern inline unsigned long dtlb_probe(unsigned long addr) +static inline unsigned long dtlb_probe(unsigned long addr) { unsigned long tmp; __asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr)); return tmp; } -extern inline void invalidate_itlb_entry (unsigned long probe) +static inline void invalidate_itlb_entry (unsigned long probe) { __asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe)); } -extern inline void invalidate_dtlb_entry (unsigned long probe) +static inline void invalidate_dtlb_entry (unsigned long probe) { __asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe)); } @@ -80,68 +80,68 @@ extern inline void invalidate_dtlb_entry (unsigned long probe) * caller must follow up with an 'isync', which can be relatively * expensive on some Xtensa implementations. */ -extern inline void invalidate_itlb_entry_no_isync (unsigned entry) +static inline void invalidate_itlb_entry_no_isync (unsigned entry) { /* Caller must follow up with 'isync'. */ __asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) ); } -extern inline void invalidate_dtlb_entry_no_isync (unsigned entry) +static inline void invalidate_dtlb_entry_no_isync (unsigned entry) { /* Caller must follow up with 'isync'. */ __asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) ); } -extern inline void set_itlbcfg_register (unsigned long val) +static inline void set_itlbcfg_register (unsigned long val) { __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t" : : "a" (val)); } -extern inline void set_dtlbcfg_register (unsigned long val) +static inline void set_dtlbcfg_register (unsigned long val) { __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t" : : "a" (val)); } -extern inline void set_ptevaddr_register (unsigned long val) +static inline void set_ptevaddr_register (unsigned long val) { __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n" : : "a" (val)); } -extern inline unsigned long read_ptevaddr_register (void) +static inline unsigned long read_ptevaddr_register (void) { unsigned long tmp; __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp)); return tmp; } -extern inline void write_dtlb_entry (pte_t entry, int way) +static inline void write_dtlb_entry (pte_t entry, int way) { __asm__ __volatile__("wdtlb %1, %0; dsync\n\t" : : "r" (way), "r" (entry) ); } -extern inline void write_itlb_entry (pte_t entry, int way) +static inline void write_itlb_entry (pte_t entry, int way) { __asm__ __volatile__("witlb %1, %0; isync\n\t" : : "r" (way), "r" (entry) ); } -extern inline void invalidate_page_directory (void) +static inline void invalidate_page_directory (void) { invalidate_dtlb_entry (DTLB_WAY_PGTABLE); } -extern inline void invalidate_itlb_mapping (unsigned address) +static inline void invalidate_itlb_mapping (unsigned address) { unsigned long tlb_entry; while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS) invalidate_itlb_entry (tlb_entry); } -extern inline void invalidate_dtlb_mapping (unsigned address) +static inline void invalidate_dtlb_mapping (unsigned address) { unsigned long tlb_entry; while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS) @@ -165,28 +165,28 @@ extern inline void invalidate_dtlb_mapping (unsigned address) * as[07..00] contain the asid */ -extern inline unsigned long read_dtlb_virtual (int way) +static inline unsigned long read_dtlb_virtual (int way) { unsigned long tmp; __asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way)); return tmp; } -extern inline unsigned long read_dtlb_translation (int way) +static inline unsigned long read_dtlb_translation (int way) { unsigned long tmp; __asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way)); return tmp; } -extern inline unsigned long read_itlb_virtual (int way) +static inline unsigned long read_itlb_virtual (int way) { unsigned long tmp; __asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way)); return tmp; } -extern inline unsigned long read_itlb_translation (int way) +static inline unsigned long read_itlb_translation (int way) { unsigned long tmp; __asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way)); diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h index 35576b25c7b..fc268ac923c 100644 --- a/include/asm-xtensa/uaccess.h +++ b/include/asm-xtensa/uaccess.h @@ -211,7 +211,7 @@ #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) -extern inline int verify_area(int type, const void * addr, unsigned long size) +static inline int verify_area(int type, const void * addr, unsigned long size) { return access_ok(type,addr,size) ? 0 : -EFAULT; } @@ -464,7 +464,7 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) * success. */ -extern inline unsigned long +static inline unsigned long __xtensa_clear_user(void *addr, unsigned long size) { if ( ! memset(addr, 0, size) ) @@ -472,7 +472,7 @@ __xtensa_clear_user(void *addr, unsigned long size) return 0; } -extern inline unsigned long +static inline unsigned long clear_user(void *addr, unsigned long size) { if (access_ok(VERIFY_WRITE, addr, size)) @@ -486,7 +486,7 @@ clear_user(void *addr, unsigned long size) extern long __strncpy_user(char *, const char *, long); #define __strncpy_from_user __strncpy_user -extern inline long +static inline long strncpy_from_user(char *dst, const char *src, long count) { if (access_ok(VERIFY_READ, src, 1)) @@ -502,7 +502,7 @@ strncpy_from_user(char *dst, const char *src, long count) */ extern long __strnlen_user(const char *, long); -extern inline long strnlen_user(const char *str, long len) +static inline long strnlen_user(const char *str, long len) { unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1; -- cgit v1.2.3 From 4c139862b8831261d57de02716b92f82e5fb463b Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 3 Sep 2005 15:57:55 -0700 Subject: [PATCH] xtensa: delete accidental file This file seems to be an accident. Signed-off-by: Adrian Bunk Signed-off-by: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-xtensa/page.h.n | 135 -------------------------------------------- 1 file changed, 135 deletions(-) delete mode 100644 include/asm-xtensa/page.h.n (limited to 'include') diff --git a/include/asm-xtensa/page.h.n b/include/asm-xtensa/page.h.n deleted file mode 100644 index 546cc6624f2..00000000000 --- a/include/asm-xtensa/page.h.n +++ /dev/null @@ -1,135 +0,0 @@ -/* - * linux/include/asm-xtensa/page.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version2 as - * published by the Free Software Foundation. - * - * Copyright (C) 2001 - 2005 Tensilica Inc. - */ - -#ifndef _XTENSA_PAGE_H -#define _XTENSA_PAGE_H - -#ifdef __KERNEL__ - -#include -#include - -/* - * PAGE_SHIFT determines the page size - * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary - */ -#define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE -#define PAGE_SIZE (1 << PAGE_SHIFT) -#define PAGE_MASK (~(PAGE_SIZE-1)) -#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK) - -#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS) -#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR - -#ifdef __ASSEMBLY__ - -#define __pgprot(x) (x) - -#else - - -/* - * These are used to make use of C type-checking.. - */ -typedef struct { unsigned long pte; } pte_t; /* page table entry */ -typedef struct { unsigned long pmd; } pmd_t; /* PMD table entry */ -typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */ -typedef struct { unsigned long pgprot; } pgprot_t; - -#define pte_val(x) ((x).pte) -#define pmd_val(x) ((x).pmd) -#define pgd_val(x) ((x).pgd) -#define pgprot_val(x) ((x).pgprot) - -#define __pte(x) ((pte_t) { (x) } ) -#define __pmd(x) ((pmd_t) { (x) } ) -#define __pgd(x) ((pgd_t) { (x) } ) -#define __pgprot(x) ((pgprot_t) { (x) } ) - -/* - * Pure 2^n version of get_order - */ -extern __inline__ int get_order(unsigned long size) -{ - int order; -#ifndef XCHAL_HAVE_NSU - unsigned long x1, x2, x4, x8, x16; - - size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; - x1 = size & 0xAAAAAAAA; - x2 = size & 0xCCCCCCCC; - x4 = size & 0xF0F0F0F0; - x8 = size & 0xFF00FF00; - x16 = size & 0xFFFF0000; - order = x2 ? 2 : 0; - order += (x16 != 0) * 16; - order += (x8 != 0) * 8; - order += (x4 != 0) * 4; - order += (x1 != 0); - - return order; -#else - size = (size - 1) >> PAGE_SHIFT; - asm ("nsau %0, %1" : "=r" (order) : "r" (size)); - return 32 - order; -#endif -} - - -struct page; -extern void clear_page(void *page); -extern void copy_page(void *to, void *from); - -/* - * If we have cache aliasing and writeback caches, we might have to do - * some extra work - */ - -#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK -void clear_user_page(void *addr, unsigned long vaddr, struct page* page); -void copy_user_page(void *to, void* from, unsigned long vaddr, struct page* page); -#else -# define clear_user_page(page,vaddr,pg) clear_page(page) -# define copy_user_page(to, from, vaddr, pg) copy_page(to, from) -#endif - - -/* - * This handles the memory map. We handle pages at - * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space. - * These macros are for conversion of kernel address, not user - * addresses. - */ - -#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) -#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) -#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr) -#ifndef CONFIG_DISCONTIGMEM -# define pfn_to_page(pfn) (mem_map + (pfn)) -# define page_to_pfn(page) ((unsigned long)((page) - mem_map)) -#else -# error CONFIG_DISCONTIGMEM not supported -#endif - -#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) -#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) -#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) - -#define WANT_PAGE_VIRTUAL - - -#endif /* __ASSEMBLY__ */ - -#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ - VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#endif /* __KERNEL__ */ -#endif /* _XTENSA_PAGE_H */ -- cgit v1.2.3 From ae6aa2ea8973e200cb3d0564a64a1b441d233428 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Sat, 3 Sep 2005 15:57:56 -0700 Subject: [PATCH] s390: machine check handler bugs The new machine check handler still has a few bugs. 1) The system entry time has to be stored in the machine check handler, 2) the machine check return psw may not be stored at the usual place because it might overwrite the return psw of the interrupted context, 3) the return address for the call to s390_handle_mcck in the i/o interrupt handler is not correct, 4) the system call cleanup has to take the different save area of the machine check handler into account, 5) the machine check handler may not call UPDATE_VTIME before CREATE_STACK_FRAME, and 6) the io leave path needs a critical section cleanup to make sure that the TIF_MCCK_PENDING bit is really checked before switching back to user space. Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/lowcore.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h index afe6a9f9b0a..c6f51c9ce3f 100644 --- a/include/asm-s390/lowcore.h +++ b/include/asm-s390/lowcore.h @@ -68,6 +68,7 @@ #define __LC_SYSTEM_TIMER 0x270 #define __LC_LAST_UPDATE_CLOCK 0x278 #define __LC_STEAL_CLOCK 0x280 +#define __LC_RETURN_MCCK_PSW 0x288 #define __LC_KERNEL_STACK 0xC40 #define __LC_THREAD_INFO 0xC44 #define __LC_ASYNC_STACK 0xC48 @@ -90,6 +91,7 @@ #define __LC_SYSTEM_TIMER 0x278 #define __LC_LAST_UPDATE_CLOCK 0x280 #define __LC_STEAL_CLOCK 0x288 +#define __LC_RETURN_MCCK_PSW 0x290 #define __LC_KERNEL_STACK 0xD40 #define __LC_THREAD_INFO 0xD48 #define __LC_ASYNC_STACK 0xD50 @@ -196,7 +198,8 @@ struct _lowcore __u64 system_timer; /* 0x270 */ __u64 last_update_clock; /* 0x278 */ __u64 steal_clock; /* 0x280 */ - __u8 pad8[0xc00-0x288]; /* 0x288 */ + psw_t return_mcck_psw; /* 0x288 */ + __u8 pad8[0xc00-0x290]; /* 0x290 */ /* System info area */ __u32 save_area[16]; /* 0xc00 */ @@ -285,7 +288,8 @@ struct _lowcore __u64 system_timer; /* 0x278 */ __u64 last_update_clock; /* 0x280 */ __u64 steal_clock; /* 0x288 */ - __u8 pad8[0xc00-0x290]; /* 0x290 */ + psw_t return_mcck_psw; /* 0x290 */ + __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */ /* System info area */ __u64 save_area[16]; /* 0xc00 */ __u8 pad9[0xd40-0xc80]; /* 0xc80 */ -- cgit v1.2.3 From 942eaabd5d77522223a311ed9bddaaa3cefde27d Mon Sep 17 00:00:00 2001 From: Michael Holzheu Date: Sat, 3 Sep 2005 15:57:58 -0700 Subject: [PATCH] s390: debug feature changes debug feature changes/bug fixes: - Use get_clock() function instead of private inline assembly. - Use 'struct timeval' instead of 'struct timespec' for call to tod_to_timeval(). Now the microsecond part of the timestamp is correct again. - Fix a locking problem: when creating a snapshot of the current content of the debug areas, lock the entire debug_info object. Signed-off-by: Michael Holzheu Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/debug.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index 92360d90144..7127030ae16 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h @@ -52,8 +52,6 @@ struct __debug_entry{ #define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */ /* the entry information */ -#define STCK(x) asm volatile ("STCK 0(%1)" : "=m" (x) : "a" (&(x)) : "cc") - typedef struct __debug_entry debug_entry_t; struct debug_view; -- cgit v1.2.3 From 9513e5e3f5a6b429da8a9fd4330f71f1e547c8e0 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Sat, 3 Sep 2005 15:58:05 -0700 Subject: [PATCH] s390: spinlock corner case On s390 the lock value used for spinlocks consists of the lower 32 bits of the PSW that holds the lock. If this address happens to be on a four gigabyte boundary the lock is left unlocked. This allows other cpus to grab the same lock and enter a lock protected code path concurrently. In theory this can happen if the vmalloc area for the code of a module crosses a 4 GB boundary. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/spinlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h index 8ff10300f7e..321b23bba1e 100644 --- a/include/asm-s390/spinlock.h +++ b/include/asm-s390/spinlock.h @@ -47,7 +47,7 @@ extern int _raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc); static inline void _raw_spin_lock(spinlock_t *lp) { - unsigned long pc = (unsigned long) __builtin_return_address(0); + unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) _raw_spin_lock_wait(lp, pc); @@ -55,7 +55,7 @@ static inline void _raw_spin_lock(spinlock_t *lp) static inline int _raw_spin_trylock(spinlock_t *lp) { - unsigned long pc = (unsigned long) __builtin_return_address(0); + unsigned long pc = 1 | (unsigned long) __builtin_return_address(0); if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) return 1; -- cgit v1.2.3 From 9d88347758c58ee5b4ac9cd594b96eaafa5e08bb Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 5 Sep 2005 10:21:04 +0100 Subject: [ARM] Remove unused DYN_TICK_* macros Neither DYN_TICK_SKIPPING nor DYN_TICK_SUITABLE are used on ARM. Remove them. Signed-off-by: Russell King --- include/asm-arm/mach/time.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h index 2cf279a4401..96c6db7dd0e 100644 --- a/include/asm-arm/mach/time.h +++ b/include/asm-arm/mach/time.h @@ -47,9 +47,7 @@ struct sys_timer { #ifdef CONFIG_NO_IDLE_HZ -#define DYN_TICK_SKIPPING (1 << 2) #define DYN_TICK_ENABLED (1 << 1) -#define DYN_TICK_SUITABLE (1 << 0) struct dyn_tick_timer { unsigned int state; /* Current state */ -- cgit v1.2.3 From a61fc683ae1b7871d8d81ac5025af1a923731547 Mon Sep 17 00:00:00 2001 From: "bgardner@wabtec.com" Date: Wed, 27 Jul 2005 12:43:03 -0500 Subject: [PATCH] I2C: add kobj_to_i2c_client Move the inline function kobj_to_i2c_client() from max6875.c to i2c.h. Signed-off-by: Ben Gardner Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index be837b13f29..01744594381 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -160,6 +160,11 @@ struct i2c_client { }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) +static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) +{ + return to_i2c_client(container_of(kobj, struct device, kobj)); +} + static inline void *i2c_get_clientdata (struct i2c_client *dev) { return dev_get_drvdata (&dev->dev); -- cgit v1.2.3 From 1236441f38b6a98caf4c7983e7efdecc2d1527b5 Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Fri, 15 Jul 2005 21:38:08 -0400 Subject: [PATCH] I2C hwmon: hwmon sysfs class This patch adds the sysfs class "hwmon" for use by hardware monitoring (sensors) chip drivers. It also fixes up the related Kconfig/Makefile bits. Signed-off-by: Mark M. Hoffman Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/linux/hwmon.h (limited to 'include') diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h new file mode 100644 index 00000000000..bf90e6001e3 --- /dev/null +++ b/include/linux/hwmon.h @@ -0,0 +1,24 @@ +/* + hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring + + This file declares helper functions for the sysfs class "hwmon", + for use by sensors drivers. + + Copyright (C) 2005 Mark M. Hoffman + + 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; version 2 of the License. +*/ + +#ifndef _HWMON_H_ +#define _HWMON_H_ + +#include + +struct class_device *hwmon_device_register(struct device *dev); + +void hwmon_device_unregister(struct class_device *cdev); + +#endif + -- cgit v1.2.3 From efde723fdac02111872bff606ef362074fc1efa8 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 20 Jul 2005 23:03:50 +0200 Subject: [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9) Temporarily export a few structures and functions from i2c-core, because we will soon need them in i2c-isa. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 01744594381..3be06105034 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -34,6 +34,13 @@ #include /* for struct device */ #include +/* --- For i2c-isa ---------------------------------------------------- */ + +extern void i2c_adapter_dev_release(struct device *dev); +extern struct device_driver i2c_adapter_driver; +extern struct class i2c_adapter_class; +extern struct bus_type i2c_bus_type; + /* --- General options ------------------------------------------------ */ struct i2c_msg; -- cgit v1.2.3 From 400c455eaa0d0819d18cd42a74070e0e238a73dc Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 19 Jul 2005 23:48:43 +0200 Subject: [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (2/9) Convert i2c-isa from a dumb i2c_adapter into a pseudo i2c-core for ISA hardware monitoring drivers. The isa i2c_adapter is no more registered with i2c-core, drivers have to explicitely connect to it using the new i2c_isa_{add,del}_driver interface. At this point, all ISA chip drivers are useless, because they still register with i2c-core in the hope i2c-isa is registered there as well, but it isn't anymore. The fake bus will be named i2c-9191 in sysfs. This is the number it already had internally in various places, so it's not exactly new, except that now the number is seen in userspace as well. This shouldn't be a problem until someone really has 9192 I2C busses in a given system ;) The fake bus will no more show in "i2cdetect -l", as it won't be seen by i2c-dev anymore (not being registered with i2c-core), which is a good thing, as i2cdetect/i2cdump/i2cset cannot operate on this fake bus anyway. Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-isa.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/linux/i2c-isa.h (limited to 'include') diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h new file mode 100644 index 00000000000..b5727d7702e --- /dev/null +++ b/include/linux/i2c-isa.h @@ -0,0 +1,29 @@ +/* + * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface + * + * Copyright (C) 2005 Jean Delvare + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _LINUX_I2C_ISA_H +#define _LINUX_I2C_ISA_H + +#include + +extern int i2c_isa_add_driver(struct i2c_driver *driver); +extern int i2c_isa_del_driver(struct i2c_driver *driver); + +#endif /* _LINUX_I2C_ISA_H */ -- cgit v1.2.3 From 5071860aba7fc69279ab822638ed2c2e4549f9fd Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 20 Jul 2005 00:02:32 +0200 Subject: [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9) Kill normal_isa in header files, documentation and all chip drivers, as it is no more used. normal_i2c could be renamed to normal, but I decided not to do so at the moment, so as to limit the number of changes. This might be done later as part of the i2c_probe/i2c_detect merge. Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-sensor.h | 36 +++++++++++++++--------------------- include/linux/i2c.h | 8 ++------ 2 files changed, 17 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h index 21b62520495..ae73b9e789c 100644 --- a/include/linux/i2c-sensor.h +++ b/include/linux/i2c-sensor.h @@ -27,11 +27,10 @@ that place. If a specific chip is given, the module blindly assumes this chip type is present; if a general force (kind == 0) is given, the module will still try to figure out what type of chip is present. This is useful - if for some reasons the detect for SMBus or ISA address space filled - fails. - probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for - the ISA bus, -1 for any I2C bus), the second is the address. + if for some reasons the detect for SMBus address space filled fails. + probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any + I2C bus), the second is the address. kind: The kind of chip. 0 equals any chip. */ struct i2c_force_data { @@ -40,25 +39,22 @@ struct i2c_force_data { }; /* A structure containing the detect information. - normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END. + normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. A list of I2C addresses which should normally be examined. - normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. - A list of ISA addresses which should normally be examined. - probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for - the ISA bus, -1 for any I2C bus), the second is the address. These - addresses are also probed, as if they were in the 'normal' list. - ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. - A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for - the ISA bus, -1 for any I2C bus), the second is the I2C address. These - addresses are never probed. This parameter overrules 'normal' and - 'probe', but not the 'force' lists. + probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any + I2C bus), the second is the address. These addresses are also probed, + as if they were in the 'normal' list. + ignore: insmod parameter. Initialize this list with I2C_CLIENT_END values. + A list of pairs. The first value is a bus number (ANY_I2C_BUS for any + I2C bus), the second is the I2C address. These addresses are never + probed. This parameter overrules 'normal' and probe', but not the + 'force' lists. force_data: insmod parameters. A list, ending with an element of which the force field is NULL. */ struct i2c_address_data { unsigned short *normal_i2c; - unsigned int *normal_isa; unsigned short *probe; unsigned short *ignore; struct i2c_force_data *forces; @@ -78,7 +74,6 @@ struct i2c_address_data { "List of adapter,address pairs not to scan"); \ static struct i2c_address_data addr_data = { \ .normal_i2c = normal_i2c, \ - .normal_isa = normal_isa, \ .probe = probe, \ .ignore = ignore, \ .forces = forces, \ @@ -242,8 +237,7 @@ struct i2c_address_data { /* Detect function. It iterates over all possible addresses itself. For SMBus addresses, it will only call found_proc if some client is connected - to the SMBus (unless a 'force' matched); for ISA detections, this is not - done. */ + to the SMBus (unless a 'force' matched). */ extern int i2c_detect(struct i2c_adapter *adapter, struct i2c_address_data *address_data, int (*found_proc) (struct i2c_adapter *, int, int)); diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3be06105034..39ff363eade 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -150,12 +150,9 @@ struct i2c_driver { */ struct i2c_client { unsigned int flags; /* div., see below */ - unsigned int addr; /* chip address - NOTE: 7bit */ + unsigned short addr; /* chip address - NOTE: 7bit */ /* addresses are stored in the */ - /* _LOWER_ 7 bits of this char */ - /* addr: unsigned int to make lm_sensors i2c-isa adapter work - more cleanly. It does not take any more memory space, due to - alignment considerations */ + /* _LOWER_ 7 bits */ struct i2c_adapter *adapter; /* the adapter we sit on */ struct i2c_driver *driver; /* and our access routines */ int usage_count; /* How many accesses currently */ @@ -309,7 +306,6 @@ struct i2c_client_address_data { /* Internal numbers to terminate lists */ #define I2C_CLIENT_END 0xfffeU -#define I2C_CLIENT_ISA_END 0xfffefffeU /* The numbers to use to set I2C bus address */ #define ANY_I2C_BUS 0xffff -- cgit v1.2.3 From 570aefc361d3315ec6749f573009286106b0b2d8 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 20 Jul 2005 00:09:03 +0200 Subject: [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (9/9) Move the definitions of i2c_is_isa_client and i2c_is_isa_adapter from i2c.h to i2c-isa.h. Only hybrid drivers still need them. Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-isa.h | 7 +++++++ include/linux/i2c.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h index b5727d7702e..db793b68356 100644 --- a/include/linux/i2c-isa.h +++ b/include/linux/i2c-isa.h @@ -26,4 +26,11 @@ extern int i2c_isa_add_driver(struct i2c_driver *driver); extern int i2c_isa_del_driver(struct i2c_driver *driver); +/* Detect whether we are on the isa bus. This is only useful to hybrid + (i2c+isa) drivers. */ +#define i2c_is_isa_client(clientptr) \ + ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) +#define i2c_is_isa_adapter(adapptr) \ + ((adapptr)->algo->id == I2C_ALGO_ISA) + #endif /* _LINUX_I2C_ISA_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 39ff363eade..da4faa016b1 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -580,11 +580,4 @@ union i2c_smbus_data { .force = force, \ } -/* Detect whether we are on the isa bus. If this returns true, all i2c - access will fail! */ -#define i2c_is_isa_client(clientptr) \ - ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) -#define i2c_is_isa_adapter(adapptr) \ - ((adapptr)->algo->id == I2C_ALGO_ISA) - #endif /* _LINUX_I2C_H */ -- cgit v1.2.3 From 5563e27d3a42667734e81c1cb8ad72bff76321f6 Mon Sep 17 00:00:00 2001 From: "R.Marek@sh.cvut.cz" Date: Wed, 27 Jul 2005 11:43:47 +0000 Subject: [PATCH] I2C: W83792D driver 1/3 I would like to announce support for W83792D chip. This driver was developed by Winbond Electronics Corp. I added sysfs attributes callbacks infrastructure plus various code fixes and codingstyle cleanups. I would like to thank Winbond for supporting free software. This patch is against 2.6.13rc3 plus hwmon-class and hwmon-split. Separate patch for documantation and hwmon class register will follow. Signed-off-by: Rudolf Marek Signed-off-by: Chunhao Huang Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon-sysfs.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 1b5018a965f..7eb4004b360 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h @@ -33,4 +33,19 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \ .index = _index, \ } +struct sensor_device_attribute_2 { + struct device_attribute dev_attr; + u8 index; + u8 nr; +}; +#define to_sensor_dev_attr_2(_dev_attr) \ + container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) + +#define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ +struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ + .dev_attr = __ATTR(_name,_mode,_show,_store), \ + .index = _index, \ + .nr = _nr, \ +} + #endif /* _LINUX_HWMON_SYSFS_H */ -- cgit v1.2.3 From cdcb19219714c796ddef1202e952566c5f86354d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 28 Jul 2005 23:09:40 +0200 Subject: [PATCH] I2C: inline i2c_adapter_id We could inline i2c_adapter_id, as it is really, really short. Doing so saves a few bytes both in i2c-core and in the drivers using this function. before after diff drivers/hwmon/adm1026.ko 41344 41305 -39 drivers/hwmon/asb100.ko 27325 27246 -79 drivers/hwmon/gl518sm.ko 20824 20785 -39 drivers/hwmon/it87.ko 26419 26380 -39 drivers/hwmon/lm78.ko 21424 21385 -39 drivers/hwmon/lm85.ko 41034 40939 -95 drivers/hwmon/w83781d.ko 39561 39514 -47 drivers/hwmon/w83792d.ko 32979 32932 -47 drivers/i2c/i2c-core.ko 24708 24531 -177 Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index da4faa016b1..ad1c0fb164b 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -364,10 +364,6 @@ extern int i2c_probe(struct i2c_adapter *adapter, */ extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); -/* This call returns a unique low identifier for each registered adapter, - * or -1 if the adapter was not registered. - */ -extern int i2c_adapter_id(struct i2c_adapter *adap); extern struct i2c_adapter* i2c_get_adapter(int id); extern void i2c_put_adapter(struct i2c_adapter *adap); @@ -384,6 +380,12 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func) return (func & i2c_get_functionality(adap)) == func; } +/* Return id number for a specific adapter */ +static inline int i2c_adapter_id(struct i2c_adapter *adap) +{ + return adap->nr; +} + /* * I2C Message - used for pure i2c transaction, also from /dev interface */ -- cgit v1.2.3 From 53ae11b08353268c4012ef107bf205a0724d71aa Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 28 Jul 2005 23:14:59 +0200 Subject: [PATCH] hwmon: move SENSORS_LIMIT to hwmon.h Move SENSORS_LIMIT from i2c-sensor.h to hwmon.h, as it is in no way related to i2c. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon.h | 11 +++++++++++ include/linux/i2c-sensor.h | 12 ------------ 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index bf90e6001e3..0efd994c37f 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h @@ -20,5 +20,16 @@ struct class_device *hwmon_device_register(struct device *dev); void hwmon_device_unregister(struct class_device *cdev); +/* Scale user input to sensible values */ +static inline int SENSORS_LIMIT(long value, long low, long high) +{ + if (value < low) + return low; + else if (value > high) + return high; + else + return value; +} + #endif diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h index ae73b9e789c..e832d3286a4 100644 --- a/include/linux/i2c-sensor.h +++ b/include/linux/i2c-sensor.h @@ -242,16 +242,4 @@ extern int i2c_detect(struct i2c_adapter *adapter, struct i2c_address_data *address_data, int (*found_proc) (struct i2c_adapter *, int, int)); - -/* This macro is used to scale user-input to sensible values in almost all - chip drivers. */ -static inline int SENSORS_LIMIT(long value, long low, long high) -{ - if (value < low) - return low; - else if (value > high) - return high; - else - return value; -} #endif /* def _LINUX_I2C_SENSOR_H */ -- cgit v1.2.3 From 9fc6adfa9adf2be84119a3c2592287f33bd1dff2 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:20:43 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (01/11) Add support for kind-forced addresses to i2c_probe, like i2c_detect has for (essentially) hardware monitoring drivers. Note that this change will slightly increase the size of the drivers using I2C_CLIENT_INSMOD, with no immediate benefit. This is a requirement if we want to merge i2c_probe and i2c_detect though, and seems a reasonable price to pay in comparison with the previous cleanups which saved much more than that (such as the i2c-isa cleanup or the i2c address ranges removal.) Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index ad1c0fb164b..9419bc5584a 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -48,7 +48,6 @@ struct i2c_algorithm; struct i2c_adapter; struct i2c_client; struct i2c_driver; -struct i2c_client_address_data; union i2c_smbus_data; /* @@ -301,7 +300,7 @@ struct i2c_client_address_data { unsigned short *normal_i2c; unsigned short *probe; unsigned short *ignore; - unsigned short *force; + unsigned short **forces; }; /* Internal numbers to terminate lists */ @@ -575,11 +574,15 @@ union i2c_smbus_data { I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ + static unsigned short *addr_forces[] = { \ + force, \ + NULL \ + }; \ static struct i2c_client_address_data addr_data = { \ .normal_i2c = normal_i2c, \ .probe = probe, \ .ignore = ignore, \ - .force = force, \ + .forces = addr_forces, \ } #endif /* _LINUX_I2C_H */ -- cgit v1.2.3 From ef8dec5d8b3e96e359f377f35cd8caff42fe6d58 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:33:23 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (02/11) The way i2c-sensor handles forced addresses could be optimized. It defines a structure (i2c_force_data) to associate a module parameter with a given kind value, but in fact this kind value is always the index of the structure in each array it is used in. So this additional value can be omitted, and still be deduced in the code handling these arrays. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-sensor.h | 133 +++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 72 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h index e832d3286a4..4facaa0b905 100644 --- a/include/linux/i2c-sensor.h +++ b/include/linux/i2c-sensor.h @@ -22,22 +22,6 @@ #ifndef _LINUX_I2C_SENSOR_H #define _LINUX_I2C_SENSOR_H -/* A structure containing detect information. - Force variables overrule all other variables; they force a detection on - that place. If a specific chip is given, the module blindly assumes this - chip type is present; if a general force (kind == 0) is given, the module - will still try to figure out what type of chip is present. This is useful - if for some reasons the detect for SMBus address space filled fails. - probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. - A list of pairs. The first value is a bus number (ANY_I2C_BUS for any - I2C bus), the second is the address. - kind: The kind of chip. 0 equals any chip. -*/ -struct i2c_force_data { - unsigned short *force; - unsigned short kind; -}; - /* A structure containing the detect information. normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. A list of I2C addresses which should normally be examined. @@ -50,14 +34,18 @@ struct i2c_force_data { I2C bus), the second is the I2C address. These addresses are never probed. This parameter overrules 'normal' and probe', but not the 'force' lists. - force_data: insmod parameters. A list, ending with an element of which - the force field is NULL. + forces: insmod parameters. A list, ending with a NULL element. + Force variables overrule all other variables; they force a detection on + that place. If a specific chip is given, the module blindly assumes this + chip type is present; if a general force (kind == 0) is given, the module + will still try to figure out what type of chip is present. This is useful + if for some reasons the detect for SMBus address space filled fails. */ struct i2c_address_data { unsigned short *normal_i2c; unsigned short *probe; unsigned short *ignore; - struct i2c_force_data *forces; + unsigned short **forces; }; #define SENSORS_MODULE_PARM_FORCE(name) \ @@ -88,7 +76,8 @@ struct i2c_address_data { I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ - static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \ + static unsigned short *forces[] = { force, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_1(chip1) \ @@ -97,9 +86,9 @@ struct i2c_address_data { "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ - static struct i2c_force_data forces[] = {{force,any_chip},\ - {force_ ## chip1,chip1}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_2(chip1,chip2) \ @@ -109,10 +98,10 @@ struct i2c_address_data { "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ SENSORS_MODULE_PARM_FORCE(chip2); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_3(chip1,chip2,chip3) \ @@ -123,11 +112,11 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip1); \ SENSORS_MODULE_PARM_FORCE(chip2); \ SENSORS_MODULE_PARM_FORCE(chip3); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ @@ -139,12 +128,12 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip2); \ SENSORS_MODULE_PARM_FORCE(chip3); \ SENSORS_MODULE_PARM_FORCE(chip4); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {force_ ## chip4,chip4}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + force_##chip4, \ + NULL}; \ SENSORS_INSMOD #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ @@ -157,13 +146,13 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip3); \ SENSORS_MODULE_PARM_FORCE(chip4); \ SENSORS_MODULE_PARM_FORCE(chip5); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {force_ ## chip4,chip4}, \ - {force_ ## chip5,chip5}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + force_##chip4, \ + force_##chip5, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ @@ -177,14 +166,14 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip4); \ SENSORS_MODULE_PARM_FORCE(chip5); \ SENSORS_MODULE_PARM_FORCE(chip6); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {force_ ## chip4,chip4}, \ - {force_ ## chip5,chip5}, \ - {force_ ## chip6,chip6}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + force_##chip4, \ + force_##chip5, \ + force_##chip6, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ @@ -199,15 +188,15 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip5); \ SENSORS_MODULE_PARM_FORCE(chip6); \ SENSORS_MODULE_PARM_FORCE(chip7); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {force_ ## chip4,chip4}, \ - {force_ ## chip5,chip5}, \ - {force_ ## chip6,chip6}, \ - {force_ ## chip7,chip7}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + force_##chip4, \ + force_##chip5, \ + force_##chip6, \ + force_##chip7, \ + NULL }; \ SENSORS_INSMOD #define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \ @@ -223,16 +212,16 @@ struct i2c_address_data { SENSORS_MODULE_PARM_FORCE(chip6); \ SENSORS_MODULE_PARM_FORCE(chip7); \ SENSORS_MODULE_PARM_FORCE(chip8); \ - static struct i2c_force_data forces[] = {{force,any_chip}, \ - {force_ ## chip1,chip1}, \ - {force_ ## chip2,chip2}, \ - {force_ ## chip3,chip3}, \ - {force_ ## chip4,chip4}, \ - {force_ ## chip5,chip5}, \ - {force_ ## chip6,chip6}, \ - {force_ ## chip7,chip7}, \ - {force_ ## chip8,chip8}, \ - {NULL}}; \ + static unsigned short *forces[] = { force, \ + force_##chip1, \ + force_##chip2, \ + force_##chip3, \ + force_##chip4, \ + force_##chip5, \ + force_##chip6, \ + force_##chip7, \ + force_##chip8, \ + NULL }; \ SENSORS_INSMOD /* Detect function. It iterates over all possible addresses itself. For -- cgit v1.2.3 From b78ec31582c60578ee1d3bb470791d6dde96ccf7 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:36:24 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (03/11) We now have two identical structures, i2c_address_data in i2c-sensor.h and i2c_client_address_data in i2c.h. We can kill one of them, I choose to keep the one in i2c.h as it makes more sense (this structure is not specific to sensors.) Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-sensor.h | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h index 4facaa0b905..fc9284af9fa 100644 --- a/include/linux/i2c-sensor.h +++ b/include/linux/i2c-sensor.h @@ -22,31 +22,7 @@ #ifndef _LINUX_I2C_SENSOR_H #define _LINUX_I2C_SENSOR_H -/* A structure containing the detect information. - normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_END. - A list of I2C addresses which should normally be examined. - probe: insmod parameter. Initialize this list with I2C_CLIENT_END values. - A list of pairs. The first value is a bus number (ANY_I2C_BUS for any - I2C bus), the second is the address. These addresses are also probed, - as if they were in the 'normal' list. - ignore: insmod parameter. Initialize this list with I2C_CLIENT_END values. - A list of pairs. The first value is a bus number (ANY_I2C_BUS for any - I2C bus), the second is the I2C address. These addresses are never - probed. This parameter overrules 'normal' and probe', but not the - 'force' lists. - forces: insmod parameters. A list, ending with a NULL element. - Force variables overrule all other variables; they force a detection on - that place. If a specific chip is given, the module blindly assumes this - chip type is present; if a general force (kind == 0) is given, the module - will still try to figure out what type of chip is present. This is useful - if for some reasons the detect for SMBus address space filled fails. -*/ -struct i2c_address_data { - unsigned short *normal_i2c; - unsigned short *probe; - unsigned short *ignore; - unsigned short **forces; -}; +#include #define SENSORS_MODULE_PARM_FORCE(name) \ I2C_CLIENT_MODULE_PARM(force_ ## name, \ @@ -60,7 +36,7 @@ struct i2c_address_data { "List of adapter,address pairs to scan additionally"); \ I2C_CLIENT_MODULE_PARM(ignore, \ "List of adapter,address pairs not to scan"); \ - static struct i2c_address_data addr_data = { \ + static struct i2c_client_address_data addr_data = { \ .normal_i2c = normal_i2c, \ .probe = probe, \ .ignore = ignore, \ @@ -228,7 +204,7 @@ struct i2c_address_data { SMBus addresses, it will only call found_proc if some client is connected to the SMBus (unless a 'force' matched). */ extern int i2c_detect(struct i2c_adapter *adapter, - struct i2c_address_data *address_data, + struct i2c_client_address_data *address_data, int (*found_proc) (struct i2c_adapter *, int, int)); #endif /* def _LINUX_I2C_SENSOR_H */ -- cgit v1.2.3 From 96478ef3f3f71fa929cc905cc794993e312d9a5d Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:45:27 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (05/11) The i2c_detect function has no more user, delete it. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-sensor.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h index fc9284af9fa..1563d445dfd 100644 --- a/include/linux/i2c-sensor.h +++ b/include/linux/i2c-sensor.h @@ -200,11 +200,4 @@ NULL }; \ SENSORS_INSMOD -/* Detect function. It iterates over all possible addresses itself. For - SMBus addresses, it will only call found_proc if some client is connected - to the SMBus (unless a 'force' matched). */ -extern int i2c_detect(struct i2c_adapter *adapter, - struct i2c_client_address_data *address_data, - int (*found_proc) (struct i2c_adapter *, int, int)); - #endif /* def _LINUX_I2C_SENSOR_H */ -- cgit v1.2.3 From f4b50261207c987913f076d867c2e154d71fd012 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:49:03 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (06/11) The only thing left in i2c-sensor.h are module parameter definition macros. It's only an extension of what i2c.h offers, and this extension is not sensors-specific. As a matter of fact, a few non-sensors drivers use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h altogether. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-sensor.h | 203 --------------------------------------------- include/linux/i2c.h | 148 ++++++++++++++++++++++++++++++--- 2 files changed, 136 insertions(+), 215 deletions(-) delete mode 100644 include/linux/i2c-sensor.h (limited to 'include') diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h deleted file mode 100644 index 1563d445dfd..00000000000 --- a/include/linux/i2c-sensor.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - i2c-sensor.h - Part of the i2c package - was originally sensors.h - Part of lm_sensors, Linux kernel modules - for hardware monitoring - Copyright (c) 1998, 1999 Frodo Looijaard - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef _LINUX_I2C_SENSOR_H -#define _LINUX_I2C_SENSOR_H - -#include - -#define SENSORS_MODULE_PARM_FORCE(name) \ - I2C_CLIENT_MODULE_PARM(force_ ## name, \ - "List of adapter,address pairs which are unquestionably" \ - " assumed to contain a `" # name "' chip") - - -/* This defines several insmod variables, and the addr_data structure */ -#define SENSORS_INSMOD \ - I2C_CLIENT_MODULE_PARM(probe, \ - "List of adapter,address pairs to scan additionally"); \ - I2C_CLIENT_MODULE_PARM(ignore, \ - "List of adapter,address pairs not to scan"); \ - static struct i2c_client_address_data addr_data = { \ - .normal_i2c = normal_i2c, \ - .probe = probe, \ - .ignore = ignore, \ - .forces = forces, \ - } - -/* The following functions create an enum with the chip names as elements. - The first element of the enum is any_chip. These are the only macros - a module will want to use. */ - -#define SENSORS_INSMOD_0 \ - enum chips { any_chip }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - static unsigned short *forces[] = { force, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_1(chip1) \ - enum chips { any_chip, chip1 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_2(chip1,chip2) \ - enum chips { any_chip, chip1, chip2 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_3(chip1,chip2,chip3) \ - enum chips { any_chip, chip1, chip2, chip3 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ - enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - SENSORS_MODULE_PARM_FORCE(chip4); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - force_##chip4, \ - NULL}; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ - enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - SENSORS_MODULE_PARM_FORCE(chip4); \ - SENSORS_MODULE_PARM_FORCE(chip5); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - force_##chip4, \ - force_##chip5, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ - enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - SENSORS_MODULE_PARM_FORCE(chip4); \ - SENSORS_MODULE_PARM_FORCE(chip5); \ - SENSORS_MODULE_PARM_FORCE(chip6); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - force_##chip4, \ - force_##chip5, \ - force_##chip6, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ - enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - SENSORS_MODULE_PARM_FORCE(chip4); \ - SENSORS_MODULE_PARM_FORCE(chip5); \ - SENSORS_MODULE_PARM_FORCE(chip6); \ - SENSORS_MODULE_PARM_FORCE(chip7); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - force_##chip4, \ - force_##chip5, \ - force_##chip6, \ - force_##chip7, \ - NULL }; \ - SENSORS_INSMOD - -#define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \ - enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \ - I2C_CLIENT_MODULE_PARM(force, \ - "List of adapter,address pairs to boldly assume " \ - "to be present"); \ - SENSORS_MODULE_PARM_FORCE(chip1); \ - SENSORS_MODULE_PARM_FORCE(chip2); \ - SENSORS_MODULE_PARM_FORCE(chip3); \ - SENSORS_MODULE_PARM_FORCE(chip4); \ - SENSORS_MODULE_PARM_FORCE(chip5); \ - SENSORS_MODULE_PARM_FORCE(chip6); \ - SENSORS_MODULE_PARM_FORCE(chip7); \ - SENSORS_MODULE_PARM_FORCE(chip8); \ - static unsigned short *forces[] = { force, \ - force_##chip1, \ - force_##chip2, \ - force_##chip3, \ - force_##chip4, \ - force_##chip5, \ - force_##chip6, \ - force_##chip7, \ - force_##chip8, \ - NULL }; \ - SENSORS_INSMOD - -#endif /* def _LINUX_I2C_SENSOR_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9419bc5584a..3ad3969b6f0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -565,24 +565,148 @@ union i2c_smbus_data { module_param_array(var, short, &var##_num, 0); \ MODULE_PARM_DESC(var,desc) -/* This is the one you want to use in your own modules */ +#define I2C_CLIENT_MODULE_PARM_FORCE(name) \ +I2C_CLIENT_MODULE_PARM(force_##name, \ + "List of adapter,address pairs which are " \ + "unquestionably assumed to contain a `" \ + # name "' chip") + + +#define I2C_CLIENT_INSMOD_COMMON \ +I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ + "additionally"); \ +I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ + "scan"); \ +static struct i2c_client_address_data addr_data = { \ + .normal_i2c = normal_i2c, \ + .probe = probe, \ + .ignore = ignore, \ + .forces = forces, \ +} + +/* These are the ones you want to use in your own drivers. Pick the one + which matches the number of devices the driver differenciates between. */ #define I2C_CLIENT_INSMOD \ - I2C_CLIENT_MODULE_PARM(probe, \ - "List of adapter,address pairs to scan additionally"); \ - I2C_CLIENT_MODULE_PARM(ignore, \ - "List of adapter,address pairs not to scan"); \ I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ - static unsigned short *addr_forces[] = { \ + static unsigned short *forces[] = { \ force, \ NULL \ }; \ - static struct i2c_client_address_data addr_data = { \ - .normal_i2c = normal_i2c, \ - .probe = probe, \ - .ignore = ignore, \ - .forces = addr_forces, \ - } +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_1(chip1) \ +enum chips { any_chip, chip1 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +static unsigned short *forces[] = { force, force_##chip1, NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_2(chip1, chip2) \ +enum chips { any_chip, chip1, chip2 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ +enum chips { any_chip, chip1, chip2, chip3 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ +enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + force_##chip4, NULL}; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ +enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + force_##chip4, force_##chip5, \ + NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ +enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + force_##chip4, force_##chip5, \ + force_##chip6, NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ +enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ + chip7 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + force_##chip4, force_##chip5, \ + force_##chip6, force_##chip7, \ + NULL }; \ +I2C_CLIENT_INSMOD_COMMON + +#define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ +enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ + chip7, chip8 }; \ +I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ + "boldly assume to be present"); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ +I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ +static unsigned short *forces[] = { force, force_##chip1, \ + force_##chip2, force_##chip3, \ + force_##chip4, force_##chip5, \ + force_##chip6, force_##chip7, \ + force_##chip8, NULL }; \ +I2C_CLIENT_INSMOD_COMMON #endif /* _LINUX_I2C_H */ -- cgit v1.2.3 From 303760b44a7a142cb9f4c9df4609fb63bbda98db Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:52:01 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (07/11) The only part left in i2c-sensor is the VRM/VRD/VID handling code. This is in no way related to i2c, so it doesn't belong there. Move the code to hwmon, where it belongs. Note that not all hardware monitoring drivers do VRM/VRD/VID operations, so less drivers depend on hwmon-vid than there were depending on i2c-sensor. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon-vid.h | 112 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/i2c-vid.h | 111 --------------------------------------------- 2 files changed, 112 insertions(+), 111 deletions(-) create mode 100644 include/linux/hwmon-vid.h delete mode 100644 include/linux/i2c-vid.h (limited to 'include') diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h new file mode 100644 index 00000000000..c45cd872c55 --- /dev/null +++ b/include/linux/hwmon-vid.h @@ -0,0 +1,112 @@ +/* + hwmon-vid.h - VID/VRM/VRD voltage conversions + + Originally part of lm_sensors + Copyright (c) 2002 Mark D. Studebaker + With assistance from Trent Piepho + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + This file contains common code for decoding VID pins. + This file is #included in various chip drivers in this directory. + As the user is unlikely to load more than one driver which + includes this code we don't worry about the wasted space. + Reference: VRM x.y DC-DC Converter Design Guidelines, + available at http://developer.intel.com +*/ + +/* + AMD Opteron processors don't follow the Intel VRM spec. + I'm going to "make up" 2.4 as the VRM spec for the Opterons. + No good reason just a mnemonic for the 24x Opteron processor + series + + Opteron VID encoding is: + + 00000 = 1.550 V + 00001 = 1.525 V + . . . . + 11110 = 0.800 V + 11111 = 0.000 V (off) + */ + +/* + Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f. + vrm is the Intel VRM document version. + Note: vrm version is scaled by 10 and the return value is scaled by 1000 + to avoid floating point in the kernel. +*/ + +int vid_which_vrm(void); + +#define DEFAULT_VRM 82 + +static inline int vid_from_reg(int val, int vrm) +{ + int vid; + + switch(vrm) { + + case 0: + return 0; + + case 100: /* VRD 10.0 */ + if((val & 0x1f) == 0x1f) + return 0; + if((val & 0x1f) <= 0x09 || val == 0x0a) + vid = 10875 - (val & 0x1f) * 250; + else + vid = 18625 - (val & 0x1f) * 250; + if(val & 0x20) + vid -= 125; + vid /= 10; /* only return 3 dec. places for now */ + return vid; + + case 24: /* Opteron processor */ + return(val == 0x1f ? 0 : 1550 - val * 25); + + case 91: /* VRM 9.1 */ + case 90: /* VRM 9.0 */ + return(val == 0x1f ? 0 : + 1850 - val * 25); + + case 85: /* VRM 8.5 */ + return((val & 0x10 ? 25 : 0) + + ((val & 0x0f) > 0x04 ? 2050 : 1250) - + ((val & 0x0f) * 50)); + + case 84: /* VRM 8.4 */ + val &= 0x0f; + /* fall through */ + default: /* VRM 8.2 */ + return(val == 0x1f ? 0 : + val & 0x10 ? 5100 - (val) * 100 : + 2050 - (val) * 50); + } +} + +static inline int vid_to_reg(int val, int vrm) +{ + switch (vrm) { + case 91: /* VRM 9.1 */ + case 90: /* VRM 9.0 */ + return ((val >= 1100) && (val <= 1850) ? + ((18499 - val * 10) / 25 + 5) / 10 : -1); + default: + return -1; + } +} diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h deleted file mode 100644 index 41d0635e0ba..00000000000 --- a/include/linux/i2c-vid.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - i2c-vid.h - Part of lm_sensors, Linux kernel modules for hardware - monitoring - Copyright (c) 2002 Mark D. Studebaker - With assistance from Trent Piepho - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* - This file contains common code for decoding VID pins. - This file is #included in various chip drivers in this directory. - As the user is unlikely to load more than one driver which - includes this code we don't worry about the wasted space. - Reference: VRM x.y DC-DC Converter Design Guidelines, - available at http://developer.intel.com -*/ - -/* - AMD Opteron processors don't follow the Intel VRM spec. - I'm going to "make up" 2.4 as the VRM spec for the Opterons. - No good reason just a mnemonic for the 24x Opteron processor - series - - Opteron VID encoding is: - - 00000 = 1.550 V - 00001 = 1.525 V - . . . . - 11110 = 0.800 V - 11111 = 0.000 V (off) - */ - -/* - Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f. - vrm is the Intel VRM document version. - Note: vrm version is scaled by 10 and the return value is scaled by 1000 - to avoid floating point in the kernel. -*/ - -int i2c_which_vrm(void); - -#define DEFAULT_VRM 82 - -static inline int vid_from_reg(int val, int vrm) -{ - int vid; - - switch(vrm) { - - case 0: - return 0; - - case 100: /* VRD 10.0 */ - if((val & 0x1f) == 0x1f) - return 0; - if((val & 0x1f) <= 0x09 || val == 0x0a) - vid = 10875 - (val & 0x1f) * 250; - else - vid = 18625 - (val & 0x1f) * 250; - if(val & 0x20) - vid -= 125; - vid /= 10; /* only return 3 dec. places for now */ - return vid; - - case 24: /* Opteron processor */ - return(val == 0x1f ? 0 : 1550 - val * 25); - - case 91: /* VRM 9.1 */ - case 90: /* VRM 9.0 */ - return(val == 0x1f ? 0 : - 1850 - val * 25); - - case 85: /* VRM 8.5 */ - return((val & 0x10 ? 25 : 0) + - ((val & 0x0f) > 0x04 ? 2050 : 1250) - - ((val & 0x0f) * 50)); - - case 84: /* VRM 8.4 */ - val &= 0x0f; - /* fall through */ - default: /* VRM 8.2 */ - return(val == 0x1f ? 0 : - val & 0x10 ? 5100 - (val) * 100 : - 2050 - (val) * 50); - } -} - -static inline int vid_to_reg(int val, int vrm) -{ - switch (vrm) { - case 91: /* VRM 9.1 */ - case 90: /* VRM 9.0 */ - return ((val >= 1100) && (val <= 1850) ? - ((18499 - val * 10) / 25 + 5) / 10 : -1); - default: - return -1; - } -} -- cgit v1.2.3 From ee70d3a33368038d41985474d9e70ac07f19651c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 31 Jul 2005 21:57:33 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (09/11) Delete DEFAULT_VRM from hwmon-vid.h, it has no more users. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon-vid.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index c45cd872c55..6d9d4f9bad5 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -53,8 +53,6 @@ int vid_which_vrm(void); -#define DEFAULT_VRM 82 - static inline int vid_from_reg(int val, int vrm) { int vid; -- cgit v1.2.3 From d0f282706df877f8fd8869419e308d24eedb523b Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 1 Aug 2005 22:50:08 +0200 Subject: [PATCH] hwmon: hwmon vs i2c, second round (10/11) I see very little reason why vid_from_reg is inlined. It is not exactly short, its parameters are seldom known in advance, and it is never called in speed critical areas. Uninlining it should cause little performance loss if any, and saves a signficant space as well as compilation time. As suggested by Alexey Dobriyan, I am leaving vid_to_reg inline for now, as it is short and has a single user so far. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/hwmon-vid.h | 83 +++++------------------------------------------ 1 file changed, 9 insertions(+), 74 deletions(-) (limited to 'include') diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h index 6d9d4f9bad5..cd4b7a042b8 100644 --- a/include/linux/hwmon-vid.h +++ b/include/linux/hwmon-vid.h @@ -20,83 +20,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* - This file contains common code for decoding VID pins. - This file is #included in various chip drivers in this directory. - As the user is unlikely to load more than one driver which - includes this code we don't worry about the wasted space. - Reference: VRM x.y DC-DC Converter Design Guidelines, - available at http://developer.intel.com -*/ - -/* - AMD Opteron processors don't follow the Intel VRM spec. - I'm going to "make up" 2.4 as the VRM spec for the Opterons. - No good reason just a mnemonic for the 24x Opteron processor - series - - Opteron VID encoding is: - - 00000 = 1.550 V - 00001 = 1.525 V - . . . . - 11110 = 0.800 V - 11111 = 0.000 V (off) - */ - -/* - Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f. - vrm is the Intel VRM document version. - Note: vrm version is scaled by 10 and the return value is scaled by 1000 - to avoid floating point in the kernel. -*/ +#ifndef _LINUX_HWMON_VID_H +#define _LINUX_HWMON_VID_H +int vid_from_reg(int val, int vrm); int vid_which_vrm(void); -static inline int vid_from_reg(int val, int vrm) -{ - int vid; - - switch(vrm) { - - case 0: - return 0; - - case 100: /* VRD 10.0 */ - if((val & 0x1f) == 0x1f) - return 0; - if((val & 0x1f) <= 0x09 || val == 0x0a) - vid = 10875 - (val & 0x1f) * 250; - else - vid = 18625 - (val & 0x1f) * 250; - if(val & 0x20) - vid -= 125; - vid /= 10; /* only return 3 dec. places for now */ - return vid; - - case 24: /* Opteron processor */ - return(val == 0x1f ? 0 : 1550 - val * 25); - - case 91: /* VRM 9.1 */ - case 90: /* VRM 9.0 */ - return(val == 0x1f ? 0 : - 1850 - val * 25); - - case 85: /* VRM 8.5 */ - return((val & 0x10 ? 25 : 0) + - ((val & 0x0f) > 0x04 ? 2050 : 1250) - - ((val & 0x0f) * 50)); - - case 84: /* VRM 8.4 */ - val &= 0x0f; - /* fall through */ - default: /* VRM 8.2 */ - return(val == 0x1f ? 0 : - val & 0x10 ? 5100 - (val) * 100 : - 2050 - (val) * 50); - } -} - +/* vrm is the VRM/VRD document version multiplied by 10. + val is in mV to avoid floating point in the kernel. + Returned value is the 4-, 5- or 6-bit VID code. + Note that only VRM 9.x is supported for now. */ static inline int vid_to_reg(int val, int vrm) { switch (vrm) { @@ -108,3 +41,5 @@ static inline int vid_to_reg(int val, int vrm) return -1; } } + +#endif /* _LINUX_HWMON_VID_H */ -- cgit v1.2.3 From 975185880d55676b1352047e82a0cb84173c6c28 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:33:24 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.name (1/7) The name member of the i2c_algorithm is never used, although all drivers conscientiously fill it. We can drop it completely, this structure doesn't need to have a name. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 3ad3969b6f0..f04b1fc6a0f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -192,7 +192,6 @@ static inline char *i2c_clientname(struct i2c_client *c) * to name two of the most common. */ struct i2c_algorithm { - char name[32]; /* textual description */ unsigned int id; /* If an adapter algorithm can't do I2C-level access, set master_xfer -- cgit v1.2.3 From e51cc6b3a365e170d3ebe51c2308fdd42e027a46 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:36:49 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.id (2/7) Use the adapter id rather than the algorithm id to detect the i2c-isa pseudo-adapter. This saves one level of dereferencing, and the algorithm ids will soon be gone anyway. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-isa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h index db793b68356..54c27e88d10 100644 --- a/include/linux/i2c-isa.h +++ b/include/linux/i2c-isa.h @@ -28,9 +28,9 @@ extern int i2c_isa_del_driver(struct i2c_driver *driver); /* Detect whether we are on the isa bus. This is only useful to hybrid (i2c+isa) drivers. */ -#define i2c_is_isa_client(clientptr) \ - ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) #define i2c_is_isa_adapter(adapptr) \ - ((adapptr)->algo->id == I2C_ALGO_ISA) + ((adapptr)->id == (I2C_ALGO_ISA | I2C_HW_ISA)) +#define i2c_is_isa_client(clientptr) \ + i2c_is_isa_adapter((clientptr)->adapter) #endif /* _LINUX_I2C_ISA_H */ -- cgit v1.2.3 From 1d8b9e1bad35fa3ea829990b9056c2a257d8fe79 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:40:19 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.id (4/7) There are no more users of i2c_algorithm.id, so we can finally drop this structure member. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index f04b1fc6a0f..af4983b488b 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -192,8 +192,6 @@ static inline char *i2c_clientname(struct i2c_client *c) * to name two of the most common. */ struct i2c_algorithm { - unsigned int id; - /* If an adapter algorithm can't do I2C-level access, set master_xfer to NULL. If an adapter algorithm can do SMBus access, set smbus_xfer. If set to NULL, the SMBus protocol is simulated -- cgit v1.2.3 From c7a46533ff7ef9e1c51bae6e54208527c5275b24 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:41:56 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.id (5/7) Merge the algorithm id part (16 upper bits) of the i2c adapters ids into the definition of the adapters ids directly. After that, we don't need to OR both ids together for each i2c_adapter structure. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-id.h | 128 ++++++++++++++++++++++++------------------------ include/linux/i2c-isa.h | 2 +- 2 files changed, 65 insertions(+), 65 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 33f08258f22..5b72f664cc2 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -218,103 +218,103 @@ */ /* --- Bit algorithm adapters */ -#define I2C_HW_B_LP 0x00 /* Parallel port Philips style adapter */ -#define I2C_HW_B_LPC 0x01 /* Parallel port, over control reg. */ -#define I2C_HW_B_SER 0x02 /* Serial line interface */ -#define I2C_HW_B_ELV 0x03 /* ELV Card */ -#define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */ -#define I2C_HW_B_BT848 0x05 /* BT848 video boards */ -#define I2C_HW_B_WNV 0x06 /* Winnov Videums */ -#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ -#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ -#define I2C_HW_B_G400 0x09 /* Matrox G400 */ -#define I2C_HW_B_I810 0x0a /* Intel I810 */ -#define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */ -#define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */ -#define I2C_HW_B_SAVG 0x0d /* Savage 4 */ -#define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */ -#define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ -#define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */ -#define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */ -#define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */ -#define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */ -#define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */ -#define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */ -#define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */ -#define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */ -#define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */ -#define I2C_HW_B_PCILYNX 0x1a /* TI PCILynx I2C adapter */ -#define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */ +#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ +#define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */ +#define I2C_HW_B_SER 0x010002 /* Serial line interface */ +#define I2C_HW_B_ELV 0x010003 /* ELV Card */ +#define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */ +#define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ +#define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ +#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ +#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ +#define I2C_HW_B_G400 0x010009 /* Matrox G400 */ +#define I2C_HW_B_I810 0x01000a /* Intel I810 */ +#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ +#define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */ +#define I2C_HW_B_SAVG 0x01000d /* Savage 4 */ +#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ +#define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ +#define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ +#define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ +#define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */ +#define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ +#define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ +#define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ +#define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */ +#define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */ +#define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ +#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ +#define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ /* --- PCF 8584 based algorithms */ -#define I2C_HW_P_LP 0x00 /* Parallel port interface */ -#define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */ -#define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */ +#define I2C_HW_P_LP 0x020000 /* Parallel port interface */ +#define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */ +#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ /* --- PCA 9564 based algorithms */ -#define I2C_HW_A_ISA 0x00 /* generic ISA Bus interface card */ +#define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */ /* --- ACPI Embedded controller algorithms */ -#define I2C_HW_ACPI_EC 0x00 +#define I2C_HW_ACPI_EC 0x1f0000 /* --- MPC824x PowerPC adapters */ -#define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */ +#define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */ /* --- MPC8xx PowerPC adapters */ -#define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */ +#define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ /* --- ITE based algorithms */ -#define I2C_HW_I_IIC 0x00 /* controller on the ITE */ +#define I2C_HW_I_IIC 0x080000 /* controller on the ITE */ /* --- PowerPC on-chip adapters */ -#define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ +#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ /* --- Broadcom SiByte adapters */ -#define I2C_HW_SIBYTE 0x00 +#define I2C_HW_SIBYTE 0x150000 /* --- SGI adapters */ -#define I2C_HW_SGI_VINO 0x00 -#define I2C_HW_SGI_MACE 0x01 +#define I2C_HW_SGI_VINO 0x160000 +#define I2C_HW_SGI_MACE 0x160001 /* --- XSCALE on-chip adapters */ -#define I2C_HW_IOP3XX 0x00 +#define I2C_HW_IOP3XX 0x140000 /* --- Au1550 PSC adapters adapters */ -#define I2C_HW_AU1550_PSC 0x00 +#define I2C_HW_AU1550_PSC 0x1b0000 /* --- SMBus only adapters */ -#define I2C_HW_SMBUS_PIIX4 0x00 -#define I2C_HW_SMBUS_ALI15X3 0x01 -#define I2C_HW_SMBUS_VIA2 0x02 -#define I2C_HW_SMBUS_VOODOO3 0x03 -#define I2C_HW_SMBUS_I801 0x04 -#define I2C_HW_SMBUS_AMD756 0x05 -#define I2C_HW_SMBUS_SIS5595 0x06 -#define I2C_HW_SMBUS_ALI1535 0x07 -#define I2C_HW_SMBUS_SIS630 0x08 -#define I2C_HW_SMBUS_SIS96X 0x09 -#define I2C_HW_SMBUS_AMD8111 0x0a -#define I2C_HW_SMBUS_SCX200 0x0b -#define I2C_HW_SMBUS_NFORCE2 0x0c -#define I2C_HW_SMBUS_W9968CF 0x0d -#define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */ -#define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */ -#define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */ -#define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress/OmniVision FX2 webcam */ +#define I2C_HW_SMBUS_PIIX4 0x040000 +#define I2C_HW_SMBUS_ALI15X3 0x040001 +#define I2C_HW_SMBUS_VIA2 0x040002 +#define I2C_HW_SMBUS_VOODOO3 0x040003 +#define I2C_HW_SMBUS_I801 0x040004 +#define I2C_HW_SMBUS_AMD756 0x040005 +#define I2C_HW_SMBUS_SIS5595 0x040006 +#define I2C_HW_SMBUS_ALI1535 0x040007 +#define I2C_HW_SMBUS_SIS630 0x040008 +#define I2C_HW_SMBUS_SIS96X 0x040009 +#define I2C_HW_SMBUS_AMD8111 0x04000a +#define I2C_HW_SMBUS_SCX200 0x04000b +#define I2C_HW_SMBUS_NFORCE2 0x04000c +#define I2C_HW_SMBUS_W9968CF 0x04000d +#define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ +#define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ +#define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ +#define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ /* --- ISA pseudo-adapter */ -#define I2C_HW_ISA 0x00 +#define I2C_HW_ISA 0x050000 /* --- IPMI pseudo-adapter */ -#define I2C_HW_IPMI 0x00 +#define I2C_HW_IPMI 0x0b0000 /* --- IPMB adapter */ -#define I2C_HW_IPMB 0x00 +#define I2C_HW_IPMB 0x0c0000 /* --- MCP107 adapter */ -#define I2C_HW_MPC107 0x00 +#define I2C_HW_MPC107 0x0d0000 /* --- Marvell mv64xxx i2c adapter */ -#define I2C_HW_MV64XXX 0x00 +#define I2C_HW_MV64XXX 0x190000 #endif /* LINUX_I2C_ID_H */ diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h index 54c27e88d10..67e3598c4ce 100644 --- a/include/linux/i2c-isa.h +++ b/include/linux/i2c-isa.h @@ -29,7 +29,7 @@ extern int i2c_isa_del_driver(struct i2c_driver *driver); /* Detect whether we are on the isa bus. This is only useful to hybrid (i2c+isa) drivers. */ #define i2c_is_isa_adapter(adapptr) \ - ((adapptr)->id == (I2C_ALGO_ISA | I2C_HW_ISA)) + ((adapptr)->id == I2C_HW_ISA) #define i2c_is_isa_client(clientptr) \ i2c_is_isa_adapter((clientptr)->adapter) -- cgit v1.2.3 From 1684a984303abbfc39aa8b59b0fe825c717811a9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:51:10 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.id (6/7) In theory, there should be no more users of I2C_ALGO_* at this point. However, it happens that several drivers were using I2C_ALGO_* for adapter ids, so we need to correct these before we can get rid of all the I2C_ALGO_* definitions. Note that this also fixes a bug in media/video/tvaudio.c: /* don't attach on saa7146 based cards, because dedicated drivers are used */ if ((adap->id & I2C_ALGO_SAA7146)) return 0; This test was plain broken, as it would succeed for many more adapters than just the saa7146: any those id would share at least one bit with the saa7146 id. We are really lucky that the few other adapters we want this driver to work with did not fulfill that condition. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-id.h | 7 +++++++ include/media/id.h | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 5b72f664cc2..d044e738d38 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -245,6 +245,9 @@ #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ #define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ +#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ +#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ +#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ /* --- PCF 8584 based algorithms */ #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ @@ -317,4 +320,8 @@ /* --- Marvell mv64xxx i2c adapter */ #define I2C_HW_MV64XXX 0x190000 +/* --- Miscellaneous adapters */ +#define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ +#define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ + #endif /* LINUX_I2C_ID_H */ diff --git a/include/media/id.h b/include/media/id.h index a39a6423914..801ddef301a 100644 --- a/include/media/id.h +++ b/include/media/id.h @@ -34,8 +34,3 @@ #ifndef I2C_DRIVERID_SAA6752HS # define I2C_DRIVERID_SAA6752HS I2C_DRIVERID_EXP0+8 #endif - -/* algorithms */ -#ifndef I2C_ALGO_SAA7134 -# define I2C_ALGO_SAA7134 0x090000 -#endif -- cgit v1.2.3 From c2459cf257106cea5adbc83f084b76d0030eb700 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 11 Aug 2005 23:52:35 +0200 Subject: [PATCH] I2C: Kill i2c_algorithm.id (7/7) The I2C_ALGO_* constants have no more users, delete them. Also update the comments in i2c-id.h so that they reflect the current state of the file. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c-id.h | 57 +------------------------------------------------- 1 file changed, 1 insertion(+), 56 deletions(-) (limited to 'include') diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index d044e738d38..44f30876a1c 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -1,6 +1,6 @@ /* ------------------------------------------------------------------------- */ /* */ -/* i2c.h - definitions for the i2c-bus interface */ +/* i2c-id.h - identifier values for i2c drivers and adapters */ /* */ /* ------------------------------------------------------------------------- */ /* Copyright (C) 1995-1999 Simon G. Vogl @@ -23,16 +23,6 @@ #ifndef LINUX_I2C_ID_H #define LINUX_I2C_ID_H -/* - * This file is part of the i2c-bus package and contains the identifier - * values for drivers, adapters and other folk populating these serial - * worlds. - * - * These will change often (i.e. additions) , therefore this has been - * separated from the functional interface definitions of the i2c api. - * - */ - /* * ---- Driver types ----------------------------------------------------- * device id name + number function description, i2c address(es) @@ -170,51 +160,6 @@ /* * ---- Adapter types ---------------------------------------------------- - * - * First, we distinguish between several algorithms to access the hardware - * interface types, as a PCF 8584 needs other care than a bit adapter. - */ - -#define I2C_ALGO_NONE 0x000000 -#define I2C_ALGO_BIT 0x010000 /* bit style adapters */ -#define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */ -#define I2C_ALGO_ATI 0x030000 /* ATI video card */ -#define I2C_ALGO_SMBUS 0x040000 -#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */ -#define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */ -#define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */ -#define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */ -#define I2C_ALGO_SAA7134 0x090000 -#define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */ -#define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */ -#define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */ -#define I2C_ALGO_MPC107 0x0d0000 -#define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */ - -#define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */ -#define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */ -#define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */ -#define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ -#define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */ -#define I2C_ALGO_SGI 0x160000 /* SGI algorithm */ - -#define I2C_ALGO_USB 0x170000 /* USB algorithm */ -#define I2C_ALGO_VIRT 0x180000 /* Virtual bus adapter */ - -#define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */ -#define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */ -#define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */ - -#define I2C_ALGO_EXP 0x800000 /* experimental */ - -#define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */ -#define I2C_ALGO_SHIFT 0x10 /* right shift to get index values */ - -#define I2C_HW_ADAPS 0x10000 /* # adapter types */ -#define I2C_HW_MASK 0xffff - - -/* hw specific modules that are defined per algorithm layer */ /* --- Bit algorithm adapters */ -- cgit v1.2.3 From 020789e9cb688ac8b15a9950d25fe45492b23398 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 13 Aug 2005 13:04:32 +0200 Subject: [PATCH] I2C: Outdated i2c_adapter comment Delete an outdated comment about i2c_algorithm.id being computed from algo->id. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index af4983b488b..233c153b12b 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -219,8 +219,7 @@ struct i2c_algorithm { */ struct i2c_adapter { struct module *owner; - unsigned int id;/* == is algo->id | hwdep.struct->id, */ - /* for registered values see below */ + unsigned int id; unsigned int class; struct i2c_algorithm *algo;/* the algorithm to access the bus */ void *algo_data; -- cgit v1.2.3 From fae91e72b79ba9a21f0ce7551a1fd7e8984c85a6 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 15 Aug 2005 19:57:04 +0200 Subject: [PATCH] I2C: Drop I2C_DEVNAME and i2c_clientname I2C_DEVNAME and i2c_clientname were introduced in 2.5.68 [1] to help media/video driver authors who wanted their code to be compatible with both Linux 2.4 and 2.6. The cause of the incompatibility has gone since [2], so I think we can get rid of them, as they tend to make the code harder to read and longer to preprocess/compile for no more benefit. I'd hope nobody seriously attempts to keep media/video driver compatible across Linux trees anymore, BTW. [1] http://marc.theaimsgroup.com/?l=linux-kernel&m=104930186524598&w=2 [2] http://www.linuxhq.com/kernel/v2.6/0-test3/include/linux/i2c.h Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 233c153b12b..1ead5195fde 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -178,13 +178,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) dev_set_drvdata (&dev->dev, data); } -#define I2C_DEVNAME(str) .name = str - -static inline char *i2c_clientname(struct i2c_client *c) -{ - return &c->name[0]; -} - /* * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can -- cgit v1.2.3 From 77ae84554cc0178e03862391599a0cedf96fa4c4 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 3 Sep 2005 10:52:11 +0200 Subject: [PATCH] I2C: Drop the I2C_ACK_TEST ioctl Drop the I2C_ACK_TEST ioctl, which was commented out. It never really existed (not after 1999 anyway), and there is no such thing as a ack test on I2C/SMBus anyway. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- include/linux/i2c.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 1ead5195fde..be35332b67e 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -508,9 +508,6 @@ union i2c_smbus_data { #define I2C_FUNCS 0x0705 /* Get the adapter functionality */ #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ #define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ -#if 0 -#define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */ -#endif #define I2C_SMBUS 0x0720 /* SMBus-level access */ -- cgit v1.2.3 From 0ce7625f3c1e3f921f6b83f7e944e00031a39dfa Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 5 Sep 2005 20:49:54 +0100 Subject: [ARM] 2882/1: pxa2xx_sharpsl: Update PCMCIA driver to support variety of new hardware Patch from Richard Purdie This patch updates the PCMCIA pxa2xx_sharpsl driver to support multiple scoop devices by adding a scoop to pcmcia slot mapping structure. It adds platform support for poodle, is known to work on spitz (which is dual slot) and should also support collie with a minor amount of further work. Signed-off-by: Richard Purdie Signed-off-by: Russell King --- include/asm-arm/hardware/scoop.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h index 7ea771ff614..527404b5a8d 100644 --- a/include/asm-arm/hardware/scoop.h +++ b/include/asm-arm/hardware/scoop.h @@ -40,6 +40,19 @@ struct scoop_config { unsigned short io_dir; }; +/* Structure for linking scoop devices to PCMCIA sockets */ +struct scoop_pcmcia_dev { + struct device *dev; /* Pointer to this socket's scoop device */ + int irq; /* irq for socket */ + int cd_irq; + const char *cd_irq_str; + unsigned char keep_vs; + unsigned char keep_rd; +}; + +extern int scoop_num; +extern struct scoop_pcmcia_dev *scoop_devs; + void reset_scoop(struct device *dev); unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit); -- cgit v1.2.3 From d856f1e337782326c638c70c0b4df2b909350dec Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Fri, 19 Aug 2005 09:14:01 -0400 Subject: [PATCH] klist: fix klist to have the same klist_add semantics as list_head at the moment, the list_head semantics are list_add(node, head) whereas current klist semantics are klist_add(head, node) This is bound to cause confusion, and since klist is the newcomer, it should follow the list_head semantics. I also added missing include guards to klist.h Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman --- include/linux/klist.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/klist.h b/include/linux/klist.h index eebf5e5696e..c4d1fae4dd8 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h @@ -9,6 +9,9 @@ * This file is rleased under the GPL v2. */ +#ifndef _LINUX_KLIST_H +#define _LINUX_KLIST_H + #include #include #include @@ -31,8 +34,8 @@ struct klist_node { struct completion n_removed; }; -extern void klist_add_tail(struct klist * k, struct klist_node * n); -extern void klist_add_head(struct klist * k, struct klist_node * n); +extern void klist_add_tail(struct klist_node * n, struct klist * k); +extern void klist_add_head(struct klist_node * n, struct klist * k); extern void klist_del(struct klist_node * n); extern void klist_remove(struct klist_node * n); @@ -53,3 +56,4 @@ extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, extern void klist_iter_exit(struct klist_iter * i); extern struct klist_node * klist_next(struct klist_iter * i); +#endif -- cgit v1.2.3 From 506e7beb7468c7cf56370d0a7a6afbec56653473 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 5 Sep 2005 18:08:11 -0700 Subject: [IRDA]: IrDA prototype fixes Every file should #include the header files containing the prototypes of it's global functions. In this case this showed that the prototype of irlan_print_filter() was wrong which is also corrected in this patch. Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- include/net/irda/irlan_filter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/irda/irlan_filter.h b/include/net/irda/irlan_filter.h index 3afeb6c94ea..492dedaa8ac 100644 --- a/include/net/irda/irlan_filter.h +++ b/include/net/irda/irlan_filter.h @@ -28,6 +28,6 @@ void irlan_check_command_param(struct irlan_cb *self, char *param, char *value); void irlan_filter_request(struct irlan_cb *self, struct sk_buff *skb); -int irlan_print_filter(struct seq_file *seq, int filter_type); +void irlan_print_filter(struct seq_file *seq, int filter_type); #endif /* IRLAN_FILTER_H */ -- cgit v1.2.3 From 6baf1f417d092bd2de7c8892cecad456024c993f Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 5 Sep 2005 18:14:11 -0700 Subject: [NET]: Do not protect sysctl_optmem_max with CONFIG_SYSCTL The ipv4 and ipv6 protocols need to access it unconditionally. SYSCTL=n build failure reported by Russell King. Signed-off-by: David S. Miller --- include/net/sock.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/sock.h b/include/net/sock.h index cf628261da5..8c48fbecb7c 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1377,9 +1377,10 @@ extern void sk_init(void); #ifdef CONFIG_SYSCTL extern struct ctl_table core_table[]; -extern int sysctl_optmem_max; #endif +extern int sysctl_optmem_max; + extern __u32 sysctl_wmem_default; extern __u32 sysctl_rmem_default; -- cgit v1.2.3 From cdcd318fefab8c8655fdc3b085ccc23848a93001 Mon Sep 17 00:00:00 2001 From: Milton Miller Date: Tue, 6 Sep 2005 11:50:55 +1000 Subject: [PATCH] ppc64: Add missing include inline pmac_call_feature references ppc_md so include asm/machdep.h in asm/pmac_feature.h Signed-off-by: Milton Miller Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc/pmac_feature.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-ppc/pmac_feature.h b/include/asm-ppc/pmac_feature.h index 8beb162873f..e9683bcff19 100644 --- a/include/asm-ppc/pmac_feature.h +++ b/include/asm-ppc/pmac_feature.h @@ -32,6 +32,7 @@ #define __PPC_ASM_PMAC_FEATURE_H #include +#include /* * Known Mac motherboard models -- cgit v1.2.3 From c8f1c8be629ee34991fdba8bfe46a5c455393209 Mon Sep 17 00:00:00 2001 From: Milton Miller Date: Tue, 6 Sep 2005 11:56:42 +1000 Subject: [PATCH] ppc64: Take udbg out of ppc_md Take udbg out of ppc_md. Allows us to not overwrite early udbg inits when assigning ppc_md. Signed-off-by: Milton Miller Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/machdep.h | 5 ----- include/asm-ppc64/udbg.h | 25 ++++++++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h index ff2c9287d3b..9a1ef4427ed 100644 --- a/include/asm-ppc64/machdep.h +++ b/include/asm-ppc64/machdep.h @@ -103,11 +103,6 @@ struct machdep_calls { void (*progress)(char *, unsigned short); - /* Debug interface. Low level I/O to some terminal device */ - void (*udbg_putc)(unsigned char c); - unsigned char (*udbg_getc)(void); - int (*udbg_getc_poll)(void); - /* Interface for platform error logging */ void (*log_error)(char *buf, unsigned int err_type, int fatal); diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h index a6e04d014b2..2cf1e87fd7d 100644 --- a/include/asm-ppc64/udbg.h +++ b/include/asm-ppc64/udbg.h @@ -12,17 +12,20 @@ * 2 of the License, or (at your option) any later version. */ -void udbg_init_uart(void __iomem *comport, unsigned int speed); -void udbg_putc(unsigned char c); -unsigned char udbg_getc(void); -int udbg_getc_poll(void); -void udbg_puts(const char *s); -int udbg_write(const char *s, int n); -int udbg_read(char *buf, int buflen); +extern void (*udbg_putc)(unsigned char c); +extern unsigned char (*udbg_getc)(void); +extern int (*udbg_getc_poll)(void); + +extern void udbg_puts(const char *s); +extern int udbg_write(const char *s, int n); +extern int udbg_read(char *buf, int buflen); + struct console; -void udbg_console_write(struct console *con, const char *s, unsigned int n); -void udbg_printf(const char *fmt, ...); -void udbg_ppcdbg(unsigned long flags, const char *fmt, ...); -unsigned long udbg_ifdebug(unsigned long flags); +extern void udbg_console_write(struct console *con, const char *s, unsigned int n); +extern void udbg_printf(const char *fmt, ...); +extern void udbg_ppcdbg(unsigned long flags, const char *fmt, ...); +extern unsigned long udbg_ifdebug(unsigned long flags); + +extern void udbg_init_uart(void __iomem *comport, unsigned int speed); #endif -- cgit v1.2.3 From 8d9273918635f0301368c01b56c03a6f339e8d51 Mon Sep 17 00:00:00 2001 From: Milton Miller Date: Tue, 6 Sep 2005 11:57:27 +1000 Subject: [PATCH] ppc64: Consolidate early console and PPCDBG code Consolidate the early console and PPCDBG code in udbg.c Signed-off-by: Milton Miller Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/udbg.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/udbg.h b/include/asm-ppc64/udbg.h index 2cf1e87fd7d..c786604aef0 100644 --- a/include/asm-ppc64/udbg.h +++ b/include/asm-ppc64/udbg.h @@ -2,6 +2,7 @@ #define __UDBG_HDR #include +#include /* * c 2001 PPC 64 Team, IBM Corp @@ -20,12 +21,11 @@ extern void udbg_puts(const char *s); extern int udbg_write(const char *s, int n); extern int udbg_read(char *buf, int buflen); -struct console; -extern void udbg_console_write(struct console *con, const char *s, unsigned int n); +extern void register_early_udbg_console(void); extern void udbg_printf(const char *fmt, ...); extern void udbg_ppcdbg(unsigned long flags, const char *fmt, ...); extern unsigned long udbg_ifdebug(unsigned long flags); - +extern void __init ppcdbg_initialize(void); extern void udbg_init_uart(void __iomem *comport, unsigned int speed); #endif -- cgit v1.2.3 From b2c0ab17ba751abe13a28508b1ac7e9ca074cd87 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 13:05:58 +1000 Subject: [PATCH] ppc64: speedup cmpxchg cmpxchg has the following code: __typeof__(*(ptr)) _o_ = (o); __typeof__(*(ptr)) _n_ = (n); Unfortunately it makes gcc 4.0 store and load the variables to the stack. Eg in atomic_dec_and_test we get: stw r10,112(r1) stw r9,116(r1) lwz r9,112(r1) lwz r0,116(r1) x86 is just casting the values so do that instead. Also change __xchg* and __cmpxchg* to take unsigned values, removing a few sign extensions. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/system.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/system.h b/include/asm-ppc64/system.h index b9e1835351e..c0396428cc3 100644 --- a/include/asm-ppc64/system.h +++ b/include/asm-ppc64/system.h @@ -158,7 +158,7 @@ static inline int __is_processor(unsigned long pv) * is more like most of the other architectures. */ static __inline__ unsigned long -__xchg_u32(volatile int *m, unsigned long val) +__xchg_u32(volatile unsigned int *m, unsigned long val) { unsigned long dummy; @@ -200,7 +200,7 @@ __xchg_u64(volatile long *m, unsigned long val) extern void __xchg_called_with_bad_pointer(void); static __inline__ unsigned long -__xchg(volatile void *ptr, unsigned long x, int size) +__xchg(volatile void *ptr, unsigned long x, unsigned int size) { switch (size) { case 4: @@ -223,7 +223,7 @@ __xchg(volatile void *ptr, unsigned long x, int size) #define __HAVE_ARCH_CMPXCHG 1 static __inline__ unsigned long -__cmpxchg_u32(volatile int *p, int old, int new) +__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) { unsigned int prev; @@ -271,7 +271,8 @@ __cmpxchg_u64(volatile long *p, unsigned long old, unsigned long new) extern void __cmpxchg_called_with_bad_pointer(void); static __inline__ unsigned long -__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, + unsigned int size) { switch (size) { case 4: @@ -283,13 +284,9 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) return old; } -#define cmpxchg(ptr,o,n) \ - ({ \ - __typeof__(*(ptr)) _o_ = (o); \ - __typeof__(*(ptr)) _n_ = (n); \ - (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ - (unsigned long)_n_, sizeof(*(ptr))); \ - }) +#define cmpxchg(ptr,o,n)\ + ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ + (unsigned long)(n),sizeof(*(ptr)))) /* * We handle most unaligned accesses in hardware. On the other hand -- cgit v1.2.3 From ad6571a78ac74e9fa27e581834709067dba459af Mon Sep 17 00:00:00 2001 From: Becky Bruce Date: Sat, 3 Sep 2005 19:01:57 -0500 Subject: [PATCH] Move 3 more headers to asm-powerpc Merged several nearly-identical header files from asm-ppc and asm-ppc64 into asm-powerpc. Signed-off-by: Kumar Gala Signed-off-by: Becky Bruce Signed-off-by: Paul Mackerras --- include/asm-powerpc/mman.h | 52 +++++++++ include/asm-powerpc/termbits.h | 191 +++++++++++++++++++++++++++++++++ include/asm-powerpc/termios.h | 236 +++++++++++++++++++++++++++++++++++++++++ include/asm-ppc/mman.h | 44 -------- include/asm-ppc/termbits.h | 185 -------------------------------- include/asm-ppc/termios.h | 232 ---------------------------------------- include/asm-ppc64/mman.h | 52 --------- include/asm-ppc64/termbits.h | 193 --------------------------------- include/asm-ppc64/termios.h | 235 ---------------------------------------- 9 files changed, 479 insertions(+), 941 deletions(-) create mode 100644 include/asm-powerpc/mman.h create mode 100644 include/asm-powerpc/termbits.h create mode 100644 include/asm-powerpc/termios.h delete mode 100644 include/asm-ppc/mman.h delete mode 100644 include/asm-ppc/termbits.h delete mode 100644 include/asm-ppc/termios.h delete mode 100644 include/asm-ppc64/mman.h delete mode 100644 include/asm-ppc64/termbits.h delete mode 100644 include/asm-ppc64/termios.h (limited to 'include') diff --git a/include/asm-powerpc/mman.h b/include/asm-powerpc/mman.h new file mode 100644 index 00000000000..f2d55988d74 --- /dev/null +++ b/include/asm-powerpc/mman.h @@ -0,0 +1,52 @@ +#ifndef _POWERPC_MMAN_H +#define _POWERPC_MMAN_H + +/* + * 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. + */ + +#define PROT_READ 0x1 /* page can be read */ +#define PROT_WRITE 0x2 /* page can be written */ +#define PROT_EXEC 0x4 /* page can be executed */ +#define PROT_SEM 0x8 /* page may be used for atomic ops */ +#define PROT_NONE 0x0 /* page can not be accessed */ +#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ +#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ + +#define MAP_SHARED 0x01 /* Share changes */ +#define MAP_PRIVATE 0x02 /* Changes are private */ +#define MAP_TYPE 0x0f /* Mask for type of mapping */ +#define MAP_FIXED 0x10 /* Interpret addr exactly */ +#define MAP_ANONYMOUS 0x20 /* don't use a file */ +#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */ +#define MAP_NORESERVE 0x40 /* don't reserve swap pages */ +#define MAP_LOCKED 0x80 + +#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ +#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ + +#define MS_ASYNC 1 /* sync memory asynchronously */ +#define MS_INVALIDATE 2 /* invalidate the caches */ +#define MS_SYNC 4 /* synchronous memory sync */ + +#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */ +#define MCL_FUTURE 0x4000 /* lock all additions to address space */ + +#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ +#define MAP_NONBLOCK 0x10000 /* do not block on IO */ + +#define MADV_NORMAL 0x0 /* default page-in behavior */ +#define MADV_RANDOM 0x1 /* page-in minimum required */ +#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ +#define MADV_WILLNEED 0x3 /* pre-fault pages */ +#define MADV_DONTNEED 0x4 /* discard these pages */ + +/* compatibility flags */ +#define MAP_ANON MAP_ANONYMOUS +#define MAP_FILE 0 + +#endif /* _POWERPC_MMAN_H */ diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h new file mode 100644 index 00000000000..2c5bf85a8c3 --- /dev/null +++ b/include/asm-powerpc/termbits.h @@ -0,0 +1,191 @@ +#ifndef _POWERPC_TERMBITS_H +#define _POWERPC_TERMBITS_H + +/* + * 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. + */ + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +/* + * termios type and macro definitions. Be careful about adding stuff + * to this file since it's used in GNU libc and there are strict rules + * concerning namespace pollution. + */ + +#define NCCS 19 +struct termios { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_cc[NCCS]; /* control characters */ + cc_t c_line; /* line discipline (== c_cc[19]) */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VMIN 5 +#define VEOL 6 +#define VTIME 7 +#define VEOL2 8 +#define VSWTC 9 +#define VWERASE 10 +#define VREPRINT 11 +#define VSUSP 12 +#define VSTART 13 +#define VSTOP 14 +#define VLNEXT 15 +#define VDISCARD 16 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#define IXANY 0004000 +#define IUCLC 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#define NLDLY 00001400 +#define NL0 00000000 +#define NL1 00000400 +#define NL2 00001000 +#define NL3 00001400 +#define TABDLY 00006000 +#define TAB0 00000000 +#define TAB1 00002000 +#define TAB2 00004000 +#define TAB3 00006000 +#define XTABS 00006000 /* required by POSIX to == TAB3 */ +#define CRDLY 00030000 +#define CR0 00000000 +#define CR1 00010000 +#define CR2 00020000 +#define CR3 00030000 +#define FFDLY 00040000 +#define FF0 00000000 +#define FF1 00040000 +#define BSDLY 00100000 +#define BS0 00000000 +#define BS1 00100000 +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 + +/* c_cflag bit meaning */ +#define CBAUD 0000377 +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA B19200 +#define EXTB B38400 +#define CBAUDEX 0000000 +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 +#define B500000 00024 +#define B576000 00025 +#define B921600 00026 +#define B1000000 00027 +#define B1152000 00030 +#define B1500000 00031 +#define B2000000 00032 +#define B2500000 00033 +#define B3000000 00034 +#define B3500000 00035 +#define B4000000 00036 + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 +#define CRTSCTS 020000000000 /* flow control */ + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#define XCASE 0x00004000 +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#define ECHOCTL 0x00000040 +#define ECHOPRT 0x00000020 +#define ECHOKE 0x00000001 +#define FLUSHO 0x00800000 +#define PENDIN 0x20000000 +#define IEXTEN 0x00000400 + +/* Values for the ACTION argument to `tcflow'. */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#endif /* _POWERPC_TERMBITS_H */ diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h new file mode 100644 index 00000000000..237533bb0e9 --- /dev/null +++ b/include/asm-powerpc/termios.h @@ -0,0 +1,236 @@ +#ifndef _POWERPC_TERMIOS_H +#define _POWERPC_TERMIOS_H + +/* + * Liberally adapted from alpha/termios.h. In particular, the c_cc[] + * fields have been reordered so that termio & termios share the + * common subset in the same order (for brain dead programs that don't + * know or care about the differences). + * + * 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. + */ + +#include +#include + +struct sgttyb { + char sg_ispeed; + char sg_ospeed; + char sg_erase; + char sg_kill; + short sg_flags; +}; + +struct tchars { + char t_intrc; + char t_quitc; + char t_startc; + char t_stopc; + char t_eofc; + char t_brkc; +}; + +struct ltchars { + char t_suspc; + char t_dsuspc; + char t_rprntc; + char t_flushc; + char t_werasc; + char t_lnextc; +}; + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define NCC 10 +struct termio { + unsigned short c_iflag; /* input mode flags */ + unsigned short c_oflag; /* output mode flags */ + unsigned short c_cflag; /* control mode flags */ + unsigned short c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +/* c_cc characters */ +#define _VINTR 0 +#define _VQUIT 1 +#define _VERASE 2 +#define _VKILL 3 +#define _VEOF 4 +#define _VMIN 5 +#define _VEOL 6 +#define _VTIME 7 +#define _VEOL2 8 +#define _VSWTC 9 + +/* line disciplines */ +#define N_TTY 0 +#define N_SLIP 1 +#define N_MOUSE 2 +#define N_PPP 3 +#define N_STRIP 4 +#define N_AX25 5 +#define N_X25 6 /* X.25 async */ +#define N_6PACK 7 +#define N_MASC 8 /* Reserved for Mobitex module */ +#define N_R3964 9 /* Reserved for Simatic R3964 module */ +#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ +#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */ +#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ +#define N_HDLC 13 /* synchronous HDLC */ +#define N_SYNC_PPP 14 +#define N_HCI 15 /* Bluetooth HCI UART */ + +#ifdef __KERNEL__ +/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ +#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" +#endif + +#define FIOCLEX _IO('f', 1) +#define FIONCLEX _IO('f', 2) +#define FIOASYNC _IOW('f', 125, int) +#define FIONBIO _IOW('f', 126, int) +#define FIONREAD _IOR('f', 127, int) +#define TIOCINQ FIONREAD + +#define TIOCGETP _IOR('t', 8, struct sgttyb) +#define TIOCSETP _IOW('t', 9, struct sgttyb) +#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ + +#define TIOCSETC _IOW('t', 17, struct tchars) +#define TIOCGETC _IOR('t', 18, struct tchars) +#define TCGETS _IOR('t', 19, struct termios) +#define TCSETS _IOW('t', 20, struct termios) +#define TCSETSW _IOW('t', 21, struct termios) +#define TCSETSF _IOW('t', 22, struct termios) + +#define TCGETA _IOR('t', 23, struct termio) +#define TCSETA _IOW('t', 24, struct termio) +#define TCSETAW _IOW('t', 25, struct termio) +#define TCSETAF _IOW('t', 28, struct termio) + +#define TCSBRK _IO('t', 29) +#define TCXONC _IO('t', 30) +#define TCFLSH _IO('t', 31) + +#define TIOCSWINSZ _IOW('t', 103, struct winsize) +#define TIOCGWINSZ _IOR('t', 104, struct winsize) +#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ +#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ +#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ + +#define TIOCGLTC _IOR('t', 116, struct ltchars) +#define TIOCSLTC _IOW('t', 117, struct ltchars) +#define TIOCSPGRP _IOW('t', 118, int) +#define TIOCGPGRP _IOR('t', 119, int) + +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E + +#define TIOCSTI 0x5412 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 + +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ + +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ +#define TIOCSERGETLSR 0x5459 /* Get line status register */ +#define TIOCSERGETMULTI 0x545A /* Get multiport config */ +#define TIOCSERSETMULTI 0x545B /* Set multiport config */ + +#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ +#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ + +/* Used for packet mode */ +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 + +/* modem lines */ +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + +#ifdef __KERNEL__ + +/* + * Translate a "termio" structure into a "termios". Ugh. + */ +#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ + unsigned short __tmp; \ + get_user(__tmp,&(termio)->x); \ + (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \ +} + +#define user_termio_to_kernel_termios(termios, termio) \ +({ \ + SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ +}) + +/* + * Translate a "termios" structure into a "termio". Ugh. + */ +#define kernel_termios_to_user_termio(termio, termios) \ +({ \ + put_user((termios)->c_iflag, &(termio)->c_iflag); \ + put_user((termios)->c_oflag, &(termio)->c_oflag); \ + put_user((termios)->c_cflag, &(termio)->c_cflag); \ + put_user((termios)->c_lflag, &(termio)->c_lflag); \ + put_user((termios)->c_line, &(termio)->c_line); \ + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ +}) + +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) + +#endif /* __KERNEL__ */ + +#endif /* _POWERPC_TERMIOS_H */ diff --git a/include/asm-ppc/mman.h b/include/asm-ppc/mman.h deleted file mode 100644 index 5fd19fd4936..00000000000 --- a/include/asm-ppc/mman.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef __PPC_MMAN_H__ -#define __PPC_MMAN_H__ - -#define PROT_READ 0x1 /* page can be read */ -#define PROT_WRITE 0x2 /* page can be written */ -#define PROT_EXEC 0x4 /* page can be executed */ -#define PROT_SEM 0x8 /* page may be used for atomic ops */ -#define PROT_NONE 0x0 /* page can not be accessed */ -#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ -#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ - -#define MAP_SHARED 0x01 /* Share changes */ -#define MAP_PRIVATE 0x02 /* Changes are private */ -#define MAP_TYPE 0x0f /* Mask for type of mapping */ -#define MAP_FIXED 0x10 /* Interpret addr exactly */ -#define MAP_ANONYMOUS 0x20 /* don't use a file */ -#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */ -#define MAP_NORESERVE 0x40 /* don't reserve swap pages */ -#define MAP_LOCKED 0x80 - -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -#define MAP_NONBLOCK 0x10000 /* do not block on IO */ - -#define MS_ASYNC 1 /* sync memory asynchronously */ -#define MS_INVALIDATE 2 /* invalidate the caches */ -#define MS_SYNC 4 /* synchronous memory sync */ - -#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */ -#define MCL_FUTURE 0x4000 /* lock all additions to address space */ - -#define MADV_NORMAL 0x0 /* default page-in behavior */ -#define MADV_RANDOM 0x1 /* page-in minimum required */ -#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ -#define MADV_WILLNEED 0x3 /* pre-fault pages */ -#define MADV_DONTNEED 0x4 /* discard these pages */ - -/* compatibility flags */ -#define MAP_ANON MAP_ANONYMOUS -#define MAP_FILE 0 - -#endif /* __PPC_MMAN_H__ */ diff --git a/include/asm-ppc/termbits.h b/include/asm-ppc/termbits.h deleted file mode 100644 index c343fb7bdfe..00000000000 --- a/include/asm-ppc/termbits.h +++ /dev/null @@ -1,185 +0,0 @@ -#ifndef _PPC_TERMBITS_H -#define _PPC_TERMBITS_H - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -/* - * termios type and macro definitions. Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[19]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VMIN 5 -#define VEOL 6 -#define VTIME 7 -#define VEOL2 8 -#define VSWTC 9 - -#define VWERASE 10 -#define VREPRINT 11 -#define VSUSP 12 -#define VSTART 13 -#define VSTOP 14 -#define VLNEXT 15 -#define VDISCARD 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#define IXANY 0004000 -#define IUCLC 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#define NLDLY 00001400 -#define NL0 00000000 -#define NL1 00000400 -#define NL2 00001000 -#define NL3 00001400 -#define TABDLY 00006000 -#define TAB0 00000000 -#define TAB1 00002000 -#define TAB2 00004000 -#define TAB3 00006000 -#define XTABS 00006000 /* required by POSIX to == TAB3 */ -#define CRDLY 00030000 -#define CR0 00000000 -#define CR1 00010000 -#define CR2 00020000 -#define CR3 00030000 -#define FFDLY 00040000 -#define FF0 00000000 -#define FF1 00040000 -#define BSDLY 00100000 -#define BS0 00000000 -#define BS1 00100000 -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 - -/* c_cflag bit meaning */ -#define CBAUD 0000377 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CBAUDEX 0000000 -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 -#define B500000 00024 -#define B576000 00025 -#define B921600 00026 -#define B1000000 00027 -#define B1152000 00030 -#define B1500000 00031 -#define B2000000 00032 -#define B2500000 00033 -#define B3000000 00034 -#define B3500000 00035 -#define B4000000 00036 - -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 -#define CRTSCTS 020000000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#define XCASE 0x00004000 -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#define ECHOCTL 0x00000040 -#define ECHOPRT 0x00000020 -#define ECHOKE 0x00000001 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 -#define IEXTEN 0x00000400 - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif /* _PPC_TERMBITS_H */ diff --git a/include/asm-ppc/termios.h b/include/asm-ppc/termios.h deleted file mode 100644 index 97c6287a6cb..00000000000 --- a/include/asm-ppc/termios.h +++ /dev/null @@ -1,232 +0,0 @@ -#ifndef _PPC_TERMIOS_H -#define _PPC_TERMIOS_H - -/* - * Liberally adapted from alpha/termios.h. In particular, the c_cc[] - * fields have been reordered so that termio & termios share the - * common subset in the same order (for brain dead programs that don't - * know or care about the differences). - */ - -#include -#include - -struct sgttyb { - char sg_ispeed; - char sg_ospeed; - char sg_erase; - char sg_kill; - short sg_flags; -}; - -struct tchars { - char t_intrc; - char t_quitc; - char t_startc; - char t_stopc; - char t_eofc; - char t_brkc; -}; - -struct ltchars { - char t_suspc; - char t_dsuspc; - char t_rprntc; - char t_flushc; - char t_werasc; - char t_lnextc; -}; - -#define FIOCLEX _IO('f', 1) -#define FIONCLEX _IO('f', 2) -#define FIOASYNC _IOW('f', 125, int) -#define FIONBIO _IOW('f', 126, int) -#define FIONREAD _IOR('f', 127, int) -#define TIOCINQ FIONREAD -#define FIOQSIZE _IOR('f', 128, loff_t) - -#define TIOCGETP _IOR('t', 8, struct sgttyb) -#define TIOCSETP _IOW('t', 9, struct sgttyb) -#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ - -#define TIOCSETC _IOW('t', 17, struct tchars) -#define TIOCGETC _IOR('t', 18, struct tchars) -#define TCGETS _IOR('t', 19, struct termios) -#define TCSETS _IOW('t', 20, struct termios) -#define TCSETSW _IOW('t', 21, struct termios) -#define TCSETSF _IOW('t', 22, struct termios) - -#define TCGETA _IOR('t', 23, struct termio) -#define TCSETA _IOW('t', 24, struct termio) -#define TCSETAW _IOW('t', 25, struct termio) -#define TCSETAF _IOW('t', 28, struct termio) - -#define TCSBRK _IO('t', 29) -#define TCXONC _IO('t', 30) -#define TCFLSH _IO('t', 31) - -#define TIOCSWINSZ _IOW('t', 103, struct winsize) -#define TIOCGWINSZ _IOR('t', 104, struct winsize) -#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ -#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ -#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ - -#define TIOCGLTC _IOR('t', 116, struct ltchars) -#define TIOCSLTC _IOW('t', 117, struct ltchars) -#define TIOCSPGRP _IOW('t', 118, int) -#define TIOCGPGRP _IOR('t', 119, int) - -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E - -#define TIOCSTI 0x5412 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 - -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ - -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -#define TIOCSERGETLSR 0x5459 /* Get line status register */ -#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -#define TIOCSERSETMULTI 0x545B /* Set multiport config */ - -#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 10 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* c_cc characters */ -#define _VINTR 0 -#define _VQUIT 1 -#define _VERASE 2 -#define _VKILL 3 -#define _VEOF 4 -#define _VMIN 5 -#define _VEOL 6 -#define _VTIME 7 -#define _VEOL2 8 -#define _VSWTC 9 - -#ifdef __KERNEL__ -/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ -#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" -#endif /* __KERNEL__ */ - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 /* X.25 async */ -#define N_6PACK 7 -#define N_MASC 8 /* Reserved for Mobitex module */ -#define N_R3964 9 /* Reserved for Simatic R3964 module */ -#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ -#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ -#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ -#define N_HDLC 13 /* synchronous HDLC */ -#define N_SYNC_PPP 14 -#define N_HCI 15 /* Bluetooth HCI UART */ - -#ifdef __KERNEL__ - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* __KERNEL__ */ - -#endif /* _PPC_TERMIOS_H */ diff --git a/include/asm-ppc64/mman.h b/include/asm-ppc64/mman.h deleted file mode 100644 index d4f93446a52..00000000000 --- a/include/asm-ppc64/mman.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef __PPC64_MMAN_H__ -#define __PPC64_MMAN_H__ - -/* - * 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. - */ - -#define PROT_READ 0x1 /* page can be read */ -#define PROT_WRITE 0x2 /* page can be written */ -#define PROT_EXEC 0x4 /* page can be executed */ -#define PROT_SEM 0x8 /* page may be used for atomic ops */ -#define PROT_NONE 0x0 /* page can not be accessed */ -#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ -#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ - -#define MAP_SHARED 0x01 /* Share changes */ -#define MAP_PRIVATE 0x02 /* Changes are private */ -#define MAP_TYPE 0x0f /* Mask for type of mapping */ -#define MAP_FIXED 0x10 /* Interpret addr exactly */ -#define MAP_ANONYMOUS 0x20 /* don't use a file */ -#define MAP_RENAME MAP_ANONYMOUS /* In SunOS terminology */ -#define MAP_NORESERVE 0x40 /* don't reserve swap pages */ -#define MAP_LOCKED 0x80 - -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ - -#define MS_ASYNC 1 /* sync memory asynchronously */ -#define MS_INVALIDATE 2 /* invalidate the caches */ -#define MS_SYNC 4 /* synchronous memory sync */ - -#define MCL_CURRENT 0x2000 /* lock all currently mapped pages */ -#define MCL_FUTURE 0x4000 /* lock all additions to address space */ - -#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -#define MAP_NONBLOCK 0x10000 /* do not block on IO */ - -#define MADV_NORMAL 0x0 /* default page-in behavior */ -#define MADV_RANDOM 0x1 /* page-in minimum required */ -#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ -#define MADV_WILLNEED 0x3 /* pre-fault pages */ -#define MADV_DONTNEED 0x4 /* discard these pages */ - -/* compatibility flags */ -#define MAP_ANON MAP_ANONYMOUS -#define MAP_FILE 0 - -#endif /* __PPC64_MMAN_H__ */ diff --git a/include/asm-ppc64/termbits.h b/include/asm-ppc64/termbits.h deleted file mode 100644 index d1a2bee10ce..00000000000 --- a/include/asm-ppc64/termbits.h +++ /dev/null @@ -1,193 +0,0 @@ -#ifndef _PPC64_TERMBITS_H -#define _PPC64_TERMBITS_H - -/* - * 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. - */ - -#include - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -/* - * termios type and macro definitions. Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[19]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VMIN 5 -#define VEOL 6 -#define VTIME 7 -#define VEOL2 8 -#define VSWTC 9 -#define VWERASE 10 -#define VREPRINT 11 -#define VSUSP 12 -#define VSTART 13 -#define VSTOP 14 -#define VLNEXT 15 -#define VDISCARD 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#define IXANY 0004000 -#define IUCLC 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#define NLDLY 00001400 -#define NL0 00000000 -#define NL1 00000400 -#define NL2 00001000 -#define NL3 00001400 -#define TABDLY 00006000 -#define TAB0 00000000 -#define TAB1 00002000 -#define TAB2 00004000 -#define TAB3 00006000 -#define XTABS 00006000 /* required by POSIX to == TAB3 */ -#define CRDLY 00030000 -#define CR0 00000000 -#define CR1 00010000 -#define CR2 00020000 -#define CR3 00030000 -#define FFDLY 00040000 -#define FF0 00000000 -#define FF1 00040000 -#define BSDLY 00100000 -#define BS0 00000000 -#define BS1 00100000 -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 - -/* c_cflag bit meaning */ -#define CBAUD 0000377 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CBAUDEX 0000000 -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 -#define B500000 00024 -#define B576000 00025 -#define B921600 00026 -#define B1000000 00027 -#define B1152000 00030 -#define B1500000 00031 -#define B2000000 00032 -#define B2500000 00033 -#define B3000000 00034 -#define B3500000 00035 -#define B4000000 00036 - -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 -#define CRTSCTS 020000000000 /* flow control */ - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#define XCASE 0x00004000 -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#define ECHOCTL 0x00000040 -#define ECHOPRT 0x00000020 -#define ECHOKE 0x00000001 -#define FLUSHO 0x00800000 -#define PENDIN 0x20000000 -#define IEXTEN 0x00000400 - -/* Values for the ACTION argument to `tcflow'. */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* Values for the QUEUE_SELECTOR argument to `tcflush'. */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif /* _PPC64_TERMBITS_H */ diff --git a/include/asm-ppc64/termios.h b/include/asm-ppc64/termios.h deleted file mode 100644 index 02c3d283aa6..00000000000 --- a/include/asm-ppc64/termios.h +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef _PPC64_TERMIOS_H -#define _PPC64_TERMIOS_H - -/* - * Liberally adapted from alpha/termios.h. In particular, the c_cc[] - * fields have been reordered so that termio & termios share the - * common subset in the same order (for brain dead programs that don't - * know or care about the differences). - * - * 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. - */ - -#include -#include - -struct sgttyb { - char sg_ispeed; - char sg_ospeed; - char sg_erase; - char sg_kill; - short sg_flags; -}; - -struct tchars { - char t_intrc; - char t_quitc; - char t_startc; - char t_stopc; - char t_eofc; - char t_brkc; -}; - -struct ltchars { - char t_suspc; - char t_dsuspc; - char t_rprntc; - char t_flushc; - char t_werasc; - char t_lnextc; -}; - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 10 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* c_cc characters */ -#define _VINTR 0 -#define _VQUIT 1 -#define _VERASE 2 -#define _VKILL 3 -#define _VEOF 4 -#define _VMIN 5 -#define _VEOL 6 -#define _VTIME 7 -#define _VEOL2 8 -#define _VSWTC 9 - -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 /* X.25 async */ -#define N_6PACK 7 -#define N_MASC 8 /* Reserved for Mobitex module */ -#define N_R3964 9 /* Reserved for Simatic R3964 module */ -#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ -#define N_IRDA 11 /* Linux IrDa - http://www.cs.uit.no/~dagb/irda/irda.html */ -#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ -#define N_HDLC 13 /* synchronous HDLC */ -#define N_SYNC_PPP 14 - -#ifdef __KERNEL__ -/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ -#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" -#endif - -#define FIOCLEX _IO('f', 1) -#define FIONCLEX _IO('f', 2) -#define FIOASYNC _IOW('f', 125, int) -#define FIONBIO _IOW('f', 126, int) -#define FIONREAD _IOR('f', 127, int) -#define TIOCINQ FIONREAD - -#define TIOCGETP _IOR('t', 8, struct sgttyb) -#define TIOCSETP _IOW('t', 9, struct sgttyb) -#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ - -#define TIOCSETC _IOW('t', 17, struct tchars) -#define TIOCGETC _IOR('t', 18, struct tchars) -#define TCGETS _IOR('t', 19, struct termios) -#define TCSETS _IOW('t', 20, struct termios) -#define TCSETSW _IOW('t', 21, struct termios) -#define TCSETSF _IOW('t', 22, struct termios) - -#define TCGETA _IOR('t', 23, struct termio) -#define TCSETA _IOW('t', 24, struct termio) -#define TCSETAW _IOW('t', 25, struct termio) -#define TCSETAF _IOW('t', 28, struct termio) - -#define TCSBRK _IO('t', 29) -#define TCXONC _IO('t', 30) -#define TCFLSH _IO('t', 31) - -#define TIOCSWINSZ _IOW('t', 103, struct winsize) -#define TIOCGWINSZ _IOR('t', 104, struct winsize) -#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ -#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ -#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ - -#define TIOCGLTC _IOR('t', 116, struct ltchars) -#define TIOCSLTC _IOW('t', 117, struct ltchars) -#define TIOCSPGRP _IOW('t', 118, int) -#define TIOCGPGRP _IOR('t', 119, int) - -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E - -#define TIOCSTI 0x5412 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 - -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ - -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -#define TIOCSERGETLSR 0x5459 /* Get line status register */ -#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -#define TIOCSERSETMULTI 0x545B /* Set multiport config */ - -#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -#ifdef __KERNEL__ - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - (termios)->x = (0xffff0000 & (termios)->x) | __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* __KERNEL__ */ - -#endif /* _PPC64_TERMIOS_H */ -- cgit v1.2.3 From 6b9269abd64c54f11dc4aaf162d2915fccae6c77 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Thu, 1 Sep 2005 15:51:52 -0500 Subject: [PATCH] ppc/ppc64: Merge more include files This patch merges several include files from asm-ppc and asm-ppc64 into the new asm-powerpc. Signed-off-by: Jon Loeliger Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-powerpc/bugs.h | 18 +++++++++ include/asm-powerpc/mc146818rtc.h | 36 ++++++++++++++++++ include/asm-powerpc/module.h | 77 +++++++++++++++++++++++++++++++++++++++ include/asm-powerpc/sembuf.h | 36 ++++++++++++++++++ include/asm-powerpc/shmbuf.h | 59 ++++++++++++++++++++++++++++++ include/asm-powerpc/siginfo.h | 18 +++++++++ include/asm-powerpc/socket.h | 59 ++++++++++++++++++++++++++++++ include/asm-powerpc/sockios.h | 19 ++++++++++ include/asm-ppc/bugs.h | 6 --- include/asm-ppc/mc146818rtc.h | 31 ---------------- include/asm-ppc/module.h | 44 ---------------------- include/asm-ppc/sembuf.h | 19 ---------- include/asm-ppc/shmbuf.h | 37 ------------------- include/asm-ppc/siginfo.h | 6 --- include/asm-ppc/socket.h | 58 ----------------------------- include/asm-ppc/sockios.h | 17 --------- include/asm-ppc64/bugs.h | 12 ------ include/asm-ppc64/mc146818rtc.h | 32 ---------------- include/asm-ppc64/module.h | 36 ------------------ include/asm-ppc64/sembuf.h | 27 -------------- include/asm-ppc64/shmbuf.h | 43 ---------------------- include/asm-ppc64/siginfo.h | 16 -------- include/asm-ppc64/socket.h | 59 ------------------------------ include/asm-ppc64/sockios.h | 19 ---------- 24 files changed, 322 insertions(+), 462 deletions(-) create mode 100644 include/asm-powerpc/bugs.h create mode 100644 include/asm-powerpc/mc146818rtc.h create mode 100644 include/asm-powerpc/module.h create mode 100644 include/asm-powerpc/sembuf.h create mode 100644 include/asm-powerpc/shmbuf.h create mode 100644 include/asm-powerpc/siginfo.h create mode 100644 include/asm-powerpc/socket.h create mode 100644 include/asm-powerpc/sockios.h delete mode 100644 include/asm-ppc/bugs.h delete mode 100644 include/asm-ppc/mc146818rtc.h delete mode 100644 include/asm-ppc/module.h delete mode 100644 include/asm-ppc/sembuf.h delete mode 100644 include/asm-ppc/shmbuf.h delete mode 100644 include/asm-ppc/siginfo.h delete mode 100644 include/asm-ppc/socket.h delete mode 100644 include/asm-ppc/sockios.h delete mode 100644 include/asm-ppc64/bugs.h delete mode 100644 include/asm-ppc64/mc146818rtc.h delete mode 100644 include/asm-ppc64/module.h delete mode 100644 include/asm-ppc64/sembuf.h delete mode 100644 include/asm-ppc64/shmbuf.h delete mode 100644 include/asm-ppc64/siginfo.h delete mode 100644 include/asm-ppc64/socket.h delete mode 100644 include/asm-ppc64/sockios.h (limited to 'include') diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h new file mode 100644 index 00000000000..310187d0e33 --- /dev/null +++ b/include/asm-powerpc/bugs.h @@ -0,0 +1,18 @@ +#ifndef _POWERPC_BUGS_H +#define _POWERPC_BUGS_H + +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* + * This file is included by 'init/main.c' to check for + * architecture-dependent bugs. + */ + +extern void check_bugs(void); + +#endif /* _POWERPC_BUGS_H */ diff --git a/include/asm-powerpc/mc146818rtc.h b/include/asm-powerpc/mc146818rtc.h new file mode 100644 index 00000000000..a5619a2a139 --- /dev/null +++ b/include/asm-powerpc/mc146818rtc.h @@ -0,0 +1,36 @@ +#ifndef _POWERPC_MC146818RTC_H +#define _POWERPC_MC146818RTC_H + +/* + * Machine dependent access functions for RTC registers. + * + * 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. + */ + +#ifdef __KERNEL__ + +#include + +#ifndef RTC_PORT +#define RTC_PORT(x) (0x70 + (x)) +#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ +#endif + +/* + * The yet supported machines all access the RTC index register via + * an ISA port access but the way to access the date register differs ... + */ +#define CMOS_READ(addr) ({ \ +outb_p((addr),RTC_PORT(0)); \ +inb_p(RTC_PORT(1)); \ +}) +#define CMOS_WRITE(val, addr) ({ \ +outb_p((addr),RTC_PORT(0)); \ +outb_p((val),RTC_PORT(1)); \ +}) + +#endif /* __KERNEL__ */ +#endif /* _POWERPC_MC146818RTC_H */ diff --git a/include/asm-powerpc/module.h b/include/asm-powerpc/module.h new file mode 100644 index 00000000000..4438f4fd652 --- /dev/null +++ b/include/asm-powerpc/module.h @@ -0,0 +1,77 @@ +#ifndef _POWERPC_MODULE_H +#define _POWERPC_MODULE_H + +/* + * 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. + */ + +#include +#include + + +#ifndef __powerpc64__ +/* + * Thanks to Paul M for explaining this. + * + * PPC can only do rel jumps += 32MB, and often the kernel and other + * modules are furthur away than this. So, we jump to a table of + * trampolines attached to the module (the Procedure Linkage Table) + * whenever that happens. + */ + +struct ppc_plt_entry { + /* 16 byte jump instruction sequence (4 instructions) */ + unsigned int jump[4]; +}; +#endif /* __powerpc64__ */ + + +struct mod_arch_specific { +#ifdef __powerpc64__ + unsigned int stubs_section; /* Index of stubs section in module */ + unsigned int toc_section; /* What section is the TOC? */ +#else + /* Indices of PLT sections within module. */ + unsigned int core_plt_section; + unsigned int init_plt_section; +#endif + + /* List of BUG addresses, source line numbers and filenames */ + struct list_head bug_list; + struct bug_entry *bug_table; + unsigned int num_bugs; +}; + +extern struct bug_entry *module_find_bug(unsigned long bugaddr); + +/* + * Select ELF headers. + * Make empty section for module_frob_arch_sections to expand. + */ + +#ifdef __powerpc64__ +# define Elf_Shdr Elf64_Shdr +# define Elf_Sym Elf64_Sym +# define Elf_Ehdr Elf64_Ehdr +# ifdef MODULE + asm(".section .stubs,\"ax\",@nobits; .align 3; .previous"); +# endif +#else +# define Elf_Shdr Elf32_Shdr +# define Elf_Sym Elf32_Sym +# define Elf_Ehdr Elf32_Ehdr +# ifdef MODULE + asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); + asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); +# endif /* MODULE */ +#endif + + +struct exception_table_entry; +void sort_ex_table(struct exception_table_entry *start, + struct exception_table_entry *finish); + +#endif /* _POWERPC_MODULE_H */ diff --git a/include/asm-powerpc/sembuf.h b/include/asm-powerpc/sembuf.h new file mode 100644 index 00000000000..c98fc18fe80 --- /dev/null +++ b/include/asm-powerpc/sembuf.h @@ -0,0 +1,36 @@ +#ifndef _POWERPC_SEMBUF_H +#define _POWERPC_SEMBUF_H + +/* + * 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. + */ + +/* + * The semid64_ds structure for PPC architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ +#ifndef __powerpc64__ + unsigned long __unused1; +#endif + __kernel_time_t sem_otime; /* last semop time */ +#ifndef __powerpc64__ + unsigned long __unused2; +#endif + __kernel_time_t sem_ctime; /* last change time */ + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long __unused3; + unsigned long __unused4; +}; + +#endif /* _POWERPC_SEMBUF_H */ diff --git a/include/asm-powerpc/shmbuf.h b/include/asm-powerpc/shmbuf.h new file mode 100644 index 00000000000..29632db3b17 --- /dev/null +++ b/include/asm-powerpc/shmbuf.h @@ -0,0 +1,59 @@ +#ifndef _POWERPC_SHMBUF_H +#define _POWERPC_SHMBUF_H + +/* + * 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. + */ + +/* + * The shmid64_ds structure for PPC architecture. + * + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ + +struct shmid64_ds { + struct ipc64_perm shm_perm; /* operation perms */ +#ifndef __power64__ + unsigned long __unused1; +#endif + __kernel_time_t shm_atime; /* last attach time */ +#ifndef __power64__ + unsigned long __unused2; +#endif + __kernel_time_t shm_dtime; /* last detach time */ +#ifndef __power64__ + unsigned long __unused3; +#endif + __kernel_time_t shm_ctime; /* last change time */ +#ifndef __power64__ + unsigned long __unused4; +#endif + size_t shm_segsz; /* size of segment (bytes) */ + __kernel_pid_t shm_cpid; /* pid of creator */ + __kernel_pid_t shm_lpid; /* pid of last operator */ + unsigned long shm_nattch; /* no. of current attaches */ + unsigned long __unused5; + unsigned long __unused6; +}; + +struct shminfo64 { + unsigned long shmmax; + unsigned long shmmin; + unsigned long shmmni; + unsigned long shmseg; + unsigned long shmall; + unsigned long __unused1; + unsigned long __unused2; + unsigned long __unused3; + unsigned long __unused4; +}; + +#endif /* _POWERPC_SHMBUF_H */ diff --git a/include/asm-powerpc/siginfo.h b/include/asm-powerpc/siginfo.h new file mode 100644 index 00000000000..ae70b8010b1 --- /dev/null +++ b/include/asm-powerpc/siginfo.h @@ -0,0 +1,18 @@ +#ifndef _POWERPC_SIGINFO_H +#define _POWERPC_SIGINFO_H + +/* + * 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. + */ + +#ifdef __powerpc64__ +# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +# define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) +#endif + +#include + +#endif /* _POWERPC_SIGINFO_H */ diff --git a/include/asm-powerpc/socket.h b/include/asm-powerpc/socket.h new file mode 100644 index 00000000000..51a0cf5ee9f --- /dev/null +++ b/include/asm-powerpc/socket.h @@ -0,0 +1,59 @@ +#ifndef _POWERPC_SOCKET_H +#define _POWERPC_SOCKET_H + +/* + * 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. + */ + +#include + +/* For setsockopt(2) */ +#define SOL_SOCKET 1 + +#define SO_DEBUG 1 +#define SO_REUSEADDR 2 +#define SO_TYPE 3 +#define SO_ERROR 4 +#define SO_DONTROUTE 5 +#define SO_BROADCAST 6 +#define SO_SNDBUF 7 +#define SO_RCVBUF 8 +#define SO_SNDBUFFORCE 32 +#define SO_RCVBUFFORCE 33 +#define SO_KEEPALIVE 9 +#define SO_OOBINLINE 10 +#define SO_NO_CHECK 11 +#define SO_PRIORITY 12 +#define SO_LINGER 13 +#define SO_BSDCOMPAT 14 +/* To add :#define SO_REUSEPORT 15 */ +#define SO_RCVLOWAT 16 +#define SO_SNDLOWAT 17 +#define SO_RCVTIMEO 18 +#define SO_SNDTIMEO 19 +#define SO_PASSCRED 20 +#define SO_PEERCRED 21 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define SO_SECURITY_AUTHENTICATION 22 +#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define SO_ATTACH_FILTER 26 +#define SO_DETACH_FILTER 27 + +#define SO_PEERNAME 28 +#define SO_TIMESTAMP 29 +#define SCM_TIMESTAMP SO_TIMESTAMP + +#define SO_ACCEPTCONN 30 + +#define SO_PEERSEC 31 + +#endif /* _POWERPC_SOCKET_H */ diff --git a/include/asm-powerpc/sockios.h b/include/asm-powerpc/sockios.h new file mode 100644 index 00000000000..ef7ff664167 --- /dev/null +++ b/include/asm-powerpc/sockios.h @@ -0,0 +1,19 @@ +#ifndef _POWERPC_SOCKIOS_H +#define _POWERPC_SOCKIOS_H + +/* + * 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. + */ + +/* Socket-level I/O control calls. */ +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 /* Get stamp */ + +#endif /* _POWERPC_SOCKIOS_H */ diff --git a/include/asm-ppc/bugs.h b/include/asm-ppc/bugs.h deleted file mode 100644 index 8dce1e290fd..00000000000 --- a/include/asm-ppc/bugs.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * This file is included by 'init/main.c' - */ - -extern void -check_bugs(void); diff --git a/include/asm-ppc/mc146818rtc.h b/include/asm-ppc/mc146818rtc.h deleted file mode 100644 index 227018b2fef..00000000000 --- a/include/asm-ppc/mc146818rtc.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Machine dependent access functions for RTC registers. - */ -#ifdef __KERNEL__ -#ifndef __ASM_PPC_MC146818RTC_H -#define __ASM_PPC_MC146818RTC_H - -#include - -#ifndef RTC_PORT -#define RTC_PORT(x) (0x70 + (x)) -#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ -#endif - -/* - * The yet supported machines all access the RTC index register via - * an ISA port access but the way to access the date register differs ... - */ -#define CMOS_READ(addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -inb_p(RTC_PORT(1)); \ -}) -#define CMOS_WRITE(val, addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -outb_p((val),RTC_PORT(1)); \ -}) - -#define RTC_IRQ 8 - -#endif /* __ASM_PPC_MC146818RTC_H */ -#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/module.h b/include/asm-ppc/module.h deleted file mode 100644 index fb63492562b..00000000000 --- a/include/asm-ppc/module.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _ASM_PPC_MODULE_H -#define _ASM_PPC_MODULE_H -/* Module stuff for PPC. (C) 2001 Rusty Russell */ - -#include -#include - -/* Thanks to Paul M for explaining this. - - PPC can only do rel jumps += 32MB, and often the kernel and other - modules are furthur away than this. So, we jump to a table of - trampolines attached to the module (the Procedure Linkage Table) - whenever that happens. -*/ - -struct ppc_plt_entry -{ - /* 16 byte jump instruction sequence (4 instructions) */ - unsigned int jump[4]; -}; - -struct mod_arch_specific -{ - /* Indices of PLT sections within module. */ - unsigned int core_plt_section, init_plt_section; - - /* List of BUG addresses, source line numbers and filenames */ - struct list_head bug_list; - struct bug_entry *bug_table; - unsigned int num_bugs; -}; - -extern struct bug_entry *module_find_bug(unsigned long bugaddr); - -#define Elf_Shdr Elf32_Shdr -#define Elf_Sym Elf32_Sym -#define Elf_Ehdr Elf32_Ehdr - -/* Make empty sections for module_frob_arch_sections to expand. */ -#ifdef MODULE -asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); -asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); -#endif -#endif /* _ASM_PPC_MODULE_H */ diff --git a/include/asm-ppc/sembuf.h b/include/asm-ppc/sembuf.h deleted file mode 100644 index 883f682f85b..00000000000 --- a/include/asm-ppc/sembuf.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _PPC_SEMBUF_H -#define _PPC_SEMBUF_H - -/* - * The semid64_ds structure for PPC architecture. - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - unsigned int __unused1; - __kernel_time_t sem_otime; /* last semop time */ - unsigned int __unused2; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _PPC_SEMBUF_H */ diff --git a/include/asm-ppc/shmbuf.h b/include/asm-ppc/shmbuf.h deleted file mode 100644 index 7ac0bd38cbd..00000000000 --- a/include/asm-ppc/shmbuf.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _PPC_SHMBUF_H -#define _PPC_SHMBUF_H - -/* - * The shmid64_ds structure for PPC architecture. - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - unsigned int __unused1; - __kernel_time_t shm_atime; /* last attach time */ - unsigned int __unused2; - __kernel_time_t shm_dtime; /* last detach time */ - unsigned int __unused3; - __kernel_time_t shm_ctime; /* last change time */ - unsigned int __unused4; - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused5; - unsigned long __unused6; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _PPC_SHMBUF_H */ diff --git a/include/asm-ppc/siginfo.h b/include/asm-ppc/siginfo.h deleted file mode 100644 index 4b9435bb904..00000000000 --- a/include/asm-ppc/siginfo.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _PPC_SIGINFO_H -#define _PPC_SIGINFO_H - -#include - -#endif diff --git a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h deleted file mode 100644 index 296e1a3469d..00000000000 --- a/include/asm-ppc/socket.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _ASM_SOCKET_H -#define _ASM_SOCKET_H - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp */ - -/* For setsockopt(2) */ -#define SOL_SOCKET 1 - -#define SO_DEBUG 1 -#define SO_REUSEADDR 2 -#define SO_TYPE 3 -#define SO_ERROR 4 -#define SO_DONTROUTE 5 -#define SO_BROADCAST 6 -#define SO_SNDBUF 7 -#define SO_RCVBUF 8 -#define SO_SNDBUFFORCE 32 -#define SO_RCVBUFFORCE 33 -#define SO_KEEPALIVE 9 -#define SO_OOBINLINE 10 -#define SO_NO_CHECK 11 -#define SO_PRIORITY 12 -#define SO_LINGER 13 -#define SO_BSDCOMPAT 14 -/* To add :#define SO_REUSEPORT 15 */ -#define SO_RCVLOWAT 16 -#define SO_SNDLOWAT 17 -#define SO_RCVTIMEO 18 -#define SO_SNDTIMEO 19 -#define SO_PASSCRED 20 -#define SO_PEERCRED 21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION 22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define SO_SECURITY_ENCRYPTION_NETWORK 24 - -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER 26 -#define SO_DETACH_FILTER 27 - -#define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 -#define SCM_TIMESTAMP SO_TIMESTAMP - -#define SO_ACCEPTCONN 30 - -#define SO_PEERSEC 31 - -#endif /* _ASM_SOCKET_H */ diff --git a/include/asm-ppc/sockios.h b/include/asm-ppc/sockios.h deleted file mode 100644 index 385aedc55ce..00000000000 --- a/include/asm-ppc/sockios.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _ASM_PPC_SOCKIOS_H -#define _ASM_PPC_SOCKIOS_H - -#if 0 /* These are defined this way on Alpha - maybe later. */ -/* Socket-level I/O control calls. */ - -#define FIOGETOWN _IOR('f', 123, int) -#define FIOSETOWN _IOW('f', 124, int) - -#define SIOCATMARK _IOR('s', 7, int) -#define SIOCSPGRP _IOW('s', 8, pid_t) -#define SIOCGPGRP _IOR('s', 9, pid_t) - -#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */ -#endif - -#endif /* _ASM_PPC_SOCKIOS_H */ diff --git a/include/asm-ppc64/bugs.h b/include/asm-ppc64/bugs.h deleted file mode 100644 index 861074b3cf7..00000000000 --- a/include/asm-ppc64/bugs.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * This file is included by 'init/main.c' to check for architecture-dependent - * bugs. - * - */ -#ifndef _ASM_PPC64_BUGS_H -#define _ASM_PPC64_BUGS_H - -static void check_bugs(void) { -} - -#endif /* _ASM_PPC64_BUGS_H */ diff --git a/include/asm-ppc64/mc146818rtc.h b/include/asm-ppc64/mc146818rtc.h deleted file mode 100644 index f713e1bbb53..00000000000 --- a/include/asm-ppc64/mc146818rtc.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Machine dependent access functions for RTC registers. - * - * 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 __ASM_PPC64_MC146818RTC_H -#define __ASM_PPC64_MC146818RTC_H - -#include - -#ifndef RTC_PORT -#define RTC_PORT(x) (0x70 + (x)) -#define RTC_ALWAYS_BCD 1 /* RTC operates in binary mode */ -#endif - -/* - * The yet supported machines all access the RTC index register via - * an ISA port access but the way to access the date register differs ... - */ -#define CMOS_READ(addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -inb_p(RTC_PORT(1)); \ -}) -#define CMOS_WRITE(val, addr) ({ \ -outb_p((addr),RTC_PORT(0)); \ -outb_p((val),RTC_PORT(1)); \ -}) - -#endif /* __ASM_PPC64_MC146818RTC_H */ diff --git a/include/asm-ppc64/module.h b/include/asm-ppc64/module.h deleted file mode 100644 index 0581607826e..00000000000 --- a/include/asm-ppc64/module.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _ASM_PPC64_MODULE_H -#define _ASM_PPC64_MODULE_H - -#include -#include - -struct mod_arch_specific -{ - /* Index of stubs section within module. */ - unsigned int stubs_section; - - /* What section is the TOC? */ - unsigned int toc_section; - - /* List of BUG addresses, source line numbers and filenames */ - struct list_head bug_list; - struct bug_entry *bug_table; - unsigned int num_bugs; -}; - -extern struct bug_entry *module_find_bug(unsigned long bugaddr); - -#define Elf_Shdr Elf64_Shdr -#define Elf_Sym Elf64_Sym -#define Elf_Ehdr Elf64_Ehdr - -/* Make empty section for module_frob_arch_sections to expand. */ -#ifdef MODULE -asm(".section .stubs,\"ax\",@nobits; .align 3; .previous"); -#endif - -struct exception_table_entry; -void sort_ex_table(struct exception_table_entry *start, - struct exception_table_entry *finish); - -#endif /* _ASM_PPC64_MODULE_H */ diff --git a/include/asm-ppc64/sembuf.h b/include/asm-ppc64/sembuf.h deleted file mode 100644 index 172e5900076..00000000000 --- a/include/asm-ppc64/sembuf.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _PPC64_SEMBUF_H -#define _PPC64_SEMBUF_H - -/* - * The semid64_ds structure for PPC architecture. - * - * - * 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. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - __kernel_time_t sem_ctime; /* last change time */ - unsigned long sem_nsems; /* no. of semaphores in array */ - - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _PPC64_SEMBUF_H */ diff --git a/include/asm-ppc64/shmbuf.h b/include/asm-ppc64/shmbuf.h deleted file mode 100644 index 02e99d6ec92..00000000000 --- a/include/asm-ppc64/shmbuf.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _PPC64_SHMBUF_H -#define _PPC64_SHMBUF_H - -/* - * The shmid64_ds structure for PPC64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 2 miscellaneous 64-bit values - * - * 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. - */ - -struct shmid64_ds { - struct ipc64_perm shm_perm; /* operation perms */ - __kernel_time_t shm_atime; /* last attach time */ - __kernel_time_t shm_dtime; /* last detach time */ - __kernel_time_t shm_ctime; /* last change time */ - size_t shm_segsz; /* size of segment (bytes) */ - __kernel_pid_t shm_cpid; /* pid of creator */ - __kernel_pid_t shm_lpid; /* pid of last operator */ - unsigned long shm_nattch; /* no. of current attaches */ - unsigned long __unused1; - unsigned long __unused2; -}; - -struct shminfo64 { - unsigned long shmmax; - unsigned long shmmin; - unsigned long shmmni; - unsigned long shmseg; - unsigned long shmall; - unsigned long __unused1; - unsigned long __unused2; - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _PPC64_SHMBUF_H */ diff --git a/include/asm-ppc64/siginfo.h b/include/asm-ppc64/siginfo.h deleted file mode 100644 index 3a7c23dcb5a..00000000000 --- a/include/asm-ppc64/siginfo.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _PPC64_SIGINFO_H -#define _PPC64_SIGINFO_H - -/* - * 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. - */ - -#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) -#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) - -#include - -#endif /* _PPC64_SIGINFO_H */ diff --git a/include/asm-ppc64/socket.h b/include/asm-ppc64/socket.h deleted file mode 100644 index 9e1af8eb2d9..00000000000 --- a/include/asm-ppc64/socket.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _ASM_SOCKET_H -#define _ASM_SOCKET_H - -/* - * 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. - */ - -#include - -/* For setsockoptions(2) */ -#define SOL_SOCKET 1 - -#define SO_DEBUG 1 -#define SO_REUSEADDR 2 -#define SO_TYPE 3 -#define SO_ERROR 4 -#define SO_DONTROUTE 5 -#define SO_BROADCAST 6 -#define SO_SNDBUF 7 -#define SO_RCVBUF 8 -#define SO_SNDBUFFORCE 32 -#define SO_RCVBUFFORCE 33 -#define SO_KEEPALIVE 9 -#define SO_OOBINLINE 10 -#define SO_NO_CHECK 11 -#define SO_PRIORITY 12 -#define SO_LINGER 13 -#define SO_BSDCOMPAT 14 -/* To add :#define SO_REUSEPORT 15 */ -#define SO_RCVLOWAT 16 -#define SO_SNDLOWAT 17 -#define SO_RCVTIMEO 18 -#define SO_SNDTIMEO 19 -#define SO_PASSCRED 20 -#define SO_PEERCRED 21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION 22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define SO_SECURITY_ENCRYPTION_NETWORK 24 - -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER 26 -#define SO_DETACH_FILTER 27 - -#define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 -#define SCM_TIMESTAMP SO_TIMESTAMP - -#define SO_ACCEPTCONN 30 - -#define SO_PEERSEC 31 - -#endif /* _ASM_SOCKET_H */ diff --git a/include/asm-ppc64/sockios.h b/include/asm-ppc64/sockios.h deleted file mode 100644 index 6bd1a22af4f..00000000000 --- a/include/asm-ppc64/sockios.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _ASM_PPC64_SOCKIOS_H -#define _ASM_PPC64_SOCKIOS_H - -/* - * 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. - */ - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp */ - -#endif /* _ASM_PPC64_SOCKIOS_H */ -- cgit v1.2.3 From fd5b4377eacac42293b1a349dbb0f9892bf7f74a Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 14:47:49 +1000 Subject: [PATCH] ppc64: add number of PMCs to cputable Add a field in the cputable struct to store the number of PMCs. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/cputable.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h index ae6cf383010..0c8affc657f 100644 --- a/include/asm-ppc64/cputable.h +++ b/include/asm-ppc64/cputable.h @@ -52,6 +52,9 @@ struct cpu_spec { unsigned int icache_bsize; unsigned int dcache_bsize; + /* number of performance monitor counters */ + unsigned int num_pmcs; + /* this is called to initialize various CPU bits like L1 cache, * BHT, SPD, etc... from head.S before branching to identify_machine */ -- cgit v1.2.3 From 8530935d384bef1467ba76e1f4382f0f8b3c899d Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 14:50:48 +1000 Subject: [PATCH] ppc64: remove CPU_FTR_PMC8 Remove the CPU_FTR_PMC8 feature now we encode the number of PMCs directly. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/cputable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h index 0c8affc657f..80b907727a7 100644 --- a/include/asm-ppc64/cputable.h +++ b/include/asm-ppc64/cputable.h @@ -98,7 +98,7 @@ static inline unsigned long cpu_has_feature(unsigned long feature) #define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) #define CPU_FTR_IABR ASM_CONST(0x0000002000000000) #define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) -#define CPU_FTR_PMC8 ASM_CONST(0x0000008000000000) +/* unused ASM_CONST(0x0000008000000000) */ #define CPU_FTR_SMT ASM_CONST(0x0000010000000000) #define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) #define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) -- cgit v1.2.3 From 1a410d883023da70806a0190c4bde104545cb9c6 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 14:53:57 +1000 Subject: [PATCH] ppc64: Add oprofile cpu_type to cpu feature struct Add oprofile cpu_type to cpu feature struct. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/cputable.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h index 80b907727a7..445727ae2ba 100644 --- a/include/asm-ppc64/cputable.h +++ b/include/asm-ppc64/cputable.h @@ -59,6 +59,9 @@ struct cpu_spec { * BHT, SPD, etc... from head.S before branching to identify_machine */ cpu_setup_t cpu_setup; + + /* Used by oprofile userspace to select the right counters */ + char *oprofile_cpu_type; }; extern struct cpu_spec cpu_specs[]; -- cgit v1.2.3 From dca859329cee9b4cf02c8b7cb805b49973292ed2 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 14:55:35 +1000 Subject: [PATCH] ppc64: Move oprofile_impl.h into include/asm-ppc64 Move oprofile_impl.h into include/asm-ppc64 in preparation for moving oprofile_model into cpu feature struct. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/oprofile_impl.h | 111 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 include/asm-ppc64/oprofile_impl.h (limited to 'include') diff --git a/include/asm-ppc64/oprofile_impl.h b/include/asm-ppc64/oprofile_impl.h new file mode 100644 index 00000000000..b04f1dfb142 --- /dev/null +++ b/include/asm-ppc64/oprofile_impl.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2004 Anton Blanchard , IBM + * + * Based on alpha version. + * + * 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 OP_IMPL_H +#define OP_IMPL_H 1 + +#define OP_MAX_COUNTER 8 + +/* Per-counter configuration as set via oprofilefs. */ +struct op_counter_config { + unsigned long valid; + unsigned long enabled; + unsigned long event; + unsigned long count; + unsigned long kernel; + /* We dont support per counter user/kernel selection */ + unsigned long user; + unsigned long unit_mask; +}; + +/* System-wide configuration as set via oprofilefs. */ +struct op_system_config { + unsigned long mmcr0; + unsigned long mmcr1; + unsigned long mmcra; + unsigned long enable_kernel; + unsigned long enable_user; + unsigned long backtrace_spinlocks; +}; + +/* Per-arch configuration */ +struct op_ppc64_model { + void (*reg_setup) (struct op_counter_config *, + struct op_system_config *, + int num_counters); + void (*cpu_setup) (void *); + void (*start) (struct op_counter_config *); + void (*stop) (void); + void (*handle_interrupt) (struct pt_regs *, + struct op_counter_config *); + int num_counters; +}; + +extern struct op_ppc64_model op_model_rs64; +extern struct op_ppc64_model op_model_power4; + +static inline unsigned int ctr_read(unsigned int i) +{ + switch(i) { + case 0: + return mfspr(SPRN_PMC1); + case 1: + return mfspr(SPRN_PMC2); + case 2: + return mfspr(SPRN_PMC3); + case 3: + return mfspr(SPRN_PMC4); + case 4: + return mfspr(SPRN_PMC5); + case 5: + return mfspr(SPRN_PMC6); + case 6: + return mfspr(SPRN_PMC7); + case 7: + return mfspr(SPRN_PMC8); + default: + return 0; + } +} + +static inline void ctr_write(unsigned int i, unsigned int val) +{ + switch(i) { + case 0: + mtspr(SPRN_PMC1, val); + break; + case 1: + mtspr(SPRN_PMC2, val); + break; + case 2: + mtspr(SPRN_PMC3, val); + break; + case 3: + mtspr(SPRN_PMC4, val); + break; + case 4: + mtspr(SPRN_PMC5, val); + break; + case 5: + mtspr(SPRN_PMC6, val); + break; + case 6: + mtspr(SPRN_PMC7, val); + break; + case 7: + mtspr(SPRN_PMC8, val); + break; + default: + break; + } +} + +#endif -- cgit v1.2.3 From 8fef0306f9164d4bfd0befb62e63e4d1167681b5 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 6 Sep 2005 14:57:52 +1000 Subject: [PATCH] ppc64: Move oprofile_model into cpu feature struct Move oprofile_model into cpu feature struct. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- include/asm-ppc64/cputable.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h index 445727ae2ba..acc9b4d6c16 100644 --- a/include/asm-ppc64/cputable.h +++ b/include/asm-ppc64/cputable.h @@ -36,6 +36,7 @@ * via the mkdefs mechanism. */ struct cpu_spec; +struct op_ppc64_model; typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec); @@ -62,6 +63,9 @@ struct cpu_spec { /* Used by oprofile userspace to select the right counters */ char *oprofile_cpu_type; + + /* Processor specific oprofile operations */ + struct op_ppc64_model *oprofile_model; }; extern struct cpu_spec cpu_specs[]; -- cgit v1.2.3 From 14b34661615ec036ab4c91637913706e4caccc93 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 6 Sep 2005 14:59:47 +1000 Subject: [PATCH] Invert sense of SLB class bit Currently, we set the class bit in kernel SLB entries, and clear it on user SLB entries. On POWER5, ERAT entries created in real mode have the class bit clear. So to avoid flushing kernel ERAT entries on each context switch, this patch inverts our usage of the class bit, setting it on user SLB entries and clearing it on kernel SLB entries. Booted on POWER5 and G5. Signed-off-by: David Gibson Signed-off-by: Paul Mackerras --- include/asm-ppc64/mmu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h index ad36bb28de2..7bc42eb087a 100644 --- a/include/asm-ppc64/mmu.h +++ b/include/asm-ppc64/mmu.h @@ -54,8 +54,10 @@ extern char initial_stab[]; #define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */ #define SLB_VSID_LS ASM_CONST(0x0000000000000070) /* size of largepage */ -#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C) -#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS) +#define SLB_VSID_KERNEL (SLB_VSID_KP) +#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS|SLB_VSID_C) + +#define SLBIE_C (0x08000000) /* * Hash table -- cgit v1.2.3 From 93c37f292110a37dd77e4cc0aaf1c341d79bf6aa Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 6 Sep 2005 13:57:08 -0700 Subject: [SERIAL]: Avoid 'statement with no effect' warnings. When SUPPORT_SYSRQ is false, gcc can emit warnings for the uart_handle_sysrq_char() that results. Using an empty inline returning zero kills the warning. Signed-off-by: David S. Miller --- include/linux/serial_core.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index cf0f64ea2bc..9b12fe73161 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -385,11 +385,11 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); /* * The following are helper functions for the low level drivers. */ -#ifdef SUPPORT_SYSRQ static inline int uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, struct pt_regs *regs) { +#ifdef SUPPORT_SYSRQ if (port->sysrq) { if (ch && time_before(jiffies, port->sysrq)) { handle_sysrq(ch, regs, NULL); @@ -398,11 +398,9 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, } port->sysrq = 0; } +#endif return 0; } -#else -#define uart_handle_sysrq_char(port,ch,regs) (0) -#endif /* * We do the SysRQ and SAK checking like this... -- cgit v1.2.3 From 2248bcfcd8fb622ec88b8587d0c1f139635ffd2e Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 6 Sep 2005 15:06:42 -0700 Subject: [NETFILTER]: Add support for permanent expectations A permanent expectation exists until timeing out and can expect multiple related connections. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_ipv4/ip_conntrack.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 088742befe4..7e033e9271a 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h @@ -263,6 +263,9 @@ struct ip_conntrack_expect /* Unique ID */ unsigned int id; + /* Flags */ + unsigned int flags; + #ifdef CONFIG_IP_NF_NAT_NEEDED /* This is the original per-proto part, used to map the * expected connection the way the recipient expects. */ @@ -272,6 +275,8 @@ struct ip_conntrack_expect #endif }; +#define IP_CT_EXPECT_PERMANENT 0x1 + static inline struct ip_conntrack * tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) { -- cgit v1.2.3 From 03486a4f838c55481317fca5ac2e7d12550a4fb7 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 6 Sep 2005 15:09:43 -0700 Subject: [NETFILTER]: Handle NAT module load race When the NAT module is loaded when connections are already confirmed it must not change their tuples anymore. This is especially important with CONFIG_NETFILTER_DEBUG, the netfilter listhelp functions will refuse to remove an entry from a list when it can not be found on the list, so when a changed tuple hashes to a new bucket the entry is kept in the list until and after the conntrack is freed. Allocate the exact conntrack tuple for NAT for already confirmed connections or drop them if that fails. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_ipv4/ip_nat_rule.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/netfilter_ipv4/ip_nat_rule.h b/include/linux/netfilter_ipv4/ip_nat_rule.h index fecd2a06dcd..73b9552e6a8 100644 --- a/include/linux/netfilter_ipv4/ip_nat_rule.h +++ b/include/linux/netfilter_ipv4/ip_nat_rule.h @@ -19,5 +19,10 @@ extern unsigned int alloc_null_binding(struct ip_conntrack *conntrack, struct ip_nat_info *info, unsigned int hooknum); + +extern unsigned int +alloc_null_binding_confirmed(struct ip_conntrack *conntrack, + struct ip_nat_info *info, + unsigned int hooknum); #endif #endif /* _IP_NAT_RULE_H */ -- cgit v1.2.3 From 49719eb355d32fa07793017b4b46b1c02e88b275 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 6 Sep 2005 15:10:46 -0700 Subject: [NETFILTER]: kill __ip_ct_expect_unlink_destroy The following patch kills __ip_ct_expect_unlink_destroy and export unlink_expect as ip_ct_unlink_expect. As it was discussed [1], the function __ip_ct_expect_unlink_destroy is a bit confusing so better do the following sequence: ip_ct_destroy_expect and ip_conntrack_expect_put. [1] https://lists.netfilter.org/pipermail/netfilter-devel/2005-August/020794.html Signed-off-by: Pablo Neira Ayuso Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_ipv4/ip_conntrack_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index dc4d2a0575d..907d4f5ca5d 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h @@ -52,7 +52,7 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb) return ret; } -extern void __ip_ct_expect_unlink_destroy(struct ip_conntrack_expect *exp); +extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp); extern struct list_head *ip_conntrack_hash; extern struct list_head ip_conntrack_expect_list; -- cgit v1.2.3 From c5478def7a3a2dba9ceda452c2aa3539514d30a9 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 6 Sep 2005 14:04:26 +0200 Subject: [SCSI] switch EH thread startup to the kthread API Signed-off-by: James Bottomley --- include/scsi/scsi_host.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index ac1b6125e3a..916144be208 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -467,12 +467,10 @@ struct Scsi_Host { struct task_struct * ehandler; /* Error recovery thread. */ struct semaphore * eh_wait; /* The error recovery thread waits on this. */ - struct completion * eh_notify; /* wait for eh to begin or end */ struct semaphore * eh_action; /* Wait for specific actions on the host. */ unsigned int eh_active:1; /* Indicates the eh thread is awake and active if this is true. */ - unsigned int eh_kill:1; /* set when killing the eh thread */ wait_queue_head_t host_wait; struct scsi_host_template *hostt; struct scsi_transport_template *transportt; -- cgit v1.2.3 From fe1b2d544d71300f8e2d151c3c77a130d13a58be Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 6 Sep 2005 14:15:37 +0200 Subject: [SCSI] unexport scsi_add_timer/scsi_delete_timer Signed-off-by: James Bottomley --- include/scsi/scsi_eh.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h index 80557f879e3..4b71095be68 100644 --- a/include/scsi/scsi_eh.h +++ b/include/scsi/scsi_eh.h @@ -27,9 +27,6 @@ struct scsi_sense_hdr { /* See SPC-3 section 4.5 */ }; -extern void scsi_add_timer(struct scsi_cmnd *, int, - void (*)(struct scsi_cmnd *)); -extern int scsi_delete_timer(struct scsi_cmnd *); extern void scsi_report_bus_reset(struct Scsi_Host *, int); extern void scsi_report_device_reset(struct Scsi_Host *, int, int); extern int scsi_block_when_processing_errors(struct scsi_device *); -- cgit v1.2.3 From f2c383988d68c91a7d474b7cf26c0a2df49bbafe Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 6 Sep 2005 15:48:03 -0700 Subject: [NET]: skb_get/set_timestamp use const The new timestamp get/set routines should have const attribute on parameters (helps to indicate direction). Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- include/linux/skbuff.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 42edce6abe2..da7da9c0ed1 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1251,7 +1251,7 @@ extern void skb_add_mtu(int mtu); * This function converts the offset back to a struct timeval and stores * it in stamp. */ -static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp) +static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) { stamp->tv_sec = skb->tstamp.off_sec; stamp->tv_usec = skb->tstamp.off_usec; @@ -1270,7 +1270,7 @@ static inline void skb_get_timestamp(struct sk_buff *skb, struct timeval *stamp) * This function converts a struct timeval to an offset and stores * it in the skb. */ -static inline void skb_set_timestamp(struct sk_buff *skb, struct timeval *stamp) +static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) { skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; -- cgit v1.2.3 From f75268cd6cbd24e6c70ff1390f4de5d0bb618539 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 6 Sep 2005 15:49:39 -0700 Subject: [AX25]: Make ax2asc thread-proof Ax2asc was still using a static buffer for all invocations which isn't exactly SMP-safe. Change ax2asc to take an additional result buffer as the argument. Change all callers to provide such a buffer. Signed-off-by: Ralf Baechle DL5RB Signed-off-by: David S. Miller --- include/net/ax25.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/ax25.h b/include/net/ax25.h index 926eed54302..364b046e9f4 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -257,7 +257,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); /* ax25_addr.c */ extern ax25_address null_ax25_address; -extern char *ax2asc(ax25_address *); +extern char *ax2asc(char *buf, ax25_address *); extern ax25_address *asc2ax(char *); extern int ax25cmp(ax25_address *, ax25_address *); extern int ax25digicmp(ax25_digi *, ax25_digi *); -- cgit v1.2.3 From aaec0fab5f8809fe1509fdc204e769bb35ebe41a Mon Sep 17 00:00:00 2001 From: Jens Osterkamp Date: Mon, 5 Sep 2005 15:19:29 -0700 Subject: [PATCH] net: add driver for the NIC on Cell Blades This patch adds a driver for a new 1000 Mbit ethernet NIC. It is integrated on the south bridge that is used for our Cell Blades. The code gets the MAC address from the Open Firmware device tree, so it won't compile on platforms other than ppc64. This is the first public release, so I don't expect the first version to get merged, but I'd aim for integration within the 2.6.13 time frame. Cc: Utz Bacher Signed-off-by: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- include/linux/pci_ids.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 95c941f8c74..ee0ab7a5f91 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1612,6 +1612,7 @@ #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 +#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 #define PCI_VENDOR_ID_RICOH 0x1180 #define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 -- cgit v1.2.3 From 6582c164f2b3b6e58d1f13c1c031b19ee691eb14 Mon Sep 17 00:00:00 2001 From: Jean Tourrilhes Date: Fri, 2 Sep 2005 11:32:28 -0700 Subject: [PATCH] WE-19 for kernel 2.6.13 Hi Jeff, This is version 19 of the Wireless Extensions. It was supposed to be the fallback of the WPA API changes, but people seem quite happy about it (especially Jouni), so the patch is rather small. The patch has been fully tested with 2.6.13 and various wireless drivers, and is in its final version. Would you mind pushing that into Linus's kernel so that the driver and the apps can take advantage ot it ? It includes : o iwstat improvement (explicit dBm). This is the result of long discussions with Dan Williams, the authors of NetworkManager. Thanks to him for all the fruitful feedback. o remove pointer from event stream. I was not totally sure if this pointer was 32-64 bits clean, so I'd rather remove it and be at peace with it. o remove linux header from wireless.h. This has long been requested by people writting user space apps, now it's done, and it was not even painful. o final deprecation of spy_offset. You did not like it, it's now gone for good. o Start deprecating dev->get_wireless_stats -> debloat netdev o Add "check" version of event macros for ieee802.11 stack. Jiri Benc doesn't like the current macros, we aim to please ;-) All those changes, except the last one, have been bit-roting on my web pages for a while... Patches for most kernel drivers will follow. Patches for the Orinoco and the HostAP drivers have been sent to their respective maintainers. Have fun... Jean Signed-off-by: Jeff Garzik --- include/linux/wireless.h | 47 ++++++++++++------ include/net/iw_handler.h | 123 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 141 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/include/linux/wireless.h b/include/linux/wireless.h index ae485f9c916..dab5afdaf71 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h @@ -1,7 +1,7 @@ /* * This file define a set of standard wireless extensions * - * Version : 18 12.3.05 + * Version : 19 18.3.05 * * Authors : Jean Tourrilhes - HPL - * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. @@ -69,11 +69,12 @@ /***************************** INCLUDES *****************************/ -/* To minimise problems in user space, I might remove those headers - * at some point. Jean II */ -#include /* for "caddr_t" et al */ -#include /* for "struct sockaddr" et al */ -#include /* for IFNAMSIZ and co... */ +/* Do not put any header in this file, this creates a mess when + * exported to user space. Most users have included all the + * relevant headers anyway... Jean II */ +/*#include */ /* for "caddr_t" et al */ +/*#include */ /* for "struct sockaddr" et al */ +/*#include */ /* for IFNAMSIZ and co... */ /***************************** VERSION *****************************/ /* @@ -82,7 +83,7 @@ * (there is some stuff that will be added in the future...) * I just plan to increment with each new version. */ -#define WIRELESS_EXT 18 +#define WIRELESS_EXT 19 /* * Changes : @@ -197,6 +198,15 @@ * related parameters (extensible up to 4096 parameter values) * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND + * + * V18 to V19 + * ---------- + * - Remove (struct iw_point *)->pointer from events and streams + * - Remove header includes to help user space + * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64 + * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros + * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM + * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros */ /**************************** CONSTANTS ****************************/ @@ -322,6 +332,7 @@ /* The first and the last (range) */ #define SIOCIWFIRST 0x8B00 #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ +#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) /* Even : get (world access), odd : set (root access) */ #define IW_IS_SET(cmd) (!((cmd) & 0x1)) @@ -366,6 +377,7 @@ * (struct iw_pmkid_cand) */ #define IWEVFIRST 0x8C00 +#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) /* ------------------------- PRIVATE INFO ------------------------- */ /* @@ -427,12 +439,15 @@ #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ /* Statistics flags (bitmask in updated) */ -#define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ -#define IW_QUAL_LEVEL_UPDATED 0x2 -#define IW_QUAL_NOISE_UPDATED 0x4 +#define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ +#define IW_QUAL_LEVEL_UPDATED 0x02 +#define IW_QUAL_NOISE_UPDATED 0x04 +#define IW_QUAL_ALL_UPDATED 0x07 +#define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */ #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ #define IW_QUAL_LEVEL_INVALID 0x20 #define IW_QUAL_NOISE_INVALID 0x40 +#define IW_QUAL_ALL_INVALID 0x70 /* Frequency flags */ #define IW_FREQ_AUTO 0x00 /* Let the driver decides */ @@ -443,7 +458,7 @@ #define IW_MAX_ENCODING_SIZES 8 /* Maximum size of the encoding token in bytes */ -#define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */ +#define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */ /* Flags for encoding (along with the token) */ #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ @@ -1039,12 +1054,16 @@ struct iw_event #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) -#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point)) #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) -/* Note : in the case of iw_point, the extra data will come at the - * end of the event */ +/* iw_point events are special. First, the payload (extra data) come at + * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second, + * we omit the pointer, so start at an offset. */ +#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \ + (char *) NULL) +#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ + IW_EV_POINT_OFF) #endif /* _LINUX_WIRELESS_H */ diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 44edd48f123..d67c8393a34 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h @@ -1,10 +1,10 @@ /* * This file define the new driver API for Wireless Extensions * - * Version : 6 21.6.04 + * Version : 7 18.3.05 * * Authors : Jean Tourrilhes - HPL - - * Copyright (c) 2001-2004 Jean Tourrilhes, All Rights Reserved. + * Copyright (c) 2001-2005 Jean Tourrilhes, All Rights Reserved. */ #ifndef _IW_HANDLER_H @@ -207,7 +207,7 @@ * will be needed... * I just plan to increment with each new version. */ -#define IW_HANDLER_VERSION 6 +#define IW_HANDLER_VERSION 7 /* * Changes : @@ -232,6 +232,13 @@ * - Remove spy #ifdef, they are always on -> cleaner code * - Add IW_DESCR_FLAG_NOMAX flag for very large requests * - Start migrating get_wireless_stats to struct iw_handler_def + * + * V6 to V7 + * -------- + * - Add struct ieee80211_device pointer in struct iw_public_data + * - Remove (struct iw_point *)->pointer from events and streams + * - Remove spy_offset from struct iw_handler_def + * - Add "check" version of event macros for ieee802.11 stack */ /**************************** CONSTANTS ****************************/ @@ -334,9 +341,6 @@ struct iw_handler_def * We will automatically export that to user space... */ const struct iw_priv_args * private_args; - /* This field will be *removed* in the next version of WE */ - long spy_offset; /* DO NOT USE */ - /* New location of get_wireless_stats, to de-bloat struct net_device. * The old pointer in struct net_device will be gradually phased * out, and drivers are encouraged to use this one... */ @@ -400,16 +404,21 @@ struct iw_spy_data /* --------------------- DEVICE WIRELESS DATA --------------------- */ /* * This is all the wireless data specific to a device instance that - * is managed by the core of Wireless Extensions. + * is managed by the core of Wireless Extensions or the 802.11 layer. * We only keep pointer to those structures, so that a driver is free * to share them between instances. * This structure should be initialised before registering the device. * Access to this data follow the same rules as any other struct net_device * data (i.e. valid as long as struct net_device exist, same locking rules). */ +/* Forward declaration */ +struct ieee80211_device; +/* The struct */ struct iw_public_data { /* Driver enhanced spy support */ - struct iw_spy_data * spy_data; + struct iw_spy_data * spy_data; + /* Structure managed by the in-kernel IEEE 802.11 layer */ + struct ieee80211_device * ieee80211; }; /**************************** PROTOTYPES ****************************/ @@ -424,7 +433,7 @@ struct iw_public_data { extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, int length); -/* Handle IOCTLs, called in net/code/dev.c */ +/* Handle IOCTLs, called in net/core/dev.c */ extern int wireless_process_ioctl(struct ifreq *ifr, unsigned int cmd); /* Second : functions that may be called by driver modules */ @@ -479,7 +488,7 @@ iwe_stream_add_event(char * stream, /* Stream of events */ int event_len) /* Real size of payload */ { /* Check if it's possible */ - if((stream + event_len) < ends) { + if(likely((stream + event_len) < ends)) { iwe->len = event_len; memcpy(stream, (char *) iwe, event_len); stream += event_len; @@ -495,14 +504,17 @@ iwe_stream_add_event(char * stream, /* Stream of events */ static inline char * iwe_stream_add_point(char * stream, /* Stream of events */ char * ends, /* End of stream */ - struct iw_event *iwe, /* Payload */ - char * extra) + struct iw_event *iwe, /* Payload length + flags */ + char * extra) /* More payload */ { int event_len = IW_EV_POINT_LEN + iwe->u.data.length; /* Check if it's possible */ - if((stream + event_len) < ends) { + if(likely((stream + event_len) < ends)) { iwe->len = event_len; - memcpy(stream, (char *) iwe, IW_EV_POINT_LEN); + memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); + memcpy(stream + IW_EV_LCP_LEN, + ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, + IW_EV_POINT_LEN - IW_EV_LCP_LEN); memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); stream += event_len; } @@ -526,7 +538,7 @@ iwe_stream_add_value(char * event, /* Event in the stream */ event_len -= IW_EV_LCP_LEN; /* Check if it's possible */ - if((value + event_len) < ends) { + if(likely((value + event_len) < ends)) { /* Add new value */ memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); value += event_len; @@ -537,4 +549,85 @@ iwe_stream_add_value(char * event, /* Event in the stream */ return value; } +/*------------------------------------------------------------------*/ +/* + * Wrapper to add an Wireless Event to a stream of events. + * Same as above, with explicit error check... + */ +static inline char * +iwe_stream_check_add_event(char * stream, /* Stream of events */ + char * ends, /* End of stream */ + struct iw_event *iwe, /* Payload */ + int event_len, /* Size of payload */ + int * perr) /* Error report */ +{ + /* Check if it's possible, set error if not */ + if(likely((stream + event_len) < ends)) { + iwe->len = event_len; + memcpy(stream, (char *) iwe, event_len); + stream += event_len; + } else + *perr = -E2BIG; + return stream; +} + +/*------------------------------------------------------------------*/ +/* + * Wrapper to add an short Wireless Event containing a pointer to a + * stream of events. + * Same as above, with explicit error check... + */ +static inline char * +iwe_stream_check_add_point(char * stream, /* Stream of events */ + char * ends, /* End of stream */ + struct iw_event *iwe, /* Payload length + flags */ + char * extra, /* More payload */ + int * perr) /* Error report */ +{ + int event_len = IW_EV_POINT_LEN + iwe->u.data.length; + /* Check if it's possible */ + if(likely((stream + event_len) < ends)) { + iwe->len = event_len; + memcpy(stream, (char *) iwe, IW_EV_LCP_LEN); + memcpy(stream + IW_EV_LCP_LEN, + ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, + IW_EV_POINT_LEN - IW_EV_LCP_LEN); + memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); + stream += event_len; + } else + *perr = -E2BIG; + return stream; +} + +/*------------------------------------------------------------------*/ +/* + * Wrapper to add a value to a Wireless Event in a stream of events. + * Be careful, this one is tricky to use properly : + * At the first run, you need to have (value = event + IW_EV_LCP_LEN). + * Same as above, with explicit error check... + */ +static inline char * +iwe_stream_check_add_value(char * event, /* Event in the stream */ + char * value, /* Value in event */ + char * ends, /* End of stream */ + struct iw_event *iwe, /* Payload */ + int event_len, /* Size of payload */ + int * perr) /* Error report */ +{ + /* Don't duplicate LCP */ + event_len -= IW_EV_LCP_LEN; + + /* Check if it's possible */ + if(likely((value + event_len) < ends)) { + /* Add new value */ + memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); + value += event_len; + /* Patch LCP */ + iwe->len = value - event; + memcpy(event, (char *) iwe, IW_EV_LCP_LEN); + } else + *perr = -E2BIG; + return value; +} + #endif /* _IW_HANDLER_H */ -- cgit v1.2.3 From bbeec90b98a3066f6f2b8d41c80561f5665e4631 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 7 Sep 2005 00:27:54 -0400 Subject: [wireless] build fixes after merging WE-19 --- include/linux/wireless.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/wireless.h b/include/linux/wireless.h index dab5afdaf71..a555a0f7a7b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h @@ -69,12 +69,9 @@ /***************************** INCLUDES *****************************/ -/* Do not put any header in this file, this creates a mess when - * exported to user space. Most users have included all the - * relevant headers anyway... Jean II */ -/*#include */ /* for "caddr_t" et al */ -/*#include */ /* for "struct sockaddr" et al */ -/*#include */ /* for IFNAMSIZ and co... */ +#include /* for "caddr_t" et al */ +#include /* for "struct sockaddr" et al */ +#include /* for IFNAMSIZ and co... */ /***************************** VERSION *****************************/ /* -- cgit v1.2.3 From 344babaa9d39b10b85cadec4e5335d43b52b4ec0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 7 Sep 2005 01:15:17 -0400 Subject: [kernel-doc] fix various DocBook build problems/warnings Most serious is fixing include/sound/pcm.h, which breaks the DocBook build. The other stuff is just filling in things that cause warnings. --- include/sound/pcm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index fa23ebfb857..389e8ebe9c1 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -903,7 +903,7 @@ int snd_pcm_format_unsigned(snd_pcm_format_t format); int snd_pcm_format_linear(snd_pcm_format_t format); int snd_pcm_format_little_endian(snd_pcm_format_t format); int snd_pcm_format_big_endian(snd_pcm_format_t format); -/** +/* * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian * @format: the format to check * -- cgit v1.2.3 From 7efb833d645d10258e32664404354d26cf6070e3 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 7 Sep 2005 11:49:23 +0100 Subject: [ARM] 2889/1: S3C2410 - Add machine Anubis Patch from Ben Dooks Add the Simtec Anubis to the list of supported machines in the arch/arm/mach-s3c2410 directory. This ensures the core peripherals are registered, the timer source is configured and the correct power-management is enabled. Signed-off-by: Ben Dooks Signed-off-by: Russell King --- include/asm-arm/arch-s3c2410/anubis-cpld.h | 24 ++++++++++++++++ include/asm-arm/arch-s3c2410/anubis-irq.h | 23 +++++++++++++++ include/asm-arm/arch-s3c2410/anubis-map.h | 46 ++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 include/asm-arm/arch-s3c2410/anubis-cpld.h create mode 100644 include/asm-arm/arch-s3c2410/anubis-irq.h create mode 100644 include/asm-arm/arch-s3c2410/anubis-map.h (limited to 'include') diff --git a/include/asm-arm/arch-s3c2410/anubis-cpld.h b/include/asm-arm/arch-s3c2410/anubis-cpld.h new file mode 100644 index 00000000000..5675b1796b5 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/anubis-cpld.h @@ -0,0 +1,24 @@ +/* linux/include/asm-arm/arch-s3c2410/anubis-cpld.h + * + * (c) 2005 Simtec Electronics + * http://www.simtec.co.uk/products/ + * Ben Dooks + * + * ANUBIS - CPLD control constants + * + * 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. + * + * Changelog: + * +*/ + +#ifndef __ASM_ARCH_ANUBISCPLD_H +#define __ASM_ARCH_ANUBISCPLD_H + +/* CTRL2 - NAND WP control, IDE Reset assert/check */ + +#define ANUBIS_CTRL1_NANDSEL (0x3) + +#endif /* __ASM_ARCH_ANUBISCPLD_H */ diff --git a/include/asm-arm/arch-s3c2410/anubis-irq.h b/include/asm-arm/arch-s3c2410/anubis-irq.h new file mode 100644 index 00000000000..82f15dbd97e --- /dev/null +++ b/include/asm-arm/arch-s3c2410/anubis-irq.h @@ -0,0 +1,23 @@ +/* linux/include/asm-arm/arch-s3c2410/anubis-irq.h + * + * (c) 2005 Simtec Electronics + * http://www.simtec.co.uk/products/ + * Ben Dooks + * + * ANUBIS - IRQ Number definitions + * + * 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. + * + * Changelog: + */ + +#ifndef __ASM_ARCH_ANUBISIRQ_H +#define __ASM_ARCH_ANUBISIRQ_H + +#define IRQ_IDE0 IRQ_EINT2 +#define IRQ_IDE1 IRQ_EINT3 +#define IRQ_ASIX IRQ_EINT1 + +#endif /* __ASM_ARCH_ANUBISIRQ_H */ diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h new file mode 100644 index 00000000000..97741d6e506 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/anubis-map.h @@ -0,0 +1,46 @@ +/* linux/include/asm-arm/arch-s3c2410/anubis-map.h + * + * (c) 2005 Simtec Electronics + * http://www.simtec.co.uk/products/ + * Ben Dooks + * + * ANUBIS - Memory map definitions + * + * 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. + * + * Changelog: +*/ + +/* needs arch/map.h including with this */ + +#ifndef __ASM_ARCH_ANUBISMAP_H +#define __ASM_ARCH_ANUBISMAP_H + +/* start peripherals off after the S3C2410 */ + +#define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x02000000)) + +#define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26)) + +/* we put the CPLD registers next, to get them out of the way */ + +#define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01300000 */ +#define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) + +#define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01400000 */ +#define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) + +#define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01500000 */ +#define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) + +#define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01600000 */ +#define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) + +#define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) +#define ANUBIS_IDEPRIAUX ANUBIS_IOADDR(0x01100000) +#define ANUBIS_IDESEC ANUBIS_IOADDR(0x01200000) +#define ANUBIS_IDESECAUX ANUBIS_IOADDR(0x01300000) + +#endif /* __ASM_ARCH_ANUBISMAP_H */ -- cgit v1.2.3 From 9839c6b8dd414612be0b6a70c4aa06eaca5b7652 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Wed, 7 Sep 2005 17:20:27 +0100 Subject: [ARM] 2888/1: OMAP 3/4: Update omap include files, take 2 Patch from Tony Lindgren This patch syncs the mainline kernel with linux-omap tree. The highlights of the patch are: - Start adding 24xx support by Paul Mundt - Clean-up of cpu detection by Dirk Behme and Tony Lindgren - Add DSP header by Toshihiro Kobayashi - Add support for mtd-xip by Vladimir Barinov - Add various new mux registers - Move OMAP specific serial defines back to serial.h Signed-off-by: Tony Lindgren Signed-off-by: Russell King --- include/asm-arm/arch-omap/board-h4.h | 3 + include/asm-arm/arch-omap/board-innovator.h | 25 --- include/asm-arm/arch-omap/board-perseus2.h | 17 +- include/asm-arm/arch-omap/board-voiceblue.h | 5 - include/asm-arm/arch-omap/board.h | 19 ++- include/asm-arm/arch-omap/cpu.h | 187 ++++++++++++--------- include/asm-arm/arch-omap/debug-macro.S | 13 ++ include/asm-arm/arch-omap/dma.h | 1 + include/asm-arm/arch-omap/dmtimer.h | 92 +++++++++++ include/asm-arm/arch-omap/dsp.h | 244 ++++++++++++++++++++++++++++ include/asm-arm/arch-omap/dsp_common.h | 37 +++++ include/asm-arm/arch-omap/entry-macro.S | 28 ++++ include/asm-arm/arch-omap/gpio.h | 28 +++- include/asm-arm/arch-omap/hardware.h | 39 ++--- include/asm-arm/arch-omap/io.h | 26 ++- include/asm-arm/arch-omap/irqs.h | 6 +- include/asm-arm/arch-omap/memory.h | 14 +- include/asm-arm/arch-omap/mtd-xip.h | 61 +++++++ include/asm-arm/arch-omap/mux.h | 10 +- include/asm-arm/arch-omap/omap1510.h | 13 -- include/asm-arm/arch-omap/omap16xx.h | 16 -- include/asm-arm/arch-omap/omap24xx.h | 15 ++ include/asm-arm/arch-omap/omap730.h | 4 - include/asm-arm/arch-omap/pm.h | 55 +++---- include/asm-arm/arch-omap/serial.h | 37 +++++ include/asm-arm/arch-omap/uncompress.h | 10 +- 26 files changed, 767 insertions(+), 238 deletions(-) create mode 100644 include/asm-arm/arch-omap/dmtimer.h create mode 100644 include/asm-arm/arch-omap/dsp.h create mode 100644 include/asm-arm/arch-omap/dsp_common.h create mode 100644 include/asm-arm/arch-omap/mtd-xip.h create mode 100644 include/asm-arm/arch-omap/omap24xx.h create mode 100644 include/asm-arm/arch-omap/serial.h (limited to 'include') diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h index 79138dcfb4a..d64ee9211ee 100644 --- a/include/asm-arm/arch-omap/board-h4.h +++ b/include/asm-arm/arch-omap/board-h4.h @@ -30,6 +30,9 @@ #define __ASM_ARCH_OMAP_H4_H /* Placeholder for H4 specific defines */ +/* GPMC CS1 */ +#define OMAP24XX_ETHR_START 0x08000300 +#define OMAP24XX_ETHR_GPIO_IRQ 92 #endif /* __ASM_ARCH_OMAP_H4_H */ diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h index 0f1abaefe4d..79574e0ed13 100644 --- a/include/asm-arm/arch-omap/board-innovator.h +++ b/include/asm-arm/arch-omap/board-innovator.h @@ -36,31 +36,6 @@ #define OMAP1510P1_EMIFS_PRI_VALUE 0x00 #define OMAP1510P1_EMIFF_PRI_VALUE 0x00 -/* - * These definitions define an area of FLASH set aside - * for the use of MTD/JFFS2. This is the area of flash - * that a JFFS2 filesystem will reside which is mounted - * at boot with the "root=/dev/mtdblock/0 rw" - * command line option. The flash address used here must - * fall within the legal range defined by rrload for storing - * the filesystem component. This address will be sufficiently - * deep into the overall flash range to avoid the other - * components also stored in flash such as the bootloader, - * the bootloader params, and the kernel. - * The SW2 settings for the map below are: - * 1 off, 2 off, 3 on, 4 off. - */ - -/* Intel flash_0, partitioned as expected by rrload */ -#define OMAP_FLASH_0_BASE 0xD8000000 -#define OMAP_FLASH_0_START 0x00000000 -#define OMAP_FLASH_0_SIZE SZ_16M - -/* Intel flash_1, used for cramfs or other flash file systems */ -#define OMAP_FLASH_1_BASE 0xD9000000 -#define OMAP_FLASH_1_START 0x01000000 -#define OMAP_FLASH_1_SIZE SZ_16M - #define NR_FPGA_IRQS 24 #define NR_IRQS IH_BOARD_BASE + NR_FPGA_IRQS diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h index 0c224cc74fe..691e52a52b4 100644 --- a/include/asm-arm/arch-omap/board-perseus2.h +++ b/include/asm-arm/arch-omap/board-perseus2.h @@ -36,23 +36,14 @@ #define OMAP_SDRAM_DEVICE D256M_1X16_4B #endif -/* - * These definitions define an area of FLASH set aside - * for the use of MTD/JFFS2. This is the area of flash - * that a JFFS2 filesystem will reside which is mounted - * at boot with the "root=/dev/mtdblock/0 rw" - * command line option. - */ - -/* Intel flash_0, partitioned as expected by rrload */ -#define OMAP_FLASH_0_BASE 0xD8000000 /* VA */ -#define OMAP_FLASH_0_START 0x00000000 /* PA */ -#define OMAP_FLASH_0_SIZE SZ_32M - #define MAXIRQNUM IH_BOARD_BASE #define MAXFIQNUM MAXIRQNUM #define MAXSWINUM MAXIRQNUM #define NR_IRQS (MAXIRQNUM + 1) +/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ +#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ +#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ + #endif diff --git a/include/asm-arm/arch-omap/board-voiceblue.h b/include/asm-arm/arch-omap/board-voiceblue.h index 33977b8956f..ed6d346ee12 100644 --- a/include/asm-arm/arch-omap/board-voiceblue.h +++ b/include/asm-arm/arch-omap/board-voiceblue.h @@ -11,11 +11,6 @@ #ifndef __ASM_ARCH_VOICEBLUE_H #define __ASM_ARCH_VOICEBLUE_H -#if (EXTERNAL_MAX_NR_PORTS < 4) -#undef EXTERNAL_MAX_NR_PORTS -#define EXTERNAL_MAX_NR_PORTS 4 -#endif - extern void voiceblue_wdt_enable(void); extern void voiceblue_wdt_disable(void); extern void voiceblue_wdt_ping(void); diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index 95bd625480c..a0040cd8663 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h @@ -30,10 +30,23 @@ struct omap_clock_config { u8 system_clock_type; }; +struct omap_mmc_conf { + unsigned enabled:1; + /* nomux means "standard" muxing is wrong on this board, and that + * board-specific code handled it before common init logic. + */ + unsigned nomux:1; + /* switch pin can be for card detect (default) or card cover */ + unsigned cover:1; + /* 4 wire signaling is optional, and is only used for SD/SDIO */ + unsigned wire4:1; + s16 power_pin; + s16 switch_pin; + s16 wp_pin; +}; + struct omap_mmc_config { - u8 mmc_blocks; - s16 mmc1_power_pin, mmc2_power_pin; - s16 mmc1_switch_pin, mmc2_switch_pin; + struct omap_mmc_conf mmc[2]; }; struct omap_serial_console_config { diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h index e8786713ee5..1119e2b53e7 100644 --- a/include/asm-arm/arch-omap/cpu.h +++ b/include/asm-arm/arch-omap/cpu.h @@ -38,146 +38,179 @@ extern unsigned int system_rev; /* * Test if multicore OMAP support is needed */ -#undef MULTI_OMAP +#undef MULTI_OMAP1 +#undef MULTI_OMAP2 #undef OMAP_NAME #ifdef CONFIG_ARCH_OMAP730 # ifdef OMAP_NAME -# undef MULTI_OMAP -# define MULTI_OMAP +# undef MULTI_OMAP1 +# define MULTI_OMAP1 # else # define OMAP_NAME omap730 # endif #endif #ifdef CONFIG_ARCH_OMAP1510 # ifdef OMAP_NAME -# undef MULTI_OMAP -# define MULTI_OMAP +# undef MULTI_OMAP1 +# define MULTI_OMAP1 # else # define OMAP_NAME omap1510 # endif #endif #ifdef CONFIG_ARCH_OMAP16XX # ifdef OMAP_NAME -# undef MULTI_OMAP -# define MULTI_OMAP +# undef MULTI_OMAP1 +# define MULTI_OMAP1 # else -# define OMAP_NAME omap1610 +# define OMAP_NAME omap16xx # endif #endif -#ifdef CONFIG_ARCH_OMAP16XX -# ifdef OMAP_NAME -# undef MULTI_OMAP -# define MULTI_OMAP +#ifdef CONFIG_ARCH_OMAP24XX +# if (defined(OMAP_NAME) || defined(MULTI_OMAP1)) +# error "OMAP1 and OMAP2 can't be selected at the same time" # else -# define OMAP_NAME omap1710 +# undef MULTI_OMAP2 +# define OMAP_NAME omap24xx # endif #endif /* - * Generate various OMAP cpu specific macros, and cpu class - * specific macros + * Macros to group OMAP into cpu classes. + * These can be used in most places. + * cpu_is_omap7xx(): True for OMAP730 + * cpu_is_omap15xx(): True for OMAP1510 and OMAP5910 + * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 + * cpu_is_omap24xx(): True for OMAP2420 */ -#define GET_OMAP_TYPE ((system_rev >> 24) & 0xff) #define GET_OMAP_CLASS (system_rev & 0xff) -#define IS_OMAP_TYPE(type, id) \ -static inline int is_omap ##type (void) \ -{ \ - return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ -} - #define IS_OMAP_CLASS(class, id) \ static inline int is_omap ##class (void) \ { \ return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ } -IS_OMAP_TYPE(730, 0x07) -IS_OMAP_TYPE(1510, 0x15) -IS_OMAP_TYPE(1610, 0x16) -IS_OMAP_TYPE(5912, 0x16) -IS_OMAP_TYPE(1710, 0x17) -IS_OMAP_TYPE(2420, 0x24) - IS_OMAP_CLASS(7xx, 0x07) IS_OMAP_CLASS(15xx, 0x15) IS_OMAP_CLASS(16xx, 0x16) IS_OMAP_CLASS(24xx, 0x24) -/* - * Macros to group OMAP types into cpu classes. - * These can be used in most places. - * cpu_is_omap15xx(): True for 1510 and 5910 - * cpu_is_omap16xx(): True for 1610, 5912 and 1710 - */ -#if defined(MULTI_OMAP) -# define cpu_is_omap7xx() is_omap7xx() -# define cpu_is_omap15xx() is_omap15xx() -# if !(defined(CONFIG_ARCH_OMAP1510) || defined(CONFIG_ARCH_OMAP730)) -# define cpu_is_omap16xx() 1 -# else +#define cpu_is_omap7xx() 0 +#define cpu_is_omap15xx() 0 +#define cpu_is_omap16xx() 0 +#define cpu_is_omap24xx() 0 + +#if defined(MULTI_OMAP1) +# if defined(CONFIG_ARCH_OMAP730) +# undef cpu_is_omap7xx +# define cpu_is_omap7xx() is_omap7xx() +# endif +# if defined(CONFIG_ARCH_OMAP1510) +# undef cpu_is_omap15xx +# define cpu_is_omap15xx() is_omap15xx() +# endif +# if defined(CONFIG_ARCH_OMAP16XX) +# undef cpu_is_omap16xx # define cpu_is_omap16xx() is_omap16xx() # endif #else # if defined(CONFIG_ARCH_OMAP730) +# undef cpu_is_omap7xx # define cpu_is_omap7xx() 1 -# else -# define cpu_is_omap7xx() 0 # endif # if defined(CONFIG_ARCH_OMAP1510) +# undef cpu_is_omap15xx # define cpu_is_omap15xx() 1 -# else -# define cpu_is_omap15xx() 0 # endif # if defined(CONFIG_ARCH_OMAP16XX) +# undef cpu_is_omap16xx # define cpu_is_omap16xx() 1 -# else -# define cpu_is_omap16xx() 0 +# endif +# if defined(CONFIG_ARCH_OMAP24XX) +# undef cpu_is_omap24xx +# define cpu_is_omap24xx() 1 # endif #endif -#if defined(MULTI_OMAP) -# define cpu_is_omap730() is_omap730() -# define cpu_is_omap1510() is_omap1510() -# define cpu_is_omap1610() is_omap1610() -# define cpu_is_omap5912() is_omap5912() -# define cpu_is_omap1710() is_omap1710() +/* + * Macros to detect individual cpu types. + * These are only rarely needed. + * cpu_is_omap730(): True for OMAP730 + * cpu_is_omap1510(): True for OMAP1510 + * cpu_is_omap1610(): True for OMAP1610 + * cpu_is_omap1611(): True for OMAP1611 + * cpu_is_omap5912(): True for OMAP5912 + * cpu_is_omap1621(): True for OMAP1621 + * cpu_is_omap1710(): True for OMAP1710 + * cpu_is_omap2420(): True for OMAP2420 + */ +#define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) + +#define IS_OMAP_TYPE(type, id) \ +static inline int is_omap ##type (void) \ +{ \ + return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ +} + +IS_OMAP_TYPE(730, 0x0730) +IS_OMAP_TYPE(1510, 0x1510) +IS_OMAP_TYPE(1610, 0x1610) +IS_OMAP_TYPE(1611, 0x1611) +IS_OMAP_TYPE(5912, 0x1611) +IS_OMAP_TYPE(1621, 0x1621) +IS_OMAP_TYPE(1710, 0x1710) +IS_OMAP_TYPE(2420, 0x2420) + +#define cpu_is_omap730() 0 +#define cpu_is_omap1510() 0 +#define cpu_is_omap1610() 0 +#define cpu_is_omap5912() 0 +#define cpu_is_omap1611() 0 +#define cpu_is_omap1621() 0 +#define cpu_is_omap1710() 0 +#define cpu_is_omap2420() 0 + +#if defined(MULTI_OMAP1) +# if defined(CONFIG_ARCH_OMAP730) +# undef cpu_is_omap730 +# define cpu_is_omap730() is_omap730() +# endif +# if defined(CONFIG_ARCH_OMAP1510) +# undef cpu_is_omap1510 +# define cpu_is_omap1510() is_omap1510() +# endif #else # if defined(CONFIG_ARCH_OMAP730) +# undef cpu_is_omap730 # define cpu_is_omap730() 1 -# else -# define cpu_is_omap730() 0 # endif # if defined(CONFIG_ARCH_OMAP1510) +# undef cpu_is_omap1510 # define cpu_is_omap1510() 1 -# else -# define cpu_is_omap1510() 0 # endif -# if defined(CONFIG_ARCH_OMAP16XX) -# define cpu_is_omap1610() 1 -# else -# define cpu_is_omap1610() 0 -# endif -# if defined(CONFIG_ARCH_OMAP16XX) -# define cpu_is_omap5912() 1 -# else -# define cpu_is_omap5912() 0 -# endif -# if defined(CONFIG_ARCH_OMAP16XX) +#endif + +/* + * Whether we have MULTI_OMAP1 or not, we still need to distinguish + * between 1611B/5912 and 1710. + */ +#if defined(CONFIG_ARCH_OMAP16XX) +# undef cpu_is_omap1610 +# undef cpu_is_omap1611 +# undef cpu_is_omap5912 +# undef cpu_is_omap1621 +# undef cpu_is_omap1710 # define cpu_is_omap1610() is_omap1610() +# define cpu_is_omap1611() is_omap1611() # define cpu_is_omap5912() is_omap5912() +# define cpu_is_omap1621() is_omap1621() # define cpu_is_omap1710() is_omap1710() -# else -# define cpu_is_omap1610() 0 -# define cpu_is_omap5912() 0 -# define cpu_is_omap1710() 0 -# endif -# if defined(CONFIG_ARCH_OMAP2420) +#endif + +#if defined(CONFIG_ARCH_OMAP2420) +# undef cpu_is_omap2420 # define cpu_is_omap2420() 1 -# else -# define cpu_is_omap2420() 0 -# endif #endif #endif diff --git a/include/asm-arm/arch-omap/debug-macro.S b/include/asm-arm/arch-omap/debug-macro.S index 83bb458afd0..ca4f577f967 100644 --- a/include/asm-arm/arch-omap/debug-macro.S +++ b/include/asm-arm/arch-omap/debug-macro.S @@ -14,6 +14,7 @@ .macro addruart,rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled? +#ifdef CONFIG_ARCH_OMAP1 moveq \rx, #0xff000000 @ physical base address movne \rx, #0xfe000000 @ virtual base orr \rx, \rx, #0x00fb0000 @@ -22,6 +23,18 @@ #endif #if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) orr \rx, \rx, #0x00000800 @ UART 2 & 3 +#endif + +#elif CONFIG_ARCH_OMAP2 + moveq \rx, #0x48000000 @ physical base address + movne \rx, #0xd8000000 @ virtual base + orr \rx, \rx, #0x0006a000 +#ifdef CONFIG_OMAP_LL_DEBUG_UART2 + add \rx, \rx, #0x00002000 @ UART 2 +#endif +#ifdef CONFIG_OMAP_LL_DEBUG_UART3 + add \rx, \rx, #0x00004000 @ UART 3 +#endif #endif .endm diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index ce114ce5af5..04ebef5c6e9 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h @@ -240,6 +240,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue); extern dma_addr_t omap_get_dma_src_pos(int lch); extern dma_addr_t omap_get_dma_dst_pos(int lch); +extern int omap_get_dma_src_addr_counter(int lch); extern void omap_clear_dma(int lch); extern int omap_dma_running(void); diff --git a/include/asm-arm/arch-omap/dmtimer.h b/include/asm-arm/arch-omap/dmtimer.h new file mode 100644 index 00000000000..11772c792f3 --- /dev/null +++ b/include/asm-arm/arch-omap/dmtimer.h @@ -0,0 +1,92 @@ +/* + * linux/include/asm-arm/arm/arch-omap/dmtimer.h + * + * OMAP Dual-Mode Timers + * + * Copyright (C) 2005 Nokia Corporation + * Author: Lauri Leukkunen + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __ASM_ARCH_TIMER_H +#define __ASM_ARCH_TIMER_H + +#include + +#define OMAP_TIMER_SRC_ARMXOR 0x00 +#define OMAP_TIMER_SRC_32_KHZ 0x01 +#define OMAP_TIMER_SRC_EXT_CLK 0x02 + +/* timer control reg bits */ +#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13) +#define OMAP_TIMER_CTRL_PT (1 << 12) +#define OMAP_TIMER_CTRL_TRG_OVERFLOW (0x1 << 10) +#define OMAP_TIMER_CTRL_TRG_OFANDMATCH (0x2 << 10) +#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8) +#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8) +#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8) +#define OMAP_TIMER_CTRL_SCPWM (1 << 7) +#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */ +#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */ +#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* how much to shift the prescaler value */ +#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */ +#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */ + +/* timer interrupt enable bits */ +#define OMAP_TIMER_INT_CAPTURE (1 << 2) +#define OMAP_TIMER_INT_OVERFLOW (1 << 1) +#define OMAP_TIMER_INT_MATCH (1 << 0) + + +struct omap_dm_timer { + struct list_head timer_list; + + u32 base; + unsigned int irq; +}; + +u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, int reg); +void omap_dm_timer_write_reg(struct omap_dm_timer *timer, int reg, u32 value); + +struct omap_dm_timer * omap_dm_timer_request(void); +void omap_dm_timer_free(struct omap_dm_timer *timer); +void omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); + +void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); +void omap_dm_timer_set_trigger(struct omap_dm_timer *timer, unsigned int value); +void omap_dm_timer_enable_compare(struct omap_dm_timer *timer); +void omap_dm_timer_enable_autoreload(struct omap_dm_timer *timer); + +void omap_dm_timer_trigger(struct omap_dm_timer *timer); +void omap_dm_timer_start(struct omap_dm_timer *timer); +void omap_dm_timer_stop(struct omap_dm_timer *timer); + +void omap_dm_timer_set_load(struct omap_dm_timer *timer, unsigned int load); +void omap_dm_timer_set_match(struct omap_dm_timer *timer, unsigned int match); + +unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); +void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); + +unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); +void omap_dm_timer_reset_counter(struct omap_dm_timer *timer); + +int omap_dm_timers_active(void); + +#endif /* __ASM_ARCH_TIMER_H */ diff --git a/include/asm-arm/arch-omap/dsp.h b/include/asm-arm/arch-omap/dsp.h new file mode 100644 index 00000000000..57bf4f39ca5 --- /dev/null +++ b/include/asm-arm/arch-omap/dsp.h @@ -0,0 +1,244 @@ +/* + * linux/include/asm-arm/arch-omap/dsp.h + * + * Header for OMAP DSP driver + * + * Copyright (C) 2002-2005 Nokia Corporation + * + * Written by Toshihiro Kobayashi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * 2005/06/01: DSP Gateway version 3.3 + */ + +#ifndef ASM_ARCH_DSP_H +#define ASM_ARCH_DSP_H + + +/* + * for /dev/dspctl/ctl + */ +#define OMAP_DSP_IOCTL_RESET 1 +#define OMAP_DSP_IOCTL_RUN 2 +#define OMAP_DSP_IOCTL_SETRSTVECT 3 +#define OMAP_DSP_IOCTL_CPU_IDLE 4 +#define OMAP_DSP_IOCTL_MPUI_WORDSWAP_ON 5 +#define OMAP_DSP_IOCTL_MPUI_WORDSWAP_OFF 6 +#define OMAP_DSP_IOCTL_MPUI_BYTESWAP_ON 7 +#define OMAP_DSP_IOCTL_MPUI_BYTESWAP_OFF 8 +#define OMAP_DSP_IOCTL_GBL_IDLE 9 +#define OMAP_DSP_IOCTL_DSPCFG 10 +#define OMAP_DSP_IOCTL_DSPUNCFG 11 +#define OMAP_DSP_IOCTL_TASKCNT 12 +#define OMAP_DSP_IOCTL_POLL 13 +#define OMAP_DSP_IOCTL_REGMEMR 40 +#define OMAP_DSP_IOCTL_REGMEMW 41 +#define OMAP_DSP_IOCTL_REGIOR 42 +#define OMAP_DSP_IOCTL_REGIOW 43 +#define OMAP_DSP_IOCTL_GETVAR 44 +#define OMAP_DSP_IOCTL_SETVAR 45 +#define OMAP_DSP_IOCTL_RUNLEVEL 50 +#define OMAP_DSP_IOCTL_SUSPEND 51 +#define OMAP_DSP_IOCTL_RESUME 52 +#define OMAP_DSP_IOCTL_FBEN 53 +#define OMAP_DSP_IOCTL_FBDIS 54 +#define OMAP_DSP_IOCTL_MBSEND 99 + +/* + * for taskdev + * (ioctls below should be >= 0x10000) + */ +#define OMAP_DSP_TASK_IOCTL_BFLSH 0x10000 +#define OMAP_DSP_TASK_IOCTL_SETBSZ 0x10001 +#define OMAP_DSP_TASK_IOCTL_LOCK 0x10002 +#define OMAP_DSP_TASK_IOCTL_UNLOCK 0x10003 +#define OMAP_DSP_TASK_IOCTL_GETNAME 0x10004 + +/* + * for /dev/dspctl/mem + */ +#define OMAP_DSP_MEM_IOCTL_EXMAP 1 +#define OMAP_DSP_MEM_IOCTL_EXUNMAP 2 +#define OMAP_DSP_MEM_IOCTL_EXMAP_FLUSH 3 +#define OMAP_DSP_MEM_IOCTL_FBEXPORT 5 +#define OMAP_DSP_MEM_IOCTL_MMUITACK 7 +#define OMAP_DSP_MEM_IOCTL_MMUINIT 9 +#define OMAP_DSP_MEM_IOCTL_KMEM_RESERVE 11 +#define OMAP_DSP_MEM_IOCTL_KMEM_RELEASE 12 + +struct omap_dsp_mapinfo { + unsigned long dspadr; + unsigned long size; +}; + +/* + * for /dev/dspctl/twch + */ +#define OMAP_DSP_TWCH_IOCTL_MKDEV 1 +#define OMAP_DSP_TWCH_IOCTL_RMDEV 2 +#define OMAP_DSP_TWCH_IOCTL_TADD 11 +#define OMAP_DSP_TWCH_IOCTL_TDEL 12 +#define OMAP_DSP_TWCH_IOCTL_TKILL 13 + +#define OMAP_DSP_DEVSTATE_NOTASK 0x00000001 +#define OMAP_DSP_DEVSTATE_ATTACHED 0x00000002 +#define OMAP_DSP_DEVSTATE_GARBAGE 0x00000004 +#define OMAP_DSP_DEVSTATE_INVALID 0x00000008 +#define OMAP_DSP_DEVSTATE_ADDREQ 0x00000100 +#define OMAP_DSP_DEVSTATE_DELREQ 0x00000200 +#define OMAP_DSP_DEVSTATE_ADDFAIL 0x00001000 +#define OMAP_DSP_DEVSTATE_ADDING 0x00010000 +#define OMAP_DSP_DEVSTATE_DELING 0x00020000 +#define OMAP_DSP_DEVSTATE_KILLING 0x00040000 +#define OMAP_DSP_DEVSTATE_STATE_MASK 0x7fffffff +#define OMAP_DSP_DEVSTATE_STALE 0x80000000 + +struct omap_dsp_taddinfo { + unsigned char minor; + unsigned long taskadr; +}; +#define OMAP_DSP_TADD_ABORTADR 0xffffffff + + +/* + * error cause definition (for error detection device) + */ +#define OMAP_DSP_ERRDT_WDT 0x00000001 +#define OMAP_DSP_ERRDT_MMU 0x00000002 + + +/* + * mailbox protocol definitions + */ + +struct omap_dsp_mailbox_cmd { + unsigned short cmd; + unsigned short data; +}; + +struct omap_dsp_reginfo { + unsigned short adr; + unsigned short val; +}; + +struct omap_dsp_varinfo { + unsigned char varid; + unsigned short val[0]; +}; + +#define OMAP_DSP_MBPROT_REVISION 0x0019 + +#define OMAP_DSP_MBCMD_WDSND 0x10 +#define OMAP_DSP_MBCMD_WDREQ 0x11 +#define OMAP_DSP_MBCMD_BKSND 0x20 +#define OMAP_DSP_MBCMD_BKREQ 0x21 +#define OMAP_DSP_MBCMD_BKYLD 0x23 +#define OMAP_DSP_MBCMD_BKSNDP 0x24 +#define OMAP_DSP_MBCMD_BKREQP 0x25 +#define OMAP_DSP_MBCMD_TCTL 0x30 +#define OMAP_DSP_MBCMD_TCTLDATA 0x31 +#define OMAP_DSP_MBCMD_POLL 0x32 +#define OMAP_DSP_MBCMD_WDT 0x50 /* v3.3: obsolete */ +#define OMAP_DSP_MBCMD_RUNLEVEL 0x51 +#define OMAP_DSP_MBCMD_PM 0x52 +#define OMAP_DSP_MBCMD_SUSPEND 0x53 +#define OMAP_DSP_MBCMD_KFUNC 0x54 +#define OMAP_DSP_MBCMD_TCFG 0x60 +#define OMAP_DSP_MBCMD_TADD 0x62 +#define OMAP_DSP_MBCMD_TDEL 0x63 +#define OMAP_DSP_MBCMD_TSTOP 0x65 +#define OMAP_DSP_MBCMD_DSPCFG 0x70 +#define OMAP_DSP_MBCMD_REGRW 0x72 +#define OMAP_DSP_MBCMD_GETVAR 0x74 +#define OMAP_DSP_MBCMD_SETVAR 0x75 +#define OMAP_DSP_MBCMD_ERR 0x78 +#define OMAP_DSP_MBCMD_DBG 0x79 + +#define OMAP_DSP_MBCMD_TCTL_TINIT 0x0000 +#define OMAP_DSP_MBCMD_TCTL_TEN 0x0001 +#define OMAP_DSP_MBCMD_TCTL_TDIS 0x0002 +#define OMAP_DSP_MBCMD_TCTL_TCLR 0x0003 +#define OMAP_DSP_MBCMD_TCTL_TCLR_FORCE 0x0004 + +#define OMAP_DSP_MBCMD_RUNLEVEL_USER 0x01 +#define OMAP_DSP_MBCMD_RUNLEVEL_SUPER 0x0e +#define OMAP_DSP_MBCMD_RUNLEVEL_RECOVERY 0x10 + +#define OMAP_DSP_MBCMD_PM_DISABLE 0x00 +#define OMAP_DSP_MBCMD_PM_ENABLE 0x01 + +#define OMAP_DSP_MBCMD_KFUNC_FBCTL 0x00 + +#define OMAP_DSP_MBCMD_FBCTL_ENABLE 0x0002 +#define OMAP_DSP_MBCMD_FBCTL_DISABLE 0x0003 + +#define OMAP_DSP_MBCMD_TDEL_SAFE 0x0000 +#define OMAP_DSP_MBCMD_TDEL_KILL 0x0001 + +#define OMAP_DSP_MBCMD_DSPCFG_REQ 0x00 +#define OMAP_DSP_MBCMD_DSPCFG_SYSADRH 0x28 +#define OMAP_DSP_MBCMD_DSPCFG_SYSADRL 0x29 +#define OMAP_DSP_MBCMD_DSPCFG_PROTREV 0x70 +#define OMAP_DSP_MBCMD_DSPCFG_ABORT 0x78 +#define OMAP_DSP_MBCMD_DSPCFG_LAST 0x80 + +#define OMAP_DSP_MBCMD_REGRW_MEMR 0x00 +#define OMAP_DSP_MBCMD_REGRW_MEMW 0x01 +#define OMAP_DSP_MBCMD_REGRW_IOR 0x02 +#define OMAP_DSP_MBCMD_REGRW_IOW 0x03 +#define OMAP_DSP_MBCMD_REGRW_DATA 0x04 + +#define OMAP_DSP_MBCMD_VARID_ICRMASK 0x00 +#define OMAP_DSP_MBCMD_VARID_LOADINFO 0x01 + +#define OMAP_DSP_TTYP_ARCV 0x0001 +#define OMAP_DSP_TTYP_ASND 0x0002 +#define OMAP_DSP_TTYP_BKMD 0x0004 +#define OMAP_DSP_TTYP_BKDM 0x0008 +#define OMAP_DSP_TTYP_PVMD 0x0010 +#define OMAP_DSP_TTYP_PVDM 0x0020 + +#define OMAP_DSP_EID_BADTID 0x10 +#define OMAP_DSP_EID_BADTCN 0x11 +#define OMAP_DSP_EID_BADBID 0x20 +#define OMAP_DSP_EID_BADCNT 0x21 +#define OMAP_DSP_EID_NOTLOCKED 0x22 +#define OMAP_DSP_EID_STVBUF 0x23 +#define OMAP_DSP_EID_BADADR 0x24 +#define OMAP_DSP_EID_BADTCTL 0x30 +#define OMAP_DSP_EID_BADPARAM 0x50 +#define OMAP_DSP_EID_FATAL 0x58 +#define OMAP_DSP_EID_NOMEM 0xc0 +#define OMAP_DSP_EID_NORES 0xc1 +#define OMAP_DSP_EID_IPBFULL 0xc2 +#define OMAP_DSP_EID_WDT 0xd0 +#define OMAP_DSP_EID_TASKNOTRDY 0xe0 +#define OMAP_DSP_EID_TASKBSY 0xe1 +#define OMAP_DSP_EID_TASKERR 0xef +#define OMAP_DSP_EID_BADCFGTYP 0xf0 +#define OMAP_DSP_EID_DEBUG 0xf8 +#define OMAP_DSP_EID_BADSEQ 0xfe +#define OMAP_DSP_EID_BADCMD 0xff + +#define OMAP_DSP_TNM_LEN 16 + +#define OMAP_DSP_TID_FREE 0xff +#define OMAP_DSP_TID_ANON 0xfe + +#define OMAP_DSP_BID_NULL 0xffff +#define OMAP_DSP_BID_PVT 0xfffe + +#endif /* ASM_ARCH_DSP_H */ diff --git a/include/asm-arm/arch-omap/dsp_common.h b/include/asm-arm/arch-omap/dsp_common.h new file mode 100644 index 00000000000..4fcce694405 --- /dev/null +++ b/include/asm-arm/arch-omap/dsp_common.h @@ -0,0 +1,37 @@ +/* + * linux/include/asm-arm/arch-omap/dsp_common.h + * + * Header for OMAP DSP subsystem control + * + * Copyright (C) 2004,2005 Nokia Corporation + * + * Written by Toshihiro Kobayashi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * 2005/06/03: DSP Gateway version 3.3 + */ + +#ifndef ASM_ARCH_DSP_COMMON_H +#define ASM_ARCH_DSP_COMMON_H + +void omap_dsp_pm_suspend(void); +void omap_dsp_pm_resume(void); +void omap_dsp_request_mpui(void); +void omap_dsp_release_mpui(void); +int omap_dsp_request_mem(void); +int omap_dsp_release_mem(void); + +#endif /* ASM_ARCH_DSP_COMMON_H */ diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S index 57b126889b9..0d29b9c56a9 100644 --- a/include/asm-arm/arch-omap/entry-macro.S +++ b/include/asm-arm/arch-omap/entry-macro.S @@ -8,6 +8,8 @@ * warranty of any kind, whether express or implied. */ +#if defined(CONFIG_ARCH_OMAP1) + .macro disable_fiq .endm @@ -30,3 +32,29 @@ 1510: .endm +#elif defined(CONFIG_ARCH_OMAP24XX) + +#include + + .macro disable_fiq + .endm + + .macro get_irqnr_and_base, irqnr, irqstat, base, tmp + ldr \base, =VA_IC_BASE + ldr \irqnr, [\base, #0x98] /* IRQ pending reg 1 */ + cmp \irqnr, #0x0 + bne 2222f + ldr \irqnr, [\base, #0xb8] /* IRQ pending reg 2 */ + cmp \irqnr, #0x0 + bne 2222f + ldr \irqnr, [\base, #0xd8] /* IRQ pending reg 3 */ + cmp \irqnr, #0x0 +2222: + ldrne \irqnr, [\base, #IRQ_SIR_IRQ] + + .endm + + .macro irq_prio_table + .endm + +#endif diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h index fad2fc93ee7..74cb2b93b70 100644 --- a/include/asm-arm/arch-omap/gpio.h +++ b/include/asm-arm/arch-omap/gpio.h @@ -3,7 +3,7 @@ * * OMAP GPIO handling defines and functions * - * Copyright (C) 2003 Nokia Corporation + * Copyright (C) 2003-2005 Nokia Corporation * * Written by Juha Yrjölä * @@ -30,7 +30,23 @@ #include #include -#define OMAP_MPUIO_BASE 0xfffb5000 +#define OMAP_MPUIO_BASE (void __iomem *)0xfffb5000 + +#ifdef CONFIG_ARCH_OMAP730 +#define OMAP_MPUIO_INPUT_LATCH 0x00 +#define OMAP_MPUIO_OUTPUT 0x02 +#define OMAP_MPUIO_IO_CNTL 0x04 +#define OMAP_MPUIO_KBR_LATCH 0x08 +#define OMAP_MPUIO_KBC 0x0a +#define OMAP_MPUIO_GPIO_EVENT_MODE 0x0c +#define OMAP_MPUIO_GPIO_INT_EDGE 0x0e +#define OMAP_MPUIO_KBD_INT 0x10 +#define OMAP_MPUIO_GPIO_INT 0x12 +#define OMAP_MPUIO_KBD_MASKIT 0x14 +#define OMAP_MPUIO_GPIO_MASKIT 0x16 +#define OMAP_MPUIO_GPIO_DEBOUNCING 0x18 +#define OMAP_MPUIO_LATCH 0x1a +#else #define OMAP_MPUIO_INPUT_LATCH 0x00 #define OMAP_MPUIO_OUTPUT 0x04 #define OMAP_MPUIO_IO_CNTL 0x08 @@ -44,6 +60,7 @@ #define OMAP_MPUIO_GPIO_MASKIT 0x2c #define OMAP_MPUIO_GPIO_DEBOUNCING 0x30 #define OMAP_MPUIO_LATCH 0x34 +#endif #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) @@ -52,18 +69,11 @@ IH_MPUIO_BASE + ((nr) & 0x0f) : \ IH_GPIO_BASE + ((nr) & 0x3f)) -/* For EDGECTRL */ -#define OMAP_GPIO_NO_EDGE 0x00 -#define OMAP_GPIO_FALLING_EDGE 0x01 -#define OMAP_GPIO_RISING_EDGE 0x02 -#define OMAP_GPIO_BOTH_EDGES 0x03 - extern int omap_gpio_init(void); /* Call from board init only */ extern int omap_request_gpio(int gpio); extern void omap_free_gpio(int gpio); extern void omap_set_gpio_direction(int gpio, int is_input); extern void omap_set_gpio_dataout(int gpio, int enable); extern int omap_get_gpio_datain(int gpio); -extern void omap_set_gpio_edge_ctrl(int gpio, int edge); #endif diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h index 48258c7f654..60201e1dd6a 100644 --- a/include/asm-arm/arch-omap/hardware.h +++ b/include/asm-arm/arch-omap/hardware.h @@ -43,6 +43,7 @@ #include #endif #include +#include /* * --------------------------------------------------------------------------- @@ -89,11 +90,12 @@ /* DPLL control registers */ #define DPLL_CTL (0xfffecf00) -/* DSP clock control */ +/* DSP clock control. Must use __raw_readw() and __raw_writew() with these */ #define DSP_CONFIG_REG_BASE (0xe1008000) #define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0) #define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) #define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) +#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14) /* * --------------------------------------------------------------------------- @@ -142,6 +144,13 @@ * Interrupts * --------------------------------------------------------------------------- */ +#ifdef CONFIG_ARCH_OMAP1 + +/* + * XXX: These probably want to be moved to arch/arm/mach-omap/omap1/irq.c + * or something similar.. -- PFM. + */ + #define OMAP_IH1_BASE 0xfffecb00 #define OMAP_IH2_BASE 0xfffe0000 @@ -170,6 +179,8 @@ #define IRQ_ILR0_REG_OFFSET 0x1c #define IRQ_GMR_REG_OFFSET 0xa0 +#endif + /* * ---------------------------------------------------------------------------- * System control registers @@ -258,26 +269,6 @@ #ifndef __ASSEMBLER__ -/* - * --------------------------------------------------------------------------- - * Serial ports - * --------------------------------------------------------------------------- - */ -#define OMAP_UART1_BASE (unsigned char *)0xfffb0000 -#define OMAP_UART2_BASE (unsigned char *)0xfffb0800 -#define OMAP_UART3_BASE (unsigned char *)0xfffb9800 -#define OMAP_MAX_NR_PORTS 3 -#define OMAP1510_BASE_BAUD (12000000/16) -#define OMAP16XX_BASE_BAUD (48000000/16) - -#define is_omap_port(p) ({int __ret = 0; \ - if (p == IO_ADDRESS(OMAP_UART1_BASE) || \ - p == IO_ADDRESS(OMAP_UART2_BASE) || \ - p == IO_ADDRESS(OMAP_UART3_BASE)) \ - __ret = 1; \ - __ret; \ - }) - /* * --------------------------------------------------------------------------- * Processor specific defines @@ -286,6 +277,11 @@ #include "omap730.h" #include "omap1510.h" + +#ifdef CONFIG_ARCH_OMAP24XX +#include "omap24xx.h" +#endif + #include "omap16xx.h" /* @@ -312,7 +308,6 @@ #ifdef CONFIG_MACH_OMAP_H4 #include "board-h4.h" -#error "Support for H4 board not yet implemented." #endif #ifdef CONFIG_MACH_OMAP_OSK diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index 1c8c9fcc766..11fbf629bf7 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h @@ -49,16 +49,24 @@ * I/O mapping * ---------------------------------------------------------------------------- */ -#define IO_PHYS 0xFFFB0000 -#define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ -#define IO_VIRT (IO_PHYS - IO_OFFSET) -#define IO_SIZE 0x40000 -#define IO_ADDRESS(x) ((x) - IO_OFFSET) -#define PCIO_BASE 0 +#if defined(CONFIG_ARCH_OMAP1) +#define IO_PHYS 0xFFFB0000 +#define IO_OFFSET -0x01000000 /* Virtual IO = 0xfefb0000 */ +#define IO_SIZE 0x40000 -#define io_p2v(x) ((x) - IO_OFFSET) -#define io_v2p(x) ((x) + IO_OFFSET) +#elif defined(CONFIG_ARCH_OMAP2) +#define IO_PHYS 0x48000000 /* L4 peripherals; other stuff has to be mapped * + * manually. */ +#define IO_OFFSET 0x90000000 /* Virtual IO = 0xd8000000 */ +#define IO_SIZE 0x08000000 +#endif + +#define IO_VIRT (IO_PHYS + IO_OFFSET) +#define IO_ADDRESS(x) ((x) + IO_OFFSET) +#define PCIO_BASE 0 +#define io_p2v(x) ((x) + IO_OFFSET) +#define io_v2p(x) ((x) - IO_OFFSET) #ifndef __ASSEMBLER__ @@ -96,6 +104,8 @@ typedef struct { volatile u32 offset[4096]; } __regbase32; ->offset[((vaddr)&4095)>>2] #define __REG32(paddr) __REGV32(io_p2v(paddr)) +extern void omap_map_common_io(void); + #else #define __REG8(paddr) io_p2v(paddr) diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 0d05a7c957d..74e108ccac1 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h @@ -135,7 +135,6 @@ /* * OMAP-1510 specific IRQ numbers for interrupt handler 2 */ -#define INT_1510_OS_32kHz_TIMER (22 + IH2_BASE) #define INT_1510_COM_SPI_RO (31 + IH2_BASE) /* @@ -232,6 +231,11 @@ #define INT_730_DMA_CH15 (62 + IH2_BASE) #define INT_730_NAND (63 + IH2_BASE) +#define INT_24XX_GPIO_BANK1 29 +#define INT_24XX_GPIO_BANK2 30 +#define INT_24XX_GPIO_BANK3 31 +#define INT_24XX_GPIO_BANK4 32 + /* Max. 128 level 2 IRQs (OMAP1610), 192 GPIOs (OMAP730) and * 16 MPUIO lines */ #define OMAP_MAX_GPIO_LINES 192 diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h index f6b57dd846a..84f81e315a2 100644 --- a/include/asm-arm/arch-omap/memory.h +++ b/include/asm-arm/arch-omap/memory.h @@ -36,12 +36,11 @@ /* * Physical DRAM offset. */ +#if defined(CONFIG_ARCH_OMAP1) #define PHYS_OFFSET (0x10000000UL) - -/* - * OMAP-1510 Local Bus address offset - */ -#define OMAP1510_LB_OFFSET (0x30000000UL) +#elif defined(CONFIG_ARCH_OMAP2) +#define PHYS_OFFSET (0x80000000UL) +#endif /* * Conversion between SDRAM and fake PCI bus, used by USB @@ -64,6 +63,11 @@ */ #ifdef CONFIG_ARCH_OMAP1510 +/* + * OMAP-1510 Local Bus address offset + */ +#define OMAP1510_LB_OFFSET (0x30000000UL) + #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) #define is_lbus_device(dev) (cpu_is_omap1510() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0)) diff --git a/include/asm-arm/arch-omap/mtd-xip.h b/include/asm-arm/arch-omap/mtd-xip.h new file mode 100644 index 00000000000..a73a28571fe --- /dev/null +++ b/include/asm-arm/arch-omap/mtd-xip.h @@ -0,0 +1,61 @@ +/* + * MTD primitives for XIP support. Architecture specific functions. + * + * Do not include this file directly. It's included from linux/mtd/xip.h + * + * Author: Vladimir Barinov + * + * (c) 2005 MontaVista Software, Inc. This file is licensed under the + * terms of the GNU General Public License version 2. This program is + * licensed "as is" without any warranty of any kind, whether express or + * implied. + */ + +#ifndef __ARCH_OMAP_MTD_XIP_H__ +#define __ARCH_OMAP_MTD_XIP_H__ + +#include +#define OMAP_MPU_TIMER_BASE (0xfffec500) +#define OMAP_MPU_TIMER_OFFSET 0x100 + +typedef struct { + u32 cntl; /* CNTL_TIMER, R/W */ + u32 load_tim; /* LOAD_TIM, W */ + u32 read_tim; /* READ_TIM, R */ +} xip_omap_mpu_timer_regs_t; + +#define xip_omap_mpu_timer_base(n) \ +((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ + (n)*OMAP_MPU_TIMER_OFFSET)) + +static inline unsigned long xip_omap_mpu_timer_read(int nr) +{ + volatile xip_omap_mpu_timer_regs_t* timer = xip_omap_mpu_timer_base(nr); + return timer->read_tim; +} + +#define xip_irqpending() \ + (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR)) +#define xip_currtime() (~xip_omap_mpu_timer_read(0)) + +/* + * It's permitted to do approxmation for xip_elapsed_since macro + * (see linux/mtd/xip.h) + */ + +#ifdef CONFIG_MACH_OMAP_PERSEUS2 +#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 7) +#else +#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6) +#endif + +/* + * xip_cpu_idle() is used when waiting for a delay equal or larger than + * the system timer tick period. This should put the CPU into idle mode + * to save power and to be woken up only when some interrupts are pending. + * As above, this should not rely upon standard kernel code. + */ + +#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1)) + +#endif /* __ARCH_OMAP_MTD_XIP_H__ */ diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 5bd3f0097fc..1b1ad410534 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h @@ -185,6 +185,7 @@ typedef enum { /* MPUIO */ MPUIO2, + N15_1610_MPUIO2, MPUIO4, MPUIO5, T20_1610_MPUIO5, @@ -210,6 +211,7 @@ typedef enum { /* Misc ballouts */ BALLOUT_V8_ARMIO3, + N20_HDQ, /* OMAP-1610 MMC2 */ W8_1610_MMC2_DAT0, @@ -235,6 +237,7 @@ typedef enum { P20_1610_GPIO4, V9_1610_GPIO7, W8_1610_GPIO9, + N20_1610_GPIO11, N19_1610_GPIO13, P10_1610_GPIO22, V5_1610_GPIO24, @@ -250,7 +253,7 @@ typedef enum { U18_1610_UWIRE_SDI, W21_1610_UWIRE_SDO, N14_1610_UWIRE_CS0, - P15_1610_UWIRE_CS0, + P15_1610_UWIRE_CS3, N15_1610_UWIRE_CS1, /* OMAP-1610 Flash */ @@ -411,7 +414,8 @@ MUX_CFG("N21_1710_GPIO14", 6, 9, 0, 1, 1, 1, 1, 1, 1) MUX_CFG("W15_1710_GPIO40", 9, 27, 7, 2, 5, 1, 2, 1, 1) /* MPUIO */ -MUX_CFG("MPUIO2", 7, 18, 0, 1, 1, 1, NA, 0, 1) +MUX_CFG("MPUIO2", 7, 18, 0, 1, 14, 1, NA, 0, 1) +MUX_CFG("N15_1610_MPUIO2", 7, 18, 0, 1, 14, 1, 1, 0, 1) MUX_CFG("MPUIO4", 7, 15, 0, 1, 13, 1, NA, 0, 1) MUX_CFG("MPUIO5", 7, 12, 0, 1, 12, 1, NA, 0, 1) @@ -438,6 +442,7 @@ MUX_CFG("MCBSP3_CLKX", 9, 3, 1, 1, 29, 0, NA, 0, 1) /* Misc ballouts */ MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1) +MUX_CFG("N20_HDQ", 6, 18, 1, 1, 4, 0, 1, 4, 0) /* OMAP-1610 MMC2 */ MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1) @@ -463,6 +468,7 @@ MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1) MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1) MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1) MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1) +MUX_CFG("N20_1610_GPIO11", 6, 18, 0, 1, 4, 0, 1, 1, 1) MUX_CFG("N19_1610_GPIO13", 6, 12, 0, 1, 2, 0, 1, 1, 1) MUX_CFG("P10_1610_GPIO22", C, 0, 7, 2, 26, 0, 2, 1, 1) MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1) diff --git a/include/asm-arm/arch-omap/omap1510.h b/include/asm-arm/arch-omap/omap1510.h index f491a48ef2e..f086a393390 100644 --- a/include/asm-arm/arch-omap/omap1510.h +++ b/include/asm-arm/arch-omap/omap1510.h @@ -36,10 +36,6 @@ /* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ -#define OMAP1510_SRAM_BASE 0xD0000000 -#define OMAP1510_SRAM_SIZE (SZ_128K + SZ_64K) -#define OMAP1510_SRAM_START 0x20000000 - #define OMAP1510_DSP_BASE 0xE0000000 #define OMAP1510_DSP_SIZE 0x28000 #define OMAP1510_DSP_START 0xE0000000 @@ -48,14 +44,5 @@ #define OMAP1510_DSPREG_SIZE SZ_128K #define OMAP1510_DSPREG_START 0xE1000000 -/* - * ---------------------------------------------------------------------------- - * Memory used by power management - * ---------------------------------------------------------------------------- - */ - -#define OMAP1510_SRAM_IDLE_SUSPEND (OMAP1510_SRAM_BASE + OMAP1510_SRAM_SIZE - 0x200) -#define OMAP1510_SRAM_API_SUSPEND (OMAP1510_SRAM_IDLE_SUSPEND + 0x100) - #endif /* __ASM_ARCH_OMAP1510_H */ diff --git a/include/asm-arm/arch-omap/omap16xx.h b/include/asm-arm/arch-omap/omap16xx.h index 38a9b95e6a3..f0c7f0fb4dc 100644 --- a/include/asm-arm/arch-omap/omap16xx.h +++ b/include/asm-arm/arch-omap/omap16xx.h @@ -36,11 +36,6 @@ /* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ -#define OMAP16XX_SRAM_BASE 0xD0000000 -#define OMAP1610_SRAM_SIZE (SZ_16K) -#define OMAP5912_SRAM_SIZE 0x3E800 -#define OMAP16XX_SRAM_START 0x20000000 - #define OMAP16XX_DSP_BASE 0xE0000000 #define OMAP16XX_DSP_SIZE 0x28000 #define OMAP16XX_DSP_START 0xE0000000 @@ -49,17 +44,6 @@ #define OMAP16XX_DSPREG_SIZE SZ_128K #define OMAP16XX_DSPREG_START 0xE1000000 -/* - * ---------------------------------------------------------------------------- - * Memory used by power management - * ---------------------------------------------------------------------------- - */ - -#define OMAP1610_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP1610_SRAM_SIZE - 0x200) -#define OMAP1610_SRAM_API_SUSPEND (OMAP1610_SRAM_IDLE_SUSPEND + 0x100) -#define OMAP5912_SRAM_IDLE_SUSPEND (OMAP16XX_SRAM_BASE + OMAP5912_SRAM_SIZE - 0x200) -#define OMAP5912_SRAM_API_SUSPEND (OMAP5912_SRAM_IDLE_SUSPEND + 0x100) - /* * --------------------------------------------------------------------------- * Interrupts diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h new file mode 100644 index 00000000000..a9105466a41 --- /dev/null +++ b/include/asm-arm/arch-omap/omap24xx.h @@ -0,0 +1,15 @@ +#ifndef __ASM_ARCH_OMAP24XX_H +#define __ASM_ARCH_OMAP24XX_H + +#define OMAP24XX_L4_IO_BASE 0x48000000 + +/* interrupt controller */ +#define OMAP24XX_IC_BASE (OMAP24XX_L4_IO_BASE + 0xfe000) +#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) + +#define OMAP24XX_IVA_INTC_BASE 0x40000000 + +#define IRQ_SIR_IRQ 0x0040 + +#endif /* __ASM_ARCH_OMAP24XX_H */ + diff --git a/include/asm-arm/arch-omap/omap730.h b/include/asm-arm/arch-omap/omap730.h index 599ab00f548..755b64c5e9f 100644 --- a/include/asm-arm/arch-omap/omap730.h +++ b/include/asm-arm/arch-omap/omap730.h @@ -36,10 +36,6 @@ /* Syntax: XX_BASE = Virtual base address, XX_START = Physical base address */ -#define OMAP730_SRAM_BASE 0xD0000000 -#define OMAP730_SRAM_SIZE (SZ_128K + SZ_64K + SZ_8K) -#define OMAP730_SRAM_START 0x20000000 - #define OMAP730_DSP_BASE 0xE0000000 #define OMAP730_DSP_SIZE 0x50000 #define OMAP730_DSP_START 0xE0000000 diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index f209fc0953f..fbd742d0c49 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h @@ -61,7 +61,10 @@ #define PER_EN 0x1 #define CPU_SUSPEND_SIZE 200 -#define ULPD_LOW_POWER_EN 0x0001 +#define ULPD_LOW_PWR_EN 0x0001 +#define ULPD_DEEP_SLEEP_TRANSITION_EN 0x0010 +#define ULPD_SETUP_ANALOG_CELL_3_VAL 0 +#define ULPD_POWER_CTRL_REG_VAL 0x0219 #define DSP_IDLE_DELAY 10 #define DSP_IDLE 0x0040 @@ -86,46 +89,35 @@ #define OMAP1510_BIG_SLEEP_REQUEST 0x0cc5 #define OMAP1510_IDLE_LOOP_REQUEST 0x0c00 #define OMAP1510_IDLE_CLOCK_DOMAINS 0x2 -#define OMAP1510_ULPD_LOW_POWER_REQ 0x0001 -#define OMAP1610_DEEP_SLEEP_REQUEST 0x17c7 -#define OMAP1610_BIG_SLEEP_REQUEST TBD +/* Both big sleep and deep sleep use same values. Difference is in ULPD. */ +#define OMAP1610_IDLECT1_SLEEP_VAL 0x13c7 +#define OMAP1610_IDLECT2_SLEEP_VAL 0x09c7 +#define OMAP1610_IDLECT3_VAL 0x3f +#define OMAP1610_IDLECT3_SLEEP_ORMASK 0x2c +#define OMAP1610_IDLECT3 0xfffece24 #define OMAP1610_IDLE_LOOP_REQUEST 0x0400 -#define OMAP1610_IDLE_CLOCK_DOMAINS 0x09c7 -#define OMAP1610_ULPD_LOW_POWER_REQ 0x3 - -#ifndef OMAP1510_SRAM_IDLE_SUSPEND -#define OMAP1510_SRAM_IDLE_SUSPEND 0 -#endif -#ifndef OMAP1610_SRAM_IDLE_SUSPEND -#define OMAP1610_SRAM_IDLE_SUSPEND 0 -#endif -#ifndef OMAP5912_SRAM_IDLE_SUSPEND -#define OMAP5912_SRAM_IDLE_SUSPEND 0 -#endif - -#ifndef OMAP1510_SRAM_API_SUSPEND -#define OMAP1510_SRAM_API_SUSPEND 0 -#endif -#ifndef OMAP1610_SRAM_API_SUSPEND -#define OMAP1610_SRAM_API_SUSPEND 0 -#endif -#ifndef OMAP5912_SRAM_API_SUSPEND -#define OMAP5912_SRAM_API_SUSPEND 0 -#endif #if !defined(CONFIG_ARCH_OMAP1510) && \ - !defined(CONFIG_ARCH_OMAP16XX) + !defined(CONFIG_ARCH_OMAP16XX) && \ + !defined(CONFIG_ARCH_OMAP24XX) #error "Power management for this processor not implemented yet" #endif #ifndef __ASSEMBLER__ extern void omap_pm_idle(void); extern void omap_pm_suspend(void); -extern int omap1510_cpu_suspend(unsigned short, unsigned short); -extern int omap1610_cpu_suspend(unsigned short, unsigned short); -extern int omap1510_idle_loop_suspend(void); -extern int omap1610_idle_loop_suspend(void); +extern void omap1510_cpu_suspend(unsigned short, unsigned short); +extern void omap1610_cpu_suspend(unsigned short, unsigned short); +extern void omap1510_idle_loop_suspend(void); +extern void omap1610_idle_loop_suspend(void); + +#ifdef CONFIG_OMAP_SERIAL_WAKE +extern void omap_serial_wake_trigger(int enable); +#else +#define omap_serial_wake_trigger(x) {} +#endif /* CONFIG_OMAP_SERIAL_WAKE */ + extern unsigned int omap1510_cpu_suspend_sz; extern unsigned int omap1510_idle_loop_suspend_sz; extern unsigned int omap1610_cpu_suspend_sz; @@ -161,6 +153,7 @@ enum arm_save_state { ARM_SLEEP_SAVE_ARM_CKCTL, ARM_SLEEP_SAVE_ARM_IDLECT1, ARM_SLEEP_SAVE_ARM_IDLECT2, + ARM_SLEEP_SAVE_ARM_IDLECT3, ARM_SLEEP_SAVE_ARM_EWUPCT, ARM_SLEEP_SAVE_ARM_RSTCT1, ARM_SLEEP_SAVE_ARM_RSTCT2, diff --git a/include/asm-arm/arch-omap/serial.h b/include/asm-arm/arch-omap/serial.h new file mode 100644 index 00000000000..79a5297af9f --- /dev/null +++ b/include/asm-arm/arch-omap/serial.h @@ -0,0 +1,37 @@ +/* + * linux/include/asm-arm/arch-omap/serial.h + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __ASM_ARCH_SERIAL_H +#define __ASM_ARCH_SERIAL_H + +#if defined(CONFIG_ARCH_OMAP1) +/* OMAP1 serial ports */ +#define OMAP_UART1_BASE 0xfffb0000 +#define OMAP_UART2_BASE 0xfffb0800 +#define OMAP_UART3_BASE 0xfffb9800 +#elif defined(CONFIG_ARCH_OMAP2) +/* OMAP2 serial ports */ +#define OMAP_UART1_BASE 0x4806a000 +#define OMAP_UART2_BASE 0x4806c000 +#define OMAP_UART3_BASE 0x4806e000 +#endif + +#define OMAP_MAX_NR_PORTS 3 +#define OMAP1510_BASE_BAUD (12000000/16) +#define OMAP16XX_BASE_BAUD (48000000/16) + +#define is_omap_port(p) ({int __ret = 0; \ + if (p == IO_ADDRESS(OMAP_UART1_BASE) || \ + p == IO_ADDRESS(OMAP_UART2_BASE) || \ + p == IO_ADDRESS(OMAP_UART3_BASE)) \ + __ret = 1; \ + __ret; \ + }) + +#endif diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h index 3e640aba8c2..3545c86859c 100644 --- a/include/asm-arm/arch-omap/uncompress.h +++ b/include/asm-arm/arch-omap/uncompress.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include unsigned int system_rev; @@ -34,8 +34,9 @@ static void putstr(const char *s) { volatile u8 * uart = 0; - int shift; + int shift = 2; +#ifdef CONFIG_ARCH_OMAP #ifdef CONFIG_OMAP_LL_DEBUG_UART3 uart = (volatile u8 *)(OMAP_UART3_BASE); #elif CONFIG_OMAP_LL_DEBUG_UART2 @@ -44,6 +45,7 @@ putstr(const char *s) uart = (volatile u8 *)(OMAP_UART1_BASE); #endif +#ifdef CONFIG_ARCH_OMAP1 /* Determine which serial port to use */ do { /* MMU is not on, so cpu_is_omapXXXX() won't work here */ @@ -51,14 +53,14 @@ putstr(const char *s) if (omap_id == OMAP_ID_730) shift = 0; - else - shift = 2; if (check_port(uart, shift)) break; /* Silent boot if no serial ports are enabled. */ return; } while (0); +#endif /* CONFIG_ARCH_OMAP1 */ +#endif /* * Now, xmit each character -- cgit v1.2.3 From a52ac87eb249f5e87f43e1a0adeb1a737f4a2b43 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Wed, 7 Sep 2005 14:04:14 +0900 Subject: [IA64] Minor cleanups - remove unnecessary function prototype in irq.h The function prototype for handl_IRQ_event() in include/asm-ia64/irq.h is no longer needed. This patch removes it. Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck --- include/asm-ia64/irq.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h index bd07d11d9f3..585644c6b21 100644 --- a/include/asm-ia64/irq.h +++ b/include/asm-ia64/irq.h @@ -36,8 +36,4 @@ extern void move_irq(int irq); #define move_irq(irq) #endif -struct irqaction; -struct pt_regs; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #endif /* _ASM_IA64_IRQ_H */ -- cgit v1.2.3 From 697eaad417f9f2e40f62282e8b396208b72990cf Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Wed, 7 Sep 2005 14:06:25 +0900 Subject: [IA64] Minor cleanups - remove CONFIG_ACPI_DEALLOCATE_IRQ The config option 'CONFIG_ACPI_DEALLOCATE_IRQ' is no longer needed. This patch removes it. Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck --- include/asm-ia64/iosapic.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index a429fe225b0..9a18820f22a 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h @@ -83,9 +83,7 @@ extern int gsi_to_irq (unsigned int gsi); extern void iosapic_enable_intr (unsigned int vector); extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, unsigned long trigger); -#ifdef CONFIG_ACPI_DEALLOCATE_IRQ extern void iosapic_unregister_intr (unsigned int irq); -#endif extern void __init iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, unsigned long polarity, unsigned long trigger); -- cgit v1.2.3 From 9799e4d39a7e2763a614084f6ae6cc936047de70 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Wed, 7 Sep 2005 14:08:18 +0900 Subject: [IA64] Minor cleanups - remove unnecessary function prototype in iosapic.h The function prototypes for iosapic_enable_intr() and iosapic_pci_fixup() in include/asm-ia64/iosapic.h are no longer needed. This patch removes them. The original patch has been posted by Satoru Takeuchi. Signed-off-by: Satoru Takeuchi Signed-off-by: Kenji Kaneshige Signed-off-by: Tony Luck --- include/asm-ia64/iosapic.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index 9a18820f22a..20f98f1751a 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h @@ -80,7 +80,6 @@ extern int iosapic_remove (unsigned int gsi_base); #endif /* CONFIG_HOTPLUG */ extern int gsi_to_vector (unsigned int gsi); extern int gsi_to_irq (unsigned int gsi); -extern void iosapic_enable_intr (unsigned int vector); extern int iosapic_register_intr (unsigned int gsi, unsigned long polarity, unsigned long trigger); extern void iosapic_unregister_intr (unsigned int irq); @@ -95,7 +94,6 @@ extern int __init iosapic_register_platform_intr (u32 int_type, unsigned long trigger); extern unsigned int iosapic_version (char __iomem *addr); -extern void iosapic_pci_fixup (int); #ifdef CONFIG_NUMA extern void __devinit map_iosapic_to_node (unsigned int, int); #endif -- cgit v1.2.3 From f63ed39c578a2a2d067356a85ce7c28a7c795d8a Mon Sep 17 00:00:00 2001 From: Eugene Surovegin Date: Tue, 6 Sep 2005 15:16:14 -0700 Subject: [PATCH] ppc32: add missing sysfs node for ocp_func_emac_data.phy_feat_exc Add sysfs node for ocp_func_emac_data.phy_feat_exc field. Signed-off-by: Eugene Surovegin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/ibm_ocp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h index bd7656fa202..6f10a25bd62 100644 --- a/include/asm-ppc/ibm_ocp.h +++ b/include/asm-ppc/ibm_ocp.h @@ -84,6 +84,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \ +OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_feat_exc)\ \ void ocp_show_emac_data(struct device *dev) \ { \ @@ -99,6 +100,7 @@ void ocp_show_emac_data(struct device *dev) \ device_create_file(dev, &dev_attr_emac_tah_idx); \ device_create_file(dev, &dev_attr_emac_phy_mode); \ device_create_file(dev, &dev_attr_emac_phy_map); \ + device_create_file(dev, &dev_attr_emac_phy_feat_exc); \ } /* -- cgit v1.2.3 From 54d5d42404e7705cf3804593189e963350d470e5 Mon Sep 17 00:00:00 2001 From: Ashok Raj Date: Tue, 6 Sep 2005 15:16:15 -0700 Subject: [PATCH] x86/x86_64: deferred handling of writes to /proc/irqxx/smp_affinity When handling writes to /proc/irq, current code is re-programming rte entries directly. This is not recommended and could potentially cause chipset's to lockup, or cause missing interrupts. CONFIG_IRQ_BALANCE does this correctly, where it re-programs only when the interrupt is pending. The same needs to be done for /proc/irq handling as well. Otherwise user space irq balancers are really not doing the right thing. - Changed pending_irq_balance_cpumask to pending_irq_migrate_cpumask for lack of a generic name. - added move_irq out of IRQ_BALANCE, and added this same to X86_64 - Added new proc handler for write, so we can do deferred write at irq handling time. - Display of /proc/irq/XX/smp_affinity used to display CPU_MASKALL, instead it now shows only active cpu masks, or exactly what was set. - Provided a common move_irq implementation, instead of duplicating when using generic irq framework. Tested on i386/x86_64 and ia64 with CONFIG_PCI_MSI turned on and off. Tested UP builds as well. MSI testing: tbd: I have cards, need to look for a x-over cable, although I did test an earlier version of this patch. Will test in a couple days. Signed-off-by: Ashok Raj Acked-by: Zwane Mwaikambo Grudgingly-acked-by: Andi Kleen Signed-off-by: Coywolf Qi Hunt Signed-off-by: Ashok Raj Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/hw_irq.h | 7 --- include/asm-ia64/irq.h | 6 --- include/linux/irq.h | 123 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index 041ab8c51a6..0cf119b42f7 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h @@ -116,13 +116,6 @@ __ia64_local_vector_to_irq (ia64_vector vec) * and to obtain the irq descriptor for a given irq number. */ -/* Return a pointer to the irq descriptor for IRQ. */ -static inline irq_desc_t * -irq_descp (int irq) -{ - return irq_desc + irq; -} - /* Extract the IA-64 vector that corresponds to IRQ. */ static inline ia64_vector irq_to_vector (int irq) diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h index bd07d11d9f3..5d930fdc0be 100644 --- a/include/asm-ia64/irq.h +++ b/include/asm-ia64/irq.h @@ -30,12 +30,6 @@ extern void disable_irq_nosync (unsigned int); extern void enable_irq (unsigned int); extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); -#ifdef CONFIG_SMP -extern void move_irq(int irq); -#else -#define move_irq(irq) -#endif - struct irqaction; struct pt_regs; int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); diff --git a/include/linux/irq.h b/include/linux/irq.h index 069d3b84d31..4a362b9ec96 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -71,16 +71,139 @@ typedef struct irq_desc { unsigned int irq_count; /* For detecting broken interrupts */ unsigned int irqs_unhandled; spinlock_t lock; +#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) + unsigned int move_irq; /* Flag need to re-target intr dest*/ +#endif } ____cacheline_aligned irq_desc_t; extern irq_desc_t irq_desc [NR_IRQS]; +/* Return a pointer to the irq descriptor for IRQ. */ +static inline irq_desc_t * +irq_descp (int irq) +{ + return irq_desc + irq; +} + #include /* the arch dependent stuff */ extern int setup_irq(unsigned int irq, struct irqaction * new); #ifdef CONFIG_GENERIC_HARDIRQS extern cpumask_t irq_affinity[NR_IRQS]; + +#ifdef CONFIG_SMP +static inline void set_native_irq_info(int irq, cpumask_t mask) +{ + irq_affinity[irq] = mask; +} +#else +static inline void set_native_irq_info(int irq, cpumask_t mask) +{ +} +#endif + +#ifdef CONFIG_SMP + +#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) +extern cpumask_t pending_irq_cpumask[NR_IRQS]; + +static inline void set_pending_irq(unsigned int irq, cpumask_t mask) +{ + irq_desc_t *desc = irq_desc + irq; + unsigned long flags; + + spin_lock_irqsave(&desc->lock, flags); + desc->move_irq = 1; + pending_irq_cpumask[irq] = mask; + spin_unlock_irqrestore(&desc->lock, flags); +} + +static inline void +move_native_irq(int irq) +{ + cpumask_t tmp; + irq_desc_t *desc = irq_descp(irq); + + if (likely (!desc->move_irq)) + return; + + desc->move_irq = 0; + + if (likely(cpus_empty(pending_irq_cpumask[irq]))) + return; + + if (!desc->handler->set_affinity) + return; + + /* note - we hold the desc->lock */ + cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); + + /* + * If there was a valid mask to work with, please + * do the disable, re-program, enable sequence. + * This is *not* particularly important for level triggered + * but in a edge trigger case, we might be setting rte + * when an active trigger is comming in. This could + * cause some ioapics to mal-function. + * Being paranoid i guess! + */ + if (unlikely(!cpus_empty(tmp))) { + desc->handler->disable(irq); + desc->handler->set_affinity(irq,tmp); + desc->handler->enable(irq); + } + cpus_clear(pending_irq_cpumask[irq]); +} + +#ifdef CONFIG_PCI_MSI +/* + * Wonder why these are dummies? + * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq() + * counter part after translating the vector to irq info. We need to perform + * this operation on the real irq, when we dont use vector, i.e when + * pci_use_vector() is false. + */ +static inline void move_irq(int irq) +{ +} + +static inline void set_irq_info(int irq, cpumask_t mask) +{ +} + +#else // CONFIG_PCI_MSI + +static inline void move_irq(int irq) +{ + move_native_irq(irq); +} + +static inline void set_irq_info(int irq, cpumask_t mask) +{ + set_native_irq_info(irq, mask); +} +#endif // CONFIG_PCI_MSI + +#else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE + +#define move_irq(x) +#define move_native_irq(x) +#define set_pending_irq(x,y) +static inline void set_irq_info(int irq, cpumask_t mask) +{ + set_native_irq_info(irq, mask); +} + +#endif // CONFIG_GENERIC_PENDING_IRQ + +#else // CONFIG_SMP + +#define move_irq(x) +#define move_native_irq(x) + +#endif // CONFIG_SMP + extern int no_irq_affinity; extern int noirqdebug_setup(char *str); -- cgit v1.2.3 From 19aaabb5841439988fc357f90d5c59d28fa84658 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 6 Sep 2005 15:16:17 -0700 Subject: [PATCH] x86_64: prefetchw() can fall back to prefetch() if !3DNOW This is a multi-part message in MIME format. If the cpu lacks 3DNOW feature, we can use a normal prefetcht0 instruction instead of NOP5. "prefetchw (%rxx)" and "prefetcht0 (%rxx)" have the same length, ranging from 3 to 5 bytes depending on the register. So this patch even helps AMD64, shortening the length of the code. Signed-off-by: Eric Dumazet Acked-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86_64/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h index 194160f6a43..a8321999448 100644 --- a/include/asm-x86_64/processor.h +++ b/include/asm-x86_64/processor.h @@ -398,7 +398,7 @@ static inline void prefetch(void *x) #define ARCH_HAS_PREFETCHW 1 static inline void prefetchw(void *x) { - alternative_input(ASM_NOP5, + alternative_input("prefetcht0 (%1)", "prefetchw (%1)", X86_FEATURE_3DNOW, "r" (x)); -- cgit v1.2.3 From 4732efbeb997189d9f9b04708dc26bf8613ed721 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 6 Sep 2005 15:16:25 -0700 Subject: [PATCH] FUTEX_WAKE_OP: pthread_cond_signal() speedup ATM pthread_cond_signal is unnecessarily slow, because it wakes one waiter (which at least on UP usually means an immediate context switch to one of the waiter threads). This waiter wakes up and after a few instructions it attempts to acquire the cv internal lock, but that lock is still held by the thread calling pthread_cond_signal. So it goes to sleep and eventually the signalling thread is scheduled in, unlocks the internal lock and wakes the waiter again. Now, before 2003-09-21 NPTL was using FUTEX_REQUEUE in pthread_cond_signal to avoid this performance issue, but it was removed when locks were redesigned to the 3 state scheme (unlocked, locked uncontended, locked contended). Following scenario shows why simply using FUTEX_REQUEUE in pthread_cond_signal together with using lll_mutex_unlock_force in place of lll_mutex_unlock is not enough and probably why it has been disabled at that time: The number is value in cv->__data.__lock. thr1 thr2 thr3 0 pthread_cond_wait 1 lll_mutex_lock (cv->__data.__lock) 0 lll_mutex_unlock (cv->__data.__lock) 0 lll_futex_wait (&cv->__data.__futex, futexval) 0 pthread_cond_signal 1 lll_mutex_lock (cv->__data.__lock) 1 pthread_cond_signal 2 lll_mutex_lock (cv->__data.__lock) 2 lll_futex_wait (&cv->__data.__lock, 2) 2 lll_futex_requeue (&cv->__data.__futex, 0, 1, &cv->__data.__lock) # FUTEX_REQUEUE, not FUTEX_CMP_REQUEUE 2 lll_mutex_unlock_force (cv->__data.__lock) 0 cv->__data.__lock = 0 0 lll_futex_wake (&cv->__data.__lock, 1) 1 lll_mutex_lock (cv->__data.__lock) 0 lll_mutex_unlock (cv->__data.__lock) # Here, lll_mutex_unlock doesn't know there are threads waiting # on the internal cv's lock Now, I believe it is possible to use FUTEX_REQUEUE in pthread_cond_signal, but it will cost us not one, but 2 extra syscalls and, what's worse, one of these extra syscalls will be done for every single waiting loop in pthread_cond_*wait. We would need to use lll_mutex_unlock_force in pthread_cond_signal after requeue and lll_mutex_cond_lock in pthread_cond_*wait after lll_futex_wait. Another alternative is to do the unlocking pthread_cond_signal needs to do (the lock can't be unlocked before lll_futex_wake, as that is racy) in the kernel. I have implemented both variants, futex-requeue-glibc.patch is the first one and futex-wake_op{,-glibc}.patch is the unlocking inside of the kernel. The kernel interface allows userland to specify how exactly an unlocking operation should look like (some atomic arithmetic operation with optional constant argument and comparison of the previous futex value with another constant). It has been implemented just for ppc*, x86_64 and i?86, for other architectures I'm including just a stub header which can be used as a starting point by maintainers to write support for their arches and ATM will just return -ENOSYS for FUTEX_WAKE_OP. The requeue patch has been (lightly) tested just on x86_64, the wake_op patch on ppc64 kernel running 32-bit and 64-bit NPTL and x86_64 kernel running 32-bit and 64-bit NPTL. With the following benchmark on UP x86-64 I get: for i in nptl-orig nptl-requeue nptl-wake_op; do echo time elf/ld.so --library-path .:$i /tmp/bench; \ for j in 1 2; do echo ( time elf/ld.so --library-path .:$i /tmp/bench ) 2>&1; done; done time elf/ld.so --library-path .:nptl-orig /tmp/bench real 0m0.655s user 0m0.253s sys 0m0.403s real 0m0.657s user 0m0.269s sys 0m0.388s time elf/ld.so --library-path .:nptl-requeue /tmp/bench real 0m0.496s user 0m0.225s sys 0m0.271s real 0m0.531s user 0m0.242s sys 0m0.288s time elf/ld.so --library-path .:nptl-wake_op /tmp/bench real 0m0.380s user 0m0.176s sys 0m0.204s real 0m0.382s user 0m0.175s sys 0m0.207s The benchmark is at: http://sourceware.org/ml/libc-alpha/2005-03/txt00001.txt Older futex-requeue-glibc.patch version is at: http://sourceware.org/ml/libc-alpha/2005-03/txt00002.txt Older futex-wake_op-glibc.patch version is at: http://sourceware.org/ml/libc-alpha/2005-03/txt00003.txt Will post a new version (just x86-64 fixes so that the patch applies against pthread_cond_signal.S) to libc-hacker ml soon. Attached is the kernel FUTEX_WAKE_OP patch as well as a simple-minded testcase that will not test the atomicity of the operation, but at least check if the threads that should have been woken up are woken up and whether the arithmetic operation in the kernel gave the expected results. Acked-by: Ingo Molnar Cc: Ulrich Drepper Cc: Jamie Lokier Cc: Rusty Russell Signed-off-by: Yoichi Yuasa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/futex.h | 53 +++++++++++++++++++++ include/asm-arm/futex.h | 53 +++++++++++++++++++++ include/asm-arm26/futex.h | 53 +++++++++++++++++++++ include/asm-cris/futex.h | 53 +++++++++++++++++++++ include/asm-frv/futex.h | 53 +++++++++++++++++++++ include/asm-h8300/futex.h | 53 +++++++++++++++++++++ include/asm-i386/futex.h | 108 ++++++++++++++++++++++++++++++++++++++++++ include/asm-ia64/futex.h | 53 +++++++++++++++++++++ include/asm-m32r/futex.h | 53 +++++++++++++++++++++ include/asm-m68k/futex.h | 53 +++++++++++++++++++++ include/asm-m68knommu/futex.h | 53 +++++++++++++++++++++ include/asm-mips/futex.h | 53 +++++++++++++++++++++ include/asm-parisc/futex.h | 53 +++++++++++++++++++++ include/asm-ppc/futex.h | 53 +++++++++++++++++++++ include/asm-ppc64/futex.h | 83 ++++++++++++++++++++++++++++++++ include/asm-ppc64/memory.h | 2 + include/asm-s390/futex.h | 53 +++++++++++++++++++++ include/asm-sh/futex.h | 53 +++++++++++++++++++++ include/asm-sh64/futex.h | 53 +++++++++++++++++++++ include/asm-sparc/futex.h | 53 +++++++++++++++++++++ include/asm-sparc64/futex.h | 53 +++++++++++++++++++++ include/asm-um/futex.h | 53 +++++++++++++++++++++ include/asm-v850/futex.h | 53 +++++++++++++++++++++ include/asm-x86_64/futex.h | 98 ++++++++++++++++++++++++++++++++++++++ include/linux/futex.h | 36 ++++++++++++-- 25 files changed, 1382 insertions(+), 5 deletions(-) create mode 100644 include/asm-alpha/futex.h create mode 100644 include/asm-arm/futex.h create mode 100644 include/asm-arm26/futex.h create mode 100644 include/asm-cris/futex.h create mode 100644 include/asm-frv/futex.h create mode 100644 include/asm-h8300/futex.h create mode 100644 include/asm-i386/futex.h create mode 100644 include/asm-ia64/futex.h create mode 100644 include/asm-m32r/futex.h create mode 100644 include/asm-m68k/futex.h create mode 100644 include/asm-m68knommu/futex.h create mode 100644 include/asm-mips/futex.h create mode 100644 include/asm-parisc/futex.h create mode 100644 include/asm-ppc/futex.h create mode 100644 include/asm-ppc64/futex.h create mode 100644 include/asm-s390/futex.h create mode 100644 include/asm-sh/futex.h create mode 100644 include/asm-sh64/futex.h create mode 100644 include/asm-sparc/futex.h create mode 100644 include/asm-sparc64/futex.h create mode 100644 include/asm-um/futex.h create mode 100644 include/asm-v850/futex.h create mode 100644 include/asm-x86_64/futex.h (limited to 'include') diff --git a/include/asm-alpha/futex.h b/include/asm-alpha/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-alpha/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-arm/futex.h b/include/asm-arm/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-arm/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-arm26/futex.h b/include/asm-arm26/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-arm26/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-cris/futex.h b/include/asm-cris/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-cris/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-frv/futex.h b/include/asm-frv/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-frv/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-h8300/futex.h b/include/asm-h8300/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-h8300/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h new file mode 100644 index 00000000000..44b9db80647 --- /dev/null +++ b/include/asm-i386/futex.h @@ -0,0 +1,108 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include +#include +#include + +#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ + __asm__ __volatile ( \ +"1: " insn "\n" \ +"2: .section .fixup,\"ax\"\n\ +3: mov %3, %1\n\ + jmp 2b\n\ + .previous\n\ + .section __ex_table,\"a\"\n\ + .align 8\n\ + .long 1b,3b\n\ + .previous" \ + : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ + : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) + +#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ + __asm__ __volatile ( \ +"1: movl %2, %0\n\ + movl %0, %3\n" \ + insn "\n" \ +"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\ + jnz 1b\n\ +3: .section .fixup,\"ax\"\n\ +4: mov %5, %1\n\ + jmp 3b\n\ + .previous\n\ + .section __ex_table,\"a\"\n\ + .align 8\n\ + .long 1b,4b,2b,4b\n\ + .previous" \ + : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ + "=&r" (tem) \ + : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + if (op == FUTEX_OP_SET) + __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg); + else { +#ifndef CONFIG_X86_BSWAP + if (boot_cpu_data.x86 == 3) + ret = -ENOSYS; + else +#endif + switch (op) { + case FUTEX_OP_ADD: + __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, + oldval, uaddr, oparg); + break; + case FUTEX_OP_OR: + __futex_atomic_op2("orl %4, %3", ret, oldval, uaddr, + oparg); + break; + case FUTEX_OP_ANDN: + __futex_atomic_op2("andl %4, %3", ret, oldval, uaddr, + ~oparg); + break; + case FUTEX_OP_XOR: + __futex_atomic_op2("xorl %4, %3", ret, oldval, uaddr, + oparg); + break; + default: + ret = -ENOSYS; + } + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-ia64/futex.h b/include/asm-ia64/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-ia64/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-m32r/futex.h b/include/asm-m32r/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-m32r/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-m68k/futex.h b/include/asm-m68k/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-m68k/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-m68knommu/futex.h b/include/asm-m68knommu/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-m68knommu/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h new file mode 100644 index 00000000000..9feff4ce142 --- /dev/null +++ b/include/asm-mips/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-parisc/futex.h b/include/asm-parisc/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-parisc/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-ppc/futex.h b/include/asm-ppc/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-ppc/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-ppc64/futex.h b/include/asm-ppc64/futex.h new file mode 100644 index 00000000000..cb2640b3a40 --- /dev/null +++ b/include/asm-ppc64/futex.h @@ -0,0 +1,83 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include +#include + +#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ + __asm__ __volatile (SYNC_ON_SMP \ +"1: lwarx %0,0,%2\n" \ + insn \ +"2: stwcx. %1,0,%2\n\ + bne- 1b\n\ + li %1,0\n\ +3: .section .fixup,\"ax\"\n\ +4: li %1,%3\n\ + b 3b\n\ + .previous\n\ + .section __ex_table,\"a\"\n\ + .align 3\n\ + .llong 1b,4b,2b,4b\n\ + .previous" \ + : "=&r" (oldval), "=&r" (ret) \ + : "b" (uaddr), "i" (-EFAULT), "1" (oparg) \ + : "cr0", "memory") + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + __futex_atomic_op("", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ADD: + __futex_atomic_op("add %1,%0,%1\n", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_OR: + __futex_atomic_op("or %1,%0,%1\n", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ANDN: + __futex_atomic_op("andc %1,%0,%1\n", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_XOR: + __futex_atomic_op("xor %1,%0,%1\n", ret, oldval, uaddr, oparg); + break; + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-ppc64/memory.h b/include/asm-ppc64/memory.h index 56e09face9a..af53ffb5572 100644 --- a/include/asm-ppc64/memory.h +++ b/include/asm-ppc64/memory.h @@ -18,9 +18,11 @@ #ifdef CONFIG_SMP #define EIEIO_ON_SMP "eieio\n" #define ISYNC_ON_SMP "\n\tisync" +#define SYNC_ON_SMP "lwsync\n\t" #else #define EIEIO_ON_SMP #define ISYNC_ON_SMP +#define SYNC_ON_SMP #endif static inline void eieio(void) diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-s390/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-sh/futex.h b/include/asm-sh/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-sh/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-sh64/futex.h b/include/asm-sh64/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-sh64/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-sparc/futex.h b/include/asm-sparc/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-sparc/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-sparc64/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-um/futex.h b/include/asm-um/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-um/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-v850/futex.h b/include/asm-v850/futex.h new file mode 100644 index 00000000000..2cac5ecd9d0 --- /dev/null +++ b/include/asm-v850/futex.h @@ -0,0 +1,53 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + case FUTEX_OP_ADD: + case FUTEX_OP_OR: + case FUTEX_OP_ANDN: + case FUTEX_OP_XOR: + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/asm-x86_64/futex.h b/include/asm-x86_64/futex.h new file mode 100644 index 00000000000..8602c09bf89 --- /dev/null +++ b/include/asm-x86_64/futex.h @@ -0,0 +1,98 @@ +#ifndef _ASM_FUTEX_H +#define _ASM_FUTEX_H + +#ifdef __KERNEL__ + +#include +#include +#include +#include + +#define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ + __asm__ __volatile ( \ +"1: " insn "\n" \ +"2: .section .fixup,\"ax\"\n\ +3: mov %3, %1\n\ + jmp 2b\n\ + .previous\n\ + .section __ex_table,\"a\"\n\ + .align 8\n\ + .quad 1b,3b\n\ + .previous" \ + : "=r" (oldval), "=r" (ret), "=m" (*uaddr) \ + : "i" (-EFAULT), "m" (*uaddr), "0" (oparg), "1" (0)) + +#define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ + __asm__ __volatile ( \ +"1: movl %2, %0\n\ + movl %0, %3\n" \ + insn "\n" \ +"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\ + jnz 1b\n\ +3: .section .fixup,\"ax\"\n\ +4: mov %5, %1\n\ + jmp 3b\n\ + .previous\n\ + .section __ex_table,\"a\"\n\ + .align 8\n\ + .quad 1b,4b,2b,4b\n\ + .previous" \ + : "=&a" (oldval), "=&r" (ret), "=m" (*uaddr), \ + "=&r" (tem) \ + : "r" (oparg), "i" (-EFAULT), "m" (*uaddr), "1" (0)) + +static inline int +futex_atomic_op_inuser (int encoded_op, int __user *uaddr) +{ + int op = (encoded_op >> 28) & 7; + int cmp = (encoded_op >> 24) & 15; + int oparg = (encoded_op << 8) >> 20; + int cmparg = (encoded_op << 20) >> 20; + int oldval = 0, ret, tem; + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) + oparg = 1 << oparg; + + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) + return -EFAULT; + + inc_preempt_count(); + + switch (op) { + case FUTEX_OP_SET: + __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ADD: + __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval, + uaddr, oparg); + break; + case FUTEX_OP_OR: + __futex_atomic_op2("orl %4, %3", ret, oldval, uaddr, oparg); + break; + case FUTEX_OP_ANDN: + __futex_atomic_op2("andl %4, %3", ret, oldval, uaddr, ~oparg); + break; + case FUTEX_OP_XOR: + __futex_atomic_op2("xorl %4, %3", ret, oldval, uaddr, oparg); + break; + default: + ret = -ENOSYS; + } + + dec_preempt_count(); + + if (!ret) { + switch (cmp) { + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; + default: ret = -ENOSYS; + } + } + return ret; +} + +#endif +#endif diff --git a/include/linux/futex.h b/include/linux/futex.h index 65d6cfdb6d3..10f96c31971 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h @@ -4,14 +4,40 @@ /* Second argument to futex syscall */ -#define FUTEX_WAIT (0) -#define FUTEX_WAKE (1) -#define FUTEX_FD (2) -#define FUTEX_REQUEUE (3) -#define FUTEX_CMP_REQUEUE (4) +#define FUTEX_WAIT 0 +#define FUTEX_WAKE 1 +#define FUTEX_FD 2 +#define FUTEX_REQUEUE 3 +#define FUTEX_CMP_REQUEUE 4 +#define FUTEX_WAKE_OP 5 long do_futex(unsigned long uaddr, int op, int val, unsigned long timeout, unsigned long uaddr2, int val2, int val3); +#define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ +#define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ +#define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ +#define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */ +#define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */ + +#define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */ + +#define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */ +#define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */ +#define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */ +#define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */ +#define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */ +#define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */ + +/* FUTEX_WAKE_OP will perform atomically + int oldval = *(int *)UADDR2; + *(int *)UADDR2 = oldval OP OPARG; + if (oldval CMP CMPARG) + wake UADDR2; */ + +#define FUTEX_OP(op, oparg, cmp, cmparg) \ + (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \ + | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)) + #endif -- cgit v1.2.3 From 8446f1d391f3d27e6bf9c43d4cbcdac0ca720417 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 6 Sep 2005 15:16:27 -0700 Subject: [PATCH] detect soft lockups This patch adds a new kernel debug feature: CONFIG_DETECT_SOFTLOCKUP. When enabled then per-CPU watchdog threads are started, which try to run once per second. If they get delayed for more than 10 seconds then a callback from the timer interrupt detects this condition and prints out a warning message and a stack dump (once per lockup incident). The feature is otherwise non-intrusive, it doesnt try to unlock the box in any way, it only gets the debug info out, automatically, and on all CPUs affected by the lockup. Signed-off-by: Ingo Molnar Signed-off-by: Nishanth Aravamudan Signed-Off-By: Matthias Urlichs Signed-off-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sched.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') diff --git a/include/linux/sched.h b/include/linux/sched.h index dec5827c774..5fb31bede10 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -176,6 +176,23 @@ extern void trap_init(void); extern void update_process_times(int user); extern void scheduler_tick(void); +#ifdef CONFIG_DETECT_SOFTLOCKUP +extern void softlockup_tick(struct pt_regs *regs); +extern void spawn_softlockup_task(void); +extern void touch_softlockup_watchdog(void); +#else +static inline void softlockup_tick(struct pt_regs *regs) +{ +} +static inline void spawn_softlockup_task(void) +{ +} +static inline void touch_softlockup_watchdog(void) +{ +} +#endif + + /* Attach to any functions which should be ignored in wchan output. */ #define __sched __attribute__((__section__(".sched.text"))) /* Is this address in the __sched functions? */ -- cgit v1.2.3 From e82894f84dbba130ab46c97748c03647f8204f92 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Tue, 6 Sep 2005 15:16:30 -0700 Subject: [PATCH] relayfs Here's the latest version of relayfs, against linux-2.6.11-mm2. I'm hoping you'll consider putting this version back into your tree - the previous rounds of comment seem to have shaken out all the API issues and the number of comments on the code itself have also steadily dwindled. This patch is essentially the same as the relayfs redux part 5 patch, with some minor changes based on reviewer comments. Thanks again to Pekka Enberg for those. The patch size without documentation is now a little smaller at just over 40k. Here's a detailed list of the changes: - removed the attribute_flags in relay open and changed it to a boolean specifying either overwrite or no-overwrite mode, and removed everything referencing the attribute flags. - added a check for NULL names in relayfs_create_entry() - got rid of the unnecessary multiple labels in relay_create_buf() - some minor simplification of relay_alloc_buf() which got rid of a couple params - updated the Documentation In addition, this version (through code contained in the relay-apps tarball linked to below, not as part of the relayfs patch) tries to make it as easy as possible to create the cooperating kernel/user pieces of a typical and common type of logging application, one where kernel logging is kicked off when a user space data collection app starts and stops when the collection app exits, with the data being automatically logged to disk in between. To create this type of application, you basically just include a header file (relay-app.h, included in the relay-apps tarball) in your kernel module, define a couple of callbacks and call an initialization function, and on the user side call a single function that sets up and continuously monitors the buffers, and writes data to files as it becomes available. Channels are created when the collection app is started and destroyed when it exits, not when the kernel module is inserted, so different channel buffer sizes can be specified for each separate run via command-line options. See the README in the relay-apps tarball for details. Also included in the relay-apps tarball are a couple examples demonstrating how you can use this to create quick and dirty kernel logging/debugging applications. They are: - tprintk, short for 'tee printk', which temporarily puts a kprobe on printk() and writes a duplicate stream of printk output to a relayfs channel. This could be used anywhere there's printk() debugging code in the kernel which you'd like to exercise, but would rather not have your system logs cluttered with debugging junk. You'd probably want to kill klogd while you do this, otherwise there wouldn't be much point (since putting a kprobe on printk() doesn't change the output of printk()). I've used this method to temporarily divert the packet logging output of the iptables LOG target from the system logs to relayfs files instead, for instance. - klog, which just provides a printk-like formatted logging function on top of relayfs. Again, you can use this to keep stuff out of your system logs if used in place of printk. The example applications can be found here: http://prdownloads.sourceforge.net/dprobes/relay-apps.tar.gz?download From: Christoph Hellwig avoid lookup_hash usage in relayfs Signed-off-by: Tom Zanussi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/relayfs_fs.h | 255 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 include/linux/relayfs_fs.h (limited to 'include') diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h new file mode 100644 index 00000000000..cfafc3e76bc --- /dev/null +++ b/include/linux/relayfs_fs.h @@ -0,0 +1,255 @@ +/* + * linux/include/linux/relayfs_fs.h + * + * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp + * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com) + * + * RelayFS definitions and declarations + */ + +#ifndef _LINUX_RELAYFS_FS_H +#define _LINUX_RELAYFS_FS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Tracks changes to rchan_buf struct + */ +#define RELAYFS_CHANNEL_VERSION 5 + +/* + * Per-cpu relay channel buffer + */ +struct rchan_buf +{ + void *start; /* start of channel buffer */ + void *data; /* start of current sub-buffer */ + size_t offset; /* current offset into sub-buffer */ + size_t subbufs_produced; /* count of sub-buffers produced */ + size_t subbufs_consumed; /* count of sub-buffers consumed */ + struct rchan *chan; /* associated channel */ + wait_queue_head_t read_wait; /* reader wait queue */ + struct work_struct wake_readers; /* reader wake-up work struct */ + struct dentry *dentry; /* channel file dentry */ + struct kref kref; /* channel buffer refcount */ + struct page **page_array; /* array of current buffer pages */ + unsigned int page_count; /* number of current buffer pages */ + unsigned int finalized; /* buffer has been finalized */ + size_t *padding; /* padding counts per sub-buffer */ + size_t prev_padding; /* temporary variable */ + size_t bytes_consumed; /* bytes consumed in cur read subbuf */ + unsigned int cpu; /* this buf's cpu */ +} ____cacheline_aligned; + +/* + * Relay channel data structure + */ +struct rchan +{ + u32 version; /* the version of this struct */ + size_t subbuf_size; /* sub-buffer size */ + size_t n_subbufs; /* number of sub-buffers per buffer */ + size_t alloc_size; /* total buffer size allocated */ + struct rchan_callbacks *cb; /* client callbacks */ + struct kref kref; /* channel refcount */ + void *private_data; /* for user-defined data */ + struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ +}; + +/* + * Relayfs inode + */ +struct relayfs_inode_info +{ + struct inode vfs_inode; + struct rchan_buf *buf; +}; + +static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode) +{ + return container_of(inode, struct relayfs_inode_info, vfs_inode); +} + +/* + * Relay channel client callbacks + */ +struct rchan_callbacks +{ + /* + * subbuf_start - called on buffer-switch to a new sub-buffer + * @buf: the channel buffer containing the new sub-buffer + * @subbuf: the start of the new sub-buffer + * @prev_subbuf: the start of the previous sub-buffer + * @prev_padding: unused space at the end of previous sub-buffer + * + * The client should return 1 to continue logging, 0 to stop + * logging. + * + * NOTE: subbuf_start will also be invoked when the buffer is + * created, so that the first sub-buffer can be initialized + * if necessary. In this case, prev_subbuf will be NULL. + * + * NOTE: the client can reserve bytes at the beginning of the new + * sub-buffer by calling subbuf_start_reserve() in this callback. + */ + int (*subbuf_start) (struct rchan_buf *buf, + void *subbuf, + void *prev_subbuf, + size_t prev_padding); + + /* + * buf_mapped - relayfs buffer mmap notification + * @buf: the channel buffer + * @filp: relayfs file pointer + * + * Called when a relayfs file is successfully mmapped + */ + void (*buf_mapped)(struct rchan_buf *buf, + struct file *filp); + + /* + * buf_unmapped - relayfs buffer unmap notification + * @buf: the channel buffer + * @filp: relayfs file pointer + * + * Called when a relayfs file is successfully unmapped + */ + void (*buf_unmapped)(struct rchan_buf *buf, + struct file *filp); +}; + +/* + * relayfs kernel API, fs/relayfs/relay.c + */ + +struct rchan *relay_open(const char *base_filename, + struct dentry *parent, + size_t subbuf_size, + size_t n_subbufs, + struct rchan_callbacks *cb); +extern void relay_close(struct rchan *chan); +extern void relay_flush(struct rchan *chan); +extern void relay_subbufs_consumed(struct rchan *chan, + unsigned int cpu, + size_t consumed); +extern void relay_reset(struct rchan *chan); +extern int relay_buf_full(struct rchan_buf *buf); + +extern size_t relay_switch_subbuf(struct rchan_buf *buf, + size_t length); +extern struct dentry *relayfs_create_dir(const char *name, + struct dentry *parent); +extern int relayfs_remove_dir(struct dentry *dentry); + +/** + * relay_write - write data into the channel + * @chan: relay channel + * @data: data to be written + * @length: number of bytes to write + * + * Writes data into the current cpu's channel buffer. + * + * Protects the buffer by disabling interrupts. Use this + * if you might be logging from interrupt context. Try + * __relay_write() if you know you won't be logging from + * interrupt context. + */ +static inline void relay_write(struct rchan *chan, + const void *data, + size_t length) +{ + unsigned long flags; + struct rchan_buf *buf; + + local_irq_save(flags); + buf = chan->buf[smp_processor_id()]; + if (unlikely(buf->offset + length > chan->subbuf_size)) + length = relay_switch_subbuf(buf, length); + memcpy(buf->data + buf->offset, data, length); + buf->offset += length; + local_irq_restore(flags); +} + +/** + * __relay_write - write data into the channel + * @chan: relay channel + * @data: data to be written + * @length: number of bytes to write + * + * Writes data into the current cpu's channel buffer. + * + * Protects the buffer by disabling preemption. Use + * relay_write() if you might be logging from interrupt + * context. + */ +static inline void __relay_write(struct rchan *chan, + const void *data, + size_t length) +{ + struct rchan_buf *buf; + + buf = chan->buf[get_cpu()]; + if (unlikely(buf->offset + length > buf->chan->subbuf_size)) + length = relay_switch_subbuf(buf, length); + memcpy(buf->data + buf->offset, data, length); + buf->offset += length; + put_cpu(); +} + +/** + * relay_reserve - reserve slot in channel buffer + * @chan: relay channel + * @length: number of bytes to reserve + * + * Returns pointer to reserved slot, NULL if full. + * + * Reserves a slot in the current cpu's channel buffer. + * Does not protect the buffer at all - caller must provide + * appropriate synchronization. + */ +static inline void *relay_reserve(struct rchan *chan, size_t length) +{ + void *reserved; + struct rchan_buf *buf = chan->buf[smp_processor_id()]; + + if (unlikely(buf->offset + length > buf->chan->subbuf_size)) { + length = relay_switch_subbuf(buf, length); + if (!length) + return NULL; + } + reserved = buf->data + buf->offset; + buf->offset += length; + + return reserved; +} + +/** + * subbuf_start_reserve - reserve bytes at the start of a sub-buffer + * @buf: relay channel buffer + * @length: number of bytes to reserve + * + * Helper function used to reserve bytes at the beginning of + * a sub-buffer in the subbuf_start() callback. + */ +static inline void subbuf_start_reserve(struct rchan_buf *buf, + size_t length) +{ + BUG_ON(length >= buf->chan->subbuf_size - 1); + buf->offset = length; +} + +/* + * exported relayfs file operations, fs/relayfs/inode.c + */ + +extern struct file_operations relayfs_file_operations; + +#endif /* _LINUX_RELAYFS_FS_H */ + -- cgit v1.2.3 From 202e5979af4d91c7ca05892641131dee22653259 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:16:40 -0700 Subject: [PATCH] compat: be more consistent about [ug]id_t When I first wrote the compat layer patches, I was somewhat cavalier about the definition of compat_uid_t and compat_gid_t (or maybe I just misunderstood :-)). This patch makes the compat types much more consistent with the types we are being compatible with and hopefully will fix a few bugs along the way. compat type type in compat arch __compat_[ug]id_t __kernel_[ug]id_t __compat_[ug]id32_t __kernel_[ug]id32_t compat_[ug]id_t [ug]id_t The difference is that compat_uid_t is always 32 bits (for the archs we care about) but __compat_uid_t may be 16 bits on some. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/compat.h | 20 ++++++++++---------- include/asm-mips/compat.h | 10 ++++++---- include/asm-parisc/compat.h | 10 ++++++---- include/asm-ppc64/compat.h | 18 ++++++++++-------- include/asm-s390/compat.h | 20 ++++++++++---------- include/asm-sparc64/compat.h | 18 ++++++++++-------- include/asm-x86_64/compat.h | 20 ++++++++++---------- include/linux/compat.h | 3 +++ 8 files changed, 65 insertions(+), 54 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h index 0c05e5bad8a..aaf11f4e916 100644 --- a/include/asm-ia64/compat.h +++ b/include/asm-ia64/compat.h @@ -13,10 +13,10 @@ typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_key_t; typedef s32 compat_pid_t; -typedef u16 compat_uid_t; -typedef u16 compat_gid_t; -typedef u32 compat_uid32_t; -typedef u32 compat_gid32_t; +typedef u16 __compat_uid_t; +typedef u16 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; typedef u32 compat_ino_t; typedef u16 compat_dev_t; @@ -50,8 +50,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid_t st_uid; + __compat_gid_t st_gid; compat_dev_t st_rdev; u16 __pad2; u32 st_size; @@ -120,10 +120,10 @@ typedef u32 compat_sigset_word; struct compat_ipc64_perm { compat_key_t key; - compat_uid32_t uid; - compat_gid32_t gid; - compat_uid32_t cuid; - compat_gid32_t cgid; + __compat_uid32_t uid; + __compat_gid32_t gid; + __compat_uid32_t cuid; + __compat_gid32_t cgid; unsigned short mode; unsigned short __pad1; unsigned short seq; diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h index d78002afb1e..2c084cd4bc0 100644 --- a/include/asm-mips/compat.h +++ b/include/asm-mips/compat.h @@ -15,8 +15,10 @@ typedef s32 compat_clock_t; typedef s32 compat_suseconds_t; typedef s32 compat_pid_t; -typedef s32 compat_uid_t; -typedef s32 compat_gid_t; +typedef u32 __compat_uid_t; +typedef u32 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u32 compat_mode_t; typedef u32 compat_ino_t; typedef u32 compat_dev_t; @@ -52,8 +54,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid32_t st_uid; + __compat_gid32_t st_gid; compat_dev_t st_rdev; s32 st_pad2[2]; compat_off_t st_size; diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h index 7630d1ad239..38b918feead 100644 --- a/include/asm-parisc/compat.h +++ b/include/asm-parisc/compat.h @@ -13,8 +13,10 @@ typedef s32 compat_ssize_t; typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_pid_t; -typedef u32 compat_uid_t; -typedef u32 compat_gid_t; +typedef u32 __compat_uid_t; +typedef u32 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; typedef u32 compat_ino_t; typedef u32 compat_dev_t; @@ -67,8 +69,8 @@ struct compat_stat { compat_dev_t st_realdev; u16 st_basemode; u16 st_spareshort; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid32_t st_uid; + __compat_gid32_t st_gid; u32 st_spare4[3]; }; diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h index 12414f5fc66..6ec62cd2d1d 100644 --- a/include/asm-ppc64/compat.h +++ b/include/asm-ppc64/compat.h @@ -13,8 +13,10 @@ typedef s32 compat_ssize_t; typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_pid_t; -typedef u32 compat_uid_t; -typedef u32 compat_gid_t; +typedef u32 __compat_uid_t; +typedef u32 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u32 compat_mode_t; typedef u32 compat_ino_t; typedef u32 compat_dev_t; @@ -48,8 +50,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid32_t st_uid; + __compat_gid32_t st_gid; compat_dev_t st_rdev; compat_off_t st_size; compat_off_t st_blksize; @@ -144,10 +146,10 @@ static inline void __user *compat_alloc_user_space(long len) */ struct compat_ipc64_perm { compat_key_t key; - compat_uid_t uid; - compat_gid_t gid; - compat_uid_t cuid; - compat_gid_t cgid; + __compat_uid_t uid; + __compat_gid_t gid; + __compat_uid_t cuid; + __compat_gid_t cgid; compat_mode_t mode; unsigned int seq; unsigned int __pad2; diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h index 7f8f544eb26..a007715f4ae 100644 --- a/include/asm-s390/compat.h +++ b/include/asm-s390/compat.h @@ -13,10 +13,10 @@ typedef s32 compat_ssize_t; typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_pid_t; -typedef u16 compat_uid_t; -typedef u16 compat_gid_t; -typedef u32 compat_uid32_t; -typedef u32 compat_gid32_t; +typedef u16 __compat_uid_t; +typedef u16 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; typedef u32 compat_ino_t; typedef u16 compat_dev_t; @@ -51,8 +51,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid_t st_uid; + __compat_gid_t st_gid; compat_dev_t st_rdev; u16 __pad2; u32 st_size; @@ -140,10 +140,10 @@ static inline void __user *compat_alloc_user_space(long len) struct compat_ipc64_perm { compat_key_t key; - compat_uid32_t uid; - compat_gid32_t gid; - compat_uid32_t cuid; - compat_gid32_t cgid; + __compat_uid32_t uid; + __compat_gid32_t gid; + __compat_uid32_t cuid; + __compat_gid32_t cgid; compat_mode_t mode; unsigned short __pad1; unsigned short seq; diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index b59122dd176..c73935dc7ba 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h @@ -12,8 +12,10 @@ typedef s32 compat_ssize_t; typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_pid_t; -typedef u16 compat_uid_t; -typedef u16 compat_gid_t; +typedef u16 __compat_uid_t; +typedef u16 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; typedef u32 compat_ino_t; typedef u16 compat_dev_t; @@ -47,8 +49,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid_t st_uid; + __compat_gid_t st_gid; compat_dev_t st_rdev; compat_off_t st_size; compat_time_t st_atime; @@ -177,10 +179,10 @@ static __inline__ void __user *compat_alloc_user_space(long len) struct compat_ipc64_perm { compat_key_t key; - __kernel_uid_t uid; - __kernel_gid_t gid; - __kernel_uid_t cuid; - __kernel_gid_t cgid; + __compat_uid32_t uid; + __compat_gid32_t gid; + __compat_uid32_t cuid; + __compat_gid32_t cgid; unsigned short __pad1; compat_mode_t mode; unsigned short __pad2; diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h index d0f453c5adf..f0155c38f63 100644 --- a/include/asm-x86_64/compat.h +++ b/include/asm-x86_64/compat.h @@ -14,10 +14,10 @@ typedef s32 compat_ssize_t; typedef s32 compat_time_t; typedef s32 compat_clock_t; typedef s32 compat_pid_t; -typedef u16 compat_uid_t; -typedef u16 compat_gid_t; -typedef u32 compat_uid32_t; -typedef u32 compat_gid32_t; +typedef u16 __compat_uid_t; +typedef u16 __compat_gid_t; +typedef u32 __compat_uid32_t; +typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; typedef u32 compat_ino_t; typedef u16 compat_dev_t; @@ -52,8 +52,8 @@ struct compat_stat { compat_ino_t st_ino; compat_mode_t st_mode; compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; + __compat_uid_t st_uid; + __compat_gid_t st_gid; compat_dev_t st_rdev; u16 __pad2; u32 st_size; @@ -122,10 +122,10 @@ typedef u32 compat_sigset_word; struct compat_ipc64_perm { compat_key_t key; - compat_uid32_t uid; - compat_gid32_t gid; - compat_uid32_t cuid; - compat_gid32_t cgid; + __compat_uid32_t uid; + __compat_gid32_t gid; + __compat_uid32_t cuid; + __compat_gid32_t cgid; unsigned short mode; unsigned short __pad1; unsigned short seq; diff --git a/include/linux/compat.h b/include/linux/compat.h index b58b7d6f2fd..f9ca534787e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -18,6 +18,9 @@ #define compat_jiffies_to_clock_t(x) \ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) +typedef __compat_uid32_t compat_uid_t; +typedef __compat_gid32_t compat_gid_t; + struct rusage; struct compat_itimerspec { -- cgit v1.2.3 From 022a4a7bbdefdedc2706a13c81c832d8c3173c6d Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Tue, 6 Sep 2005 15:16:41 -0700 Subject: [PATCH] fs/jbd/: cleanups This patch contains the following cleanups: - make needlessly global functions static - journal.c: remove the unused global function __journal_internal_check and move the check to journal_init - remove the following write-only global variable: - journal.c: current_journal - remove the following unneeded EXPORT_SYMBOL: - journal.c: journal_recover Signed-off-by: Adrian Bunk Acked-by: Andreas Dilger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/jbd.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 593407e865b..84321a4cac9 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -914,7 +914,6 @@ extern int journal_wipe (journal_t *, int); extern int journal_skip_recovery (journal_t *); extern void journal_update_superblock (journal_t *, int); extern void __journal_abort_hard (journal_t *); -extern void __journal_abort_soft (journal_t *, int); extern void journal_abort (journal_t *, int); extern int journal_errno (journal_t *); extern void journal_ack_err (journal_t *); -- cgit v1.2.3 From 3676347a5e216a7fec7f8eedbbcf8bed6b9c4e40 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Tue, 6 Sep 2005 15:16:42 -0700 Subject: [PATCH] kill bio->bi_set Jens: ->bi_set is totally unnecessary bloat of struct bio. Just define a proper destructor for the bio and it already knows what bio_set it belongs too. Peter: Fixed the bugs. Signed-off-by: Jens Axboe Signed-off-by: Peter Osterlund Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/bio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/bio.h b/include/linux/bio.h index 36ef29fa0d8..69e047989f1 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -111,7 +111,6 @@ struct bio { void *bi_private; bio_destructor_t *bi_destructor; /* destructor */ - struct bio_set *bi_set; /* memory pools set */ }; /* @@ -280,6 +279,7 @@ extern void bioset_free(struct bio_set *); extern struct bio *bio_alloc(unsigned int __nocast, int); extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); extern void bio_put(struct bio *); +extern void bio_free(struct bio *, struct bio_set *); extern void bio_endio(struct bio *, unsigned int, int); struct request_queue; -- cgit v1.2.3 From 5dd42c262bd742fa3602180bbe5550b4828de8f3 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Tue, 6 Sep 2005 15:16:43 -0700 Subject: [PATCH] remove register_ioctl32_conversion and unregister_ioctl32_conversion All users have been converted. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ioctl32.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'include') diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h index e8c4af32b3b..948809d9991 100644 --- a/include/linux/ioctl32.h +++ b/include/linux/ioctl32.h @@ -14,26 +14,4 @@ struct ioctl_trans { struct ioctl_trans *next; }; -/* - * Register an 32bit ioctl translation handler for ioctl cmd. - * - * handler == NULL: use 64bit ioctl handler. - * arguments to handler: fd: file descriptor - * cmd: ioctl command. - * arg: ioctl argument - * struct file *file: file descriptor pointer. - */ - -#ifdef CONFIG_COMPAT -extern int __deprecated register_ioctl32_conversion(unsigned int cmd, - ioctl_trans_handler_t handler); -extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd); - -#else - -#define register_ioctl32_conversion(cmd, handler) ({ 0; }) -#define unregister_ioctl32_conversion(cmd) ({ 0; }) - -#endif - #endif -- cgit v1.2.3 From 36d57ac4a818cb4aa3edbdf63ad2ebc31106f925 Mon Sep 17 00:00:00 2001 From: "H. J. Lu" Date: Tue, 6 Sep 2005 15:16:49 -0700 Subject: [PATCH] auxiliary vector cleanups The size of auxiliary vector is fixed at 42 in linux/sched.h. But it isn't very obvious when looking at linux/elf.h. This patch adds AT_VECTOR_SIZE so that we can change it if necessary when a new vector is added. Because of include file ordering problems, doing this necessitated the extraction of the AT_* symbols into a standalone header file. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/auxvec.h | 24 ++++++++++++++++++++++++ include/asm-alpha/elf.h | 22 ++-------------------- include/asm-arm/auxvec.h | 4 ++++ include/asm-arm26/auxvec.h | 4 ++++ include/asm-cris/auxvec.h | 4 ++++ include/asm-frv/auxvec.h | 4 ++++ include/asm-h8300/auxvec.h | 4 ++++ include/asm-i386/auxvec.h | 11 +++++++++++ include/asm-i386/elf.h | 8 +------- include/asm-ia64/auxvec.h | 11 +++++++++++ include/asm-ia64/elf.h | 8 +------- include/asm-m32r/auxvec.h | 4 ++++ include/asm-m68k/auxvec.h | 4 ++++ include/asm-m68knommu/auxvec.h | 4 ++++ include/asm-mips/auxvec.h | 4 ++++ include/asm-parisc/auxvec.h | 4 ++++ include/asm-ppc/auxvec.h | 14 ++++++++++++++ include/asm-ppc/elf.h | 11 +---------- include/asm-ppc64/auxvec.h | 19 +++++++++++++++++++ include/asm-ppc64/elf.h | 16 +--------------- include/asm-s390/auxvec.h | 4 ++++ include/asm-sh/auxvec.h | 4 ++++ include/asm-sh64/auxvec.h | 4 ++++ include/asm-sparc/auxvec.h | 4 ++++ include/asm-sparc64/auxvec.h | 4 ++++ include/asm-um/auxvec.h | 4 ++++ include/asm-v850/auxvec.h | 4 ++++ include/asm-x86_64/auxvec.h | 4 ++++ include/asm-xtensa/auxvec.h | 4 ++++ include/linux/auxvec.h | 31 +++++++++++++++++++++++++++++++ include/linux/elf.h | 24 +----------------------- include/linux/sched.h | 4 +++- 32 files changed, 196 insertions(+), 83 deletions(-) create mode 100644 include/asm-alpha/auxvec.h create mode 100644 include/asm-arm/auxvec.h create mode 100644 include/asm-arm26/auxvec.h create mode 100644 include/asm-cris/auxvec.h create mode 100644 include/asm-frv/auxvec.h create mode 100644 include/asm-h8300/auxvec.h create mode 100644 include/asm-i386/auxvec.h create mode 100644 include/asm-ia64/auxvec.h create mode 100644 include/asm-m32r/auxvec.h create mode 100644 include/asm-m68k/auxvec.h create mode 100644 include/asm-m68knommu/auxvec.h create mode 100644 include/asm-mips/auxvec.h create mode 100644 include/asm-parisc/auxvec.h create mode 100644 include/asm-ppc/auxvec.h create mode 100644 include/asm-ppc64/auxvec.h create mode 100644 include/asm-s390/auxvec.h create mode 100644 include/asm-sh/auxvec.h create mode 100644 include/asm-sh64/auxvec.h create mode 100644 include/asm-sparc/auxvec.h create mode 100644 include/asm-sparc64/auxvec.h create mode 100644 include/asm-um/auxvec.h create mode 100644 include/asm-v850/auxvec.h create mode 100644 include/asm-x86_64/auxvec.h create mode 100644 include/asm-xtensa/auxvec.h create mode 100644 include/linux/auxvec.h (limited to 'include') diff --git a/include/asm-alpha/auxvec.h b/include/asm-alpha/auxvec.h new file mode 100644 index 00000000000..e96fe880e31 --- /dev/null +++ b/include/asm-alpha/auxvec.h @@ -0,0 +1,24 @@ +#ifndef __ASM_ALPHA_AUXVEC_H +#define __ASM_ALPHA_AUXVEC_H + +/* Reserve these numbers for any future use of a VDSO. */ +#if 0 +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 +#endif + +/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the + value is -1, then the cache doesn't exist. Otherwise: + + bit 0-3: Cache set-associativity; 0 means fully associative. + bit 4-7: Log2 of cacheline size. + bit 8-31: Size of the entire cache >> 8. + bit 32-63: Reserved. +*/ + +#define AT_L1I_CACHESHAPE 34 +#define AT_L1D_CACHESHAPE 35 +#define AT_L2_CACHESHAPE 36 +#define AT_L3_CACHESHAPE 37 + +#endif /* __ASM_ALPHA_AUXVEC_H */ diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h index e94a945a231..6c2d78fba26 100644 --- a/include/asm-alpha/elf.h +++ b/include/asm-alpha/elf.h @@ -1,6 +1,8 @@ #ifndef __ASM_ALPHA_ELF_H #define __ASM_ALPHA_ELF_H +#include + /* Special values for the st_other field in the symbol table. */ #define STO_ALPHA_NOPV 0x80 @@ -142,26 +144,6 @@ extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task); : amask (AMASK_CIX) ? "ev6" : "ev67"); \ }) -/* Reserve these numbers for any future use of a VDSO. */ -#if 0 -#define AT_SYSINFO 32 -#define AT_SYSINFO_EHDR 33 -#endif - -/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the - value is -1, then the cache doesn't exist. Otherwise: - - bit 0-3: Cache set-associativity; 0 means fully associative. - bit 4-7: Log2 of cacheline size. - bit 8-31: Size of the entire cache >> 8. - bit 32-63: Reserved. -*/ - -#define AT_L1I_CACHESHAPE 34 -#define AT_L1D_CACHESHAPE 35 -#define AT_L2_CACHESHAPE 36 -#define AT_L3_CACHESHAPE 37 - #ifdef __KERNEL__ #define SET_PERSONALITY(EX, IBCS2) \ diff --git a/include/asm-arm/auxvec.h b/include/asm-arm/auxvec.h new file mode 100644 index 00000000000..c0536f6b29a --- /dev/null +++ b/include/asm-arm/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMARM_AUXVEC_H +#define __ASMARM_AUXVEC_H + +#endif diff --git a/include/asm-arm26/auxvec.h b/include/asm-arm26/auxvec.h new file mode 100644 index 00000000000..c0536f6b29a --- /dev/null +++ b/include/asm-arm26/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMARM_AUXVEC_H +#define __ASMARM_AUXVEC_H + +#endif diff --git a/include/asm-cris/auxvec.h b/include/asm-cris/auxvec.h new file mode 100644 index 00000000000..cb30b01bf19 --- /dev/null +++ b/include/asm-cris/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMCRIS_AUXVEC_H +#define __ASMCRIS_AUXVEC_H + +#endif diff --git a/include/asm-frv/auxvec.h b/include/asm-frv/auxvec.h new file mode 100644 index 00000000000..07710778fa1 --- /dev/null +++ b/include/asm-frv/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __FRV_AUXVEC_H +#define __FRV_AUXVEC_H + +#endif diff --git a/include/asm-h8300/auxvec.h b/include/asm-h8300/auxvec.h new file mode 100644 index 00000000000..1d36fe38b08 --- /dev/null +++ b/include/asm-h8300/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMH8300_AUXVEC_H +#define __ASMH8300_AUXVEC_H + +#endif diff --git a/include/asm-i386/auxvec.h b/include/asm-i386/auxvec.h new file mode 100644 index 00000000000..395e13016bf --- /dev/null +++ b/include/asm-i386/auxvec.h @@ -0,0 +1,11 @@ +#ifndef __ASMi386_AUXVEC_H +#define __ASMi386_AUXVEC_H + +/* + * Architecture-neutral AT_ values in 0-17, leave some room + * for more of them, start the x86-specific ones at 32. + */ +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 + +#endif diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h index 130bdc8c68c..fa11117d3cf 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-i386/elf.h @@ -9,6 +9,7 @@ #include #include #include /* for savesegment */ +#include #include @@ -109,13 +110,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t; #define ELF_PLATFORM (system_utsname.machine) -/* - * Architecture-neutral AT_ values in 0-17, leave some room - * for more of them, start the x86-specific ones at 32. - */ -#define AT_SYSINFO 32 -#define AT_SYSINFO_EHDR 33 - #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) do { } while (0) diff --git a/include/asm-ia64/auxvec.h b/include/asm-ia64/auxvec.h new file mode 100644 index 00000000000..23cebe5685b --- /dev/null +++ b/include/asm-ia64/auxvec.h @@ -0,0 +1,11 @@ +#ifndef _ASM_IA64_AUXVEC_H +#define _ASM_IA64_AUXVEC_H + +/* + * Architecture-neutral AT_ values are in the range 0-17. Leave some room for more of + * them, start the architecture-specific ones at 32. + */ +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 + +#endif /* _ASM_IA64_AUXVEC_H */ diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h index 7d4ccc4b976..446fce036fd 100644 --- a/include/asm-ia64/elf.h +++ b/include/asm-ia64/elf.h @@ -12,6 +12,7 @@ #include #include +#include /* * This is used to ensure we don't load something for the wrong architecture. @@ -177,13 +178,6 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst); relevant until we have real hardware to play with... */ #define ELF_PLATFORM NULL -/* - * Architecture-neutral AT_ values are in the range 0-17. Leave some room for more of - * them, start the architecture-specific ones at 32. - */ -#define AT_SYSINFO 32 -#define AT_SYSINFO_EHDR 33 - #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX) #define elf_read_implies_exec(ex, executable_stack) \ diff --git a/include/asm-m32r/auxvec.h b/include/asm-m32r/auxvec.h new file mode 100644 index 00000000000..f76dcc860fa --- /dev/null +++ b/include/asm-m32r/auxvec.h @@ -0,0 +1,4 @@ +#ifndef _ASM_M32R__AUXVEC_H +#define _ASM_M32R__AUXVEC_H + +#endif /* _ASM_M32R__AUXVEC_H */ diff --git a/include/asm-m68k/auxvec.h b/include/asm-m68k/auxvec.h new file mode 100644 index 00000000000..844d6d52204 --- /dev/null +++ b/include/asm-m68k/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMm68k_AUXVEC_H +#define __ASMm68k_AUXVEC_H + +#endif diff --git a/include/asm-m68knommu/auxvec.h b/include/asm-m68knommu/auxvec.h new file mode 100644 index 00000000000..844d6d52204 --- /dev/null +++ b/include/asm-m68knommu/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMm68k_AUXVEC_H +#define __ASMm68k_AUXVEC_H + +#endif diff --git a/include/asm-mips/auxvec.h b/include/asm-mips/auxvec.h new file mode 100644 index 00000000000..7cf7f2d2194 --- /dev/null +++ b/include/asm-mips/auxvec.h @@ -0,0 +1,4 @@ +#ifndef _ASM_AUXVEC_H +#define _ASM_AUXVEC_H + +#endif /* _ASM_AUXVEC_H */ diff --git a/include/asm-parisc/auxvec.h b/include/asm-parisc/auxvec.h new file mode 100644 index 00000000000..9c3ac4b89dc --- /dev/null +++ b/include/asm-parisc/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMPARISC_AUXVEC_H +#define __ASMPARISC_AUXVEC_H + +#endif diff --git a/include/asm-ppc/auxvec.h b/include/asm-ppc/auxvec.h new file mode 100644 index 00000000000..172358df29c --- /dev/null +++ b/include/asm-ppc/auxvec.h @@ -0,0 +1,14 @@ +#ifndef __PPC_AUXVEC_H +#define __PPC_AUXVEC_H + +/* + * We need to put in some extra aux table entries to tell glibc what + * the cache block size is, so it can use the dcbz instruction safely. + */ +#define AT_DCACHEBSIZE 19 +#define AT_ICACHEBSIZE 20 +#define AT_UCACHEBSIZE 21 +/* A special ignored type value for PPC, for glibc compatibility. */ +#define AT_IGNOREPPC 22 + +#endif diff --git a/include/asm-ppc/elf.h b/include/asm-ppc/elf.h index 2c056966efd..c25cc35e6ab 100644 --- a/include/asm-ppc/elf.h +++ b/include/asm-ppc/elf.h @@ -7,6 +7,7 @@ #include #include #include +#include /* PowerPC relocations defined by the ABIs */ #define R_PPC_NONE 0 @@ -122,16 +123,6 @@ extern int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpu); #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) -/* - * We need to put in some extra aux table entries to tell glibc what - * the cache block size is, so it can use the dcbz instruction safely. - */ -#define AT_DCACHEBSIZE 19 -#define AT_ICACHEBSIZE 20 -#define AT_UCACHEBSIZE 21 -/* A special ignored type value for PPC, for glibc compatibility. */ -#define AT_IGNOREPPC 22 - extern int dcache_bsize; extern int icache_bsize; extern int ucache_bsize; diff --git a/include/asm-ppc64/auxvec.h b/include/asm-ppc64/auxvec.h new file mode 100644 index 00000000000..ac6381a106e --- /dev/null +++ b/include/asm-ppc64/auxvec.h @@ -0,0 +1,19 @@ +#ifndef __PPC64_AUXVEC_H +#define __PPC64_AUXVEC_H + +/* + * We need to put in some extra aux table entries to tell glibc what + * the cache block size is, so it can use the dcbz instruction safely. + */ +#define AT_DCACHEBSIZE 19 +#define AT_ICACHEBSIZE 20 +#define AT_UCACHEBSIZE 21 +/* A special ignored type value for PPC, for glibc compatibility. */ +#define AT_IGNOREPPC 22 + +/* The vDSO location. We have to use the same value as x86 for glibc's + * sake :-) + */ +#define AT_SYSINFO_EHDR 33 + +#endif /* __PPC64_AUXVEC_H */ diff --git a/include/asm-ppc64/elf.h b/include/asm-ppc64/elf.h index 085eedb956f..c919a89343d 100644 --- a/include/asm-ppc64/elf.h +++ b/include/asm-ppc64/elf.h @@ -4,6 +4,7 @@ #include #include #include +#include /* PowerPC relocations defined by the ABIs */ #define R_PPC_NONE 0 @@ -237,21 +238,6 @@ do { \ #endif -/* - * We need to put in some extra aux table entries to tell glibc what - * the cache block size is, so it can use the dcbz instruction safely. - */ -#define AT_DCACHEBSIZE 19 -#define AT_ICACHEBSIZE 20 -#define AT_UCACHEBSIZE 21 -/* A special ignored type value for PPC, for glibc compatibility. */ -#define AT_IGNOREPPC 22 - -/* The vDSO location. We have to use the same value as x86 for glibc's - * sake :-) - */ -#define AT_SYSINFO_EHDR 33 - extern int dcache_bsize; extern int icache_bsize; extern int ucache_bsize; diff --git a/include/asm-s390/auxvec.h b/include/asm-s390/auxvec.h new file mode 100644 index 00000000000..0d340720fd9 --- /dev/null +++ b/include/asm-s390/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMS390_AUXVEC_H +#define __ASMS390_AUXVEC_H + +#endif diff --git a/include/asm-sh/auxvec.h b/include/asm-sh/auxvec.h new file mode 100644 index 00000000000..fc21e4db588 --- /dev/null +++ b/include/asm-sh/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASM_SH_AUXVEC_H +#define __ASM_SH_AUXVEC_H + +#endif /* __ASM_SH_AUXVEC_H */ diff --git a/include/asm-sh64/auxvec.h b/include/asm-sh64/auxvec.h new file mode 100644 index 00000000000..1ad5a44bdc7 --- /dev/null +++ b/include/asm-sh64/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASM_SH64_AUXVEC_H +#define __ASM_SH64_AUXVEC_H + +#endif /* __ASM_SH64_AUXVEC_H */ diff --git a/include/asm-sparc/auxvec.h b/include/asm-sparc/auxvec.h new file mode 100644 index 00000000000..ad6f360261f --- /dev/null +++ b/include/asm-sparc/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASMSPARC_AUXVEC_H +#define __ASMSPARC_AUXVEC_H + +#endif /* !(__ASMSPARC_AUXVEC_H) */ diff --git a/include/asm-sparc64/auxvec.h b/include/asm-sparc64/auxvec.h new file mode 100644 index 00000000000..436a2912982 --- /dev/null +++ b/include/asm-sparc64/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASM_SPARC64_AUXVEC_H +#define __ASM_SPARC64_AUXVEC_H + +#endif /* !(__ASM_SPARC64_AUXVEC_H) */ diff --git a/include/asm-um/auxvec.h b/include/asm-um/auxvec.h new file mode 100644 index 00000000000..1e5e1c2fc9b --- /dev/null +++ b/include/asm-um/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __UM_AUXVEC_H +#define __UM_AUXVEC_H + +#endif diff --git a/include/asm-v850/auxvec.h b/include/asm-v850/auxvec.h new file mode 100644 index 00000000000..f493232d022 --- /dev/null +++ b/include/asm-v850/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __V850_AUXVEC_H__ +#define __V850_AUXVEC_H__ + +#endif /* __V850_AUXVEC_H__ */ diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86_64/auxvec.h new file mode 100644 index 00000000000..2403c4cfced --- /dev/null +++ b/include/asm-x86_64/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __ASM_X86_64_AUXVEC_H +#define __ASM_X86_64_AUXVEC_H + +#endif diff --git a/include/asm-xtensa/auxvec.h b/include/asm-xtensa/auxvec.h new file mode 100644 index 00000000000..257dec75c5a --- /dev/null +++ b/include/asm-xtensa/auxvec.h @@ -0,0 +1,4 @@ +#ifndef __XTENSA_AUXVEC_H +#define __XTENSA_AUXVEC_H + +#endif diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h new file mode 100644 index 00000000000..9a7b374c9fb --- /dev/null +++ b/include/linux/auxvec.h @@ -0,0 +1,31 @@ +#ifndef _LINUX_AUXVEC_H +#define _LINUX_AUXVEC_H + +#include + +/* Symbolic values for the entries in the auxiliary table + put on the initial stack */ +#define AT_NULL 0 /* end of vector */ +#define AT_IGNORE 1 /* entry should be ignored */ +#define AT_EXECFD 2 /* file descriptor of program */ +#define AT_PHDR 3 /* program headers for program */ +#define AT_PHENT 4 /* size of program header entry */ +#define AT_PHNUM 5 /* number of program headers */ +#define AT_PAGESZ 6 /* system page size */ +#define AT_BASE 7 /* base address of interpreter */ +#define AT_FLAGS 8 /* flags */ +#define AT_ENTRY 9 /* entry point of program */ +#define AT_NOTELF 10 /* program is not ELF */ +#define AT_UID 11 /* real uid */ +#define AT_EUID 12 /* effective uid */ +#define AT_GID 13 /* real gid */ +#define AT_EGID 14 /* effective gid */ +#define AT_PLATFORM 15 /* string identifying CPU for optimizations */ +#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ +#define AT_CLKTCK 17 /* frequency at which times() increments */ + +#define AT_SECURE 23 /* secure mode boolean */ + +#define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */ + +#endif /* _LINUX_AUXVEC_H */ diff --git a/include/linux/elf.h b/include/linux/elf.h index f5b3ba5a317..ff955dbf510 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -2,6 +2,7 @@ #define _LINUX_ELF_H #include +#include #include #ifndef elf_read_implies_exec @@ -158,29 +159,6 @@ typedef __s64 Elf64_Sxword; #define ELF64_ST_BIND(x) ELF_ST_BIND(x) #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) -/* Symbolic values for the entries in the auxiliary table - put on the initial stack */ -#define AT_NULL 0 /* end of vector */ -#define AT_IGNORE 1 /* entry should be ignored */ -#define AT_EXECFD 2 /* file descriptor of program */ -#define AT_PHDR 3 /* program headers for program */ -#define AT_PHENT 4 /* size of program header entry */ -#define AT_PHNUM 5 /* number of program headers */ -#define AT_PAGESZ 6 /* system page size */ -#define AT_BASE 7 /* base address of interpreter */ -#define AT_FLAGS 8 /* flags */ -#define AT_ENTRY 9 /* entry point of program */ -#define AT_NOTELF 10 /* program is not ELF */ -#define AT_UID 11 /* real uid */ -#define AT_EUID 12 /* effective uid */ -#define AT_GID 13 /* real gid */ -#define AT_EGID 14 /* effective gid */ -#define AT_PLATFORM 15 /* string identifying CPU for optimizations */ -#define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ -#define AT_CLKTCK 17 /* frequency at which times() increments */ - -#define AT_SECURE 23 /* secure mode boolean */ - typedef struct dynamic{ Elf32_Sword d_tag; union{ diff --git a/include/linux/sched.h b/include/linux/sched.h index 5fb31bede10..b5a22ea8004 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -35,6 +35,8 @@ #include #include +#include /* For AT_VECTOR_SIZE */ + struct exec_domain; /* @@ -261,7 +263,7 @@ struct mm_struct { mm_counter_t _rss; mm_counter_t _anon_rss; - unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ + unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ unsigned dumpable:2; cpumask_t cpu_vm_mask; -- cgit v1.2.3 From 8fc2751beb0941966d3a97b26544e8585e428c08 Mon Sep 17 00:00:00 2001 From: Mark Bellon Date: Tue, 6 Sep 2005 15:16:54 -0700 Subject: [PATCH] disk quotas fail when /etc/mtab is symlinked to /proc/mounts If /etc/mtab is a regular file all of the mount options (of a file system) are written to /etc/mtab by the mount command. The quota tools look there for the quota strings for their operation. If, however, /etc/mtab is a symlink to /proc/mounts (a "good thing" in some environments) the tools don't write anything - they assume the kernel will take care of things. While the quota options are sent down to the kernel via the mount system call and the file system codes handle them properly unfortunately there is no code to echo the quota strings into /proc/mounts and the quota tools fail in the symlink case. The attached patchs modify the EXT[2|3] and JFS codes to add the necessary hooks. The show_options function of each file system in these patches currently deal with only those things that seemed related to quotas; especially in the EXT3 case more can be done (later?). Jan Kara also noted the difficulty in moving these changes above the FS codes responding similarly to myself to Andrew's comment about possible VFS migration. Issue summary: - FS codes have to process the entire string of options anyway. - Only FS codes that use quotas must have a show_options function (for quotas to work properly) however quotas are only used in a small number of FS. - Since most of the quota using FS support other options these FS codes should have the a show_options function to show those options - and the quota echoing becomes virtually negligible. Based on feedback I have modified my patches from the original: JFS a missing patch has been restored to the posting EXT[2|3] and JFS always use the show_options function - Each FS has at least one FS specific option displayed - QUOTA output is under a CONFIG_QUOTA ifdef - a follow-on patch will add a multitude of options for each FS EXT[2|3] and JFS "quota" is treated as "usrquota" EXT3 journalled data check for journalled quota removed EXT[2|3] mount when quota specified but not compiled in - no changes from my original patch. I tested the patch and the codes warn but - still mount. With all due respection I believe the comments otherwise were a - misread of the patch. Please reread/test and comment. XFS patch removed - the XFS team already made the necessary changes EXT3 mixing old and new quotas are handled differently (not purely exclusive) - if old and new quotas for the same type are used together the old type is silently depricated for compatability (e.g. usrquota and usrjquota) - mixing of old and new quotas is an error (e.g. usrjquota and grpquota) Signed-off-by: Mark Bellon Acked-by: Dave Kleikamp Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ext2_fs.h | 3 +++ include/linux/ext3_fs.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index a657130ba03..f7bd1c7ebef 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -313,6 +313,9 @@ struct ext2_inode { #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ +#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ +#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ + #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt #define set_opt(o, opt) o |= EXT2_MOUNT_##opt diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c16662836c5..c0272d73ab2 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -373,6 +373,8 @@ struct ext3_inode { #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ +#define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ +#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ #ifndef _LINUX_EXT2_FS_H -- cgit v1.2.3 From 2865cf001878d22d5fd12e5215621dffbcad76dc Mon Sep 17 00:00:00 2001 From: Zhigang Huo Date: Tue, 6 Sep 2005 15:17:00 -0700 Subject: [PATCH] remove pipe definitions These no longer have any users. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pipe_fs_i.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 36725e7c02c..1767073df26 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -39,9 +39,6 @@ struct pipe_inode_info { #define PIPE_SEM(inode) (&(inode).i_sem) #define PIPE_WAIT(inode) (&(inode).i_pipe->wait) -#define PIPE_BASE(inode) ((inode).i_pipe->base) -#define PIPE_START(inode) ((inode).i_pipe->start) -#define PIPE_LEN(inode) ((inode).i_pipe->len) #define PIPE_READERS(inode) ((inode).i_pipe->readers) #define PIPE_WRITERS(inode) ((inode).i_pipe->writers) #define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) -- cgit v1.2.3 From d2052c1676a39cae101a81f3da8a4ade8b668c88 Mon Sep 17 00:00:00 2001 From: Erik Waling Date: Tue, 6 Sep 2005 15:17:02 -0700 Subject: [PATCH] sonypi SPIC initialisation fix Newer Sony VAIO models (VGN-S480, VGN-S460, VGN-S3XP etc) use a new method to initialize the SPIC device. The new way to initialize (and disable) the device comes directly from the AML code in the _CRS, _SRS and _DIS methods from the DSDT table. This patch adds support for the new models. Signed-off-by: Erik Waling Signed-off-by: Stelian Pop Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sonypi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 768cbba617d..f56d2473495 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h @@ -99,6 +99,8 @@ #define SONYPI_EVENT_BATTERY_INSERT 57 #define SONYPI_EVENT_BATTERY_REMOVE 58 #define SONYPI_EVENT_FNKEY_RELEASED 59 +#define SONYPI_EVENT_WIRELESS_ON 60 +#define SONYPI_EVENT_WIRELESS_OFF 61 /* get/set brightness */ #define SONYPI_IOCGBRT _IOR('v', 0, __u8) -- cgit v1.2.3 From e139aa595c5d3bd01699530cbe017dec75fdb07f Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 6 Sep 2005 15:17:05 -0700 Subject: [PATCH] PNP: make pnp_dbg conditional directly on CONFIG_PNP_DEBUG Seems pointless to require .c files to test CONFIG_PNP_DEBUG and conditionally define DEBUG before including . Just test CONFIG_PNP_DEBUG directly in pnp.h. Signed-off-by: Bjorn Helgaas Cc: Adam Belay Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pnp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 5ec2bd0c284..aadbac29103 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -443,7 +443,7 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) -#ifdef DEBUG +#ifdef CONFIG_PNP_DEBUG #define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) #else #define pnp_dbg(format, arg...) do {} while (0) -- cgit v1.2.3 From f35279d3f713e5c97b98cbdbf47d98f79942c11f Mon Sep 17 00:00:00 2001 From: Bruce Allan Date: Tue, 6 Sep 2005 15:17:08 -0700 Subject: [PATCH] sunrpc: cache_register can use wrong module reference When registering an RPC cache, cache_register() always sets the owner as the sunrpc module. However, there are RPC caches owned by other modules. With the incorrect owner setting, the real owning module can be removed potentially with an open reference to the cache from userspace. For example, if one were to stop the nfs server and unmount the nfsd filesystem, the nfsd module could be removed eventhough rpc.idmapd had references to the idtoname and nametoid caches (i.e. /proc/net/rpc/nfs4./channel is still open). This resulted in a system panic on one of our machines when attempting to restart the nfs services after reloading the nfsd module. The following patch adds a 'struct module *owner' field in struct cache_detail. The owner is further assigned to the struct proc_dir_entry in cache_register() so that the module cannot be unloaded while user-space daemons have an open reference on the associated file under /proc. Signed-off-by: Bruce Allan Cc: Trond Myklebust Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sunrpc/cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6864063d1b9..c4e3ea7cf15 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -60,6 +60,7 @@ struct cache_head { #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ struct cache_detail { + struct module * owner; int hash_size; struct cache_head ** hash_table; rwlock_t hash_lock; -- cgit v1.2.3 From 19b4946ca9d1e35d4c641dcebe27378de34f3ddd Mon Sep 17 00:00:00 2001 From: Mike Waychison Date: Tue, 6 Sep 2005 15:17:10 -0700 Subject: [PATCH] ipc: convert /proc/sysvipc/* to generic seq_file interface Change the /proc/sysvipc/shm|sem|msg files to use the generic seq_file implementation for struct ipc_ids. Signed-off-by: Mike Waychison Cc: Manfred Spraul Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/msg.h | 1 + include/linux/sem.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/msg.h b/include/linux/msg.h index 2c4c6aa643f..903e0ab8101 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h @@ -77,6 +77,7 @@ struct msg_msg { /* one msq_queue structure for each present queue on the system */ struct msg_queue { struct kern_ipc_perm q_perm; + int q_id; time_t q_stime; /* last msgsnd time */ time_t q_rtime; /* last msgrcv time */ time_t q_ctime; /* last change time */ diff --git a/include/linux/sem.h b/include/linux/sem.h index 2d8516be9fd..106f9757339 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h @@ -88,6 +88,7 @@ struct sem { /* One sem_array data structure for each set of semaphores in the system. */ struct sem_array { struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ + int sem_id; time_t sem_otime; /* last semop time */ time_t sem_ctime; /* last change time */ struct sem *sem_base; /* ptr to first semaphore in array */ -- cgit v1.2.3 From 6e3eaab02028c4087a92711b20abb9e72cc803a7 Mon Sep 17 00:00:00 2001 From: Abhay Salunke Date: Tue, 6 Sep 2005 15:17:13 -0700 Subject: [PATCH] modified firmware_class.c to support no hotplug Upgrade the request_firmware_nowait function to not start the hotplug action on a firmware update. This patch is tested along with dell_rbu driver on i386 and x86-64 systems. Signed-off-by: Abhay Salunke Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/firmware.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 886255b69bb..2063c0839d4 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -3,6 +3,9 @@ #include #include #define FIRMWARE_NAME_MAX 30 +#define FW_ACTION_NOHOTPLUG 0 +#define FW_ACTION_HOTPLUG 1 + struct firmware { size_t size; u8 *data; @@ -11,7 +14,7 @@ struct device; int request_firmware(const struct firmware **fw, const char *name, struct device *device); int request_firmware_nowait( - struct module *module, + struct module *module, int hotplug, const char *name, struct device *device, void *context, void (*cont)(const struct firmware *fw, void *context)); -- cgit v1.2.3 From f26fdd59929e1144c6caf72adcaf4561d6e682a4 Mon Sep 17 00:00:00 2001 From: Karsten Wiese Date: Tue, 6 Sep 2005 15:17:25 -0700 Subject: [PATCH] CHECK_IRQ_PER_CPU() to avoid dead code in __do_IRQ() IRQ_PER_CPU is not used by all architectures. This patch introduces the macros ARCH_HAS_IRQ_PER_CPU and CHECK_IRQ_PER_CPU() to avoid the generation of dead code in __do_IRQ(). ARCH_HAS_IRQ_PER_CPU is defined by architectures using IRQ_PER_CPU in their include/asm_ARCH/irq.h file. Through grepping the tree I found the following architectures currently use IRQ_PER_CPU: cris, ia64, ppc, ppc64 and parisc. Signed-off-by: Karsten Wiese Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-cris/irq.h | 5 +++++ include/asm-ia64/irq.h | 5 +++++ include/asm-parisc/irq.h | 5 +++++ include/asm-ppc/irq.h | 5 +++++ include/asm-ppc64/irq.h | 5 +++++ include/linux/irq.h | 7 ++++++- 6 files changed, 31 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h index 8e787fdaedd..4fab5c3b2e1 100644 --- a/include/asm-cris/irq.h +++ b/include/asm-cris/irq.h @@ -1,6 +1,11 @@ #ifndef _ASM_IRQ_H #define _ASM_IRQ_H +/* + * IRQ line status macro IRQ_PER_CPU is used + */ +#define ARCH_HAS_IRQ_PER_CPU + #include extern __inline__ int irq_canonicalize(int irq) diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h index 5d930fdc0be..cd984d08fd1 100644 --- a/include/asm-ia64/irq.h +++ b/include/asm-ia64/irq.h @@ -14,6 +14,11 @@ #define NR_IRQS 256 #define NR_IRQ_VECTORS NR_IRQS +/* + * IRQ line status macro IRQ_PER_CPU is used + */ +#define ARCH_HAS_IRQ_PER_CPU + static __inline__ int irq_canonicalize (int irq) { diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h index 75654ba9335..f876bdf2205 100644 --- a/include/asm-parisc/irq.h +++ b/include/asm-parisc/irq.h @@ -26,6 +26,11 @@ #define NR_IRQS (CPU_IRQ_MAX + 1) +/* + * IRQ line status macro IRQ_PER_CPU is used + */ +#define ARCH_HAS_IRQ_PER_CPU + static __inline__ int irq_canonicalize(int irq) { return (irq == 2) ? 9 : irq; diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index a244d93ca95..b4b270457ed 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -19,6 +19,11 @@ #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ +/* + * IRQ line status macro IRQ_PER_CPU is used + */ +#define ARCH_HAS_IRQ_PER_CPU + #if defined(CONFIG_40x) #include diff --git a/include/asm-ppc64/irq.h b/include/asm-ppc64/irq.h index 570678b1da9..99782afb4cd 100644 --- a/include/asm-ppc64/irq.h +++ b/include/asm-ppc64/irq.h @@ -33,6 +33,11 @@ #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ +/* + * IRQ line status macro IRQ_PER_CPU is used + */ +#define ARCH_HAS_IRQ_PER_CPU + #define get_irq_desc(irq) (&irq_desc[(irq)]) /* Define a way to iterate across irqs. */ diff --git a/include/linux/irq.h b/include/linux/irq.h index 4a362b9ec96..69681c3b1f0 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -32,7 +32,12 @@ #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ #define IRQ_LEVEL 64 /* IRQ level triggered */ #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ -#define IRQ_PER_CPU 256 /* IRQ is per CPU */ +#if defined(ARCH_HAS_IRQ_PER_CPU) +# define IRQ_PER_CPU 256 /* IRQ is per CPU */ +# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) +#else +# define CHECK_IRQ_PER_CPU(var) 0 +#endif /* * Interrupt controller descriptor. This is all we need -- cgit v1.2.3 From c8d127418d78aaeeb1a417ef7453dc09c9118146 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 6 Sep 2005 15:17:27 -0700 Subject: [PATCH] remove asm-*/hdreg.h unused and useless.. Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/hdreg.h | 1 - include/asm-arm/hdreg.h | 1 - include/asm-arm26/hdreg.h | 1 - include/asm-generic/hdreg.h | 8 -------- include/asm-h8300/hdreg.h | 15 --------------- include/asm-i386/hdreg.h | 1 - include/asm-ia64/hdreg.h | 14 -------------- include/asm-m32r/hdreg.h | 1 - include/asm-m68k/hdreg.h | 1 - include/asm-m68knommu/hdreg.h | 1 - include/asm-mips/hdreg.h | 1 - include/asm-parisc/hdreg.h | 1 - include/asm-sh/hdreg.h | 1 - include/asm-sh64/hdreg.h | 6 ------ include/asm-sparc/hdreg.h | 1 - include/asm-sparc64/hdreg.h | 1 - include/asm-um/hdreg.h | 6 ------ include/asm-x86_64/hdreg.h | 1 - include/asm-xtensa/hdreg.h | 17 ----------------- 19 files changed, 79 deletions(-) delete mode 100644 include/asm-alpha/hdreg.h delete mode 100644 include/asm-arm/hdreg.h delete mode 100644 include/asm-arm26/hdreg.h delete mode 100644 include/asm-generic/hdreg.h delete mode 100644 include/asm-h8300/hdreg.h delete mode 100644 include/asm-i386/hdreg.h delete mode 100644 include/asm-ia64/hdreg.h delete mode 100644 include/asm-m32r/hdreg.h delete mode 100644 include/asm-m68k/hdreg.h delete mode 100644 include/asm-m68knommu/hdreg.h delete mode 100644 include/asm-mips/hdreg.h delete mode 100644 include/asm-parisc/hdreg.h delete mode 100644 include/asm-sh/hdreg.h delete mode 100644 include/asm-sh64/hdreg.h delete mode 100644 include/asm-sparc/hdreg.h delete mode 100644 include/asm-sparc64/hdreg.h delete mode 100644 include/asm-um/hdreg.h delete mode 100644 include/asm-x86_64/hdreg.h delete mode 100644 include/asm-xtensa/hdreg.h (limited to 'include') diff --git a/include/asm-alpha/hdreg.h b/include/asm-alpha/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-alpha/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-arm/hdreg.h b/include/asm-arm/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-arm/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-arm26/hdreg.h b/include/asm-arm26/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-arm26/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-generic/hdreg.h b/include/asm-generic/hdreg.h deleted file mode 100644 index 7051fba8bcf..00000000000 --- a/include/asm-generic/hdreg.h +++ /dev/null @@ -1,8 +0,0 @@ -#warning is obsolete, please do not use it - -#ifndef __ASM_GENERIC_HDREG_H -#define __ASM_GENERIC_HDREG_H - -typedef unsigned long ide_ioreg_t; - -#endif /* __ASM_GENERIC_HDREG_H */ diff --git a/include/asm-h8300/hdreg.h b/include/asm-h8300/hdreg.h deleted file mode 100644 index 36d0c06687d..00000000000 --- a/include/asm-h8300/hdreg.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * linux/include/asm-h8300/hdreg.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -#warning this file is obsolete, please do not use it - -#ifndef _H8300_HDREG_H -#define _H8300_HDREG_H - -typedef unsigned int q40ide_ioreg_t; -typedef unsigned char * ide_ioreg_t; - -#endif /* _H8300_HDREG_H */ diff --git a/include/asm-i386/hdreg.h b/include/asm-i386/hdreg.h deleted file mode 100644 index 5989bbc97cb..00000000000 --- a/include/asm-i386/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#warning this file is obsolete, please do not use it diff --git a/include/asm-ia64/hdreg.h b/include/asm-ia64/hdreg.h deleted file mode 100644 index 83b5161d267..00000000000 --- a/include/asm-ia64/hdreg.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * linux/include/asm-ia64/hdreg.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -#warning this file is obsolete, please do not use it - -#ifndef __ASM_IA64_HDREG_H -#define __ASM_IA64_HDREG_H - -typedef unsigned short ide_ioreg_t; - -#endif /* __ASM_IA64_HDREG_H */ diff --git a/include/asm-m32r/hdreg.h b/include/asm-m32r/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-m32r/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-m68k/hdreg.h b/include/asm-m68k/hdreg.h deleted file mode 100644 index 5989bbc97cb..00000000000 --- a/include/asm-m68k/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#warning this file is obsolete, please do not use it diff --git a/include/asm-m68knommu/hdreg.h b/include/asm-m68knommu/hdreg.h deleted file mode 100644 index 5cdd9b084d3..00000000000 --- a/include/asm-m68knommu/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-mips/hdreg.h b/include/asm-mips/hdreg.h deleted file mode 100644 index 5989bbc97cb..00000000000 --- a/include/asm-mips/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#warning this file is obsolete, please do not use it diff --git a/include/asm-parisc/hdreg.h b/include/asm-parisc/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-parisc/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-sh/hdreg.h b/include/asm-sh/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-sh/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-sh64/hdreg.h b/include/asm-sh64/hdreg.h deleted file mode 100644 index 52d983635a2..00000000000 --- a/include/asm-sh64/hdreg.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_SH64_HDREG_H -#define __ASM_SH64_HDREG_H - -#include - -#endif /* __ASM_SH64_HDREG_H */ diff --git a/include/asm-sparc/hdreg.h b/include/asm-sparc/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-sparc/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-sparc64/hdreg.h b/include/asm-sparc64/hdreg.h deleted file mode 100644 index 7f7fd1af0af..00000000000 --- a/include/asm-sparc64/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/asm-um/hdreg.h b/include/asm-um/hdreg.h deleted file mode 100644 index cf6363abcab..00000000000 --- a/include/asm-um/hdreg.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __UM_HDREG_H -#define __UM_HDREG_H - -#include "asm/arch/hdreg.h" - -#endif diff --git a/include/asm-x86_64/hdreg.h b/include/asm-x86_64/hdreg.h deleted file mode 100644 index 5989bbc97cb..00000000000 --- a/include/asm-x86_64/hdreg.h +++ /dev/null @@ -1 +0,0 @@ -#warning this file is obsolete, please do not use it diff --git a/include/asm-xtensa/hdreg.h b/include/asm-xtensa/hdreg.h deleted file mode 100644 index 64b80607b80..00000000000 --- a/include/asm-xtensa/hdreg.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * include/asm-xtensa/hdreg.h - * - * This file is subject to the terms and conditions of the GNU General - * Public License. See the file "COPYING" in the main directory of - * this archive for more details. - * - * Copyright (C) 2002 - 2005 Tensilica Inc. - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -#ifndef _XTENSA_HDREG_H -#define _XTENSA_HDREG_H - -typedef unsigned int ide_ioreg_t; - -#endif -- cgit v1.2.3 From f23ef184b486ac021b6a471b4e94cfa04860d3b0 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 6 Sep 2005 15:17:29 -0700 Subject: [PATCH] Delete unused do_nanosleep declaration There is no do_nanosleep function so kill it's declaration in . Signed-off-by: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/time.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/time.h b/include/linux/time.h index 5634497ff5d..c10d4c21c18 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -97,7 +97,6 @@ extern int do_settimeofday(struct timespec *tv); extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); extern void clock_was_set(void); // call when ever the clock is set extern int do_posix_clock_monotonic_gettime(struct timespec *tp); -extern long do_nanosleep(struct timespec *t); extern long do_utimes(char __user * filename, struct timeval * times); struct itimerval; extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); -- cgit v1.2.3 From 2832e9366a1fcd6f76957a42157be041240f994e Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 6 Sep 2005 15:17:38 -0700 Subject: [PATCH] remove file.f_maxcount struct file cleanup: f_maxcount has an unique value (INT_MAX). Just use the hard-wired value. Signed-off-by: Eric Dumazet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 67e6732d4fd..2036747c7d1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -594,7 +594,6 @@ struct file { unsigned int f_uid, f_gid; struct file_ra_state f_ra; - size_t f_maxcount; unsigned long f_version; void *f_security; -- cgit v1.2.3 From b149ee2233edf08fb59b11e879a2c5941929bcb8 Mon Sep 17 00:00:00 2001 From: john stultz Date: Tue, 6 Sep 2005 15:17:46 -0700 Subject: [PATCH] NTP: ntp-helper functions This patch cleans up a commonly repeated set of changes to the NTP state variables by adding two helper inline functions: ntp_clear(): Clears the ntp state variables ntp_synced(): Returns 1 if the system is synced with a time server. This was compile tested for alpha, arm, i386, x86-64, ppc64, s390, sparc, sparc64. Signed-off-by: John Stultz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/timex.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'include') diff --git a/include/linux/timex.h b/include/linux/timex.h index 74fdd07d379..7e050a2cc35 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h @@ -260,6 +260,29 @@ extern long pps_calcnt; /* calibration intervals */ extern long pps_errcnt; /* calibration errors */ extern long pps_stbcnt; /* stability limit exceeded */ +/** + * ntp_clear - Clears the NTP state variables + * + * Must be called while holding a write on the xtime_lock + */ +static inline void ntp_clear(void) +{ + time_adjust = 0; /* stop active adjtime() */ + time_status |= STA_UNSYNC; + time_maxerror = NTP_PHASE_LIMIT; + time_esterror = NTP_PHASE_LIMIT; +} + +/** + * ntp_synced - Returns 1 if the NTP status is not UNSYNC + * + */ +static inline int ntp_synced(void) +{ + return !(time_status & STA_UNSYNC); +} + + #ifdef CONFIG_TIME_INTERPOLATION #define TIME_SOURCE_CPU 0 -- cgit v1.2.3 From 9c45817f41af987277353e463c78a1c6beb37da2 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 6 Sep 2005 15:17:47 -0700 Subject: [PATCH] Remove non-arch consumers of asm/segment.h asm/segment.h varies greatly on different architectures but is clearly deprecated. Removing all non-architecture consumers will make it easier for us to get ride of asm/segment.h all together. Signed-off-by: Kumar Gala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/isdn.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 862083eb58a..53eaee96065 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -150,7 +150,6 @@ typedef struct { #include #include #include -#include #include #include #include -- cgit v1.2.3 From 97de50c0add1e8f3b4e764c66a13c07235fee631 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 6 Sep 2005 15:17:49 -0700 Subject: [PATCH] remove verify_area(): remove verify_area() from various uaccess.h headers Remove the deprecated (and unused) verify_area() from various uaccess.h headers. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/uaccess.h | 6 ------ include/asm-arm/uaccess.h | 6 ------ include/asm-arm26/uaccess.h | 6 ------ include/asm-cris/uaccess.h | 7 ------- include/asm-frv/uaccess.h | 6 ------ include/asm-h8300/uaccess.h | 6 ------ include/asm-i386/uaccess.h | 24 ------------------------ include/asm-ia64/uaccess.h | 7 ------- include/asm-m32r/uaccess.h | 25 ------------------------- include/asm-m68k/uaccess.h | 6 ------ include/asm-m68knommu/uaccess.h | 6 ------ include/asm-mips/uaccess.h | 23 ----------------------- include/asm-parisc/uaccess.h | 4 ---- include/asm-ppc/uaccess.h | 7 ------- include/asm-ppc64/uaccess.h | 7 ------- include/asm-s390/uaccess.h | 7 ------- include/asm-sh/uaccess.h | 6 ------ include/asm-sh64/uaccess.h | 6 ------ include/asm-sparc/uaccess.h | 6 ------ include/asm-sparc64/uaccess.h | 6 ------ include/asm-v850/uaccess.h | 6 ------ include/asm-x86_64/uaccess.h | 7 ------- 22 files changed, 190 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h index 4c39ee750f3..22de3b434a2 100644 --- a/include/asm-alpha/uaccess.h +++ b/include/asm-alpha/uaccess.h @@ -48,12 +48,6 @@ __access_ok(((unsigned long)(addr)),(size),get_fs()); \ }) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type. diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index a7c018b8a0d..a2fdad0138b 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h @@ -77,12 +77,6 @@ static inline void set_fs (mm_segment_t fs) #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void __user *addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - /* * Single-value transfer routines. They automatically use the right * size if we just have the right pointer type. Note that the functions diff --git a/include/asm-arm26/uaccess.h b/include/asm-arm26/uaccess.h index ab9ce38c6ae..3f2dd1093e5 100644 --- a/include/asm-arm26/uaccess.h +++ b/include/asm-arm26/uaccess.h @@ -40,12 +40,6 @@ extern int fixup_exception(struct pt_regs *regs); #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void * addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - /* * Single-value transfer routines. They automatically use the right * size if we just have the right pointer type. Note that the functions diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h index 6db17221fd9..7d50086eb5e 100644 --- a/include/asm-cris/uaccess.h +++ b/include/asm-cris/uaccess.h @@ -91,13 +91,6 @@ #define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size))) #define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - - #include /* diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h index 32dc52e883e..991b50fbba2 100644 --- a/include/asm-frv/uaccess.h +++ b/include/asm-frv/uaccess.h @@ -67,12 +67,6 @@ static inline int ___range_ok(unsigned long addr, unsigned long size) #define access_ok(type,addr,size) (__range_ok((addr), (size)) == 0) #define __access_ok(addr,size) (__range_ok((addr), (size)) == 0) -/* this function will go away soon - use access_ok() / __range_ok() instead */ -static inline int __deprecated verify_area(int type, const void * addr, unsigned long size) -{ - return __range_ok(addr, size); -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-h8300/uaccess.h b/include/asm-h8300/uaccess.h index 1480f307a47..ebe58c6c838 100644 --- a/include/asm-h8300/uaccess.h +++ b/include/asm-h8300/uaccess.h @@ -24,12 +24,6 @@ static inline int __access_ok(unsigned long addr, unsigned long size) return(RANGE_CHECK_OK(addr, size, 0L, (unsigned long)&_ramend)); } -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void *addr, unsigned long size) -{ - return access_ok(type,addr,size)?0:-EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index 886867aea94..89ab7e2bc5a 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h @@ -83,30 +83,6 @@ extern struct movsl_mask { */ #define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0)) -/** - * verify_area: - Obsolete/deprecated and will go away soon, - * use access_ok() instead. - * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE - * @addr: User space pointer to start of block to check - * @size: Size of block to check - * - * Context: User context only. This function may sleep. - * - * This function has been replaced by access_ok(). - * - * Checks if a pointer to a block of memory in user space is valid. - * - * Returns zero if the memory block may be valid, -EFAULT - * if it is definitely invalid. - * - * See access_ok() for more details. - */ -static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h index 8edd9a90949..3a7829bb595 100644 --- a/include/asm-ia64/uaccess.h +++ b/include/asm-ia64/uaccess.h @@ -72,13 +72,6 @@ }) #define access_ok(type, addr, size) __access_ok((addr), (size), get_fs()) -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated -verify_area (int type, const void __user *addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - /* * These are the main single-value transfer routines. They automatically * use the right size if we just have the right pointer type. diff --git a/include/asm-m32r/uaccess.h b/include/asm-m32r/uaccess.h index bbb8ac4018a..93d863c455a 100644 --- a/include/asm-m32r/uaccess.h +++ b/include/asm-m32r/uaccess.h @@ -120,31 +120,6 @@ static inline int access_ok(int type, const void *addr, unsigned long size) } #endif /* CONFIG_MMU */ -/** - * verify_area: - Obsolete/deprecated and will go away soon, - * use access_ok() instead. - * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE - * @addr: User space pointer to start of block to check - * @size: Size of block to check - * - * Context: User context only. This function may sleep. - * - * This function has been replaced by access_ok(). - * - * Checks if a pointer to a block of memory in user space is valid. - * - * Returns zero if the memory block may be valid, -EFAULT - * if it is definitely invalid. - * - * See access_ok() for more details. - */ -static inline int __deprecated verify_area(int type, const void __user *addr, - unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index 605e6cb811f..f5cedf19cf6 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h @@ -14,12 +14,6 @@ /* We let the MMU do all checking */ #define access_ok(type,addr,size) 1 -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void *addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index f0be74bb353..05be9515a2d 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h @@ -23,12 +23,6 @@ static inline int _access_ok(unsigned long addr, unsigned long size) (is_in_rom(addr) && is_in_rom(addr+size))); } -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void * addr, unsigned long size) -{ - return access_ok(type,addr,size)?0:-EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-mips/uaccess.h b/include/asm-mips/uaccess.h index a543ead72ec..5c2c9832901 100644 --- a/include/asm-mips/uaccess.h +++ b/include/asm-mips/uaccess.h @@ -111,29 +111,6 @@ #define access_ok(type, addr, size) \ likely(__access_ok((unsigned long)(addr), (size),__access_mask)) -/* - * verify_area: - Obsolete/deprecated and will go away soon, - * use access_ok() instead. - * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE - * @addr: User space pointer to start of block to check - * @size: Size of block to check - * - * Context: User context only. This function may sleep. - * - * This function has been replaced by access_ok(). - * - * Checks if a pointer to a block of memory in user space is valid. - * - * Returns zero if the memory block may be valid, -EFAULT - * if it is definitely invalid. - * - * See access_ok() for more details. - */ -static inline int __deprecated verify_area(int type, const void * addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - /* * put_user: - Write a simple value into user space. * @x: Value to copy to user space. diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index c1b5bdea53e..f6c417c8c48 100644 --- a/include/asm-parisc/uaccess.h +++ b/include/asm-parisc/uaccess.h @@ -40,10 +40,6 @@ static inline long access_ok(int type, const void __user * addr, return 1; } -#define verify_area(type,addr,size) (0) /* FIXME: all users should go away soon, - * and use access_ok instead, then this - * should be removed. */ - #define put_user __put_user #define get_user __get_user diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index b044ae03ac5..63f56224da8 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -37,13 +37,6 @@ #define access_ok(type, addr, size) \ (__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size))) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h index 05b5943ab1e..c181a60d868 100644 --- a/include/asm-ppc64/uaccess.h +++ b/include/asm-ppc64/uaccess.h @@ -56,13 +56,6 @@ #define access_ok(type,addr,size) \ __access_ok(((__force unsigned long)(addr)),(size),get_fs()) -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void __user *addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h index 3e3bfe6a8fa..38a5cf8ab9e 100644 --- a/include/asm-s390/uaccess.h +++ b/include/asm-s390/uaccess.h @@ -65,13 +65,6 @@ #define access_ok(type,addr,size) __access_ok(addr,size) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user *addr, - unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h index fb9e334afa2..2cb01861e7c 100644 --- a/include/asm-sh/uaccess.h +++ b/include/asm-sh/uaccess.h @@ -146,12 +146,6 @@ static inline int access_ok(int type, const void __user *p, unsigned long size) return __access_ok(addr, size); } -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * Uh, these should become the main single-value transfer routines ... * They automatically use the right size if we just have the right diff --git a/include/asm-sh64/uaccess.h b/include/asm-sh64/uaccess.h index a33654d576a..56aa3cf0f27 100644 --- a/include/asm-sh64/uaccess.h +++ b/include/asm-sh64/uaccess.h @@ -60,12 +60,6 @@ #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) #define __access_ok(addr,size) (__range_ok(addr,size) == 0) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * Uh, these should become the main single-value transfer routines ... * They automatically use the right size if we just have the right diff --git a/include/asm-sparc/uaccess.h b/include/asm-sparc/uaccess.h index 0a780e84a12..f8f1ec1f06e 100644 --- a/include/asm-sparc/uaccess.h +++ b/include/asm-sparc/uaccess.h @@ -47,12 +47,6 @@ #define access_ok(type, addr, size) \ ({ (void)(type); __access_ok((unsigned long)(addr), size); }) -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 5690142f82d..80a65d7e3db 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h @@ -59,12 +59,6 @@ static inline int access_ok(int type, const void __user * addr, unsigned long si return 1; } -/* this function will go away soon - use access_ok() instead */ -static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return 0; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-v850/uaccess.h b/include/asm-v850/uaccess.h index 4386cfc6a8d..188b28597cf 100644 --- a/include/asm-v850/uaccess.h +++ b/include/asm-v850/uaccess.h @@ -27,12 +27,6 @@ extern inline int access_ok (int type, const void *addr, unsigned long size) return val >= (0x80 + NUM_CPU_IRQS*16) && val < 0xFFFFF000; } -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area (int type, const void *addr, unsigned long size) -{ - return access_ok (type, addr, size) ? 0 : -EFAULT; -} - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 48f292752c9..1bb8b8a2443 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h @@ -49,13 +49,6 @@ #define access_ok(type, addr, size) (__range_not_ok(addr,size) == 0) -/* this function will go away soon - use access_ok() instead */ -extern inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) -{ - return access_ok(type,addr,size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is -- cgit v1.2.3 From eed74dfcd48101d259012ac08d29061eea500249 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Tue, 6 Sep 2005 15:17:51 -0700 Subject: [PATCH] optimise 64bit unaligned access on 32bit kernel I've rewriten Atushi's fix for the 64-bit put_unaligned on 32-bit systems bug to generate more efficient code. This case has buzilla URL http://bugzilla.kernel.org/show_bug.cgi?id=5138. Signed-off-by: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/unaligned.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 6c90f0f36ee..4dc8ddb401c 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -16,9 +16,9 @@ * The main single-value unaligned transfer routines. */ #define get_unaligned(ptr) \ - ((__typeof__(*(ptr)))__get_unaligned((ptr), sizeof(*(ptr)))) + __get_unaligned((ptr), sizeof(*(ptr))) #define put_unaligned(x,ptr) \ - __put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr))) + __put_unaligned((__u64)(x), (ptr), sizeof(*(ptr))) /* * This function doesn't actually exist. The idea is that when @@ -36,19 +36,19 @@ struct __una_u16 { __u16 x __attribute__((packed)); }; * Elemental unaligned loads */ -static inline unsigned long __uldq(const __u64 *addr) +static inline __u64 __uldq(const __u64 *addr) { const struct __una_u64 *ptr = (const struct __una_u64 *) addr; return ptr->x; } -static inline unsigned long __uldl(const __u32 *addr) +static inline __u32 __uldl(const __u32 *addr) { const struct __una_u32 *ptr = (const struct __una_u32 *) addr; return ptr->x; } -static inline unsigned long __uldw(const __u16 *addr) +static inline __u16 __uldw(const __u16 *addr) { const struct __una_u16 *ptr = (const struct __una_u16 *) addr; return ptr->x; @@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u16 *addr) #define __get_unaligned(ptr, size) ({ \ const void *__gu_p = ptr; \ - unsigned long val; \ + __typeof__(*(ptr)) val; \ switch (size) { \ case 1: \ val = *(const __u8 *)__gu_p; \ -- cgit v1.2.3 From 9317259ead88fe6c05120ae1e3ace99738e2c698 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:17:57 -0700 Subject: [PATCH] Create asm-generic/fcntl.h This set of patches creates asm-generic/fcntl.h and consolidates as much as possible from the asm-*/fcntl.h files into it. This patch just gathers all the identical bits of the asm-*/fcntl.h files into asm-generic/fcntl.h. Signed-off-by: Stephen Rothwell Signed-off-by: Yoichi Yuasa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/fcntl.h | 25 +------------------------ include/asm-arm/fcntl.h | 27 ++------------------------- include/asm-arm26/fcntl.h | 27 ++------------------------- include/asm-cris/fcntl.h | 26 +------------------------- include/asm-frv/fcntl.h | 27 ++------------------------- include/asm-generic/fcntl.h | 32 ++++++++++++++++++++++++++++++++ include/asm-h8300/fcntl.h | 27 ++------------------------- include/asm-i386/fcntl.h | 26 +------------------------- include/asm-ia64/fcntl.h | 28 ++-------------------------- include/asm-m32r/fcntl.h | 26 +------------------------- include/asm-m68k/fcntl.h | 27 ++------------------------- include/asm-mips/fcntl.h | 28 ++-------------------------- include/asm-parisc/fcntl.h | 26 +------------------------- include/asm-ppc/fcntl.h | 27 ++------------------------- include/asm-ppc64/fcntl.h | 26 +------------------------- include/asm-s390/fcntl.h | 28 +++------------------------- include/asm-sh/fcntl.h | 27 ++------------------------- include/asm-sparc/fcntl.h | 27 ++------------------------- include/asm-sparc64/fcntl.h | 26 +------------------------- include/asm-v850/fcntl.h | 27 ++------------------------- include/asm-x86_64/fcntl.h | 26 +------------------------- include/asm-xtensa/fcntl.h | 26 +------------------------- 22 files changed, 66 insertions(+), 526 deletions(-) create mode 100644 include/asm-generic/fcntl.h (limited to 'include') diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h index 6b7d6c1649c..3f3ad49e836 100644 --- a/include/asm-alpha/fcntl.h +++ b/include/asm-alpha/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 01000 /* not fcntl */ #define O_TRUNC 02000 /* not fcntl */ #define O_EXCL 04000 /* not fcntl */ @@ -23,11 +19,6 @@ #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ #define O_NOATIME 04000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 @@ -37,9 +28,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 @@ -51,17 +39,6 @@ #define F_INPROGRESS 64 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -70,6 +47,6 @@ struct flock { __kernel_pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index 485b6bdf4d7..e6606669cee 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_LARGEFILE 0400000 #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,5 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index 485b6bdf4d7..e6606669cee 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_LARGEFILE 0400000 #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,5 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index 61c563242b5..edde3cc6560 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -5,10 +5,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -24,11 +20,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -42,9 +33,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -57,18 +45,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -85,6 +61,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index d61b999f997..e2092dff9d0 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,6 +59,7 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif /* _ASM_FCNTL_H */ diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h new file mode 100644 index 00000000000..d256c5bb6ed --- /dev/null +++ b/include/asm-generic/fcntl.h @@ -0,0 +1,32 @@ +#ifndef _ASM_GENERIC_FCNTL_H +#define _ASM_GENERIC_FCNTL_H + +#define O_ACCMODE 0003 +#define O_RDONLY 0000 +#define O_WRONLY 0001 +#define O_RDWR 0002 + +#define F_DUPFD 0 /* dup */ +#define F_GETFD 1 /* get close_on_exec */ +#define F_SETFD 2 /* set/clear close_on_exec */ +#define F_GETFL 3 /* get file->f_flags */ +#define F_SETFL 4 /* set file->f_flags */ + +/* for F_[GET|SET]FL */ +#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ + +/* operations for bsd flock(), also used by the kernel implementation */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* or'd with one of the above to prevent + blocking */ +#define LOCK_UN 8 /* remove lock */ + +#define LOCK_MAND 32 /* This is a mandatory flock ... */ +#define LOCK_READ 64 /* which allows concurrent read operations */ +#define LOCK_WRITE 128 /* which allows concurrent write operations */ +#define LOCK_RW 192 /* which allows concurrent read & write ops */ + +#define F_LINUX_SPECIFIC_BASE 1024 + +#endif /* _ASM_GENERIC_FCNTL_H */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 355350a57bf..43803ac89f4 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_LARGEFILE 0400000 #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,5 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif /* _H8300_FCNTL_H */ diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index 511cde94a3e..b51233c6a72 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,6 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index cee16ea1780..9f0ec1e4bd5 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -11,10 +11,6 @@ * open/fcntl - O_SYNC is only implemented on blocks devices and on * files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -30,11 +26,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -44,9 +35,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -59,18 +47,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -79,9 +55,9 @@ struct flock { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 - #define force_o_largefile() \ (personality(current->personality) != PER_LINUX32) +#include + #endif /* _ASM_IA64_FCNTL_H */ diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index 3e308957202..3372bf91554 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -7,10 +7,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -26,11 +22,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -44,9 +35,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -59,18 +47,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -87,6 +63,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* _ASM_M32R_FCNTL_H */ diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index 0d4212983a3..8051f38ecc8 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_LARGEFILE 0400000 #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,5 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif /* _M68K_FCNTL_H */ diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index 2436392e799..4b6043f1280 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -10,10 +10,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0x0003 -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 #define O_APPEND 0x0008 #define O_SYNC 0x0010 #define O_NONBLOCK 0x0080 @@ -30,11 +26,6 @@ #define O_NDELAY O_NONBLOCK -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 14 #define F_SETLK 6 #define F_SETLKW 7 @@ -50,9 +41,6 @@ #define F_SETLKW64 35 #endif -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -65,18 +53,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - /* * The flavours of struct flock. "struct flock" is the ABI compliant * variant. Finally struct flock64 is the LFS variant of struct flock. As @@ -86,7 +62,7 @@ #ifndef __mips64 -typedef struct flock { +struct flock { short l_type; short l_whence; __kernel_off_t l_start; @@ -120,6 +96,6 @@ typedef struct flock { #endif -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* _ASM_FCNTL_H */ diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index def35230716..0a4ee639873 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 00000003 -#define O_RDONLY 00000000 -#define O_WRONLY 00000001 -#define O_RDWR 00000002 #define O_APPEND 00000010 #define O_BLKSEEK 00000100 /* HPUX only */ #define O_CREAT 00000400 /* not fcntl */ @@ -27,11 +23,6 @@ #define O_NOFOLLOW 00000200 /* don't follow links */ #define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get f_flags */ -#define F_SETFD 2 /* set f_flags */ -#define F_GETFL 3 /* more flags (cloexec) */ -#define F_SETFL 4 #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -44,9 +35,6 @@ #define F_SETSIG 13 /* for sockets. */ #define F_GETSIG 14 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 01 #define F_WRLCK 02 @@ -59,18 +47,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -87,6 +63,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 5e28e41fb29..e8c2dc20661 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_DIRECT 0400000 /* direct disk access hint */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - #ifdef __KERNEL__ #define F_POSIX 1 #define F_FLOCK 2 @@ -89,5 +65,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif diff --git a/include/asm-ppc64/fcntl.h b/include/asm-ppc64/fcntl.h index 842560d5065..579a5292fd5 100644 --- a/include/asm-ppc64/fcntl.h +++ b/include/asm-ppc64/fcntl.h @@ -10,10 +10,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -29,11 +25,6 @@ #define O_DIRECT 0400000 /* direct disk access hint */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -43,9 +34,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -58,18 +46,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - #ifdef __KERNEL__ #define F_POSIX 1 #define F_FLOCK 2 @@ -84,6 +60,6 @@ struct flock { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* _PPC64_FCNTL_H */ diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index 48f692b4573..159979f3509 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -10,10 +10,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -29,11 +25,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -49,9 +40,6 @@ #define F_SETLKW64 14 #endif /* ! __s390x__ */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -64,18 +52,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -93,5 +69,7 @@ struct flock64 { pid_t l_pid; }; #endif -#define F_LINUX_SPECIFIC_BASE 1024 + +#include + #endif diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index 0b3ae524e34..7c256734cf1 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,6 +59,7 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif /* __ASM_SH_FCNTL_H */ diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index df9c75d41d6..68d3fd9156f 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -4,10 +4,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_ACCMODE 0x0003 #define O_APPEND 0x0008 #define FASYNC 0x0040 /* fcntl, for BSD compatibility */ #define O_CREAT 0x0200 /* not fcntl */ @@ -23,11 +19,6 @@ #define O_DIRECT 0x100000 /* direct disk access hint */ #define O_NOATIME 0x200000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ #define F_GETLK 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -85,5 +61,6 @@ struct flock64 { short __unused; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h index e36def0d0d8..a8c543d1ebf 100644 --- a/include/asm-sparc64/fcntl.h +++ b/include/asm-sparc64/fcntl.h @@ -4,10 +4,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_ACCMODE 0x0003 #define O_NDELAY 0x0004 #define O_APPEND 0x0008 #define FASYNC 0x0040 /* fcntl, for BSD compatibility */ @@ -24,11 +20,6 @@ #define O_NOATIME 0x200000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ #define F_GETLK 7 @@ -37,9 +28,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 @@ -52,18 +40,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -73,6 +49,6 @@ struct flock { short __unused; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* !(_SPARC64_FCNTL_H) */ diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index 31d4b596122..1a39a0cb9ce 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_LARGEFILE 0400000 #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -40,9 +31,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -55,18 +43,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -83,5 +59,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include + #endif /* __V850_FCNTL_H__ */ diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h index 4411f221c03..f58d8d1d9b2 100644 --- a/include/asm-x86_64/fcntl.h +++ b/include/asm-x86_64/fcntl.h @@ -3,10 +3,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0003 -#define O_RDONLY 00 -#define O_WRONLY 01 -#define O_RDWR 02 #define O_CREAT 0100 /* not fcntl */ #define O_EXCL 0200 /* not fcntl */ #define O_NOCTTY 0400 /* not fcntl */ @@ -22,11 +18,6 @@ #define O_NOFOLLOW 0400000 /* don't follow links */ #define O_NOATIME 01000000 -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 @@ -36,9 +27,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -51,18 +39,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ - struct flock { short l_type; short l_whence; @@ -71,6 +47,6 @@ struct flock { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* !_X86_64_FCNTL_H */ diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index 48876bb727d..a5c6e4b6a20 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -14,10 +14,6 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_ACCMODE 0x0003 -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 #define O_APPEND 0x0008 #define O_SYNC 0x0010 #define O_NONBLOCK 0x0080 @@ -34,11 +30,6 @@ #define O_NDELAY O_NONBLOCK -#define F_DUPFD 0 /* dup */ -#define F_GETFD 1 /* get close_on_exec */ -#define F_SETFD 2 /* set/clear close_on_exec */ -#define F_GETFL 3 /* get file->f_flags */ -#define F_SETFL 4 /* set file->f_flags */ #define F_GETLK 14 #define F_GETLK64 15 #define F_SETLK 6 @@ -51,9 +42,6 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ -/* for F_[GET|SET]FL */ -#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ - /* for posix fcntl() and lockf() */ #define F_RDLCK 0 #define F_WRLCK 1 @@ -66,18 +54,6 @@ /* for leases */ #define F_INPROGRESS 16 -/* operations for bsd flock(), also used by the kernel implementation */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ - -#define LOCK_MAND 32 /* This is a mandatory flock ... */ -#define LOCK_READ 64 /* which allows concurrent read operations */ -#define LOCK_WRITE 128 /* which allows concurrent write operations */ -#define LOCK_RW 192 /* which allows concurrent read & write ops */ - typedef struct flock { short l_type; short l_whence; @@ -96,6 +72,6 @@ struct flock64 { pid_t l_pid; }; -#define F_LINUX_SPECIFIC_BASE 1024 +#include #endif /* _XTENSA_FCNTL_H */ -- cgit v1.2.3 From 2b2fa38e5f3f17a5e1ef3fe29a9869d93197ebfd Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:17:58 -0700 Subject: [PATCH] Consolidate asm-ppc*/fcntl.h These two files are basically identical, so make one just include the other (protecting the 32-bit-only parts with __powerpc64__). Also remove some completely unused defines. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/fcntl.h | 12 ++++----- include/asm-ppc64/fcntl.h | 66 +---------------------------------------------- 2 files changed, 6 insertions(+), 72 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index e8c2dc20661..2f1cfb6f234 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -27,9 +27,11 @@ #define F_SETSIG 10 /* for sockets. */ #define F_GETSIG 11 /* for sockets. */ +#ifndef __powerpc64__ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 +#endif /* for posix fcntl() and lockf() */ #define F_RDLCK 0 @@ -43,12 +45,6 @@ /* for leases */ #define F_INPROGRESS 16 -#ifdef __KERNEL__ -#define F_POSIX 1 -#define F_FLOCK 2 -#define F_BROKEN 4 /* broken flock() emulation */ -#endif /* __KERNEL__ */ - struct flock { short l_type; short l_whence; @@ -57,6 +53,7 @@ struct flock { pid_t l_pid; }; +#ifndef __powerpc64__ struct flock64 { short l_type; short l_whence; @@ -64,7 +61,8 @@ struct flock64 { loff_t l_len; pid_t l_pid; }; +#endif #include -#endif +#endif /* _PPC_FCNTL_H */ diff --git a/include/asm-ppc64/fcntl.h b/include/asm-ppc64/fcntl.h index 579a5292fd5..6526023b59f 100644 --- a/include/asm-ppc64/fcntl.h +++ b/include/asm-ppc64/fcntl.h @@ -1,65 +1 @@ -#ifndef _PPC64_FCNTL_H -#define _PPC64_FCNTL_H - -/* - * 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. - */ - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECTORY 040000 /* must be a directory */ -#define O_NOFOLLOW 0100000 /* don't follow links */ -#define O_LARGEFILE 0200000 -#define O_DIRECT 0400000 /* direct disk access hint */ -#define O_NOATIME 01000000 - -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - -#ifdef __KERNEL__ -#define F_POSIX 1 -#define F_FLOCK 2 -#define F_BROKEN 4 /* broken flock() emulation */ -#endif /* __KERNEL__ */ - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - -#include - -#endif /* _PPC64_FCNTL_H */ +#include -- cgit v1.2.3 From e64ca97fd80a129e538ca42d0b12c379746b83db Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:17:58 -0700 Subject: [PATCH] Clean up the open flags This patch puts the most popular of each open flag into asm-generic/fcntl.h and cleans up the arch files. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/fcntl.h | 2 -- include/asm-arm/fcntl.h | 12 ----------- include/asm-arm26/fcntl.h | 10 --------- include/asm-cris/fcntl.h | 19 ----------------- include/asm-frv/fcntl.h | 17 --------------- include/asm-generic/fcntl.h | 52 +++++++++++++++++++++++++++++++++++++++++---- include/asm-h8300/fcntl.h | 12 ----------- include/asm-i386/fcntl.h | 17 --------------- include/asm-ia64/fcntl.h | 21 ------------------ include/asm-m32r/fcntl.h | 17 --------------- include/asm-m68k/fcntl.h | 12 ----------- include/asm-mips/fcntl.h | 8 ------- include/asm-parisc/fcntl.h | 4 ---- include/asm-ppc/fcntl.h | 12 ----------- include/asm-s390/fcntl.h | 17 --------------- include/asm-sh/fcntl.h | 17 --------------- include/asm-sparc/fcntl.h | 2 -- include/asm-sparc64/fcntl.h | 2 -- include/asm-v850/fcntl.h | 12 ----------- include/asm-x86_64/fcntl.h | 17 --------------- include/asm-xtensa/fcntl.h | 5 ----- 21 files changed, 48 insertions(+), 239 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h index 3f3ad49e836..e2aacbbe38b 100644 --- a/include/asm-alpha/fcntl.h +++ b/include/asm-alpha/fcntl.h @@ -10,9 +10,7 @@ #define O_NONBLOCK 00004 #define O_APPEND 00010 -#define O_NDELAY O_NONBLOCK #define O_SYNC 040000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 0100000 /* must be a directory */ #define O_NOFOLLOW 0200000 /* don't follow links */ #define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index e6606669cee..fca93693957 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -1,22 +1,10 @@ #ifndef _ARM_FCNTL_H #define _ARM_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index e6606669cee..76e44e92632 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -3,20 +3,10 @@ /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index edde3cc6560..562bb11b945 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -1,25 +1,6 @@ #ifndef _CRIS_FCNTL_H #define _CRIS_FCNTL_H -/* verbatim copy of i386 version */ - -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint - currently ignored */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index e2092dff9d0..44cae14576e 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -1,23 +1,6 @@ #ifndef _ASM_FCNTL_H #define _ASM_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index d256c5bb6ed..f3690e73a40 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -1,10 +1,54 @@ #ifndef _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H -#define O_ACCMODE 0003 -#define O_RDONLY 0000 -#define O_WRONLY 0001 -#define O_RDWR 0002 +/* open/fcntl - O_SYNC is only implemented on blocks devices and on files + located on an ext2 file system */ +#define O_ACCMODE 00000003 +#define O_RDONLY 00000000 +#define O_WRONLY 00000001 +#define O_RDWR 00000002 +#ifndef O_CREAT +#define O_CREAT 00000100 /* not fcntl */ +#endif +#ifndef O_EXCL +#define O_EXCL 00000200 /* not fcntl */ +#endif +#ifndef O_NOCTTY +#define O_NOCTTY 00000400 /* not fcntl */ +#endif +#ifndef O_TRUNC +#define O_TRUNC 00001000 /* not fcntl */ +#endif +#ifndef O_APPEND +#define O_APPEND 00002000 +#endif +#ifndef O_NONBLOCK +#define O_NONBLOCK 00004000 +#endif +#ifndef O_SYNC +#define O_SYNC 00010000 +#endif +#ifndef FASYNC +#define FASYNC 00020000 /* fcntl, for BSD compatibility */ +#endif +#ifndef O_DIRECT +#define O_DIRECT 00040000 /* direct disk access hint */ +#endif +#ifndef O_LARGEFILE +#define O_LARGEFILE 00100000 +#endif +#ifndef O_DIRECTORY +#define O_DIRECTORY 00200000 /* must be a directory */ +#endif +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 00400000 /* don't follow links */ +#endif +#ifndef O_NOATIME +#define O_NOATIME 01000000 +#endif +#ifndef O_NDELAY +#define O_NDELAY O_NONBLOCK +#endif #define F_DUPFD 0 /* dup */ #define F_GETFD 1 /* get close_on_exec */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 43803ac89f4..881af9a1ffb 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -1,22 +1,10 @@ #ifndef _H8300_FCNTL_H #define _H8300_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index b51233c6a72..4fa08ffde87 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -1,23 +1,6 @@ #ifndef _I386_FCNTL_H #define _I386_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index 9f0ec1e4bd5..b9551337080 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -1,31 +1,10 @@ #ifndef _ASM_IA64_FCNTL_H #define _ASM_IA64_FCNTL_H /* - * Based on . - * * Modified 1998-2000 * David Mosberger-Tang , Hewlett-Packard Co. */ -/* - * open/fcntl - O_SYNC is only implemented on blocks devices and on - * files located on an ext2 file system - */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint - currently ignored */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index 3372bf91554..9e0191c31e3 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -5,23 +5,6 @@ /* orig : i386 2.4.18 */ -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index 8051f38ecc8..60a88ce4ba0 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -1,22 +1,10 @@ #ifndef _M68K_FCNTL_H #define _M68K_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index 4b6043f1280..67b309d34c0 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -8,23 +8,15 @@ #ifndef _ASM_FCNTL_H #define _ASM_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ #define O_APPEND 0x0008 #define O_SYNC 0x0010 #define O_NONBLOCK 0x0080 #define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ #define O_EXCL 0x0400 /* not fcntl */ #define O_NOCTTY 0x0800 /* not fcntl */ #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ #define O_LARGEFILE 0x2000 /* allow large file opens */ #define O_DIRECT 0x8000 /* direct disk access hint */ -#define O_DIRECTORY 0x10000 /* must be a directory */ -#define O_NOFOLLOW 0x20000 /* don't follow links */ -#define O_NOATIME 0x40000 - -#define O_NDELAY O_NONBLOCK #define F_GETLK 14 #define F_SETLK 6 diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index 0a4ee639873..64664ba3344 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -6,19 +6,15 @@ #define O_APPEND 00000010 #define O_BLKSEEK 00000100 /* HPUX only */ #define O_CREAT 00000400 /* not fcntl */ -#define O_TRUNC 00001000 /* not fcntl */ #define O_EXCL 00002000 /* not fcntl */ #define O_LARGEFILE 00004000 #define O_SYNC 00100000 #define O_NONBLOCK 00200004 /* HPUX has separate NDELAY & NONBLOCK */ -#define O_NDELAY O_NONBLOCK #define O_NOCTTY 00400000 /* not fcntl */ #define O_DSYNC 01000000 /* HPUX only */ #define O_RSYNC 02000000 /* HPUX only */ #define O_NOATIME 04000000 -#define FASYNC 00020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 00040000 /* direct disk access hint - currently ignored */ #define O_DIRECTORY 00010000 /* must be a directory */ #define O_NOFOLLOW 00000200 /* don't follow links */ #define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 2f1cfb6f234..4e0cfdb2001 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -1,22 +1,10 @@ #ifndef _PPC_FCNTL_H #define _PPC_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_LARGEFILE 0200000 #define O_DIRECT 0400000 /* direct disk access hint */ -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index 159979f3509..ea9a75bd6c9 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -8,23 +8,6 @@ #ifndef _S390_FCNTL_H #define _S390_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index 7c256734cf1..0441ad64f7c 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -1,23 +1,6 @@ #ifndef __ASM_SH_FCNTL_H #define __ASM_SH_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint - currently ignored */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index 68d3fd9156f..1d35c90daec 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -13,8 +13,6 @@ #define O_NONBLOCK 0x4000 #define O_NDELAY (0x0004 | O_NONBLOCK) #define O_NOCTTY 0x8000 /* not fcntl */ -#define O_DIRECTORY 0x10000 /* must be a directory */ -#define O_NOFOLLOW 0x20000 /* don't follow links */ #define O_LARGEFILE 0x40000 #define O_DIRECT 0x100000 /* direct disk access hint */ #define O_NOATIME 0x200000 diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h index a8c543d1ebf..3e82239a771 100644 --- a/include/asm-sparc64/fcntl.h +++ b/include/asm-sparc64/fcntl.h @@ -13,8 +13,6 @@ #define O_SYNC 0x2000 #define O_NONBLOCK 0x4000 #define O_NOCTTY 0x8000 /* not fcntl */ -#define O_DIRECTORY 0x10000 /* must be a directory */ -#define O_NOFOLLOW 0x20000 /* don't follow links */ #define O_LARGEFILE 0x40000 #define O_DIRECT 0x100000 /* direct disk access hint */ #define O_NOATIME 0x200000 diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index 1a39a0cb9ce..fff7d57f175 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -1,22 +1,10 @@ #ifndef __V850_FCNTL_H__ #define __V850_FCNTL_H__ -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ #define O_DIRECTORY 040000 /* must be a directory */ #define O_NOFOLLOW 0100000 /* don't follow links */ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define O_NOATIME 01000000 #define F_GETLK 5 #define F_SETLK 6 diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h index f58d8d1d9b2..4e800feddcf 100644 --- a/include/asm-x86_64/fcntl.h +++ b/include/asm-x86_64/fcntl.h @@ -1,23 +1,6 @@ #ifndef _X86_64_FCNTL_H #define _X86_64_FCNTL_H -/* open/fcntl - O_SYNC is only implemented on blocks devices and on files - located on an ext2 file system */ -#define O_CREAT 0100 /* not fcntl */ -#define O_EXCL 0200 /* not fcntl */ -#define O_NOCTTY 0400 /* not fcntl */ -#define O_TRUNC 01000 /* not fcntl */ -#define O_APPEND 02000 -#define O_NONBLOCK 04000 -#define O_NDELAY O_NONBLOCK -#define O_SYNC 010000 -#define FASYNC 020000 /* fcntl, for BSD compatibility */ -#define O_DIRECT 040000 /* direct disk access hint */ -#define O_LARGEFILE 0100000 -#define O_DIRECTORY 0200000 /* must be a directory */ -#define O_NOFOLLOW 0400000 /* don't follow links */ -#define O_NOATIME 01000000 - #define F_GETLK 5 #define F_SETLK 6 #define F_SETLKW 7 diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index a5c6e4b6a20..7724345ee07 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -18,18 +18,13 @@ #define O_SYNC 0x0010 #define O_NONBLOCK 0x0080 #define O_CREAT 0x0100 /* not fcntl */ -#define O_TRUNC 0x0200 /* not fcntl */ #define O_EXCL 0x0400 /* not fcntl */ #define O_NOCTTY 0x0800 /* not fcntl */ #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ #define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */ #define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/ -#define O_DIRECTORY 0x10000 /* must be a directory */ -#define O_NOFOLLOW 0x20000 /* don't follow links */ #define O_NOATIME 0x100000 -#define O_NDELAY O_NONBLOCK - #define F_GETLK 14 #define F_GETLK64 15 #define F_SETLK 6 -- cgit v1.2.3 From 1abf62afb6e9cdc1b2618b69067a186b94281587 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:17:59 -0700 Subject: [PATCH] Clean up the fcntl operations This patch puts the most popular of each fcntl operation/flag into asm-generic/fcntl.h and cleans up the arch files. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/fcntl.h | 21 --------------------- include/asm-arm26/fcntl.h | 21 --------------------- include/asm-cris/fcntl.h | 21 --------------------- include/asm-frv/fcntl.h | 21 --------------------- include/asm-generic/fcntl.h | 31 +++++++++++++++++++++++++++++++ include/asm-h8300/fcntl.h | 21 --------------------- include/asm-i386/fcntl.h | 21 --------------------- include/asm-ia64/fcntl.h | 21 --------------------- include/asm-m32r/fcntl.h | 21 --------------------- include/asm-m68k/fcntl.h | 21 --------------------- include/asm-mips/fcntl.h | 12 ------------ include/asm-parisc/fcntl.h | 10 ---------- include/asm-ppc/fcntl.h | 21 --------------------- include/asm-s390/fcntl.h | 21 --------------------- include/asm-sh/fcntl.h | 21 --------------------- include/asm-sparc/fcntl.h | 9 --------- include/asm-sparc64/fcntl.h | 9 --------- include/asm-v850/fcntl.h | 21 --------------------- include/asm-x86_64/fcntl.h | 21 --------------------- include/asm-xtensa/fcntl.h | 14 -------------- 20 files changed, 31 insertions(+), 348 deletions(-) (limited to 'include') diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index fca93693957..6337df23831 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -6,31 +6,10 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index 76e44e92632..2f08302fa8c 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -8,31 +8,10 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index 562bb11b945..e91b576985d 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -1,31 +1,10 @@ #ifndef _CRIS_FCNTL_H #define _CRIS_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index 44cae14576e..e5523669b62 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -1,31 +1,10 @@ #ifndef _ASM_FCNTL_H #define _ASM_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index f3690e73a40..1e66f923a25 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -55,10 +55,41 @@ #define F_SETFD 2 /* set/clear close_on_exec */ #define F_GETFL 3 /* get file->f_flags */ #define F_SETFL 4 /* set file->f_flags */ +#ifndef F_GETLK +#define F_GETLK 5 +#define F_SETLK 6 +#define F_SETLKW 7 +#endif +#ifndef F_SETOWN +#define F_SETOWN 8 /* for sockets. */ +#define F_GETOWN 9 /* for sockets. */ +#endif +#ifndef F_SETSIG +#define F_SETSIG 10 /* for sockets. */ +#define F_GETSIG 11 /* for sockets. */ +#endif /* for F_[GET|SET]FL */ #define FD_CLOEXEC 1 /* actually anything with low bit set goes */ +/* for posix fcntl() and lockf() */ +#ifndef F_RDLCK +#define F_RDLCK 0 +#define F_WRLCK 1 +#define F_UNLCK 2 +#endif + +/* for old implementation of bsd flock () */ +#ifndef F_EXLCK +#define F_EXLCK 4 /* or 3 */ +#define F_SHLCK 8 /* or 4 */ +#endif + +/* for leases */ +#ifndef F_INPROGRESS +#define F_INPROGRESS 16 +#endif + /* operations for bsd flock(), also used by the kernel implementation */ #define LOCK_SH 1 /* shared lock */ #define LOCK_EX 2 /* exclusive lock */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 881af9a1ffb..805aaa09c71 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -6,31 +6,10 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index 4fa08ffde87..1d06913c3bf 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -1,31 +1,10 @@ #ifndef _I386_FCNTL_H #define _I386_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index b9551337080..a9d04aca790 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -5,27 +5,6 @@ * David Mosberger-Tang , Hewlett-Packard Co. */ -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index 9e0191c31e3..ff3a0849bb8 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -5,31 +5,10 @@ /* orig : i386 2.4.18 */ -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index 60a88ce4ba0..7dd8062c8ce 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -6,31 +6,10 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index 67b309d34c0..be971d6ac9b 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -33,18 +33,6 @@ #define F_SETLKW64 35 #endif -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - /* * The flavours of struct flock. "struct flock" is the ABI compliant * variant. Finally struct flock64 is the LFS variant of struct flock. As diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index 64664ba3344..59a54fff7c6 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -19,9 +19,6 @@ #define O_NOFOLLOW 00000200 /* don't follow links */ #define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */ -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 #define F_GETLK64 8 #define F_SETLK64 9 #define F_SETLKW64 10 @@ -36,13 +33,6 @@ #define F_WRLCK 02 #define F_UNLCK 03 -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 4e0cfdb2001..8549c0332c9 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -6,33 +6,12 @@ #define O_LARGEFILE 0200000 #define O_DIRECT 0400000 /* direct disk access hint */ -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #ifndef __powerpc64__ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 #endif -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index ea9a75bd6c9..2974433e8ea 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -8,33 +8,12 @@ #ifndef _S390_FCNTL_H #define _S390_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #ifndef __s390x__ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 #endif /* ! __s390x__ */ -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index 0441ad64f7c..1db7b74450b 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -1,31 +1,10 @@ #ifndef __ASM_SH_FCNTL_H #define __ASM_SH_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index 1d35c90daec..61334bff18c 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -22,8 +22,6 @@ #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 @@ -34,13 +32,6 @@ #define F_WRLCK 2 #define F_UNLCK 3 -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h index 3e82239a771..3db10e076ee 100644 --- a/include/asm-sparc64/fcntl.h +++ b/include/asm-sparc64/fcntl.h @@ -23,21 +23,12 @@ #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 #define F_UNLCK 3 -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index fff7d57f175..70015131e4b 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -6,31 +6,10 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h index 4e800feddcf..c7b09ea97d3 100644 --- a/include/asm-x86_64/fcntl.h +++ b/include/asm-x86_64/fcntl.h @@ -1,27 +1,6 @@ #ifndef _X86_64_FCNTL_H #define _X86_64_FCNTL_H -#define F_GETLK 5 -#define F_SETLK 6 -#define F_SETLKW 7 - -#define F_SETOWN 8 /* for sockets. */ -#define F_GETOWN 9 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 - struct flock { short l_type; short l_whence; diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index 7724345ee07..06f0dc9cc52 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -34,20 +34,6 @@ #define F_SETOWN 24 /* for sockets. */ #define F_GETOWN 23 /* for sockets. */ -#define F_SETSIG 10 /* for sockets. */ -#define F_GETSIG 11 /* for sockets. */ - -/* for posix fcntl() and lockf() */ -#define F_RDLCK 0 -#define F_WRLCK 1 -#define F_UNLCK 2 - -/* for old implementation of bsd flock () */ -#define F_EXLCK 4 /* or 3 */ -#define F_SHLCK 8 /* or 4 */ - -/* for leases */ -#define F_INPROGRESS 16 typedef struct flock { short l_type; -- cgit v1.2.3 From 5ac353f9baf7169298ebb7de86b2d697b25bca44 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:18:00 -0700 Subject: [PATCH] Clean up struct flock definitions This patch just gathers together all the struct flock definitions except xtensa into asm-generic/fcntl.h. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/fcntl.h | 8 -------- include/asm-arm/fcntl.h | 8 -------- include/asm-arm26/fcntl.h | 8 -------- include/asm-cris/fcntl.h | 8 -------- include/asm-frv/fcntl.h | 8 -------- include/asm-generic/fcntl.h | 17 +++++++++++++++++ include/asm-h8300/fcntl.h | 8 -------- include/asm-i386/fcntl.h | 8 -------- include/asm-ia64/fcntl.h | 8 -------- include/asm-m32r/fcntl.h | 12 ------------ include/asm-m68k/fcntl.h | 8 -------- include/asm-mips/fcntl.h | 17 ++++------------- include/asm-parisc/fcntl.h | 8 -------- include/asm-ppc/fcntl.h | 10 ---------- include/asm-s390/fcntl.h | 10 ---------- include/asm-sh/fcntl.h | 8 -------- include/asm-sparc/fcntl.h | 11 ++--------- include/asm-sparc64/fcntl.h | 9 +-------- include/asm-v850/fcntl.h | 8 -------- include/asm-x86_64/fcntl.h | 13 ------------- include/asm-xtensa/fcntl.h | 2 ++ 21 files changed, 26 insertions(+), 171 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h index e2aacbbe38b..87f2cf459e2 100644 --- a/include/asm-alpha/fcntl.h +++ b/include/asm-alpha/fcntl.h @@ -37,14 +37,6 @@ #define F_INPROGRESS 64 -struct flock { - short l_type; - short l_whence; - __kernel_off_t l_start; - __kernel_off_t l_len; - __kernel_pid_t l_pid; -}; - #include #endif diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index 6337df23831..1816a6ac6f1 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index 2f08302fa8c..b88f8d08c60 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -12,14 +12,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index e91b576985d..f8e7d1307eb 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index e5523669b62..0b212d945ad 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 1e66f923a25..b001d7fe038 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -1,6 +1,8 @@ #ifndef _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H +#include + /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ #define O_ACCMODE 00000003 @@ -104,4 +106,19 @@ #define F_LINUX_SPECIFIC_BASE 1024 +#ifndef HAVE_ARCH_STRUCT_FLOCK +#ifndef __ARCH_FLOCK_PAD +#define __ARCH_FLOCK_PAD +#endif + +struct flock { + short l_type; + short l_whence; + off_t l_start; + off_t l_len; + pid_t l_pid; + __ARCH_FLOCK_PAD +}; +#endif + #endif /* _ASM_GENERIC_FCNTL_H */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 805aaa09c71..8caeb05e84d 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index 1d06913c3bf..01f17d29d28 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index a9d04aca790..1dd275dc8f6 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -5,14 +5,6 @@ * David Mosberger-Tang , Hewlett-Packard Co. */ -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - #define force_o_largefile() \ (personality(current->personality) != PER_LINUX32) diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index ff3a0849bb8..90f71735fa9 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -1,22 +1,10 @@ #ifndef _ASM_M32R_FCNTL_H #define _ASM_M32R_FCNTL_H -/* $Id$ */ - -/* orig : i386 2.4.18 */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index 7dd8062c8ce..d3b24e3fbac 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index be971d6ac9b..fb824bf0929 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -50,7 +50,7 @@ struct flock { long l_sysid; __kernel_pid_t l_pid; long pad[4]; -} flock_t; +}; typedef struct flock64 { short l_type; @@ -60,22 +60,13 @@ typedef struct flock64 { pid_t l_pid; } flock64_t; -#else /* 64-bit definitions */ -typedef struct flock { - short l_type; - short l_whence; - __kernel_off_t l_start; - __kernel_off_t l_len; - __kernel_pid_t l_pid; -} flock_t; - -#ifdef __KERNEL__ -#define flock64 flock -#endif +#define HAVE_ARCH_STRUCT_FLOCK #endif #include +typedef struct flock flock_t; + #endif /* _ASM_FCNTL_H */ diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index 59a54fff7c6..eadda003c20 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -33,14 +33,6 @@ #define F_WRLCK 02 #define F_UNLCK 03 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 8549c0332c9..4480f21bfde 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -10,17 +10,7 @@ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -#endif - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; -#ifndef __powerpc64__ struct flock64 { short l_type; short l_whence; diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index 2974433e8ea..3a66fba09ee 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -12,17 +12,7 @@ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -#endif /* ! __s390x__ */ -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - -#ifndef __s390x__ struct flock64 { short l_type; short l_whence; diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index 1db7b74450b..c481bab8ba1 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index 61334bff18c..634557374e9 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -32,15 +32,6 @@ #define F_WRLCK 2 #define F_UNLCK 3 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; - short __unused; -}; - struct flock64 { short l_type; short l_whence; @@ -50,6 +41,8 @@ struct flock64 { short __unused; }; +#define __ARCH_FLOCK_PAD short __unused; + #include #endif diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h index 3db10e076ee..b2aecf0054b 100644 --- a/include/asm-sparc64/fcntl.h +++ b/include/asm-sparc64/fcntl.h @@ -29,14 +29,7 @@ #define F_WRLCK 2 #define F_UNLCK 3 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; - short __unused; -}; +#define __ARCH_FLOCK_PAD short __unused; #include diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index 70015131e4b..0fd47f0c6a8 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h index c7b09ea97d3..46ab12db573 100644 --- a/include/asm-x86_64/fcntl.h +++ b/include/asm-x86_64/fcntl.h @@ -1,14 +1 @@ -#ifndef _X86_64_FCNTL_H -#define _X86_64_FCNTL_H - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - #include - -#endif /* !_X86_64_FCNTL_H */ diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index 06f0dc9cc52..fdae0e17058 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -53,6 +53,8 @@ struct flock64 { pid_t l_pid; }; +#define HAVE_ARCH_STRUCT_FLOCK + #include #endif /* _XTENSA_FCNTL_H */ -- cgit v1.2.3 From 8d286aa5eaf951bf53d4a0f64576d4b377c435ba Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:18:01 -0700 Subject: [PATCH] Clean up struct flock64 definitions This patch gathers all the struct flock64 definitions (and the operations), puts them under !CONFIG_64BIT and cleans up the arch files. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/fcntl.h | 12 ------------ include/asm-arm26/fcntl.h | 12 ------------ include/asm-cris/fcntl.h | 17 ----------------- include/asm-frv/fcntl.h | 18 ------------------ include/asm-generic/fcntl.h | 25 +++++++++++++++++++++++++ include/asm-h8300/fcntl.h | 12 ------------ include/asm-i386/fcntl.h | 17 ----------------- include/asm-m32r/fcntl.h | 17 ----------------- include/asm-m68k/fcntl.h | 12 ------------ include/asm-mips/fcntl.h | 12 +++--------- include/asm-parisc/fcntl.h | 8 -------- include/asm-ppc/fcntl.h | 14 -------------- include/asm-s390/fcntl.h | 26 -------------------------- include/asm-sh/fcntl.h | 18 ------------------ include/asm-sh64/fcntl.h | 6 ------ include/asm-sparc/fcntl.h | 14 +------------- include/asm-v850/fcntl.h | 12 ------------ include/asm-xtensa/fcntl.h | 1 + 18 files changed, 30 insertions(+), 223 deletions(-) (limited to 'include') diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index 1816a6ac6f1..a80b6607b2e 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -6,18 +6,6 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index b88f8d08c60..d85995e7459 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -8,18 +8,6 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index f8e7d1307eb..46ab12db573 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -1,18 +1 @@ -#ifndef _CRIS_FCNTL_H -#define _CRIS_FCNTL_H - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include - -#endif diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index 0b212d945ad..46ab12db573 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -1,19 +1 @@ -#ifndef _ASM_FCNTL_H -#define _ASM_FCNTL_H - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include - -#endif /* _ASM_FCNTL_H */ - diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index b001d7fe038..b663520dcdc 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -1,6 +1,7 @@ #ifndef _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H +#include #include /* open/fcntl - O_SYNC is only implemented on blocks devices and on files @@ -121,4 +122,28 @@ struct flock { }; #endif +#ifndef CONFIG_64BIT + +#ifndef F_GETLK64 +#define F_GETLK64 12 /* using 'struct flock64' */ +#define F_SETLK64 13 +#define F_SETLKW64 14 +#endif + +#ifndef HAVE_ARCH_STRUCT_FLOCK64 +#ifndef __ARCH_FLOCK64_PAD +#define __ARCH_FLOCK64_PAD +#endif + +struct flock64 { + short l_type; + short l_whence; + loff_t l_start; + loff_t l_len; + pid_t l_pid; + __ARCH_FLOCK64_PAD +}; +#endif +#endif /* !CONFIG_64BIT */ + #endif /* _ASM_GENERIC_FCNTL_H */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 8caeb05e84d..1952cb2e3b0 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -6,18 +6,6 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif /* _H8300_FCNTL_H */ diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index 01f17d29d28..46ab12db573 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -1,18 +1 @@ -#ifndef _I386_FCNTL_H -#define _I386_FCNTL_H - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include - -#endif diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index 90f71735fa9..46ab12db573 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -1,18 +1 @@ -#ifndef _ASM_M32R_FCNTL_H -#define _ASM_M32R_FCNTL_H - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include - -#endif /* _ASM_M32R_FCNTL_H */ diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index d3b24e3fbac..1c369b20dc4 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -6,18 +6,6 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif /* _M68K_FCNTL_H */ diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index fb824bf0929..06c5d13faf6 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -52,15 +52,6 @@ struct flock { long pad[4]; }; -typedef struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -} flock64_t; - - #define HAVE_ARCH_STRUCT_FLOCK #endif @@ -68,5 +59,8 @@ typedef struct flock64 { #include typedef struct flock flock_t; +#ifndef __mips64 +typedef struct flock64 flock64_t; +#endif #endif /* _ASM_FCNTL_H */ diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index eadda003c20..317851fa78f 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -33,14 +33,6 @@ #define F_WRLCK 02 #define F_UNLCK 03 -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 4480f21bfde..7ef37443cc5 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -6,20 +6,6 @@ #define O_LARGEFILE 0200000 #define O_DIRECT 0400000 /* direct disk access hint */ -#ifndef __powerpc64__ -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; -#endif - #include #endif /* _PPC_FCNTL_H */ diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index 3a66fba09ee..46ab12db573 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -1,27 +1 @@ -/* - * include/asm-s390/fcntl.h - * - * S390 version - * - * Derived from "include/asm-i386/fcntl.h" - */ -#ifndef _S390_FCNTL_H -#define _S390_FCNTL_H - -#ifndef __s390x__ -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; -#endif - #include - -#endif diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index c481bab8ba1..46ab12db573 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -1,19 +1 @@ -#ifndef __ASM_SH_FCNTL_H -#define __ASM_SH_FCNTL_H - -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include - -#endif /* __ASM_SH_FCNTL_H */ - diff --git a/include/asm-sh64/fcntl.h b/include/asm-sh64/fcntl.h index ffcc36c64fa..744dd79b9d5 100644 --- a/include/asm-sh64/fcntl.h +++ b/include/asm-sh64/fcntl.h @@ -1,7 +1 @@ -#ifndef __ASM_SH64_FCNTL_H -#define __ASM_SH64_FCNTL_H - #include - -#endif /* __ASM_SH64_FCNTL_H */ - diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index 634557374e9..5db60b5ae7b 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -23,25 +23,13 @@ #define F_SETLK 8 #define F_SETLKW 9 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 #define F_UNLCK 3 -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; - short __unused; -}; - #define __ARCH_FLOCK_PAD short __unused; +#define __ARCH_FLOCK64_PAD short __unused; #include diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index 0fd47f0c6a8..3af4d56776d 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -6,18 +6,6 @@ #define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ #define O_LARGEFILE 0400000 -#define F_GETLK64 12 /* using 'struct flock64' */ -#define F_SETLK64 13 -#define F_SETLKW64 14 - -struct flock64 { - short l_type; - short l_whence; - loff_t l_start; - loff_t l_len; - pid_t l_pid; -}; - #include #endif /* __V850_FCNTL_H__ */ diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index fdae0e17058..ec066ae96ca 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -54,6 +54,7 @@ struct flock64 { }; #define HAVE_ARCH_STRUCT_FLOCK +#define HAVE_ARCH_STRUCT_FLOCK64 #include -- cgit v1.2.3 From 8191151d0933d65fb6b659ffbd765479f0f200e1 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:18:01 -0700 Subject: [PATCH] Consolidate the asm-ppc*/fcntl.h files into asm-powerpc This makes sense now that we have asm-powerpc. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/fcntl.h | 11 +++++++++++ include/asm-ppc/fcntl.h | 11 ----------- include/asm-ppc64/fcntl.h | 1 - 3 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 include/asm-powerpc/fcntl.h delete mode 100644 include/asm-ppc/fcntl.h delete mode 100644 include/asm-ppc64/fcntl.h (limited to 'include') diff --git a/include/asm-powerpc/fcntl.h b/include/asm-powerpc/fcntl.h new file mode 100644 index 00000000000..ce5c4516d40 --- /dev/null +++ b/include/asm-powerpc/fcntl.h @@ -0,0 +1,11 @@ +#ifndef _ASM_FCNTL_H +#define _ASM_FCNTL_H + +#define O_DIRECTORY 040000 /* must be a directory */ +#define O_NOFOLLOW 0100000 /* don't follow links */ +#define O_LARGEFILE 0200000 +#define O_DIRECT 0400000 /* direct disk access hint */ + +#include + +#endif /* _ASM_FCNTL_H */ diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h deleted file mode 100644 index 7ef37443cc5..00000000000 --- a/include/asm-ppc/fcntl.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _PPC_FCNTL_H -#define _PPC_FCNTL_H - -#define O_DIRECTORY 040000 /* must be a directory */ -#define O_NOFOLLOW 0100000 /* don't follow links */ -#define O_LARGEFILE 0200000 -#define O_DIRECT 0400000 /* direct disk access hint */ - -#include - -#endif /* _PPC_FCNTL_H */ diff --git a/include/asm-ppc64/fcntl.h b/include/asm-ppc64/fcntl.h deleted file mode 100644 index 6526023b59f..00000000000 --- a/include/asm-ppc64/fcntl.h +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.3 From 7ea6040b0eff07d3a9a4e2d248ac137c6ad02d42 Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Tue, 6 Sep 2005 15:18:02 -0700 Subject: [PATCH] inotify: fix event loss on hardlinked files People have run into a problem when they do this: watch (file1, all_events); watch (file2, some_events); if file2 is a hard link to file1, some events will be missed because by default we replace the mask. The patch below adds a flag IN_MASK_ADD which will cause inotify to add to the existing mask if present. Signed-off-by: John McCutchan Signed-off-by: Robert Love Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/inotify.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 93bb3afe646..ee5b239092e 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h @@ -47,6 +47,7 @@ struct inotify_event { #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ /* special flags */ +#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ #define IN_ISDIR 0x40000000 /* event occurred against dir */ #define IN_ONESHOT 0x80000000 /* only send event once */ -- cgit v1.2.3 From f90b1d2f1aaaa40c6519a32e69615edc25bb97d5 Mon Sep 17 00:00:00 2001 From: Paul Jackson Date: Tue, 6 Sep 2005 15:18:10 -0700 Subject: [PATCH] cpusets: new __GFP_HARDWALL flag Add another GFP flag: __GFP_HARDWALL. A subsequent "cpuset_zone_allowed" patch will use this flag to mark GFP_USER allocations, and distinguish them from GFP_KERNEL allocations. Allocations (such as GFP_USER) marked GFP_HARDWALL are constrainted to the current tasks cpuset. Other allocations (such as GFP_KERNEL) can steal from the possibly larger nearest mem_exclusive cpuset ancestor, if memory is tight on every node in the current cpuset. This patch collides with Mel Gorman's patch to reduce fragmentation in the standard buddy allocator, which adds two GFP flags. This was discussed on linux-mm in July. Most likely, one of his flags for user reclaimable memory can be the same as my __GFP_HARDWALL flag, under some generic name meaning its user address space memory. Signed-off-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/gfp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7c7400137e9..4dc990f3b5c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -40,6 +40,7 @@ struct vm_area_struct; #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ +#define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */ #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) @@ -48,14 +49,15 @@ struct vm_area_struct; #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ - __GFP_NOMEMALLOC|__GFP_NORECLAIM) + __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL) #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT) #define GFP_NOFS (__GFP_WAIT | __GFP_IO) #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) -#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS) -#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) +#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) +#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ + __GFP_HIGHMEM) /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some platforms, used as appropriate on others */ -- cgit v1.2.3 From 9bf2229f8817677127a60c177aefce1badd22d7b Mon Sep 17 00:00:00 2001 From: Paul Jackson Date: Tue, 6 Sep 2005 15:18:12 -0700 Subject: [PATCH] cpusets: formalize intermediate GFP_KERNEL containment This patch makes use of the previously underutilized cpuset flag 'mem_exclusive' to provide what amounts to another layer of memory placement resolution. With this patch, there are now the following four layers of memory placement available: 1) The whole system (interrupt and GFP_ATOMIC allocations can use this), 2) The nearest enclosing mem_exclusive cpuset (GFP_KERNEL allocations can use), 3) The current tasks cpuset (GFP_USER allocations constrained to here), and 4) Specific node placement, using mbind and set_mempolicy. These nest - each layer is a subset (same or within) of the previous. Layer (2) above is new, with this patch. The call used to check whether a zone (its node, actually) is in a cpuset (in its mems_allowed, actually) is extended to take a gfp_mask argument, and its logic is extended, in the case that __GFP_HARDWALL is not set in the flag bits, to look up the cpuset hierarchy for the nearest enclosing mem_exclusive cpuset, to determine if placement is allowed. The definition of GFP_USER, which used to be identical to GFP_KERNEL, is changed to also set the __GFP_HARDWALL bit, in the previous cpuset_gfp_hardwall_flag patch. GFP_ATOMIC and GFP_KERNEL allocations will stay within the current tasks cpuset, so long as any node therein is not too tight on memory, but will escape to the larger layer, if need be. The intended use is to allow something like a batch manager to handle several jobs, each job in its own cpuset, but using common kernel memory for caches and such. Swapper and oom_kill activity is also constrained to Layer (2). A task in or below one mem_exclusive cpuset should not cause swapping on nodes in another non-overlapping mem_exclusive cpuset, nor provoke oom_killing of a task in another such cpuset. Heavy use of kernel memory for i/o caching and such by one job should not impact the memory available to jobs in other non-overlapping mem_exclusive cpusets. This patch enables providing hardwall, inescapable cpusets for memory allocations of each job, while sharing kernel memory allocations between several jobs, in an enclosing mem_exclusive cpuset. Like Dinakar's patch earlier to enable administering sched domains using the cpu_exclusive flag, this patch also provides a useful meaning to a cpuset flag that had previously done nothing much useful other than restrict what cpuset configurations were allowed. Signed-off-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cpuset.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 3438233305a..1fe1c3ebad3 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -23,7 +23,7 @@ void cpuset_init_current_mems_allowed(void); void cpuset_update_current_mems_allowed(void); void cpuset_restrict_to_mems_allowed(unsigned long *nodes); int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); -int cpuset_zone_allowed(struct zone *z); +extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); extern struct file_operations proc_cpuset_operations; extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); @@ -48,7 +48,8 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) return 1; } -static inline int cpuset_zone_allowed(struct zone *z) +static inline int cpuset_zone_allowed(struct zone *z, + unsigned int __nocast gfp_mask) { return 1; } -- cgit v1.2.3 From ef08e3b4981aebf2ba9bd7025ef7210e8eec07ce Mon Sep 17 00:00:00 2001 From: Paul Jackson Date: Tue, 6 Sep 2005 15:18:13 -0700 Subject: [PATCH] cpusets: confine oom_killer to mem_exclusive cpuset Now the real motivation for this cpuset mem_exclusive patch series seems trivial. This patch keeps a task in or under one mem_exclusive cpuset from provoking an oom kill of a task under a non-overlapping mem_exclusive cpuset. Since only interrupt and GFP_ATOMIC allocations are allowed to escape mem_exclusive containment, there is little to gain from oom killing a task under a non-overlapping mem_exclusive cpuset, as almost all kernel and user memory allocation must come from disjoint memory nodes. This patch enables configuring a system so that a runaway job under one mem_exclusive cpuset cannot cause the killing of a job in another such cpuset that might be using very high compute and memory resources for a prolonged time. Signed-off-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/cpuset.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 1fe1c3ebad3..24062a1dbf6 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -24,6 +24,7 @@ void cpuset_update_current_mems_allowed(void); void cpuset_restrict_to_mems_allowed(unsigned long *nodes); int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); +extern int cpuset_excl_nodes_overlap(const struct task_struct *p); extern struct file_operations proc_cpuset_operations; extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); @@ -54,6 +55,11 @@ static inline int cpuset_zone_allowed(struct zone *z, return 1; } +static inline int cpuset_excl_nodes_overlap(const struct task_struct *p) +{ + return 1; +} + static inline char *cpuset_task_status_allowed(struct task_struct *task, char *buffer) { -- cgit v1.2.3 From 9c1cfda20a508b181bdda8c0045f7c0c333880a5 Mon Sep 17 00:00:00 2001 From: John Hawkes Date: Tue, 6 Sep 2005 15:18:14 -0700 Subject: [PATCH] cpusets: Move the ia64 domain setup code to the generic code Signed-off-by: John Hawkes Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/processor.h | 3 --- include/asm-ia64/topology.h | 23 ----------------------- include/linux/sched.h | 7 ------- include/linux/topology.h | 23 +++++++++++++++++++++++ 4 files changed, 23 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 91bbd1f2246..94e07e72739 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h @@ -20,9 +20,6 @@ #include #include -/* Our arch specific arch_init_sched_domain is in arch/ia64/kernel/domain.c */ -#define ARCH_HAS_SCHED_DOMAIN - #define IA64_NUM_DBG_REGS 8 /* * Limits for PMC and PMD are set to less than maximum architected values diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 399bc29729f..a9f738bf18a 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h @@ -98,29 +98,6 @@ void build_cpu_to_node_map(void); .nr_balance_failed = 0, \ } -/* sched_domains SD_ALLNODES_INIT for IA64 NUMA machines */ -#define SD_ALLNODES_INIT (struct sched_domain) { \ - .span = CPU_MASK_NONE, \ - .parent = NULL, \ - .groups = NULL, \ - .min_interval = 64, \ - .max_interval = 64*num_online_cpus(), \ - .busy_factor = 128, \ - .imbalance_pct = 133, \ - .cache_hot_time = (10*1000000), \ - .cache_nice_tries = 1, \ - .busy_idx = 3, \ - .idle_idx = 3, \ - .newidle_idx = 0, /* unused */ \ - .wake_idx = 0, /* unused */ \ - .forkexec_idx = 0, /* unused */ \ - .per_cpu_gain = 100, \ - .flags = SD_LOAD_BALANCE, \ - .last_balance = jiffies, \ - .balance_interval = 64, \ - .nr_balance_failed = 0, \ -} - #endif /* CONFIG_NUMA */ #include diff --git a/include/linux/sched.h b/include/linux/sched.h index b5a22ea8004..ea1b5f32ec5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -564,13 +564,6 @@ struct sched_domain { extern void partition_sched_domains(cpumask_t *partition1, cpumask_t *partition2); -#ifdef ARCH_HAS_SCHED_DOMAIN -/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */ -extern cpumask_t cpu_isolated_map; -extern void init_sched_build_groups(struct sched_group groups[], - cpumask_t span, int (*group_fn)(int cpu)); -extern void cpu_attach_domain(struct sched_domain *sd, int cpu); -#endif /* ARCH_HAS_SCHED_DOMAIN */ #endif /* CONFIG_SMP */ diff --git a/include/linux/topology.h b/include/linux/topology.h index 0320225e96d..3df1d474e5c 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h @@ -135,6 +135,29 @@ } #endif +/* sched_domains SD_ALLNODES_INIT for NUMA machines */ +#define SD_ALLNODES_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 64, \ + .max_interval = 64*num_online_cpus(), \ + .busy_factor = 128, \ + .imbalance_pct = 133, \ + .cache_hot_time = (10*1000000), \ + .cache_nice_tries = 1, \ + .busy_idx = 3, \ + .idle_idx = 3, \ + .newidle_idx = 0, /* unused */ \ + .wake_idx = 0, /* unused */ \ + .forkexec_idx = 0, /* unused */ \ + .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE, \ + .last_balance = jiffies, \ + .balance_interval = 64, \ + .nr_balance_failed = 0, \ +} + #ifdef CONFIG_NUMA #ifndef SD_NODE_INIT #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! -- cgit v1.2.3 From 3f4bb1f4199b7dc0c958447b1e4898980013b884 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 6 Sep 2005 15:18:16 -0700 Subject: [PATCH] struct dentry: place d_hash close to d_parent and d_name to speedup lookups dentry cache uses sophisticated RCU technology (and prefetching if available) but touches 2 cache lines per dentry during hlist lookup. This patch moves d_hash in the same cache line than d_parent and d_name fields so that : 1) One cache line is needed instead of two. 2) the hlist_for_each_rcu() prefetching has a chance to bring all the needed data in advance, not only the part that includes d_hash.next. I also changed one old comment that was wrong for 64bits. A further optimisation would be to separate dentry in two parts, one that is mostly read, and one writen (d_count/d_lock) to avoid false sharing on SMP/NUMA but this would need different field placement depending on 32bits or 64bits platform. Signed-off-by: Eric Dumazet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/dcache.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 50be290d24d..ab04b4f9b0d 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -88,8 +88,9 @@ struct dentry { * negative */ /* * The next three fields are touched by __d_lookup. Place them here - * so they all fit in a 16-byte range, with 16-byte alignment. + * so they all fit in a cache line. */ + struct hlist_node d_hash; /* lookup hash list */ struct dentry *d_parent; /* parent directory */ struct qstr d_name; @@ -103,7 +104,6 @@ struct dentry { void *d_fsdata; /* fs-specific data */ struct rcu_head d_rcu; struct dcookie_struct *d_cookie; /* cookie, if any */ - struct hlist_node d_hash; /* lookup hash list */ int d_mounted; unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ }; -- cgit v1.2.3 From e89bbd3a0b3c054d9a94feb0db7bbae1cdb99e54 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Sep 2005 15:18:21 -0700 Subject: [PATCH] remove iattr.ia_attr_flags Remove unused ia_attr_flags from struct iattr, and related defines. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 2036747c7d1..57e294bf83f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -281,18 +281,8 @@ struct iattr { struct timespec ia_atime; struct timespec ia_mtime; struct timespec ia_ctime; - unsigned int ia_attr_flags; }; -/* - * This is the inode attributes flag definitions - */ -#define ATTR_FLAG_SYNCRONOUS 1 /* Syncronous write */ -#define ATTR_FLAG_NOATIME 2 /* Don't update atime */ -#define ATTR_FLAG_APPEND 4 /* Append-only file */ -#define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */ -#define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */ - /* * Includes for diskquotas. */ -- cgit v1.2.3 From ab8d11beb46f0bd0617e04205c01f5c1fe845b61 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Sep 2005 15:18:24 -0700 Subject: [PATCH] remove duplicated code from proc and ptrace Extract common code used by ptrace_attach() and may_ptrace_attach() into a separate function. Signed-off-by: Miklos Szeredi Cc: Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ptrace.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 2afdafb6212..dc6f3647bfb 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h @@ -90,6 +90,7 @@ extern void __ptrace_link(struct task_struct *child, struct task_struct *new_parent); extern void __ptrace_unlink(struct task_struct *child); extern void ptrace_untrace(struct task_struct *child); +extern int ptrace_may_attach(struct task_struct *task); static inline void ptrace_link(struct task_struct *child, struct task_struct *new_parent) -- cgit v1.2.3 From e922efc342d565a38eed3af377ff403f52148864 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Sep 2005 15:18:25 -0700 Subject: [PATCH] remove duplicated sys_open32() code from 64bit archs 64 bit architectures all implement their own compatibility sys_open(), when in fact the difference is simply not forcing the O_LARGEFILE flag. So use the a common function instead. Signed-off-by: Miklos Szeredi Cc: Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 57e294bf83f..7e1b589842a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1280,6 +1280,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) /* fs/open.c */ extern int do_truncate(struct dentry *, loff_t start); +extern long do_sys_open(const char __user *filename, int flags, int mode); extern struct file *filp_open(const char *, int, int); extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); extern int filp_close(struct file *, fl_owner_t id); -- cgit v1.2.3 From ebad6a4230bdb5927495e28bc7837f515bf667a7 Mon Sep 17 00:00:00 2001 From: Andrey Panin Date: Tue, 6 Sep 2005 15:18:29 -0700 Subject: [PATCH] dmi: add onboard devices discovery This patch adds onboard devices and IPMI BMC discovery into DMI scan code. Drivers can use dmi_find_device() function to search for devices by type and name. Signed-off-by: Andrey Panin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/dmi.h | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5e93e6dce9a..c30175e8dec 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -1,6 +1,8 @@ #ifndef __DMI_H__ #define __DMI_H__ +#include + enum dmi_field { DMI_NONE, DMI_BIOS_VENDOR, @@ -16,6 +18,24 @@ enum dmi_field { DMI_STRING_MAX, }; +enum dmi_device_type { + DMI_DEV_TYPE_ANY = 0, + DMI_DEV_TYPE_OTHER, + DMI_DEV_TYPE_UNKNOWN, + DMI_DEV_TYPE_VIDEO, + DMI_DEV_TYPE_SCSI, + DMI_DEV_TYPE_ETHERNET, + DMI_DEV_TYPE_TOKENRING, + DMI_DEV_TYPE_SOUND, + DMI_DEV_TYPE_IPMI = -1 +}; + +struct dmi_header { + u8 type; + u8 length; + u16 handle; +}; + /* * DMI callbacks for problem boards */ @@ -26,22 +46,32 @@ struct dmi_strmatch { struct dmi_system_id { int (*callback)(struct dmi_system_id *); - char *ident; + const char *ident; struct dmi_strmatch matches[4]; void *driver_data; }; -#define DMI_MATCH(a,b) { a, b } +#define DMI_MATCH(a, b) { a, b } + +struct dmi_device { + struct list_head list; + int type; + const char *name; + void *device_data; /* Type specific data */ +}; #if defined(CONFIG_X86) && !defined(CONFIG_X86_64) extern int dmi_check_system(struct dmi_system_id *list); extern char * dmi_get_system_info(int field); - +extern struct dmi_device * dmi_find_device(int type, const char *name, + struct dmi_device *from); #else static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } static inline char * dmi_get_system_info(int field) { return NULL; } +static struct dmi_device * dmi_find_device(int type, const char *name, + struct dmi_device *from) { return NULL; } #endif -- cgit v1.2.3 From dd3927105b6f65afb7dac17682172cdfb86d3f00 Mon Sep 17 00:00:00 2001 From: Pekka J Enberg Date: Tue, 6 Sep 2005 15:18:31 -0700 Subject: [PATCH] introduce and use kzalloc This patch introduces a kzalloc wrapper and converts kernel/ to use it. It saves a little program text. Signed-off-by: Pekka Enberg Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/slab.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/slab.h b/include/linux/slab.h index 80b2dfde2e8..42a6bea58af 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -99,7 +99,21 @@ found: return __kmalloc(size, flags); } -extern void *kcalloc(size_t, size_t, unsigned int __nocast); +extern void *kzalloc(size_t, unsigned int __nocast); + +/** + * kcalloc - allocate memory for an array. The memory is set to zero. + * @n: number of elements. + * @size: element size. + * @flags: the type of memory to allocate. + */ +static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) +{ + if (n != 0 && size > INT_MAX / n) + return NULL; + return kzalloc(n * size, flags); +} + extern void kfree(const void *); extern unsigned int ksize(const void *); -- cgit v1.2.3 From 8db08ea7e6527eff82d8e45507468003e3cefba3 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 6 Sep 2005 15:18:36 -0700 Subject: [PATCH] ALSA: convert kcalloc to kzalloc This patch introduces a memory-leak tracking version of kzalloc for ALSA. Signed-off-by: Pekka Enberg Cc: Jaroslav Kysela Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/sound/core.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/sound/core.h b/include/sound/core.h index f72b3ef515e..3dc41fd5c54 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -291,12 +291,14 @@ void snd_memory_done(void); int snd_memory_info_init(void); int snd_memory_info_done(void); void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags); +void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags); void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags); void snd_hidden_kfree(const void *obj); void *snd_hidden_vmalloc(unsigned long size); void snd_hidden_vfree(void *obj); char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags); #define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) +#define kzalloc(size, flags) snd_hidden_kzalloc(size, flags) #define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) #define kfree(obj) snd_hidden_kfree(obj) #define vmalloc(size) snd_hidden_vmalloc(size) -- cgit v1.2.3 From c14979b993021377228958498937bcdd9539cbce Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 6 Sep 2005 15:18:38 -0700 Subject: [PATCH] ipmi: add per-channel IPMB addresses IPMI allows multiple IPMB channels on a single interface, and each channel might have a different IPMB address. However, the driver has only one IPMB address that it uses for everything. This patch adds new IOCTLS and a new internal interface for setting per-channel IPMB addresses and LUNs. New systems are coming out with support for multiple IPMB channels, and they are broken without this patch. Signed-off-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ipmi.h | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 596ca613015..846b6989977 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -298,13 +298,19 @@ void ipmi_get_version(ipmi_user_t user, this user, so it will affect all users of this interface. This is so some initialization code can come in and do the OEM-specific things it takes to determine your address (if not the BMC) and set - it for everyone else. */ -void ipmi_set_my_address(ipmi_user_t user, - unsigned char address); -unsigned char ipmi_get_my_address(ipmi_user_t user); -void ipmi_set_my_LUN(ipmi_user_t user, - unsigned char LUN); -unsigned char ipmi_get_my_LUN(ipmi_user_t user); + it for everyone else. Note that each channel can have its own address. */ +int ipmi_set_my_address(ipmi_user_t user, + unsigned int channel, + unsigned char address); +int ipmi_get_my_address(ipmi_user_t user, + unsigned int channel, + unsigned char *address); +int ipmi_set_my_LUN(ipmi_user_t user, + unsigned int channel, + unsigned char LUN); +int ipmi_get_my_LUN(ipmi_user_t user, + unsigned int channel, + unsigned char *LUN); /* * Like ipmi_request, but lets you specify the number of retries and @@ -585,6 +591,16 @@ struct ipmi_cmdspec * things it takes to determine your address (if not the BMC) and set * it for everyone else. You should probably leave the LUN alone. */ +struct ipmi_channel_lun_address_set +{ + unsigned short channel; + unsigned char value; +}; +#define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set) +#define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set) +#define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set) +#define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set) +/* Legacy interfaces, these only set IPMB 0. */ #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int) -- cgit v1.2.3 From 07766f241b54d67999907d529b99ffaa61d8b7d9 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 6 Sep 2005 15:18:40 -0700 Subject: [PATCH] ipmi: allow userland to include ipmi.h The IPMI driver include file needs to include compiler.h so it has definitions for __user and such. Signed-off-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ipmi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 846b6989977..dd30adedd07 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -35,6 +35,7 @@ #define __LINUX_IPMI_H #include +#include /* * This file describes an interface to an IPMI driver. You have to -- cgit v1.2.3 From 56a55ec64806fb56e0cd43b0f726020b74c6689b Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 6 Sep 2005 15:18:42 -0700 Subject: [PATCH] ipmi: fix panic ipmb response The "null message handler" in the IPMI driver is used in startup and panic situations to handle messages. It was only designed to work with messages from the local management controller, but in some cases it was used to get messages from remote managmenet controllers, and the system would then panic. This patch makes the "null message handler" in the IPMI driver more general so it works with any kind of message. Signed-off-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ipmi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index dd30adedd07..938d55b813a 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h @@ -242,7 +242,8 @@ struct ipmi_recv_msg /* The user_msg_data is the data supplied when a message was sent, if this is a response to a sent message. If this is not a response to a sent message, then user_msg_data will - be NULL. */ + be NULL. If the user above is NULL, then this will be the + intf. */ void *user_msg_data; /* Call this when done with the message. It will presumably free -- cgit v1.2.3 From 8c702e16207c70119d03df924de35f8c3629a5c4 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Tue, 6 Sep 2005 15:18:46 -0700 Subject: [PATCH] ipmi poweroff: fix chassis control The IPMI power control function proc_write_chassctrl was badly written, it directly used userspace pointers, it assumed that strings were NULL terminated, and it used the evil sscanf function. This converts over to using the sysctl interface for this data and changes the semantics to be a little more logical. Signed-off-by: Corey Minyard Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/sysctl.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e82be96d490..532a6c5c24e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -711,6 +711,7 @@ enum { DEV_RAID=4, DEV_MAC_HID=5, DEV_SCSI=6, + DEV_IPMI=7, }; /* /proc/sys/dev/cdrom */ @@ -776,6 +777,11 @@ enum { DEV_SCSI_LOGGING_LEVEL=1, }; +/* /proc/sys/dev/ipmi */ +enum { + DEV_IPMI_POWEROFF_POWERCYCLE=1, +}; + /* /proc/sys/abi */ enum { -- cgit v1.2.3 From 335eadf2ef6a1122a720aea98e758e5d431da87d Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 6 Sep 2005 15:18:50 -0700 Subject: [PATCH] sd: initialize SD cards Support for the Secure Digital protocol in the MMC layer. A summary of the legal issues surrounding SD cards, as understood by yours truly: Members of the Secure Digital Association, hereafter SDA, are required to sign a NDA[1] before given access to any specifications. It has been speculated that including an SD implementation would forbid these members to redistribute Linux. This is the basic problem with SD support so it is unclear if it even is a problem since it has no effect on those of us that aren't members. The SDA doesn't seem to enforce these rules though since the patches included here are based on documentation made public by some of the members. The most complete specs[2] are actually released by Sandisk, one of the founding companies of the SDA. Because of this the NDA is considered a non-issue by most involved in the discussions concerning these patches. It might be that the SDA is only interested in protecting the so called "secure" bits of SD, which so far hasn't been found in any public spec. (The card is split into two sections, one "normal" and one "secure" which has an access scheme similar to TPM:s). (As a side note, Microsoft is working to make things easier for us since they want to be able to include the source code for a SD driver in one of their development kits. HP is making sure that the new NDA will allow a Linux implementation. So far only the SDIO specs have been opened up[3]. More will hopefully follow.) [1] http://www.sdcard.org/membership/images/ippolicy.pdf [2] http://www.sandisk.com/pdf/oem/ProdManualSDCardv1.9.pdf [3] http://www.sdcard.org/sdio/Simplified%20SDIO%20Card%20Specification.pdf This patch contains the central parts of the SD support. If no MMC cards are found on a bus then the MMC layer proceeds looking for SD cards. Helper functions are extended to handle the special needs of SD cards. Signed-off-by: Pierre Ossman Cc: Russell King Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmc/card.h | 3 +++ include/linux/mmc/host.h | 4 ++++ include/linux/mmc/mmc.h | 2 ++ 3 files changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index aefedf04b9b..538e8c86336 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -47,6 +47,7 @@ struct mmc_card { #define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ #define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ #define MMC_STATE_BAD (1<<2) /* unrecognised device */ +#define MMC_STATE_SDCARD (1<<3) /* is an SD card */ u32 raw_cid[4]; /* raw card CID */ u32 raw_csd[4]; /* raw card CSD */ struct mmc_cid cid; /* card identification */ @@ -56,10 +57,12 @@ struct mmc_card { #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) +#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) +#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) #define mmc_card_name(c) ((c)->cid.prod_name) #define mmc_card_id(c) ((c)->dev.bus_id) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 30f68c0c8c6..845020d90c6 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -87,6 +87,10 @@ struct mmc_host { struct mmc_ios ios; /* current io bus settings */ u32 ocr; /* the current OCR setting */ + unsigned int mode; /* current card mode of host */ +#define MMC_MODE_MMC 0 +#define MMC_MODE_SD 1 + struct list_head cards; /* devices attached to this host */ wait_queue_head_t wq; diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 0d35d4ffb36..1ab78e8d6c5 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -88,6 +88,8 @@ struct mmc_card; extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); +extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int, + struct mmc_command *, int); extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); -- cgit v1.2.3 From a00fc09029f02ca833cf90e5d5625f08c4ac4f51 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 6 Sep 2005 15:18:52 -0700 Subject: [PATCH] sd: read-only switch Support for the read-only switch on SD cards which must be enforced by the host. Signed-off-by: Pierre Ossman Cc: Russell King Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmc/card.h | 3 +++ include/linux/mmc/host.h | 1 + 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 538e8c86336..0e9ec01b9c5 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -48,6 +48,7 @@ struct mmc_card { #define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ #define MMC_STATE_BAD (1<<2) /* unrecognised device */ #define MMC_STATE_SDCARD (1<<3) /* is an SD card */ +#define MMC_STATE_READONLY (1<<4) /* card is read-only */ u32 raw_cid[4]; /* raw card CID */ u32 raw_csd[4]; /* raw card CSD */ struct mmc_cid cid; /* card identification */ @@ -58,11 +59,13 @@ struct mmc_card { #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) +#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) +#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) #define mmc_card_name(c) ((c)->cid.prod_name) #define mmc_card_id(c) ((c)->dev.bus_id) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 845020d90c6..8c5f71376e4 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -62,6 +62,7 @@ struct mmc_ios { struct mmc_host_ops { void (*request)(struct mmc_host *host, struct mmc_request *req); void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); + int (*get_ro)(struct mmc_host *host); }; struct mmc_card; -- cgit v1.2.3 From b57c43ad81602589afca3948a5a7121e40026e17 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 6 Sep 2005 15:18:53 -0700 Subject: [PATCH] sd: SCR register Read the SD specific SCR register from the card. Signed-off-by: Pierre Ossman Cc: Russell King Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmc/card.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 0e9ec01b9c5..18fc77f682d 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h @@ -33,6 +33,13 @@ struct mmc_csd { unsigned int capacity; }; +struct sd_scr { + unsigned char sda_vsn; + unsigned char bus_widths; +#define SD_SCR_BUS_WIDTH_1 (1<<0) +#define SD_SCR_BUS_WIDTH_4 (1<<2) +}; + struct mmc_host; /* @@ -51,8 +58,10 @@ struct mmc_card { #define MMC_STATE_READONLY (1<<4) /* card is read-only */ u32 raw_cid[4]; /* raw card CID */ u32 raw_csd[4]; /* raw card CSD */ + u32 raw_scr[2]; /* raw card SCR */ struct mmc_cid cid; /* card identification */ struct mmc_csd csd; /* card specific */ + struct sd_scr scr; /* extra SD information */ }; #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) -- cgit v1.2.3 From f218278a456b3c272b480443c89004c3d2a49f18 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 6 Sep 2005 15:18:55 -0700 Subject: [PATCH] sd: SD 4-bit bus Infrastructure for 4-bit bus transfers with SD cards. Signed-off-by: Pierre Ossman Cc: Russell King Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmc/host.h | 9 +++++++++ include/linux/mmc/protocol.h | 7 +++++++ 2 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 8c5f71376e4..6014160d9c0 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -57,6 +57,11 @@ struct mmc_ios { #define MMC_POWER_OFF 0 #define MMC_POWER_UP 1 #define MMC_POWER_ON 2 + + unsigned char bus_width; /* data bus width */ + +#define MMC_BUS_WIDTH_1 0 +#define MMC_BUS_WIDTH_4 2 }; struct mmc_host_ops { @@ -77,6 +82,10 @@ struct mmc_host { unsigned int f_max; u32 ocr_avail; + unsigned long caps; /* Host capabilities */ + +#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ + /* host specific block data */ unsigned int max_seg_size; /* see blk_queue_max_segment_size */ unsigned short max_hw_segs; /* see blk_queue_max_hw_segments */ diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 896342817b9..f819cae9226 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h @@ -236,5 +236,12 @@ struct _mmc_csd { #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ + +/* + * SD bus widths + */ +#define SD_BUS_WIDTH_1 0 +#define SD_BUS_WIDTH_4 2 + #endif /* MMC_MMC_PROTOCOL_H */ -- cgit v1.2.3 From e619524fe5f5b0c13db34ed0f6320d2dcccf6e8d Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:18:56 -0700 Subject: [PATCH] Add write protection switch handling to the PXA MMC driver Add a write protection switch handling code to the PXA MMC driver so that platform specific code can provide it if available. Signed-off-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-pxa/mmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 7492ea7ea61..9718063a211 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h @@ -10,6 +10,7 @@ struct mmc_host; struct pxamci_platform_data { unsigned int ocr_mask; /* available voltages */ int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); + int (*get_ro)(struct device *); void (*setpower)(struct device *, unsigned int); void (*exit)(struct device *, void *); }; -- cgit v1.2.3 From aac51f09d96a0acfb73c1d1c0796358bb47ea07b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:19:03 -0700 Subject: [PATCH] w100fb: Rewrite for platform independence The code w100fb was based on was horribly Sharp SL-C7x0 specific and there was little else that could be done as I had no access to anything else with a w100 in it. There is no real documentation about this chipset available. Ian Molton has access to other platforms with the w100 (Toshiba e-series) and so between us, we've improved w100fb and made it platform independent. Ian Molton also added support for the very similar w3220 and w3200 chipsets. There are a lot of changes here and it nearly amounts to a rewrite of the driver but it has been extensively tested and is being used in preference to the original driver in the Zaurus community. I'd therefore like to update the mainline code to reflect this. Signed-off-by: Richard Purdie Acked-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/w100fb.h | 138 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 133 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/video/w100fb.h b/include/video/w100fb.h index bd548c2b47c..e6da2d7ded8 100644 --- a/include/video/w100fb.h +++ b/include/video/w100fb.h @@ -1,21 +1,149 @@ /* * Support for the w100 frame buffer. * - * Copyright (c) 2004 Richard Purdie + * Copyright (c) 2004-2005 Richard Purdie + * Copyright (c) 2005 Ian Molton * * 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 W100_GPIO_PORT_A 0 +#define W100_GPIO_PORT_B 1 + +#define CLK_SRC_XTAL 0 +#define CLK_SRC_PLL 1 + +struct w100fb_par; + +unsigned long w100fb_gpio_read(int port); +void w100fb_gpio_write(int port, unsigned long value); + +/* LCD Specific Routines and Config */ +struct w100_tg_info { + void (*change)(struct w100fb_par*); + void (*suspend)(struct w100fb_par*); + void (*resume)(struct w100fb_par*); +}; + +/* General Platform Specific w100 Register Values */ +struct w100_gen_regs { + unsigned long lcd_format; + unsigned long lcdd_cntl1; + unsigned long lcdd_cntl2; + unsigned long genlcd_cntl1; + unsigned long genlcd_cntl2; + unsigned long genlcd_cntl3; +}; + +struct w100_gpio_regs { + unsigned long init_data1; + unsigned long init_data2; + unsigned long gpio_dir1; + unsigned long gpio_oe1; + unsigned long gpio_dir2; + unsigned long gpio_oe2; +}; + +/* Optional External Memory Configuration */ +struct w100_mem_info { + unsigned long ext_cntl; + unsigned long sdram_mode_reg; + unsigned long ext_timing_cntl; + unsigned long io_cntl; + unsigned int size; +}; + +struct w100_bm_mem_info { + unsigned long ext_mem_bw; + unsigned long offset; + unsigned long ext_timing_ctl; + unsigned long ext_cntl; + unsigned long mode_reg; + unsigned long io_cntl; + unsigned long config; +}; + +/* LCD Mode definition */ +struct w100_mode { + unsigned int xres; + unsigned int yres; + unsigned short left_margin; + unsigned short right_margin; + unsigned short upper_margin; + unsigned short lower_margin; + unsigned long crtc_ss; + unsigned long crtc_ls; + unsigned long crtc_gs; + unsigned long crtc_vpos_gs; + unsigned long crtc_rev; + unsigned long crtc_dclk; + unsigned long crtc_gclk; + unsigned long crtc_goe; + unsigned long crtc_ps1_active; + char pll_freq; + char fast_pll_freq; + int sysclk_src; + int sysclk_divider; + int pixclk_src; + int pixclk_divider; + int pixclk_divider_rotated; +}; + +struct w100_pll_info { + uint16_t freq; /* desired Fout for PLL (Mhz) */ + uint8_t M; /* input divider */ + uint8_t N_int; /* VCO multiplier */ + uint8_t N_fac; /* VCO multiplier fractional part */ + uint8_t tfgoal; + uint8_t lock_time; +}; + +/* Initial Video mode orientation flags */ +#define INIT_MODE_ROTATED 0x1 +#define INIT_MODE_FLIPPED 0x2 + /* * This structure describes the machine which we are running on. * It is set by machine specific code and used in the probe routine * of drivers/video/w100fb.c */ - struct w100fb_mach_info { - void (*w100fb_ssp_send)(u8 adrs, u8 data); - int comadj; - int phadadj; + /* General Platform Specific Registers */ + struct w100_gen_regs *regs; + /* Table of modes the LCD is capable of */ + struct w100_mode *modelist; + unsigned int num_modes; + /* Hooks for any platform specific tg/lcd code (optional) */ + struct w100_tg_info *tg; + /* External memory definition (if present) */ + struct w100_mem_info *mem; + /* Additional External memory definition (if present) */ + struct w100_bm_mem_info *bm_mem; + /* GPIO definitions (optional) */ + struct w100_gpio_regs *gpio; + /* Initial Mode flags */ + unsigned int init_mode; + /* Xtal Frequency */ + unsigned int xtal_freq; + /* Enable Xtal input doubler (1 == enable) */ + unsigned int xtal_dbl; +}; + +/* General frame buffer data structure */ +struct w100fb_par { + unsigned int chip_id; + unsigned int xres; + unsigned int yres; + unsigned int extmem_active; + unsigned int flip; + unsigned int blanked; + unsigned int fastpll_mode; + unsigned long hsync_len; + struct w100_mode *mode; + struct w100_pll_info *pll_table; + struct w100fb_mach_info *mach; + uint32_t *saved_intmem; + uint32_t *saved_extmem; }; -- cgit v1.2.3 From 41b1bce80b43f7c6a6c64006b2abe3a8d52ab120 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:19:05 -0700 Subject: [PATCH] w100fb: Update corgi platform code to match new driver This patch moves the platform specific Sharp SL-C7x0 LCD code from the w100fb driver into a more appropriate place and updates the Corgi code to match the new w100fb driver. It also updates the corgi touchscreen code to match the new simplified interface available from w100fb. Signed-off-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-pxa/corgi.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-pxa/corgi.h b/include/asm-arm/arch-pxa/corgi.h index 324db06b5dd..4b7aa0b8391 100644 --- a/include/asm-arm/arch-pxa/corgi.h +++ b/include/asm-arm/arch-pxa/corgi.h @@ -103,18 +103,20 @@ * Shared data structures */ extern struct platform_device corgiscoop_device; +extern struct platform_device corgissp_device; +extern struct platform_device corgifb_device; /* * External Functions */ extern unsigned long corgi_ssp_ads7846_putget(unsigned long); extern unsigned long corgi_ssp_ads7846_get(void); -extern void corgi_ssp_ads7846_put(ulong data); +extern void corgi_ssp_ads7846_put(unsigned long data); extern void corgi_ssp_ads7846_lock(void); extern void corgi_ssp_ads7846_unlock(void); -extern void corgi_ssp_lcdtg_send (u8 adrs, u8 data); +extern void corgi_ssp_lcdtg_send (unsigned char adrs, unsigned char data); extern void corgi_ssp_blduty_set(int duty); -extern int corgi_ssp_max1111_get(ulong data); +extern int corgi_ssp_max1111_get(unsigned long data); #endif /* __ASM_ARCH_CORGI_H */ -- cgit v1.2.3 From 3158106685acac8f8d4e74a17b974f160fe77c0b Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 6 Sep 2005 15:19:06 -0700 Subject: [PATCH] Input: Add a new switch event type The corgi keyboard has need of a switch event type with slightly type to the input system as recommended by the input maintainer. Signed-off-by: Richard Purdie Cc: Vojtech Pavlik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/input.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include') diff --git a/include/linux/input.h b/include/linux/input.h index bdc53c6cc96..4767e542953 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -66,6 +66,7 @@ struct input_absinfo { #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ +#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ @@ -86,6 +87,7 @@ struct input_absinfo { #define EV_REL 0x02 #define EV_ABS 0x03 #define EV_MSC 0x04 +#define EV_SW 0x05 #define EV_LED 0x11 #define EV_SND 0x12 #define EV_REP 0x14 @@ -550,6 +552,20 @@ struct input_absinfo { #define ABS_MISC 0x28 #define ABS_MAX 0x3f +/* + * Switch events + */ + +#define SW_0 0x00 +#define SW_1 0x01 +#define SW_2 0x02 +#define SW_3 0x03 +#define SW_4 0x04 +#define SW_5 0x05 +#define SW_6 0x06 +#define SW_7 0x07 +#define SW_MAX 0x0f + /* * Misc events */ @@ -824,6 +840,7 @@ struct input_dev { unsigned long ledbit[NBITS(LED_MAX)]; unsigned long sndbit[NBITS(SND_MAX)]; unsigned long ffbit[NBITS(FF_MAX)]; + unsigned long swbit[NBITS(SW_MAX)]; int ff_effects_max; unsigned int keycodemax; @@ -844,6 +861,7 @@ struct input_dev { unsigned long key[NBITS(KEY_MAX)]; unsigned long led[NBITS(LED_MAX)]; unsigned long snd[NBITS(SND_MAX)]; + unsigned long sw[NBITS(SW_MAX)]; int absmax[ABS_MAX + 1]; int absmin[ABS_MAX + 1]; @@ -886,6 +904,7 @@ struct input_dev { #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 +#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 #define INPUT_DEVICE_ID_MATCH_DEVICE\ (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) @@ -906,6 +925,7 @@ struct input_device_id { unsigned long ledbit[NBITS(LED_MAX)]; unsigned long sndbit[NBITS(SND_MAX)]; unsigned long ffbit[NBITS(FF_MAX)]; + unsigned long swbit[NBITS(SW_MAX)]; unsigned long driver_info; }; @@ -998,6 +1018,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co input_event(dev, EV_FF_STATUS, code, value); } +static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) +{ + input_event(dev, EV_SW, code, !!value); +} + static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) { dev->regs = regs; -- cgit v1.2.3 From a7662236253374012d364106b6dc9161bd929e2e Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 6 Sep 2005 15:19:10 -0700 Subject: [PATCH] Make ll_rw_block() wait for buffer lock Introduce new ll_rw_block() operation SWRITE meaning that block layer should wait for the buffer lock and write-out afterwards. Hence data in buffers at the time of call are guaranteed to be submitted to the disk. Signed-off-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 7e1b589842a..fd93ab7da90 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -69,6 +69,7 @@ extern int dir_notify_enable; #define READ 0 #define WRITE 1 #define READA 2 /* read-ahead - don't block if no resources */ +#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ #define SPECIAL 4 /* For non-blockdevice requests in request queue */ #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) -- cgit v1.2.3 From d0aaff9796c3310326d10da44fc0faed352a1d29 Mon Sep 17 00:00:00 2001 From: Prasanna S Panchamukhi Date: Tue, 6 Sep 2005 15:19:26 -0700 Subject: [PATCH] Kprobes: prevent possible race conditions generic There are possible race conditions if probes are placed on routines within the kprobes files and routines used by the kprobes. For example if you put probe on get_kprobe() routines, the system can hang while inserting probes on any routine such as do_fork(). Because while inserting probes on do_fork(), register_kprobes() routine grabs the kprobes spin lock and executes get_kprobe() routine and to handle probe of get_kprobe(), kprobes_handler() gets executed and tries to grab kprobes spin lock, and spins forever. This patch avoids such possible race conditions by preventing probes on routines within the kprobes file and routines used by kprobes. I have modified the patches as per Andi Kleen's suggestion to move kprobes routines and other routines used by kprobes to a seperate section .kprobes.text. Also moved page fault and exception handlers, general protection fault to .kprobes.text section. These patches have been tested on i386, x86_64 and ppc64 architectures, also compiled on ia64 and sparc64 architectures. Signed-off-by: Prasanna S Panchamukhi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-generic/sections.h | 1 + include/asm-generic/vmlinux.lds.h | 6 ++++++ include/linux/kprobes.h | 3 +++ include/linux/linkage.h | 7 +++++++ 4 files changed, 17 insertions(+) (limited to 'include') diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 450eae22c39..886dbd11689 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -12,5 +12,6 @@ extern char _sextratext[] __attribute__((weak)); extern char _eextratext[] __attribute__((weak)); extern char _end[]; extern char __per_cpu_start[], __per_cpu_end[]; +extern char __kprobes_text_start[], __kprobes_text_end[]; #endif /* _ASM_GENERIC_SECTIONS_H_ */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 3fa94288aa9..6f857be2b64 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -97,3 +97,9 @@ VMLINUX_SYMBOL(__lock_text_start) = .; \ *(.spinlock.text) \ VMLINUX_SYMBOL(__lock_text_end) = .; + +#define KPROBES_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__kprobes_text_start) = .; \ + *(.kprobes.text) \ + VMLINUX_SYMBOL(__kprobes_text_end) = .; diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e050fc2d4c2..e30afdca791 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -42,6 +42,9 @@ #define KPROBE_REENTER 0x00000004 #define KPROBE_HIT_SSDONE 0x00000008 +/* Attach to insert probes on any functions which should be ignored*/ +#define __kprobes __attribute__((__section__(".kprobes.text"))) + struct kprobe; struct pt_regs; struct kretprobe; diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 338f7795d8a..147eb01e0d4 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -33,6 +33,13 @@ ALIGN; \ name: +#define KPROBE_ENTRY(name) \ + .section .kprobes.text, "ax"; \ + .globl name; \ + ALIGN; \ + name: + + #endif #define NORET_TYPE /**/ -- cgit v1.2.3 From bb144a85c70a65730424ad1a9dc50fef66e5cafe Mon Sep 17 00:00:00 2001 From: Prasanna S Panchamukhi Date: Tue, 6 Sep 2005 15:19:29 -0700 Subject: [PATCH] Kprobes: prevent possible race conditions ppc64 changes This patch contains the ppc64 architecture specific changes to prevent the possible race conditions. Signed-off-by: Prasanna S Panchamukhi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc64/processor.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h index 7bd4796f123..8bd7aa95938 100644 --- a/include/asm-ppc64/processor.h +++ b/include/asm-ppc64/processor.h @@ -311,6 +311,20 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): +#define _KPROBE(name) \ + .section ".kprobes.text","a"; \ + .align 2 ; \ + .globl name; \ + .globl GLUE(.,name); \ + .section ".opd","aw"; \ +name: \ + .quad GLUE(.,name); \ + .quad .TOC.@tocbase; \ + .quad 0; \ + .previous; \ + .type GLUE(.,name),@function; \ +GLUE(.,name): + #define _STATIC(name) \ .section ".text"; \ .align 2 ; \ -- cgit v1.2.3 From deac66ae454cacf942c051b86d9232af546fb187 Mon Sep 17 00:00:00 2001 From: Keshavamurthy Anil S Date: Tue, 6 Sep 2005 15:19:35 -0700 Subject: [PATCH] kprobes: fix bug when probed on task and isr functions This patch fixes a race condition where in system used to hang or sometime crash within minutes when kprobes are inserted on ISR routine and a task routine. The fix has been stress tested on i386, ia64, pp64 and on x86_64. To reproduce the problem insert kprobes on schedule() and do_IRQ() functions and you should see hang or system crash. Signed-off-by: Anil S Keshavamurthy Signed-off-by: Ananth N Mavinakayanahalli Acked-by: Prasanna S Panchamukhi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/kprobes.h | 1 + include/asm-ppc64/kprobes.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h index bf36a32e37e..573a3574a24 100644 --- a/include/asm-ia64/kprobes.h +++ b/include/asm-ia64/kprobes.h @@ -92,6 +92,7 @@ struct arch_specific_insn { kprobe_opcode_t insn; #define INST_FLAG_FIX_RELATIVE_IP_ADDR 1 #define INST_FLAG_FIX_BRANCH_REG 2 + #define INST_FLAG_BREAK_INST 4 unsigned long inst_flag; unsigned short target_br_reg; }; diff --git a/include/asm-ppc64/kprobes.h b/include/asm-ppc64/kprobes.h index 0802919c323..d9129d2b038 100644 --- a/include/asm-ppc64/kprobes.h +++ b/include/asm-ppc64/kprobes.h @@ -42,6 +42,9 @@ typedef unsigned int kprobe_opcode_t; #define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) +#define is_trap(instr) (IS_TW(instr) || IS_TD(instr) || \ + IS_TWI(instr) || IS_TDI(instr)) + #define ARCH_SUPPORTS_KRETPROBES void kretprobe_trampoline(void); -- cgit v1.2.3 From 333fad5364d6b457c8d837f7d05802d2aaf8a961 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Thu, 8 Sep 2005 09:59:17 +0900 Subject: [IPV6]: Support several new sockopt / ancillary data in Advanced API (RFC3542). Support several new socket options / ancillary data: IPV6_RECVPKTINFO, IPV6_PKTINFO, IPV6_RECVHOPOPTS, IPV6_HOPOPTS, IPV6_RECVDSTOPTS, IPV6_DSTOPTS, IPV6_RTHDRDSTOPTS, IPV6_RECVRTHDR, IPV6_RTHDR, IPV6_RECVHOPOPTS, IPV6_HOPOPTS Old semantics are preserved as IPV6_2292xxxx so that we can maintain backward compatibility. Signed-off-by: YOSHIFUJI Hideaki --- include/linux/in6.h | 38 ++++++++++++++++++++++++++++++++------ include/linux/ipv6.h | 10 ++++++++-- include/net/ipv6.h | 4 ++++ 3 files changed, 44 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/linux/in6.h b/include/linux/in6.h index dcf5720ffcb..c11022f2f2a 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -148,13 +148,13 @@ struct in6_flowlabel_req */ #define IPV6_ADDRFORM 1 -#define IPV6_PKTINFO 2 -#define IPV6_HOPOPTS 3 -#define IPV6_DSTOPTS 4 -#define IPV6_RTHDR 5 -#define IPV6_PKTOPTIONS 6 +#define IPV6_2292PKTINFO 2 +#define IPV6_2292HOPOPTS 3 +#define IPV6_2292DSTOPTS 4 +#define IPV6_2292RTHDR 5 +#define IPV6_2292PKTOPTIONS 6 #define IPV6_CHECKSUM 7 -#define IPV6_HOPLIMIT 8 +#define IPV6_2292HOPLIMIT 8 #define IPV6_NEXTHOP 9 #define IPV6_AUTHHDR 10 /* obsolete */ #define IPV6_FLOWINFO 11 @@ -198,4 +198,30 @@ struct in6_flowlabel_req * MCAST_MSFILTER 48 */ +/* RFC3542 advanced socket options (50-67) */ +#define IPV6_RECVPKTINFO 50 +#define IPV6_PKTINFO 51 +#if 0 +#define IPV6_RECVPATHMTU 52 +#define IPV6_PATHMTU 53 +#define IPV6_DONTFRAG 54 +#define IPV6_USE_MIN_MTU 55 +#endif +#define IPV6_RECVHOPOPTS 56 +#define IPV6_HOPOPTS 57 +#if 0 +#define IPV6_RECVRTHDRDSTOPTS 58 /* Unused, see net/ipv6/datagram.c */ +#endif +#define IPV6_RTHDRDSTOPTS 59 +#define IPV6_RECVRTHDR 60 +#define IPV6_RTHDR 61 +#define IPV6_RECVDSTOPTS 62 +#define IPV6_DSTOPTS 63 +#define IPV6_RECVHOPLIMIT 64 +#define IPV6_HOPLIMIT 65 +#if 0 +#define IPV6_RECVTCLASS 66 +#define IPV6_TCLASS 67 +#endif + #endif diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 3c7dbc6a0a7..2581f1c94df 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -189,6 +189,7 @@ struct inet6_skb_parm { __u16 dst0; __u16 srcrt; __u16 dst1; + __u16 lastopt; }; #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) @@ -234,14 +235,19 @@ struct ipv6_pinfo { /* pktoption flags */ union { struct { - __u8 srcrt:2, + __u16 srcrt:2, + osrcrt:2, rxinfo:1, + rxoinfo:1, rxhlim:1, + rxohlim:1, hopopts:1, + ohopopts:1, dstopts:1, + odstopts:1, rxflow:1; } bits; - __u8 all; + __u16 all; } rxopt; /* sockopt flags */ diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 3203eaff4bd..8a9fe9434e9 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -233,6 +233,10 @@ extern int ip6_ra_control(struct sock *sk, int sel, extern int ipv6_parse_hopopts(struct sk_buff *skb, int); extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); +extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt, + int newtype, + struct ipv6_opt_hdr __user *newopt, + int newoptlen); extern int ip6_frag_nqueues; extern atomic_t ip6_frag_mem; -- cgit v1.2.3 From 41a1f8ea4fbfcdc4232f023732584aae2220de31 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Thu, 8 Sep 2005 10:19:03 +0900 Subject: [IPV6]: Support IPV6_{RECV,}TCLASS socket options / ancillary data. Based on patch from David L Stevens Signed-off-by: David L Stevens Signed-off-by: YOSHIFUJI Hideaki --- include/linux/in6.h | 2 -- include/linux/ipv6.h | 5 ++++- include/net/ipv6.h | 1 + include/net/transp_v6.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/in6.h b/include/linux/in6.h index c11022f2f2a..bd32b79d629 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -219,9 +219,7 @@ struct in6_flowlabel_req #define IPV6_DSTOPTS 63 #define IPV6_RECVHOPLIMIT 64 #define IPV6_HOPLIMIT 65 -#if 0 #define IPV6_RECVTCLASS 66 #define IPV6_TCLASS 67 -#endif #endif diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 2581f1c94df..6c5f7b39a4b 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -245,7 +245,8 @@ struct ipv6_pinfo { ohopopts:1, dstopts:1, odstopts:1, - rxflow:1; + rxflow:1, + rxtclass:1; } bits; __u16 all; } rxopt; @@ -256,6 +257,7 @@ struct ipv6_pinfo { sndflow:1, pmtudisc:2, ipv6only:1; + __u8 tclass; __u32 dst_cookie; @@ -269,6 +271,7 @@ struct ipv6_pinfo { struct ipv6_txoptions *opt; struct rt6_info *rt; int hop_limit; + int tclass; } cork; }; diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 8a9fe9434e9..65ec86678a0 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -377,6 +377,7 @@ extern int ip6_append_data(struct sock *sk, int length, int transhdrlen, int hlimit, + int tclass, struct ipv6_txoptions *opt, struct flowi *fl, struct rt6_info *rt, diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index 8b075ab7a26..4e86f2de663 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h @@ -37,7 +37,7 @@ extern int datagram_recv_ctl(struct sock *sk, extern int datagram_send_ctl(struct msghdr *msg, struct flowi *fl, struct ipv6_txoptions *opt, - int *hlimit); + int *hlimit, int *tclass); #define LOOPBACK4_IPV6 __constant_htonl(0x7f000006) -- cgit v1.2.3 From 34bb61f9ddabd7a7f909cbfb05592eb775f6662a Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Tue, 6 Sep 2005 16:56:51 -0700 Subject: [PATCH] fix klist semantics for lists which have elements removed on traversal The problem is that klists claim to provide semantics for safe traversal of lists which are being modified. The failure case is when traversal of a list causes element removal (a fairly common case). The issue is that although the list node is refcounted, if it is embedded in an object (which is universally the case), then the object will be freed regardless of the klist refcount leading to slab corruption because the klist iterator refers to the prior element to get the next. The solution is to make the klist take and release references to the embedding object meaning that the embedding object won't be released until the list relinquishes the reference to it. (akpm: fast-track this because it's needed for the 2.6.13 scsi merge) Signed-off-by: James Bottomley Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/klist.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/klist.h b/include/linux/klist.h index c4d1fae4dd8..74071254c9d 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h @@ -17,15 +17,17 @@ #include #include - +struct klist_node; struct klist { spinlock_t k_lock; struct list_head k_list; + void (*get)(struct klist_node *); + void (*put)(struct klist_node *); }; -extern void klist_init(struct klist * k); - +extern void klist_init(struct klist * k, void (*get)(struct klist_node *), + void (*put)(struct klist_node *)); struct klist_node { struct klist * n_klist; -- cgit v1.2.3 From d7b6b3589471c3856f1e6dc9c77abc4af962ffdb Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 8 Sep 2005 15:32:23 +0100 Subject: [ARM] Fix ARMv6 VIPT cache >= 32K This adds the necessary changes to ensure that we flush the caches correctly with aliasing VIPT caches. Signed-off-by: Russell King --- include/asm-arm/cacheflush.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 035cdcff43d..e81baff4f54 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h @@ -256,7 +256,7 @@ extern void dmac_flush_range(unsigned long, unsigned long); * Convert calls to our calling convention. */ #define flush_cache_all() __cpuc_flush_kern_all() - +#ifndef CONFIG_CPU_CACHE_VIPT static inline void flush_cache_mm(struct mm_struct *mm) { if (cpu_isset(smp_processor_id(), mm->cpu_vm_mask)) @@ -279,6 +279,11 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned l __cpuc_flush_user_range(addr, addr + PAGE_SIZE, vma->vm_flags); } } +#else +extern void flush_cache_mm(struct mm_struct *mm); +extern void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); +extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr, unsigned long pfn); +#endif /* * flush_cache_user_range is used when we want to ensure that the -- cgit v1.2.3 From 6df29debb7fc04ac3f92038c57437f40bab4e72d Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 8 Sep 2005 16:04:41 +0100 Subject: [SERIAL] Use an enum for serial8250 platform device IDs Rather than hard-coding the platform device IDs, enumerate them. We don't particularly care about the actual ID we get, just as long as they're unique. Signed-off-by: Russell King --- include/linux/serial_8250.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index d8a023d804d..317a979b24d 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -29,6 +29,21 @@ struct plat_serial8250_port { unsigned int flags; /* UPF_* flags */ }; +/* + * Allocate 8250 platform device IDs. Nothing is implied by + * the numbering here, except for the legacy entry being -1. + */ +enum { + PLAT8250_DEV_LEGACY = -1, + PLAT8250_DEV_PLATFORM, + PLAT8250_DEV_PLATFORM1, + PLAT8250_DEV_FOURPORT, + PLAT8250_DEV_ACCENT, + PLAT8250_DEV_BOCA, + PLAT8250_DEV_HUB6, + PLAT8250_DEV_MCA, +}; + /* * This should be used by drivers which want to register * their own 8250 ports without registering their own -- cgit v1.2.3 From 8920e8f94c44e31a73bdf923b04721e26e88cadd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 7 Sep 2005 18:28:51 -0700 Subject: [PATCH] Fix 32bit sendmsg() flaw When we copy 32bit ->msg_control contents to kernel, we walk the same userland data twice without sanity checks on the second pass. Second version of this patch: the original broke with 64-bit arches running 32-bit-compat-mode executables doing sendmsg() syscalls with unaligned CMSG data areas Another thing is that we use kmalloc() to allocate and sock_kfree_s() to free afterwards; less serious, but also needs fixing. Signed-off-by: Al Viro Signed-off-by: David Woodhouse Signed-off-by: Chris Wright Signed-off-by: Linus Torvalds --- include/net/compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/compat.h b/include/net/compat.h index 9983fd85780..482eb820f13 100644 --- a/include/net/compat.h +++ b/include/net/compat.h @@ -33,7 +33,7 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); -extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, unsigned char *, +extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); #endif /* NET_COMPAT_H */ -- cgit v1.2.3 From 8dc003359cc3996abad9e53a7b2280b272610283 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 8 Sep 2005 17:53:01 +0100 Subject: [MMC] Allow detection/removal to be delayed Change mmc_detect_change() to take a delay argument such that the detection of card insertions and removals can be delayed according to the requirements of the host driver or platform. Signed-off-by: Richard Purdie Signed-off-by: Russell King --- include/linux/mmc/host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 6014160d9c0..c5d73c0cf6b 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -123,7 +123,7 @@ extern void mmc_free_host(struct mmc_host *); extern int mmc_suspend_host(struct mmc_host *, pm_message_t); extern int mmc_resume_host(struct mmc_host *); -extern void mmc_detect_change(struct mmc_host *); +extern void mmc_detect_change(struct mmc_host *, unsigned long delay); extern void mmc_request_done(struct mmc_host *, struct mmc_request *); #endif -- cgit v1.2.3 From 0e4e4220f10bf8f58a8606f0cb28538088c64b1a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 8 Sep 2005 12:32:03 -0700 Subject: [NET]: Optimize pskb_trim_rcsum() Since packets almost never contain extra garbage at the end, it is worthwhile to optimize for that case. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- include/linux/skbuff.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index da7da9c0ed1..2741c0c55e8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) { - if (len >= skb->len) + if (likely(len >= skb->len)) return 0; if (skb->ip_summed == CHECKSUM_HW) skb->ip_summed = CHECKSUM_NONE; -- cgit v1.2.3 From e50ef933e649a2b43aa10c8a60c491543b8b4c02 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 8 Sep 2005 12:32:46 -0700 Subject: [NET]: Need struct sock forward decl in net/compat.h Else we get build failures like: CC arch/sparc64/kernel/sparc64_ksyms.o In file included from arch/sparc64/kernel/sparc64_ksyms.c:28: include/net/compat.h:37: warning: "struct sock" declared inside parameter list include/net/compat.h:37: warning: its scope is only this definition or declaration, which is probably not what you want Signed-off-by: David S. Miller --- include/net/compat.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/net/compat.h b/include/net/compat.h index 482eb820f13..290bab46d45 100644 --- a/include/net/compat.h +++ b/include/net/compat.h @@ -33,7 +33,8 @@ extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsi extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); -extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, - int); + +struct sock; +extern int cmsghdr_from_user_compat_to_kern(struct msghdr *, struct sock *, unsigned char *, int); #endif /* NET_COMPAT_H */ -- cgit v1.2.3 From baed16a7ff5194487764db300c2753ac7409c4c5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 8 Sep 2005 13:40:41 -0700 Subject: [AX.25]: Make asc2ax() thread-proof Asc2ax was still using a static buffer for all invocations which isn't exactly SMP-safe. Change asc2ax to take an additional result buffer as the argument. Change all callers to provide such a buffer. This one only really is a fix for ROSE and as per recent discussions there's still much more to fix in ROSE ... Signed-off-by: Ralf Baechle DL5RB Signed-off-by: David S. Miller --- include/net/ax25.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/ax25.h b/include/net/ax25.h index 364b046e9f4..227d3378dec 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -258,7 +258,7 @@ extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); /* ax25_addr.c */ extern ax25_address null_ax25_address; extern char *ax2asc(char *buf, ax25_address *); -extern ax25_address *asc2ax(char *); +extern void asc2ax(ax25_address *addr, char *callsign); extern int ax25cmp(ax25_address *, ax25_address *); extern int ax25digicmp(ax25_digi *, ax25_digi *); extern unsigned char *ax25_addr_parse(unsigned char *, int, ax25_address *, ax25_address *, ax25_digi *, int *, int *); -- cgit v1.2.3 From 4d803fcdcd97dd346d4b39c3b76e5879cead8a31 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 8 Sep 2005 14:37:53 -0700 Subject: [SPARC64]: Inline membar()'s again. Since GCC has to emit a call and a delay slot to the out-of-line "membar" routines in arch/sparc64/lib/mb.S it is much better to just do the necessary predicted branch inline instead as: ba,pt %xcc, 1f membar #whatever 1: instead of the current: call membar_foo dslot because this way GCC is not required to allocate a stack frame if the function can be a leaf function. This also makes this bug fix easier to backport to 2.4.x Signed-off-by: David S. Miller --- include/asm-sparc64/system.h | 49 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 5e94c05dc2f..b5417529f6f 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h @@ -28,13 +28,48 @@ enum sparc_cpu { #define ARCH_SUN4C_SUN4 0 #define ARCH_SUN4 0 -extern void mb(void); -extern void rmb(void); -extern void wmb(void); -extern void membar_storeload(void); -extern void membar_storeload_storestore(void); -extern void membar_storeload_loadload(void); -extern void membar_storestore_loadstore(void); +/* These are here in an effort to more fully work around Spitfire Errata + * #51. Essentially, if a memory barrier occurs soon after a mispredicted + * branch, the chip can stop executing instructions until a trap occurs. + * Therefore, if interrupts are disabled, the chip can hang forever. + * + * It used to be believed that the memory barrier had to be right in the + * delay slot, but a case has been traced recently wherein the memory barrier + * was one instruction after the branch delay slot and the chip still hung. + * The offending sequence was the following in sym_wakeup_done() of the + * sym53c8xx_2 driver: + * + * call sym_ccb_from_dsa, 0 + * movge %icc, 0, %l0 + * brz,pn %o0, .LL1303 + * mov %o0, %l2 + * membar #LoadLoad + * + * The branch has to be mispredicted for the bug to occur. Therefore, we put + * the memory barrier explicitly into a "branch always, predicted taken" + * delay slot to avoid the problem case. + */ +#define membar_safe(type) \ +do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \ + " membar " type "\n" \ + "1:\n" \ + : : : "memory"); \ +} while (0) + +#define mb() \ + membar_safe("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad") +#define rmb() \ + membar_safe("#LoadLoad") +#define wmb() \ + membar_safe("#StoreStore") +#define membar_storeload() \ + membar_safe("#StoreLoad") +#define membar_storeload_storestore() \ + membar_safe("#StoreLoad | #StoreStore") +#define membar_storeload_loadload() \ + membar_safe("#StoreLoad | #LoadLoad") +#define membar_storestore_loadstore() \ + membar_safe("#StoreStore | #LoadStore") #endif -- cgit v1.2.3 From 7657ec1fcb69e266ab876af56332d0c484ca6d00 Mon Sep 17 00:00:00 2001 From: Evgeniy Polyakov Date: Wed, 17 Aug 2005 15:17:26 +0400 Subject: [PATCH] lib/crc16: added crc16 algorithm. Add the crc16 routines, as used by w1 devices. Signed-off-by: Ben Gardner Signed-off-by: Evgeniy Polyakov Signed-off-by: Greg Kroah-Hartman --- include/linux/crc16.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/linux/crc16.h (limited to 'include') diff --git a/include/linux/crc16.h b/include/linux/crc16.h new file mode 100644 index 00000000000..bdedf825b04 --- /dev/null +++ b/include/linux/crc16.h @@ -0,0 +1,44 @@ +/* + * crc16.h - CRC-16 routine + * + * Implements the standard CRC-16, as used with 1-wire devices: + * Width 16 + * Poly 0x8005 (x^16 + x^15 + x^2 + 1) + * Init 0 + * + * For 1-wire devices, the CRC is stored inverted, LSB-first + * + * Example buffer with the CRC attached: + * 31 32 33 34 35 36 37 38 39 C2 44 + * + * The CRC over a buffer with the CRC attached is 0xB001. + * So, if (crc16(0, buf, size) == 0xB001) then the buffer is valid. + * + * Refer to "Application Note 937: Book of iButton Standards" for details. + * http://www.maxim-ic.com/appnotes.cfm/appnote_number/937 + * + * Copyright (c) 2005 Ben Gardner + * + * This source code is licensed under the GNU General Public License, + * Version 2. See the file COPYING for more details. + */ + +#ifndef __CRC16_H +#define __CRC16_H + +#include + +#define CRC16_INIT 0 +#define CRC16_VALID 0xb001 + +extern u16 const crc16_table[256]; + +extern u16 crc16(u16 crc, const u8 *buffer, size_t len); + +static inline u16 crc16_byte(u16 crc, const u8 data) +{ + return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff]; +} + +#endif /* __CRC16_H */ + -- cgit v1.2.3 From 01357dcac62ac028de65a1c315eb75c530c8a5d6 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 8 Sep 2005 22:46:00 +0100 Subject: [MMC] Ensure correct mmc_priv() behaviour mmc_priv() has some nasty effects if the wrong pointer type is passed to it. Introduce type checking, which also means we get the right type. Also add an additional member to mmc_host which is used to align host-private data appropriately. Signed-off-by: Russell King --- include/linux/mmc/host.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index c5d73c0cf6b..c1f021eddff 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -109,6 +109,8 @@ struct mmc_host { struct mmc_card *card_selected; /* the selected MMC card */ struct work_struct detect; + + unsigned long private[0] ____cacheline_aligned; }; extern struct mmc_host *mmc_alloc_host(int extra, struct device *); @@ -116,7 +118,11 @@ extern int mmc_add_host(struct mmc_host *); extern void mmc_remove_host(struct mmc_host *); extern void mmc_free_host(struct mmc_host *); -#define mmc_priv(x) ((void *)((x) + 1)) +static inline void *mmc_priv(struct mmc_host *host) +{ + return (void *)host->private; +} + #define mmc_dev(x) ((x)->dev) #define mmc_hostname(x) ((x)->class_dev.class_id) -- cgit v1.2.3 From 4e1491847ef5ca1c5a661601d5f96dcb7d90d2f0 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 8 Sep 2005 14:47:12 -0700 Subject: Fix up ARM serial driver compile failure Proud member of Uglyhacks'R'US. Acked-by: David S. Miller Acked-by: Russell King Signed-off-by: Linus Torvalds --- include/linux/serial_core.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 9b12fe73161..27db8da43aa 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -401,6 +401,9 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, #endif return 0; } +#ifndef SUPPORT_SYSRQ +#define uart_handle_sysrq_char(port,ch,regs) uart_handle_sysrq_char(port, 0, NULL) +#endif /* * We do the SysRQ and SAK checking like this... -- cgit v1.2.3 From c26971cbb39727b0b692c6236f890ba13046a663 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 8 Sep 2005 22:48:16 +0100 Subject: [MMC] Add mmc_detect_change() delay support for PXAMCI driver Allow PXA platforms to pass an appropriate delay value to the PXA MCI driver for delaying detection changes. Signed-Off-By: Richard Purdie Signed-off-by: Russell King --- include/asm-arm/arch-pxa/mmc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-arm/arch-pxa/mmc.h b/include/asm-arm/arch-pxa/mmc.h index 9718063a211..88c17dd02ed 100644 --- a/include/asm-arm/arch-pxa/mmc.h +++ b/include/asm-arm/arch-pxa/mmc.h @@ -9,6 +9,7 @@ struct mmc_host; struct pxamci_platform_data { unsigned int ocr_mask; /* available voltages */ + unsigned long detect_delay; /* delay in jiffies before detecting cards after interrupt */ int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *); int (*get_ro)(struct device *); void (*setpower)(struct device *, unsigned int); -- cgit v1.2.3 From d42c69972b853fd33a26c8c7405624be41a22136 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 6 Jul 2005 19:56:03 +0200 Subject: [PATCH] PCI: Run PCI driver initialization on local node Run PCI driver initialization on local node Instead of adding messy kmalloc_node()s everywhere run the PCI driver probe on the node local to the device. This would not have helped for IDE, but should for other more clean drivers that do more initialization in probe(). It won't help for drivers that do most of the work on first open (like many network drivers) Signed-off-by: Andi Kleen Signed-off-by: Greg Kroah-Hartman --- include/linux/mempolicy.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 94a46f38c53..58385ee1c0a 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h @@ -155,6 +155,7 @@ struct mempolicy *get_vma_policy(struct task_struct *task, extern void numa_default_policy(void); extern void numa_policy_init(void); +extern struct mempolicy default_policy; #else -- cgit v1.2.3 From 74d863ee8a9da2b0f31e0f977daf127807b2e9d2 Mon Sep 17 00:00:00 2001 From: "akpm@osdl.org" Date: Mon, 25 Jul 2005 23:28:14 -0700 Subject: [PATCH] PCI: Move PCI fixup data into r/o section Make PCI fixup data const, so it'll end up in a r/o section. This also fixes the conversion into ECOFF which gets broken by too many changes between r/w and r/o sections. Call it a hack but it's a change that's correct by itself. Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index bc4c40000c0..025bfc39771 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1067,7 +1067,7 @@ enum pci_fixup_pass { /* Anonymous variables would be nice... */ #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, hook) \ - static struct pci_fixup __pci_fixup_##name __attribute_used__ \ + static const struct pci_fixup __pci_fixup_##name __attribute_used__ \ __attribute__((__section__(#section))) = { vendor, device, hook }; #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ -- cgit v1.2.3 From 982245f01734e9d5a3ab98b2b2e9761ae7719094 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sun, 17 Jul 2005 04:22:20 +0200 Subject: [PATCH] PCI: remove CONFIG_PCI_NAMES This patch removes CONFIG_PCI_NAMES. Signed-off-by: Adrian Bunk Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 025bfc39771..e7a228f2fdd 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -562,11 +562,6 @@ struct pci_dev { struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled; /* has display of the rom attribute been enabled? */ struct bin_attribute *res_attr[DEVICE_COUNT_RESOURCE]; /* sysfs file for resources */ -#ifdef CONFIG_PCI_NAMES -#define PCI_NAME_SIZE 255 -#define PCI_NAME_HALF __stringify(43) /* less than half to handle slop */ - char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */ -#endif }; #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list) @@ -749,8 +744,6 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); unsigned int pci_scan_child_bus(struct pci_bus *bus); void pci_bus_add_device(struct pci_dev *dev); -void pci_name_device(struct pci_dev *dev); -char *pci_class_name(u32 class); void pci_read_bridge_bases(struct pci_bus *child); struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); @@ -1025,13 +1018,6 @@ static inline char *pci_name(struct pci_dev *pdev) return pdev->dev.bus_id; } -/* Some archs want to see the pretty pci name, so use this macro */ -#ifdef CONFIG_PCI_NAMES -#define pci_pretty_name(dev) ((dev)->pretty_name) -#else -#define pci_pretty_name(dev) "" -#endif - /* Some archs don't want to expose struct resource to userland as-is * in sysfs and /proc -- cgit v1.2.3 From 4352dfd5cd9172f1ee425924a463b43e6157b840 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 28 Jul 2005 11:37:33 -0700 Subject: [PATCH] PCI: clean up pci.h and split pci register info to separate header file. This cleans up some of the #ifdef CONFIG_PCI stuff up, and moves the pci register info out to a separate file, where it belongs. Eventually we can stop including this file from within pci.h, but lots of code needs to be audited first. Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 488 +++-------------------------------------------- include/linux/pci_regs.h | 447 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 477 insertions(+), 458 deletions(-) create mode 100644 include/linux/pci_regs.h (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index e7a228f2fdd..830c1bae56c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -19,436 +19,10 @@ #include -/* - * Under PCI, each device has 256 bytes of configuration address space, - * of which the first 64 bytes are standardized as follows: - */ -#define PCI_VENDOR_ID 0x00 /* 16 bits */ -#define PCI_DEVICE_ID 0x02 /* 16 bits */ -#define PCI_COMMAND 0x04 /* 16 bits */ -#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ -#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ -#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ -#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ -#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ -#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ -#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ -#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ -#define PCI_COMMAND_SERR 0x100 /* Enable SERR */ -#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ -#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ - -#define PCI_STATUS 0x06 /* 16 bits */ -#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ -#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ -#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ -#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ -#define PCI_STATUS_PARITY 0x100 /* Detected parity error */ -#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ -#define PCI_STATUS_DEVSEL_FAST 0x000 -#define PCI_STATUS_DEVSEL_MEDIUM 0x200 -#define PCI_STATUS_DEVSEL_SLOW 0x400 -#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ -#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ -#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ -#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ -#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ - -#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 - revision */ -#define PCI_REVISION_ID 0x08 /* Revision ID */ -#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ -#define PCI_CLASS_DEVICE 0x0a /* Device class */ - -#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ -#define PCI_LATENCY_TIMER 0x0d /* 8 bits */ -#define PCI_HEADER_TYPE 0x0e /* 8 bits */ -#define PCI_HEADER_TYPE_NORMAL 0 -#define PCI_HEADER_TYPE_BRIDGE 1 -#define PCI_HEADER_TYPE_CARDBUS 2 - -#define PCI_BIST 0x0f /* 8 bits */ -#define PCI_BIST_CODE_MASK 0x0f /* Return result */ -#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ -#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ - -/* - * Base addresses specify locations in memory or I/O space. - * Decoded size can be determined by writing a value of - * 0xffffffff to the register, and reading it back. Only - * 1 bits are decoded. - */ -#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ -#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ -#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ -#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ -#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ -#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ -#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ -#define PCI_BASE_ADDRESS_SPACE_IO 0x01 -#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 -#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 -#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ -#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ -#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ -#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ -#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL) -#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL) -/* bit 1 is reserved if address_space = 1 */ - -/* Header type 0 (normal devices) */ -#define PCI_CARDBUS_CIS 0x28 -#define PCI_SUBSYSTEM_VENDOR_ID 0x2c -#define PCI_SUBSYSTEM_ID 0x2e -#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ -#define PCI_ROM_ADDRESS_ENABLE 0x01 -#define PCI_ROM_ADDRESS_MASK (~0x7ffUL) - -#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ - -/* 0x35-0x3b are reserved */ -#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ -#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ -#define PCI_MIN_GNT 0x3e /* 8 bits */ -#define PCI_MAX_LAT 0x3f /* 8 bits */ - -/* Header type 1 (PCI-to-PCI bridges) */ -#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ -#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ -#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ -#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ -#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ -#define PCI_IO_LIMIT 0x1d -#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ -#define PCI_IO_RANGE_TYPE_16 0x00 -#define PCI_IO_RANGE_TYPE_32 0x01 -#define PCI_IO_RANGE_MASK (~0x0fUL) -#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ -#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ -#define PCI_MEMORY_LIMIT 0x22 -#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL -#define PCI_MEMORY_RANGE_MASK (~0x0fUL) -#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ -#define PCI_PREF_MEMORY_LIMIT 0x26 -#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL -#define PCI_PREF_RANGE_TYPE_32 0x00 -#define PCI_PREF_RANGE_TYPE_64 0x01 -#define PCI_PREF_RANGE_MASK (~0x0fUL) -#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ -#define PCI_PREF_LIMIT_UPPER32 0x2c -#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ -#define PCI_IO_LIMIT_UPPER16 0x32 -/* 0x34 same as for htype 0 */ -/* 0x35-0x3b is reserved */ -#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ -/* 0x3c-0x3d are same as for htype 0 */ -#define PCI_BRIDGE_CONTROL 0x3e -#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ -#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ -#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ -#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ -#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ -#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ -#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ - -/* Header type 2 (CardBus bridges) */ -#define PCI_CB_CAPABILITY_LIST 0x14 -/* 0x15 reserved */ -#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ -#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ -#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ -#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ -#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ -#define PCI_CB_MEMORY_BASE_0 0x1c -#define PCI_CB_MEMORY_LIMIT_0 0x20 -#define PCI_CB_MEMORY_BASE_1 0x24 -#define PCI_CB_MEMORY_LIMIT_1 0x28 -#define PCI_CB_IO_BASE_0 0x2c -#define PCI_CB_IO_BASE_0_HI 0x2e -#define PCI_CB_IO_LIMIT_0 0x30 -#define PCI_CB_IO_LIMIT_0_HI 0x32 -#define PCI_CB_IO_BASE_1 0x34 -#define PCI_CB_IO_BASE_1_HI 0x36 -#define PCI_CB_IO_LIMIT_1 0x38 -#define PCI_CB_IO_LIMIT_1_HI 0x3a -#define PCI_CB_IO_RANGE_MASK (~0x03UL) -/* 0x3c-0x3d are same as for htype 0 */ -#define PCI_CB_BRIDGE_CONTROL 0x3e -#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ -#define PCI_CB_BRIDGE_CTL_SERR 0x02 -#define PCI_CB_BRIDGE_CTL_ISA 0x04 -#define PCI_CB_BRIDGE_CTL_VGA 0x08 -#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 -#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ -#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ -#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ -#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 -#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 -#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 -#define PCI_CB_SUBSYSTEM_ID 0x42 -#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ -/* 0x48-0x7f reserved */ - -/* Capability lists */ - -#define PCI_CAP_LIST_ID 0 /* Capability ID */ -#define PCI_CAP_ID_PM 0x01 /* Power Management */ -#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ -#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ -#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ -#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ -#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ -#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ -#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ -#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ -#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ -#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ -#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ -#define PCI_CAP_SIZEOF 4 - -/* Power Management Registers */ - -#define PCI_PM_PMC 2 /* PM Capabilities Register */ -#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */ -#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */ -#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */ -#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */ -#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */ -#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ -#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ -#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */ -#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */ -#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */ -#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */ -#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */ -#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */ -#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */ -#define PCI_PM_CTRL 4 /* PM control and status register */ -#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ -#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ -#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */ -#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */ -#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ -#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */ -#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */ -#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */ -#define PCI_PM_DATA_REGISTER 7 /* (??) */ -#define PCI_PM_SIZEOF 8 - -/* AGP registers */ - -#define PCI_AGP_VERSION 2 /* BCD version number */ -#define PCI_AGP_RFU 3 /* Rest of capability flags */ -#define PCI_AGP_STATUS 4 /* Status register */ -#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ -#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ -#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */ -#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */ -#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */ -#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */ -#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */ -#define PCI_AGP_COMMAND 8 /* Control register */ -#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ -#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ -#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ -#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ -#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ -#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ -#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ -#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ -#define PCI_AGP_SIZEOF 12 - -/* Vital Product Data */ - -#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */ -#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ -#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ -#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ - -/* Slot Identification */ - -#define PCI_SID_ESR 2 /* Expansion Slot Register */ -#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ -#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ -#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ - -/* Message Signalled Interrupts registers */ - -#define PCI_MSI_FLAGS 2 /* Various flags */ -#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */ -#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */ -#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */ -#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */ -#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */ -#define PCI_MSI_RFU 3 /* Rest of capability flags */ -#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ -#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ -#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ -#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ -#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ - -/* CompactPCI Hotswap Register */ - -#define PCI_CHSWP_CSR 2 /* Control and Status Register */ -#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */ -#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */ -#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */ -#define PCI_CHSWP_LOO 0x08 /* LED On / Off */ -#define PCI_CHSWP_PI 0x30 /* Programming Interface */ -#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */ -#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */ - -/* PCI-X registers */ - -#define PCI_X_CMD 2 /* Modes & Features */ -#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ -#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */ -#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */ -#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */ -#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */ -#define PCI_X_STATUS 4 /* PCI-X capabilities */ -#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */ -#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */ -#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */ -#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */ -#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */ -#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */ -#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */ -#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */ -#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */ -#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */ -#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ -#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ -#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ - -/* PCI Express capability registers */ - -#define PCI_EXP_FLAGS 2 /* Capabilities register */ -#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ -#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ -#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ -#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ -#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ -#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ -#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ -#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ -#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ -#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ -#define PCI_EXP_DEVCAP 4 /* Device capabilities */ -#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ -#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ -#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ -#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ -#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ -#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ -#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ -#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ -#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ -#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ -#define PCI_EXP_DEVCTL 8 /* Device Control */ -#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ -#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ -#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ -#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ -#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */ -#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ -#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ -#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ -#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ -#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */ -#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ -#define PCI_EXP_DEVSTA 10 /* Device Status */ -#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ -#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ -#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ -#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ -#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ -#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ -#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ -#define PCI_EXP_LNKCTL 16 /* Link Control */ -#define PCI_EXP_LNKSTA 18 /* Link Status */ -#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ -#define PCI_EXP_SLTCTL 24 /* Slot Control */ -#define PCI_EXP_SLTSTA 26 /* Slot Status */ -#define PCI_EXP_RTCTL 28 /* Root Control */ -#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ -#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ -#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ -#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ -#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ -#define PCI_EXP_RTCAP 30 /* Root Capabilities */ -#define PCI_EXP_RTSTA 32 /* Root Status */ - -/* Extended Capabilities (PCI-X 2.0 and Express) */ -#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) -#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) -#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) - -#define PCI_EXT_CAP_ID_ERR 1 -#define PCI_EXT_CAP_ID_VC 2 -#define PCI_EXT_CAP_ID_DSN 3 -#define PCI_EXT_CAP_ID_PWR 4 - -/* Advanced Error Reporting */ -#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ -#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ -#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ -#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ -#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ -#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ -#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ -#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ -#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ -#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ -#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ -#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ -#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ - /* Same bits as above */ -#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ - /* Same bits as above */ -#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ -#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ -#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ -#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ -#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ -#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ -#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ - /* Same bits as above */ -#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ -#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ -#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ -#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ -#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ -#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ -#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ -#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ -#define PCI_ERR_ROOT_STATUS 48 -#define PCI_ERR_ROOT_COR_SRC 52 -#define PCI_ERR_ROOT_SRC 54 - -/* Virtual Channel */ -#define PCI_VC_PORT_REG1 4 -#define PCI_VC_PORT_REG2 8 -#define PCI_VC_PORT_CTRL 12 -#define PCI_VC_PORT_STATUS 14 -#define PCI_VC_RES_CAP 16 -#define PCI_VC_RES_CTRL 20 -#define PCI_VC_RES_STATUS 26 - -/* Power Budgeting */ -#define PCI_PWR_DSR 4 /* Data Select Register */ -#define PCI_PWR_DATA 8 /* Data Register */ -#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ -#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ -#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ -#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ -#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ -#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ -#define PCI_PWR_CAP 12 /* Capability */ -#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ +/* Include the pci register defines */ +#include /* Include the ID list */ - #include /* @@ -496,9 +70,9 @@ enum pci_mmap_state { typedef int __bitwise pci_power_t; -#define PCI_D0 ((pci_power_t __force) 0) -#define PCI_D1 ((pci_power_t __force) 1) -#define PCI_D2 ((pci_power_t __force) 2) +#define PCI_D0 ((pci_power_t __force) 0) +#define PCI_D1 ((pci_power_t __force) 1) +#define PCI_D2 ((pci_power_t __force) 2) #define PCI_D3hot ((pci_power_t __force) 3) #define PCI_D3cold ((pci_power_t __force) 4) #define PCI_POWER_ERROR ((pci_power_t __force) -1) @@ -577,15 +151,15 @@ struct pci_dev { * 7-10 bridges: address space assigned to buses behind the bridge */ -#define PCI_ROM_RESOURCE 6 -#define PCI_BRIDGE_RESOURCES 7 -#define PCI_NUM_RESOURCES 11 +#define PCI_ROM_RESOURCE 6 +#define PCI_BRIDGE_RESOURCES 7 +#define PCI_NUM_RESOURCES 11 #ifndef PCI_BUS_NUM_RESOURCES -#define PCI_BUS_NUM_RESOURCES 8 +#define PCI_BUS_NUM_RESOURCES 8 #endif - -#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ + +#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ struct pci_bus { struct list_head node; /* node in list of buses */ @@ -694,7 +268,7 @@ struct pci_driver { * @dev_class_mask: the class mask for this device * * This macro is used to create a struct pci_device_id that matches a - * specific PCI class. The vendor, device, subvendor, and subdevice + * specific PCI class. The vendor, device, subvendor, and subdevice * fields will be set to PCI_ANY_ID. */ #define PCI_DEVICE_CLASS(dev_class,dev_class_mask) \ @@ -702,7 +276,7 @@ struct pci_driver { .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID -/* +/* * pci_module_init is obsolete, this stays here till we fix up all usages of it * in the tree. */ @@ -905,18 +479,26 @@ extern void pci_disable_msix(struct pci_dev *dev); extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); #endif -#endif /* CONFIG_PCI */ - -/* Include architecture-dependent settings and functions */ +/* + * PCI domain support. Sometimes called PCI segment (eg by ACPI), + * a PCI domain is defined to be a set of PCI busses which share + * configuration space. + */ +#ifndef CONFIG_PCI_DOMAINS +static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } +static inline int pci_proc_domain(struct pci_bus *bus) +{ + return 0; +} +#endif -#include +#else /* CONFIG_PCI is not enabled */ /* * If the system does not have PCI, clearly these return errors. Define * these as simple inline functions to avoid hair in drivers. */ -#ifndef CONFIG_PCI #define _PCI_NOP(o,s,t) \ static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } @@ -967,21 +549,11 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) -#else +#endif /* CONFIG_PCI */ -/* - * PCI domain support. Sometimes called PCI segment (eg by ACPI), - * a PCI domain is defined to be a set of PCI busses which share - * configuration space. - */ -#ifndef CONFIG_PCI_DOMAINS -static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } -static inline int pci_proc_domain(struct pci_bus *bus) -{ - return 0; -} -#endif -#endif /* !CONFIG_PCI */ +/* Include architecture-dependent settings and functions */ + +#include /* these helpers provide future and backwards compatibility * for accessing popular PCI BAR info */ diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h new file mode 100644 index 00000000000..7dc391cad10 --- /dev/null +++ b/include/linux/pci_regs.h @@ -0,0 +1,447 @@ +/* + * pci_regs.h + * + * PCI standard defines + * Copyright 1994, Drew Eckhardt + * Copyright 1997--1999 Martin Mares + * + * For more information, please consult the following manuals (look at + * http://www.pcisig.com/ for how to get them): + * + * PCI BIOS Specification + * PCI Local Bus Specification + * PCI to PCI Bridge Specification + * PCI System Design Guide + */ + +#ifndef LINUX_PCI_REGS_H +#define LINUX_PCI_REGS_H + +/* + * Under PCI, each device has 256 bytes of configuration address space, + * of which the first 64 bytes are standardized as follows: + */ +#define PCI_VENDOR_ID 0x00 /* 16 bits */ +#define PCI_DEVICE_ID 0x02 /* 16 bits */ +#define PCI_COMMAND 0x04 /* 16 bits */ +#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ +#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ +#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ +#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ +#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ +#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ +#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ +#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ +#define PCI_COMMAND_SERR 0x100 /* Enable SERR */ +#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ +#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ + +#define PCI_STATUS 0x06 /* 16 bits */ +#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ +#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ +#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ +#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ +#define PCI_STATUS_PARITY 0x100 /* Detected parity error */ +#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ +#define PCI_STATUS_DEVSEL_FAST 0x000 +#define PCI_STATUS_DEVSEL_MEDIUM 0x200 +#define PCI_STATUS_DEVSEL_SLOW 0x400 +#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ +#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ +#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ +#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ +#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ + +#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */ +#define PCI_REVISION_ID 0x08 /* Revision ID */ +#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ +#define PCI_CLASS_DEVICE 0x0a /* Device class */ + +#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ +#define PCI_LATENCY_TIMER 0x0d /* 8 bits */ +#define PCI_HEADER_TYPE 0x0e /* 8 bits */ +#define PCI_HEADER_TYPE_NORMAL 0 +#define PCI_HEADER_TYPE_BRIDGE 1 +#define PCI_HEADER_TYPE_CARDBUS 2 + +#define PCI_BIST 0x0f /* 8 bits */ +#define PCI_BIST_CODE_MASK 0x0f /* Return result */ +#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ +#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ + +/* + * Base addresses specify locations in memory or I/O space. + * Decoded size can be determined by writing a value of + * 0xffffffff to the register, and reading it back. Only + * 1 bits are decoded. + */ +#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ +#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ +#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ +#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ +#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ +#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ +#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ +#define PCI_BASE_ADDRESS_SPACE_IO 0x01 +#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 +#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 +#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ +#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ +#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ +#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ +#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL) +#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL) +/* bit 1 is reserved if address_space = 1 */ + +/* Header type 0 (normal devices) */ +#define PCI_CARDBUS_CIS 0x28 +#define PCI_SUBSYSTEM_VENDOR_ID 0x2c +#define PCI_SUBSYSTEM_ID 0x2e +#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ +#define PCI_ROM_ADDRESS_ENABLE 0x01 +#define PCI_ROM_ADDRESS_MASK (~0x7ffUL) + +#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ + +/* 0x35-0x3b are reserved */ +#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ +#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ +#define PCI_MIN_GNT 0x3e /* 8 bits */ +#define PCI_MAX_LAT 0x3f /* 8 bits */ + +/* Header type 1 (PCI-to-PCI bridges) */ +#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ +#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ +#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ +#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ +#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ +#define PCI_IO_LIMIT 0x1d +#define PCI_IO_RANGE_TYPE_MASK 0x0fUL /* I/O bridging type */ +#define PCI_IO_RANGE_TYPE_16 0x00 +#define PCI_IO_RANGE_TYPE_32 0x01 +#define PCI_IO_RANGE_MASK (~0x0fUL) +#define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ +#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ +#define PCI_MEMORY_LIMIT 0x22 +#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL +#define PCI_MEMORY_RANGE_MASK (~0x0fUL) +#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ +#define PCI_PREF_MEMORY_LIMIT 0x26 +#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL +#define PCI_PREF_RANGE_TYPE_32 0x00 +#define PCI_PREF_RANGE_TYPE_64 0x01 +#define PCI_PREF_RANGE_MASK (~0x0fUL) +#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ +#define PCI_PREF_LIMIT_UPPER32 0x2c +#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ +#define PCI_IO_LIMIT_UPPER16 0x32 +/* 0x34 same as for htype 0 */ +/* 0x35-0x3b is reserved */ +#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_BRIDGE_CONTROL 0x3e +#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ +#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ +#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ +#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ +#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ +#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ +#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ + +/* Header type 2 (CardBus bridges) */ +#define PCI_CB_CAPABILITY_LIST 0x14 +/* 0x15 reserved */ +#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ +#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ +#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ +#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ +#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ +#define PCI_CB_MEMORY_BASE_0 0x1c +#define PCI_CB_MEMORY_LIMIT_0 0x20 +#define PCI_CB_MEMORY_BASE_1 0x24 +#define PCI_CB_MEMORY_LIMIT_1 0x28 +#define PCI_CB_IO_BASE_0 0x2c +#define PCI_CB_IO_BASE_0_HI 0x2e +#define PCI_CB_IO_LIMIT_0 0x30 +#define PCI_CB_IO_LIMIT_0_HI 0x32 +#define PCI_CB_IO_BASE_1 0x34 +#define PCI_CB_IO_BASE_1_HI 0x36 +#define PCI_CB_IO_LIMIT_1 0x38 +#define PCI_CB_IO_LIMIT_1_HI 0x3a +#define PCI_CB_IO_RANGE_MASK (~0x03UL) +/* 0x3c-0x3d are same as for htype 0 */ +#define PCI_CB_BRIDGE_CONTROL 0x3e +#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ +#define PCI_CB_BRIDGE_CTL_SERR 0x02 +#define PCI_CB_BRIDGE_CTL_ISA 0x04 +#define PCI_CB_BRIDGE_CTL_VGA 0x08 +#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 +#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ +#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ +#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 +#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 +#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 +#define PCI_CB_SUBSYSTEM_ID 0x42 +#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ +/* 0x48-0x7f reserved */ + +/* Capability lists */ + +#define PCI_CAP_LIST_ID 0 /* Capability ID */ +#define PCI_CAP_ID_PM 0x01 /* Power Management */ +#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ +#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ +#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ +#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ +#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ +#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ +#define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ +#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ +#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ +#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ +#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ +#define PCI_CAP_SIZEOF 4 + +/* Power Management Registers */ + +#define PCI_PM_PMC 2 /* PM Capabilities Register */ +#define PCI_PM_CAP_VER_MASK 0x0007 /* Version */ +#define PCI_PM_CAP_PME_CLOCK 0x0008 /* PME clock required */ +#define PCI_PM_CAP_RESERVED 0x0010 /* Reserved field */ +#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization */ +#define PCI_PM_CAP_AUX_POWER 0x01C0 /* Auxilliary power support mask */ +#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ +#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ +#define PCI_PM_CAP_PME 0x0800 /* PME pin supported */ +#define PCI_PM_CAP_PME_MASK 0xF800 /* PME Mask of all supported states */ +#define PCI_PM_CAP_PME_D0 0x0800 /* PME# from D0 */ +#define PCI_PM_CAP_PME_D1 0x1000 /* PME# from D1 */ +#define PCI_PM_CAP_PME_D2 0x2000 /* PME# from D2 */ +#define PCI_PM_CAP_PME_D3 0x4000 /* PME# from D3 (hot) */ +#define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */ +#define PCI_PM_CTRL 4 /* PM control and status register */ +#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ +#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ +#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */ +#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */ +#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ +#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions (??) */ +#define PCI_PM_PPB_B2_B3 0x40 /* Stop clock when in D3hot (??) */ +#define PCI_PM_BPCC_ENABLE 0x80 /* Bus power/clock control enable (??) */ +#define PCI_PM_DATA_REGISTER 7 /* (??) */ +#define PCI_PM_SIZEOF 8 + +/* AGP registers */ + +#define PCI_AGP_VERSION 2 /* BCD version number */ +#define PCI_AGP_RFU 3 /* Rest of capability flags */ +#define PCI_AGP_STATUS 4 /* Status register */ +#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ +#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ +#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */ +#define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */ +#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */ +#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */ +#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */ +#define PCI_AGP_COMMAND 8 /* Control register */ +#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ +#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ +#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ +#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ +#define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ +#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ +#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ +#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ +#define PCI_AGP_SIZEOF 12 + +/* Vital Product Data */ + +#define PCI_VPD_ADDR 2 /* Address to access (15 bits!) */ +#define PCI_VPD_ADDR_MASK 0x7fff /* Address mask */ +#define PCI_VPD_ADDR_F 0x8000 /* Write 0, 1 indicates completion */ +#define PCI_VPD_DATA 4 /* 32-bits of data returned here */ + +/* Slot Identification */ + +#define PCI_SID_ESR 2 /* Expansion Slot Register */ +#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ +#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ +#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ + +/* Message Signalled Interrupts registers */ + +#define PCI_MSI_FLAGS 2 /* Various flags */ +#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */ +#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */ +#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */ +#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */ +#define PCI_MSI_FLAGS_MASKBIT 0x100 /* 64-bit mask bits allowed */ +#define PCI_MSI_RFU 3 /* Rest of capability flags */ +#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ +#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ +#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ +#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ +#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ + +/* CompactPCI Hotswap Register */ + +#define PCI_CHSWP_CSR 2 /* Control and Status Register */ +#define PCI_CHSWP_DHA 0x01 /* Device Hiding Arm */ +#define PCI_CHSWP_EIM 0x02 /* ENUM# Signal Mask */ +#define PCI_CHSWP_PIE 0x04 /* Pending Insert or Extract */ +#define PCI_CHSWP_LOO 0x08 /* LED On / Off */ +#define PCI_CHSWP_PI 0x30 /* Programming Interface */ +#define PCI_CHSWP_EXT 0x40 /* ENUM# status - extraction */ +#define PCI_CHSWP_INS 0x80 /* ENUM# status - insertion */ + +/* PCI-X registers */ + +#define PCI_X_CMD 2 /* Modes & Features */ +#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ +#define PCI_X_CMD_ERO 0x0002 /* Enable Relaxed Ordering */ +#define PCI_X_CMD_MAX_READ 0x000c /* Max Memory Read Byte Count */ +#define PCI_X_CMD_MAX_SPLIT 0x0070 /* Max Outstanding Split Transactions */ +#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3) /* Version */ +#define PCI_X_STATUS 4 /* PCI-X capabilities */ +#define PCI_X_STATUS_DEVFN 0x000000ff /* A copy of devfn */ +#define PCI_X_STATUS_BUS 0x0000ff00 /* A copy of bus nr */ +#define PCI_X_STATUS_64BIT 0x00010000 /* 64-bit device */ +#define PCI_X_STATUS_133MHZ 0x00020000 /* 133 MHz capable */ +#define PCI_X_STATUS_SPL_DISC 0x00040000 /* Split Completion Discarded */ +#define PCI_X_STATUS_UNX_SPL 0x00080000 /* Unexpected Split Completion */ +#define PCI_X_STATUS_COMPLEX 0x00100000 /* Device Complexity */ +#define PCI_X_STATUS_MAX_READ 0x00600000 /* Designed Max Memory Read Count */ +#define PCI_X_STATUS_MAX_SPLIT 0x03800000 /* Designed Max Outstanding Split Transactions */ +#define PCI_X_STATUS_MAX_CUM 0x1c000000 /* Designed Max Cumulative Read Size */ +#define PCI_X_STATUS_SPL_ERR 0x20000000 /* Rcvd Split Completion Error Msg */ +#define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ +#define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ + +/* PCI Express capability registers */ + +#define PCI_EXP_FLAGS 2 /* Capabilities register */ +#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ +#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ +#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ +#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ +#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ +#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ +#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ +#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ +#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ +#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ +#define PCI_EXP_DEVCAP 4 /* Device capabilities */ +#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ +#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ +#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ +#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ +#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ +#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ +#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ +#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ +#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ +#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ +#define PCI_EXP_DEVCTL 8 /* Device Control */ +#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ +#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ +#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ +#define PCI_EXP_DEVCTL_RELAX_EN 0x0010 /* Enable relaxed ordering */ +#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ +#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ +#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ +#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ +#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800 /* Enable No Snoop */ +#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ +#define PCI_EXP_DEVSTA 10 /* Device Status */ +#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ +#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ +#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ +#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ +#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ +#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ +#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ +#define PCI_EXP_LNKCTL 16 /* Link Control */ +#define PCI_EXP_LNKSTA 18 /* Link Status */ +#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ +#define PCI_EXP_SLTCTL 24 /* Slot Control */ +#define PCI_EXP_SLTSTA 26 /* Slot Status */ +#define PCI_EXP_RTCTL 28 /* Root Control */ +#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ +#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ +#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ +#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ +#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ +#define PCI_EXP_RTCAP 30 /* Root Capabilities */ +#define PCI_EXP_RTSTA 32 /* Root Status */ + +/* Extended Capabilities (PCI-X 2.0 and Express) */ +#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) +#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf) +#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc) + +#define PCI_EXT_CAP_ID_ERR 1 +#define PCI_EXT_CAP_ID_VC 2 +#define PCI_EXT_CAP_ID_DSN 3 +#define PCI_EXT_CAP_ID_PWR 4 + +/* Advanced Error Reporting */ +#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ +#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ +#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ +#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ +#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ +#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ +#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ +#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ +#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ +#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ +#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ +#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ +#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ + /* Same bits as above */ +#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ + /* Same bits as above */ +#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ +#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ +#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ +#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ +#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ +#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ +#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ + /* Same bits as above */ +#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ +#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ +#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ +#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ +#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ +#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ +#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ +#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ +#define PCI_ERR_ROOT_STATUS 48 +#define PCI_ERR_ROOT_COR_SRC 52 +#define PCI_ERR_ROOT_SRC 54 + +/* Virtual Channel */ +#define PCI_VC_PORT_REG1 4 +#define PCI_VC_PORT_REG2 8 +#define PCI_VC_PORT_CTRL 12 +#define PCI_VC_PORT_STATUS 14 +#define PCI_VC_RES_CAP 16 +#define PCI_VC_RES_CTRL 20 +#define PCI_VC_RES_STATUS 26 + +/* Power Budgeting */ +#define PCI_PWR_DSR 4 /* Data Select Register */ +#define PCI_PWR_DATA 8 /* Data Register */ +#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ +#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ +#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ +#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ +#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ +#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ +#define PCI_PWR_CAP 12 /* Capability */ +#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ + +#endif /* LINUX_PCI_REGS_H */ -- cgit v1.2.3 From 064b53dbcc977dbf2753a67c2b8fc1c061d74f21 Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Wed, 27 Jul 2005 10:19:44 -0400 Subject: [PATCH] PCI: restore BAR values after D3hot->D0 for devices that need it Some PCI devices (e.g. 3c905B, 3c556B) lose all configuration (including BARs) when transitioning from D3hot->D0. This leaves such a device in an inaccessible state. The patch below causes the BARs to be restored when enabling such a device, so that its driver will be able to access it. The patch also adds pci_restore_bars as a new global symbol, and adds a correpsonding EXPORT_SYMBOL_GPL for that. Some firmware (e.g. Thinkpad T21) leaves devices in D3hot after a (re)boot. Most drivers call pci_enable_device very early, so devices left in D3hot that lose configuration during the D3hot->D0 transition will be inaccessible to their drivers. Drivers could be modified to account for this, but it would be difficult to know which drivers need modification. This is especially true since often many devices are covered by the same driver. It likely would be necessary to replicate code across dozens of drivers. The patch below should trigger only when transitioning from D3hot->D0 (or at boot), and only for devices that have the "no soft reset" bit cleared in the PM control register. I believe it is safe to include this patch as part of the PCI infrastructure. The cleanest implementation of pci_restore_bars was to call pci_update_resource. Unfortunately, that does not currently exist for the sparc64 architecture. The patch below includes a null implemenation of pci_update_resource for sparc64. Some have expressed interest in making general use of the the pci_restore_bars function, so that has been exported to GPL licensed modules. Signed-off-by: John W. Linville Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 2 ++ include/linux/pci_regs.h | 1 + 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 830c1bae56c..8878ccff9e3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -384,7 +384,9 @@ int pci_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); int pci_set_dma_mask(struct pci_dev *dev, u64 mask); int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); +void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); int pci_assign_resource(struct pci_dev *dev, int i); +void pci_restore_bars(struct pci_dev *dev); /* ROM control related routines */ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 7dc391cad10..e2a089b051e 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h @@ -222,6 +222,7 @@ #define PCI_PM_CAP_PME_D3cold 0x8000 /* PME# from D3 (cold) */ #define PCI_PM_CTRL 4 /* PM control and status register */ #define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ +#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004 /* No reset for D3hot->D0 */ #define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ #define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* Data select (??) */ #define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* Data scale (??) */ -- cgit v1.2.3 From 085ae41f66657a9655ce832b0a61832a06f0e1dc Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 8 Aug 2005 13:19:08 -0700 Subject: [PATCH] Make sparc64 use setup-res.c There were three changes necessary in order to allow sparc64 to use setup-res.c: 1) Sparc64 roots the PCI I/O and MEM address space using parent resources contained in the PCI controller structure. I'm actually surprised no other platforms do this, especially ones like Alpha and PPC{,64}. These resources get linked into the iomem/ioport tree when PCI controllers are probed. So the hierarchy looks like this: iomem --| PCI controller 1 MEM space --| device 1 device 2 etc. PCI controller 2 MEM space --| ... ioport --| PCI controller 1 IO space --| ... PCI controller 2 IO space --| ... You get the idea. The drivers/pci/setup-res.c code allocates using plain iomem_space and ioport_space as the root, so that wouldn't work with the above setup. So I added a pcibios_select_root() that is used to handle this. It uses the PCI controller struct's io_space and mem_space on sparc64, and io{port,mem}_resource on every other platform to keep current behavior. 2) quirk_io_region() is buggy. It takes in raw BUS view addresses and tries to use them as a PCI resource. pci_claim_resource() expects the resource to be fully formed when it gets called. The sparc64 implementation would do the translation but that's absolutely wrong, because if the same resource gets released then re-claimed we'll adjust things twice. So I fixed up quirk_io_region() to do the proper pcibios_bus_to_resource() conversion before passing it on to pci_claim_resource(). 3) I was mistakedly __init'ing the function methods the PCI controller drivers provide on sparc64 to implement some parts of these routines. This was, of course, easy to fix. So we end up with the following, and that nasty SPARC64 makefile ifdef in drivers/pci/Makefile is finally zapped. Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- include/asm-alpha/pci.h | 13 +++++++++++++ include/asm-arm/pci.h | 13 +++++++++++++ include/asm-generic/pci.h | 13 +++++++++++++ include/asm-ia64/pci.h | 13 +++++++++++++ include/asm-parisc/pci.h | 13 +++++++++++++ include/asm-ppc/pci.h | 13 +++++++++++++ include/asm-ppc64/pci.h | 13 +++++++++++++ include/asm-sparc64/pci.h | 2 ++ 8 files changed, 93 insertions(+) (limited to 'include') diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index f681e675b82..4e115f368d5 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -254,6 +254,19 @@ extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index static inline int pci_proc_domain(struct pci_bus *bus) diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 38ea5899a58..ead3ced38cb 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -64,6 +64,19 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + static inline void pcibios_add_platform_entries(struct pci_dev *dev) { } diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index ee1d8b5d816..c36a77d3bf4 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h @@ -30,6 +30,19 @@ pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, res->end = region->end; } +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; +} + #define pcibios_scan_all_fns(a, b) 0 #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index dba9f220be7..ef616fd4cb1 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -156,6 +156,19 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev, extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + #define pcibios_scan_all_fns(a, b) 0 #endif /* _ASM_IA64_PCI_H */ diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index 98d79a3d54f..d0b761f690b 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -257,6 +257,19 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + static inline void pcibios_add_platform_entries(struct pci_dev *dev) { } diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index a811e440c97..9dd06cd4009 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -109,6 +109,19 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + extern void pcibios_add_platform_entries(struct pci_dev *dev); struct file; diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 4d057452f59..a88bbfc2696 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h @@ -138,6 +138,19 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +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; +} + extern int unmap_bus_range(struct pci_bus *bus); diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index a4ab0ec7143..89bd71b1c0d 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -269,6 +269,8 @@ extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region); +extern struct resource *pcibios_select_root(struct pci_dev *, struct resource *); + static inline void pcibios_add_platform_entries(struct pci_dev *dev) { } -- cgit v1.2.3 From cecf4864cf52a4a243a62b2856a6a155edbb55e8 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Thu, 18 Aug 2005 14:33:01 +1000 Subject: [PATCH] PCI: Add pci_walk_bus function to PCI core (nonrecursive) The PCI error recovery infrastructure needs to be able to contact all the drivers affected by a PCI error event, which may mean traversing all the devices under a given PCI-PCI bridge. This patch adds a function to the PCI core that traverses all the PCI devices on a PCI bus and under any PCI-PCI bridges on that bus (and so on), calling a given function for each device. This provides a way for the error recovery code to iterate through all devices that are affected by an error event. This version is not implemented as a recursive function. Instead, when we reach a PCI-PCI bridge, we set the pointers to start doing the devices on the bus under the bridge, and when we reach the end of a bus's devices, we use the bus->self pointer to go back up to the next higher bus and continue doing its devices. Signed-off-by: Paul Mackerras Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 8878ccff9e3..b0e24471328 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -434,6 +434,9 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev); int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); +void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), + void *userdata); + /* kmem_cache style wrapper around pci_alloc_consistent() */ #include -- cgit v1.2.3 From 3fe9d19f9e86a55679f5f2b38ec0a43a1a510cee Mon Sep 17 00:00:00 2001 From: Daniel Ritz Date: Wed, 17 Aug 2005 15:32:19 -0700 Subject: [PATCH] PCI: Support PCM PM CAP version 3 - support PCI PM CAP version 3 (as defined in PCI PM Interface Spec v1.2) - pci/probe.c sets the PM state initially to 4 which is D3cold. add a PCI_UNKNOWN - minor cleanups Signed-off-by: Daniel Ritz Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index b0e24471328..7004dde7fef 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -75,6 +75,7 @@ typedef int __bitwise pci_power_t; #define PCI_D2 ((pci_power_t __force) 2) #define PCI_D3hot ((pci_power_t __force) 3) #define PCI_D3cold ((pci_power_t __force) 4) +#define PCI_UNKNOWN ((pci_power_t __force) 5) #define PCI_POWER_ERROR ((pci_power_t __force) -1) /* -- cgit v1.2.3 From a04ce0ffcaf561994ecf382cd3caad75556dc499 Mon Sep 17 00:00:00 2001 From: Brett M Russ Date: Mon, 15 Aug 2005 15:23:41 -0400 Subject: [PATCH] PCI/libata INTx cleanup Simple cleanup to eliminate X copies of the pci_enable_intx() function in libata. Moved ahci.c's pci_intx() to pci.c and use it throughout libata and msi.c. Signed-off-by: Brett Russ Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 7004dde7fef..6caaba0af46 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -383,6 +383,7 @@ void pci_set_master(struct pci_dev *dev); #define HAVE_PCI_SET_MWI int pci_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); +void pci_intx(struct pci_dev *dev, int enable); int pci_set_dma_mask(struct pci_dev *dev, u64 mask); int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); -- cgit v1.2.3 From 61c8c158c828073cfebf11ca8e340727feafa038 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Thu, 8 Sep 2005 23:07:40 +0100 Subject: [ARM] 2892/1: remove gcc workaround for direct access to absolute memory addresses Patch from Nicolas Pitre It used to make a difference in the gcc-2.95 era. However these days modern gcc apparently got better at not being influenced by such constructs (which is good in general) and therefore such workaround is of no real advantage anymore. The good news is that gcc (from version 4.1.0) is now fixed with regards to the defficiency this workaround was trying to address. For those interested the patch can easily be backported to older gcc versions and can be found here: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/arm.c.diff?r1=1.476&r2=1.478 and also here: http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/gcc/config/arm/arm.c.diff?r1=text&tr1=1.476&r2=text&tr2=1.478&diff_format=u Signed-off-by: Nicolas Pitre Signed-off-by: Russell King --- include/asm-arm/arch-pxa/hardware.h | 18 +++--------------- include/asm-arm/arch-sa1100/hardware.h | 18 ++---------------- 2 files changed, 5 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index 72b04d846a2..cf35721cfa4 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h @@ -44,24 +44,12 @@ #ifndef __ASSEMBLY__ -#if 0 -# define __REG(x) (*((volatile u32 *)io_p2v(x))) -#else -/* - * This __REG() version gives the same results as the one above, except - * that we are fooling gcc somehow so it generates far better and smaller - * assembly code for access to contigous registers. It's a shame that gcc - * doesn't guess this by itself. - */ -#include -typedef struct { volatile u32 offset[4096]; } __regbase; -# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2] -# define __REG(x) __REGP(io_p2v(x)) -#endif +# define __REG(x) (*((volatile unsigned long *)io_p2v(x))) /* With indexed regs we don't want to feed the index through io_p2v() especially if it is a variable, otherwise horrible code will result. */ -# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y))) +# define __REG2(x,y) \ + (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) # define __PREG(x) (io_v2p((u32)&(x))) diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 10c62db3436..19c3b1e186b 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h @@ -49,23 +49,9 @@ ( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))< -#if 0 -# define __REG(x) (*((volatile u32 *)io_p2v(x))) -#else -/* - * This __REG() version gives the same results as the one above, except - * that we are fooling gcc somehow so it generates far better and smaller - * assembly code for access to contigous registers. It's a shame that gcc - * doesn't guess this by itself. - */ -typedef struct { volatile u32 offset[4096]; } __regbase; -# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2] -# define __REG(x) __REGP(io_p2v(x)) -#endif - -# define __PREG(x) (io_v2p((u32)&(x))) +# define __REG(x) (*((volatile unsigned long *)io_p2v(x))) +# define __PREG(x) (io_v2p((unsigned long)&(x))) #else -- cgit v1.2.3 From fbf82fd2e1f4e679c60516d772d1862c941ca845 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 31 Jul 2005 01:05:53 +0200 Subject: [PATCH] USB: real nodes instead of usbfs This patch introduces a /sys/class/usb_device/ class where every connected usb-device will show up: tree /sys/class/usb_device/ /sys/class/usb_device/ |-- usb1.1 | |-- dev | `-- device -> ../../../devices/pci0000:00/0000:00:1d.0/usb1 |-- usb2.1 | |-- dev | `-- device -> ../../../devices/pci0000:00/0000:00:1d.1/usb2 ... The presence of the "dev" file lets udev create real device nodes. kay@pim:~/src/linux-2.6> tree /dev/bus/usb/ /dev/bus/usb/ |-- 1 | `-- 1 |-- 2 | `-- 1 ... udev rule: SUBSYSTEM="usb_device", PROGRAM="/sbin/usb_device %k", NAME="%c" (echo $1 | /bin/sed 's/usb\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/') This makes libusb pick up the real nodes instead of the mounted usbfs: export USB_DEVFS_PATH=/dev/bus/usb Background: All this makes it possible to manage usb devices with udev instead of the devfs solution. We are currently working on a pam_console/resmgr replacement driven by udev and a pam-helper. It applies ACL's to device nodes, which is required for modern desktop functionalty like "Fast User Switching" or multiple local login support. New patch with its own major. I've succesfully disabled usbfs and use real nodes only on my box. With: "export USB_DEVFS_PATH=/dev/bus/usb" libusb picks up the udev managed nodes instead of reading usbfs files. This makes udev to provide symlinks for libusb to pick up: SUBSYSTEM="usb_device", PROGRAM="/sbin/usbdevice %k", SYMLINK="%c" /sbin/usbdevice: #!/bin/sh echo $1 | /bin/sed 's/usbdev\([0-9]*\)\.\([0-9]*\)/bus\/usb\/\1\/\2/' Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/usb.h b/include/linux/usb.h index 72463779299..434e35120c6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -5,6 +5,7 @@ #include #define USB_MAJOR 180 +#define USB_DEVICE_MAJOR 189 #ifdef __KERNEL__ @@ -349,6 +350,7 @@ struct usb_device { char *manufacturer; char *serial; /* static strings from the device */ struct list_head filelist; + struct class_device *class_dev; struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ /* -- cgit v1.2.3 From dc5bed091a7a5fe378055c30a2da874f77228b71 Mon Sep 17 00:00:00 2001 From: Olav Kongas Date: Thu, 4 Aug 2005 16:46:28 +0300 Subject: [PATCH] USB: isp116x-hcd: use fixed power-on-to-power-good-time This patch removes the power-on-to-power-good-time configuration option for isp116x-hcd. Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_isp116x.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h index 5f5a9d9bd6c..9f4fb562681 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb_isp116x.h @@ -26,8 +26,6 @@ struct isp116x_platform_data { /* Ganged port power switching (0) or individual port power switching (1) */ unsigned power_switching_mode:1; - /* Given port_power, msec/2 after power on till power good */ - u8 potpg; /* Hardware reset set/clear. If implemented, this function must: if set == 0, deassert chip's HW reset pin otherwise, assert chip's HW reset pin */ -- cgit v1.2.3 From d4d62861b5cdb0ecfcae448e4281623284de5d05 Mon Sep 17 00:00:00 2001 From: Olav Kongas Date: Thu, 4 Aug 2005 16:48:19 +0300 Subject: [PATCH] USB: isp116x-hcd: remove unnecessary ClockNotStop configuration option Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_isp116x.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h index 9f4fb562681..0d21407ccfc 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb_isp116x.h @@ -7,19 +7,17 @@ struct isp116x_platform_data { /* Enable internal resistors on downstream ports */ unsigned sel15Kres:1; - /* Chip's internal clock won't be stopped in suspended state. - Setting/unsetting this bit takes effect only if - 'remote_wakeup_enable' below is not set. */ - unsigned clknotstop:1; /* On-chip overcurrent protection */ unsigned oc_enable:1; /* INT output polarity */ unsigned int_act_high:1; /* INT edge or level triggered */ unsigned int_edge_triggered:1; - /* WAKEUP pin connected - NOT SUPPORTED */ - /* unsigned remote_wakeup_connected:1; */ - /* Wakeup by devices on usb bus enabled */ + /* Enable wakeup by devices on usb bus (e.g. wakeup + by attachment/detachment or by device activity + such as moving a mouse). When chosen, this option + prevents stopping internal clock, increasing + thereby power consumption in suspended state. */ unsigned remote_wakeup_enable:1; /* Switch or not to switch (keep always powered) */ unsigned no_power_switching:1; -- cgit v1.2.3 From 165c0f39390212d7a517b80c3bb61cb8f1782fef Mon Sep 17 00:00:00 2001 From: Olav Kongas Date: Thu, 4 Aug 2005 16:52:31 +0300 Subject: [PATCH] USB: isp116x-hcd: support only per-port power switching The isp116x chip will now always be in per-port power switching mode. Remove conf options to set any other mode. Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_isp116x.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h index 0d21407ccfc..c028d724be9 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb_isp116x.h @@ -19,11 +19,6 @@ struct isp116x_platform_data { prevents stopping internal clock, increasing thereby power consumption in suspended state. */ unsigned remote_wakeup_enable:1; - /* Switch or not to switch (keep always powered) */ - unsigned no_power_switching:1; - /* Ganged port power switching (0) or individual port - power switching (1) */ - unsigned power_switching_mode:1; /* Hardware reset set/clear. If implemented, this function must: if set == 0, deassert chip's HW reset pin otherwise, assert chip's HW reset pin */ -- cgit v1.2.3 From 9d233d9faedfd8a4ee22288c1fdc698a6f75db21 Mon Sep 17 00:00:00 2001 From: Olav Kongas Date: Thu, 4 Aug 2005 16:54:08 +0300 Subject: [PATCH] USB: isp116x-hcd: per-port overcurrent reporting This patch sets the isp116x to report overcurrent always per-port. Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_isp116x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h index c028d724be9..8f0b3c22696 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb_isp116x.h @@ -7,7 +7,7 @@ struct isp116x_platform_data { /* Enable internal resistors on downstream ports */ unsigned sel15Kres:1; - /* On-chip overcurrent protection */ + /* On-chip overcurrent detection */ unsigned oc_enable:1; /* INT output polarity */ unsigned int_act_high:1; -- cgit v1.2.3 From f8d23d309809ae69c763520dababb7e845938272 Mon Sep 17 00:00:00 2001 From: Olav Kongas Date: Thu, 4 Aug 2005 17:02:54 +0300 Subject: [PATCH] USB: isp116x-hcd: remove clock() and reset() This patch removes support for user-provided platform-specific hardware reset and clock starting/stopping functions. Hardware reset was needed earlier as getting the software reset working was tricky due to the lack of documentation. Recently, a number of people using isp116x have said the software reset is working for them. I haven't heard of anybody using the clock starting/stopping. Signed-off-by: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_isp116x.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h index 8f0b3c22696..436dd8a2b64 100644 --- a/include/linux/usb_isp116x.h +++ b/include/linux/usb_isp116x.h @@ -19,15 +19,6 @@ struct isp116x_platform_data { prevents stopping internal clock, increasing thereby power consumption in suspended state. */ unsigned remote_wakeup_enable:1; - /* Hardware reset set/clear. If implemented, this function must: - if set == 0, deassert chip's HW reset pin - otherwise, assert chip's HW reset pin */ - void (*reset) (struct device * dev, int set); - /* Hardware clock start/stop. If implemented, this function must: - if start == 0, stop the external clock - otherwise, start the external clock - */ - void (*clock) (struct device * dev, int start); /* Inter-io delay (ns). The chip is picky about access timings; it expects at least: 150ns delay between consecutive accesses to DATA_REG, -- cgit v1.2.3 From b375a0495fd622037560c73c05f23ae6f127bb0c Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 29 Jul 2005 16:11:07 -0400 Subject: [PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel 29 July 2005, Cambridge, MA: This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK flag from the Linux kernel. Mr. Stern explained, "This flag is a relic from an earlier, less-well-designed system. For over a year it hasn't been used for anything other than printing warning messages." An anonymous spokesman for the Linux kernel development community commented, "This is exactly the sort of thing we see happening all the time. As the kernel evolves, support for old techniques and old code can be jettisoned and replaced by newer, better approaches. Proprietary operating systems do not have the freedom or flexibility to change so quickly." Mr. Stern, a staff member at Harvard University's Rowland Institute who works on Linux only as a hobby, noted that the patch (labelled as548) did not update two files, keyspan.c and option.c, in the USB drivers' "serial" subdirectory. "Those files need more extensive changes," he remarked. "They examine the status field of several URBs at times when they're not supposed to. That will need to be fixed before the URB_ASYNC_UNLINK flag is removed." Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all of Linux's USB drivers, did not respond to our inquiries or return our calls. His only comment was "Applied, thanks." Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'include') diff --git a/include/linux/usb.h b/include/linux/usb.h index 434e35120c6..4dbe580f933 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -616,7 +616,6 @@ extern int usb_disabled(void); #define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame ignored */ #define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ #define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */ -#define URB_ASYNC_UNLINK 0x0010 /* usb_unlink_urb() returns asap */ #define URB_NO_FSBR 0x0020 /* UHCI-specific */ #define URB_ZERO_PACKET 0x0040 /* Finish bulk OUTs with short packet */ #define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt needed */ @@ -724,13 +723,7 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *); * Initialization: * * All URBs submitted must initialize the dev, pipe, transfer_flags (may be - * zero), and complete fields. - * The URB_ASYNC_UNLINK transfer flag affects later invocations of - * the usb_unlink_urb() routine. Note: Failure to set URB_ASYNC_UNLINK - * with usb_unlink_urb() is deprecated. For synchronous unlinks use - * usb_kill_urb() instead. - * - * All URBs must also initialize + * zero), and complete fields. All URBs must also initialize * transfer_buffer and transfer_buffer_length. They may provide the * URB_SHORT_NOT_OK transfer flag, indicating that short reads are * to be treated as errors; that flag is invalid for write requests. -- cgit v1.2.3 From 910ce396a88b84b99377f7c46888a1ff9a86ded3 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 9 Sep 2005 09:32:14 +1000 Subject: [PATCH] m68knommu: ColdFire 523x processor register definitions ColdFire 523x processor hardware register definitions. Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- include/asm-m68knommu/m523xsim.h | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/asm-m68knommu/m523xsim.h (limited to 'include') diff --git a/include/asm-m68knommu/m523xsim.h b/include/asm-m68knommu/m523xsim.h new file mode 100644 index 00000000000..926cfb805df --- /dev/null +++ b/include/asm-m68knommu/m523xsim.h @@ -0,0 +1,46 @@ +/****************************************************************************/ + +/* + * m523xsim.h -- ColdFire 523x System Integration Module support. + * + * (C) Copyright 2003-2005, Greg Ungerer + */ + +/****************************************************************************/ +#ifndef m523xsim_h +#define m523xsim_h +/****************************************************************************/ + +#include + +/* + * Define the 523x SIM register set addresses. + */ +#define MCFICM_INTC0 0x0c00 /* Base for Interrupt Ctrl 0 */ +#define MCFICM_INTC1 0x0d00 /* Base for Interrupt Ctrl 0 */ +#define MCFINTC_IPRH 0x00 /* Interrupt pending 32-63 */ +#define MCFINTC_IPRL 0x04 /* Interrupt pending 1-31 */ +#define MCFINTC_IMRH 0x08 /* Interrupt mask 32-63 */ +#define MCFINTC_IMRL 0x0c /* Interrupt mask 1-31 */ +#define MCFINTC_INTFRCH 0x10 /* Interrupt force 32-63 */ +#define MCFINTC_INTFRCL 0x14 /* Interrupt force 1-31 */ +#define MCFINTC_IRLR 0x18 /* */ +#define MCFINTC_IACKL 0x19 /* */ +#define MCFINTC_ICR0 0x40 /* Base ICR register */ + +#define MCFINT_VECBASE 64 /* Vector base number */ +#define MCFINT_UART0 13 /* Interrupt number for UART0 */ +#define MCFINT_PIT1 36 /* Interrupt number for PIT1 */ +#define MCFINT_QSPI 18 /* Interrupt number for QSPI */ + +/* + * SDRAM configuration registers. + */ +#define MCFSIM_DCR 0x44 /* SDRAM control */ +#define MCFSIM_DACR0 0x48 /* SDRAM base address 0 */ +#define MCFSIM_DMR0 0x4c /* SDRAM address mask 0 */ +#define MCFSIM_DACR1 0x50 /* SDRAM base address 1 */ +#define MCFSIM_DMR1 0x54 /* SDRAM address mask 1 */ + +/****************************************************************************/ +#endif /* m523xsim_h */ -- cgit v1.2.3 From 1bdd89db117a55c77a854829ff507d6d68ab6485 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 9 Sep 2005 09:32:14 +1000 Subject: [PATCH] m68knommu: defines to support the ColdFire 523x processor Add processor level and clock support defines for the ColdFire 523x processor. Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- include/asm-m68knommu/coldfire.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-m68knommu/coldfire.h b/include/asm-m68knommu/coldfire.h index 16f32cc80c4..1df3f666a28 100644 --- a/include/asm-m68knommu/coldfire.h +++ b/include/asm-m68knommu/coldfire.h @@ -22,7 +22,7 @@ #define MCF_MBAR2 0x80000000 #define MCF_IPSBAR 0x40000000 -#if defined(CONFIG_M527x) || defined(CONFIG_M528x) +#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) #undef MCF_MBAR #define MCF_MBAR MCF_IPSBAR #endif @@ -54,6 +54,8 @@ #define MCF_CLK 54000000 #elif defined(CONFIG_CLOCK_60MHz) #define MCF_CLK 60000000 +#elif defined(CONFIG_CLOCK_62_5MHz) +#define MCF_CLK 62500000 #elif defined(CONFIG_CLOCK_64MHz) #define MCF_CLK 64000000 #elif defined(CONFIG_CLOCK_66MHz) @@ -76,7 +78,7 @@ * One some ColdFire family members the bus clock (used by internal * peripherals) is not the same as the CPU clock. */ -#if defined(CONFIG_M5249) || defined(CONFIG_M527x) +#if defined(CONFIG_M523x) || defined(CONFIG_M5249) || defined(CONFIG_M527x) #define MCF_BUSCLK (MCF_CLK / 2) #else #define MCF_BUSCLK MCF_CLK -- cgit v1.2.3 From 7dbdd91fe67e3cd28af36d3853df38b92deec711 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 9 Sep 2005 09:32:14 +1000 Subject: [PATCH] m68knommu: include support for the ColdFire 523x processor UARTs Add support definitions for the integrated UARTs on the 523x ColdFire processor family. Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- include/asm-m68knommu/mcfuart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h index 54d4a85f4fd..9c1210613bc 100644 --- a/include/asm-m68knommu/mcfuart.h +++ b/include/asm-m68knommu/mcfuart.h @@ -29,7 +29,7 @@ #define MCFUART_BASE1 0x140 /* Base address of UART1 */ #define MCFUART_BASE2 0x180 /* Base address of UART2 */ #endif -#elif defined(CONFIG_M527x) || defined(CONFIG_M528x) +#elif defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) #define MCFUART_BASE1 0x200 /* Base address of UART1 */ #define MCFUART_BASE2 0x240 /* Base address of UART2 */ #define MCFUART_BASE3 0x280 /* Base address of UART3 */ -- cgit v1.2.3 From d9b9d5ddb827dc36cc1f7214f5818640e1bc22d5 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Fri, 9 Sep 2005 09:32:14 +1000 Subject: [PATCH] m68knommu: include ColdFire 523x processor register definitions Include the ColdFire 523x register definitions when compiling for that target processor. Signed-off-by: Greg Ungerer Signed-off-by: Linus Torvalds --- include/asm-m68knommu/mcfsim.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h index 522e513c2bc..b0c7736f7a9 100644 --- a/include/asm-m68knommu/mcfsim.h +++ b/include/asm-m68knommu/mcfsim.h @@ -15,13 +15,15 @@ #include /* - * Include 5204, 5206/e, 5249, 5270/5271, 5272, 5280/5282, 5307 or - * 5407 specific addresses. + * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, + * 5307 or 5407 specific addresses. */ #if defined(CONFIG_M5204) #include #elif defined(CONFIG_M5206) || defined(CONFIG_M5206e) #include +#elif defined(CONFIG_M523x) +#include #elif defined(CONFIG_M5249) #include #elif defined(CONFIG_M527x) -- cgit v1.2.3 From 507d37cf269ebbd1b32bcc435fe577e411f73151 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 9 Sep 2005 02:30:07 -0300 Subject: [CCID] Only call the HC insert_options methods when requested Signed-off-by: Arnaldo Carvalho de Melo --- include/linux/dccp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 007c290f74d..5e0af0d08a9 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h @@ -433,6 +433,8 @@ struct dccp_sock { struct ccid *dccps_hc_tx_ccid; struct dccp_options_received dccps_options_received; enum dccp_role dccps_role:2; + __u8 dccps_hc_rx_insert_options:1; + __u8 dccps_hc_tx_insert_options:1; }; static inline struct dccp_sock *dccp_sk(const struct sock *sk) -- cgit v1.2.3 From b0e567806d16586629468c824dfb2e71155df7da Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 9 Sep 2005 02:38:35 -0300 Subject: [DCCP] Introduce dccp_timestamp To start the timestamps with 0.0ms, easing the integer maths in the CCIDs, this probably will be reworked to use the to be introduced struct timeval_offset infrastructure out of skb_get_timestamp, etc. Signed-off-by: Arnaldo Carvalho de Melo --- include/linux/dccp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 5e0af0d08a9..8bf4bacb505 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h @@ -432,6 +432,7 @@ struct dccp_sock { struct ccid *dccps_hc_rx_ccid; struct ccid *dccps_hc_tx_ccid; struct dccp_options_received dccps_options_received; + struct timeval dccps_epoch; enum dccp_role dccps_role:2; __u8 dccps_hc_rx_insert_options:1; __u8 dccps_hc_tx_insert_options:1; -- cgit v1.2.3 From a37c8875a764b4decf941859f4a2c63e1e86c8fa Mon Sep 17 00:00:00 2001 From: "jdl@freescale.com" Date: Wed, 7 Sep 2005 15:27:09 -0500 Subject: [PATCH] powerpc: Standardize on _ASM_POWERPC header symbol prefix Standardize on _ASM_POWERPC_... prefix for all #include exclusion symbols. Fixup all the non-compilers. Signed-off-by: Jon Loeliger Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-powerpc/8253pit.h | 8 ++++---- include/asm-powerpc/agp.h | 8 +++----- include/asm-powerpc/bugs.h | 6 +++--- include/asm-powerpc/errno.h | 6 +++--- include/asm-powerpc/ioctl.h | 6 +++--- include/asm-powerpc/ioctls.h | 6 +++--- include/asm-powerpc/linkage.h | 6 +++--- include/asm-powerpc/mc146818rtc.h | 6 +++--- include/asm-powerpc/mman.h | 6 +++--- include/asm-powerpc/module.h | 6 +++--- include/asm-powerpc/namei.h | 14 +++++++------- include/asm-powerpc/poll.h | 6 +++--- include/asm-powerpc/sembuf.h | 6 +++--- include/asm-powerpc/shmbuf.h | 6 +++--- include/asm-powerpc/shmparam.h | 6 +++--- include/asm-powerpc/siginfo.h | 6 +++--- include/asm-powerpc/socket.h | 6 +++--- include/asm-powerpc/sockios.h | 6 +++--- include/asm-powerpc/string.h | 6 +++--- include/asm-powerpc/termbits.h | 6 +++--- include/asm-powerpc/termios.h | 6 +++--- include/asm-powerpc/unaligned.h | 9 +++++---- 22 files changed, 73 insertions(+), 74 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/8253pit.h b/include/asm-powerpc/8253pit.h index 862708a749b..b70d6e53b30 100644 --- a/include/asm-powerpc/8253pit.h +++ b/include/asm-powerpc/8253pit.h @@ -1,10 +1,10 @@ +#ifndef _ASM_POWERPC_8253PIT_H +#define _ASM_POWERPC_8253PIT_H + /* * 8253/8254 Programmable Interval Timer */ -#ifndef _8253PIT_H -#define _8253PIT_H - #define PIT_TICK_RATE 1193182UL -#endif +#endif /* _ASM_POWERPC_8253PIT_H */ diff --git a/include/asm-powerpc/agp.h b/include/asm-powerpc/agp.h index ca9e423307f..885b4631a6c 100644 --- a/include/asm-powerpc/agp.h +++ b/include/asm-powerpc/agp.h @@ -1,10 +1,8 @@ -#ifndef AGP_H -#define AGP_H 1 +#ifndef _ASM_POWERPC_AGP_H +#define _ASM_POWERPC_AGP_H #include -/* nothing much needed here */ - #define map_page_into_agp(page) #define unmap_page_from_agp(page) #define flush_agp_mappings() @@ -20,4 +18,4 @@ #define free_gatt_pages(table, order) \ free_pages((unsigned long)(table), (order)) -#endif +#endif /* _ASM_POWERPC_AGP_H */ diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h index 310187d0e33..f5caee8558b 100644 --- a/include/asm-powerpc/bugs.h +++ b/include/asm-powerpc/bugs.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_BUGS_H -#define _POWERPC_BUGS_H +#ifndef _ASM_POWERPC_BUGS_H +#define _ASM_POWERPC_BUGS_H /* * This program is free software; you can redistribute it and/or @@ -15,4 +15,4 @@ extern void check_bugs(void); -#endif /* _POWERPC_BUGS_H */ +#endif /* _ASM_POWERPC_BUGS_H */ diff --git a/include/asm-powerpc/errno.h b/include/asm-powerpc/errno.h index 19f20bd41ae..8c145fd17d8 100644 --- a/include/asm-powerpc/errno.h +++ b/include/asm-powerpc/errno.h @@ -1,5 +1,5 @@ -#ifndef _PPC_ERRNO_H -#define _PPC_ERRNO_H +#ifndef _ASM_POWERPC_ERRNO_H +#define _ASM_POWERPC_ERRNO_H #include @@ -8,4 +8,4 @@ #define _LAST_ERRNO 516 -#endif +#endif /* _ASM_POWERPC_ERRNO_H */ diff --git a/include/asm-powerpc/ioctl.h b/include/asm-powerpc/ioctl.h index 93c6acfdd0f..8eb99848c40 100644 --- a/include/asm-powerpc/ioctl.h +++ b/include/asm-powerpc/ioctl.h @@ -1,5 +1,5 @@ -#ifndef _PPC_IOCTL_H -#define _PPC_IOCTL_H +#ifndef _ASM_POWERPC_IOCTL_H +#define _ASM_POWERPC_IOCTL_H /* @@ -66,4 +66,4 @@ extern unsigned int __invalid_size_argument_for_IOC; #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) -#endif +#endif /* _ASM_POWERPC_IOCTL_H */ diff --git a/include/asm-powerpc/ioctls.h b/include/asm-powerpc/ioctls.h index f5b7f2b055e..5b94ff489b8 100644 --- a/include/asm-powerpc/ioctls.h +++ b/include/asm-powerpc/ioctls.h @@ -1,5 +1,5 @@ -#ifndef _ASM_PPC_IOCTLS_H -#define _ASM_PPC_IOCTLS_H +#ifndef _ASM_POWERPC_IOCTLS_H +#define _ASM_POWERPC_IOCTLS_H #include @@ -104,4 +104,4 @@ #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ -#endif /* _ASM_PPC_IOCTLS_H */ +#endif /* _ASM_POWERPC_IOCTLS_H */ diff --git a/include/asm-powerpc/linkage.h b/include/asm-powerpc/linkage.h index 291c2d01c44..e1c4ac1cc4b 100644 --- a/include/asm-powerpc/linkage.h +++ b/include/asm-powerpc/linkage.h @@ -1,6 +1,6 @@ -#ifndef __ASM_LINKAGE_H -#define __ASM_LINKAGE_H +#ifndef _ASM_POWERPC_LINKAGE_H +#define _ASM_POWERPC_LINKAGE_H /* Nothing to see here... */ -#endif +#endif /* _ASM_POWERPC_LINKAGE_H */ diff --git a/include/asm-powerpc/mc146818rtc.h b/include/asm-powerpc/mc146818rtc.h index a5619a2a139..f2741c8b59a 100644 --- a/include/asm-powerpc/mc146818rtc.h +++ b/include/asm-powerpc/mc146818rtc.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_MC146818RTC_H -#define _POWERPC_MC146818RTC_H +#ifndef _ASM_POWERPC_MC146818RTC_H +#define _ASM_POWERPC_MC146818RTC_H /* * Machine dependent access functions for RTC registers. @@ -33,4 +33,4 @@ outb_p((val),RTC_PORT(1)); \ }) #endif /* __KERNEL__ */ -#endif /* _POWERPC_MC146818RTC_H */ +#endif /* _ASM_POWERPC_MC146818RTC_H */ diff --git a/include/asm-powerpc/mman.h b/include/asm-powerpc/mman.h index f2d55988d74..f5e5342fcac 100644 --- a/include/asm-powerpc/mman.h +++ b/include/asm-powerpc/mman.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_MMAN_H -#define _POWERPC_MMAN_H +#ifndef _ASM_POWERPC_MMAN_H +#define _ASM_POWERPC_MMAN_H /* * This program is free software; you can redistribute it and/or @@ -49,4 +49,4 @@ #define MAP_ANON MAP_ANONYMOUS #define MAP_FILE 0 -#endif /* _POWERPC_MMAN_H */ +#endif /* _ASM_POWERPC_MMAN_H */ diff --git a/include/asm-powerpc/module.h b/include/asm-powerpc/module.h index 4438f4fd652..7ecd05e0305 100644 --- a/include/asm-powerpc/module.h +++ b/include/asm-powerpc/module.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_MODULE_H -#define _POWERPC_MODULE_H +#ifndef _ASM_POWERPC_MODULE_H +#define _ASM_POWERPC_MODULE_H /* * This program is free software; you can redistribute it and/or @@ -74,4 +74,4 @@ struct exception_table_entry; void sort_ex_table(struct exception_table_entry *start, struct exception_table_entry *finish); -#endif /* _POWERPC_MODULE_H */ +#endif /* _ASM_POWERPC_MODULE_H */ diff --git a/include/asm-powerpc/namei.h b/include/asm-powerpc/namei.h index 29c9ec83213..657443474a6 100644 --- a/include/asm-powerpc/namei.h +++ b/include/asm-powerpc/namei.h @@ -1,14 +1,14 @@ +#ifndef _ASM_POWERPC_NAMEI_H +#define _ASM_POWERPC_NAMEI_H + +#ifdef __KERNEL__ + /* - * include/asm-ppc/namei.h * Adapted from include/asm-alpha/namei.h * * Included from fs/namei.c */ -#ifdef __KERNEL__ -#ifndef __PPC_NAMEI_H -#define __PPC_NAMEI_H - /* This dummy routine maybe changed to something useful * for /usr/gnemul/ emulation stuff. * Look at asm-sparc/namei.h for details. @@ -16,5 +16,5 @@ #define __emul_prefix() NULL -#endif /* __PPC_NAMEI_H */ -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_NAMEI_H */ diff --git a/include/asm-powerpc/poll.h b/include/asm-powerpc/poll.h index be5024913c6..edd2054da86 100644 --- a/include/asm-powerpc/poll.h +++ b/include/asm-powerpc/poll.h @@ -1,5 +1,5 @@ -#ifndef __PPC_POLL_H -#define __PPC_POLL_H +#ifndef _ASM_POWERPC_POLL_H +#define _ASM_POWERPC_POLL_H #define POLLIN 0x0001 #define POLLPRI 0x0002 @@ -20,4 +20,4 @@ struct pollfd { short revents; }; -#endif +#endif /* _ASM_POWERPC_POLL_H */ diff --git a/include/asm-powerpc/sembuf.h b/include/asm-powerpc/sembuf.h index c98fc18fe80..99a41938ae3 100644 --- a/include/asm-powerpc/sembuf.h +++ b/include/asm-powerpc/sembuf.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_SEMBUF_H -#define _POWERPC_SEMBUF_H +#ifndef _ASM_POWERPC_SEMBUF_H +#define _ASM_POWERPC_SEMBUF_H /* * This program is free software; you can redistribute it and/or @@ -33,4 +33,4 @@ struct semid64_ds { unsigned long __unused4; }; -#endif /* _POWERPC_SEMBUF_H */ +#endif /* _ASM_POWERPC_SEMBUF_H */ diff --git a/include/asm-powerpc/shmbuf.h b/include/asm-powerpc/shmbuf.h index 29632db3b17..dca582a4f68 100644 --- a/include/asm-powerpc/shmbuf.h +++ b/include/asm-powerpc/shmbuf.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_SHMBUF_H -#define _POWERPC_SHMBUF_H +#ifndef _ASM_POWERPC_SHMBUF_H +#define _ASM_POWERPC_SHMBUF_H /* * This program is free software; you can redistribute it and/or @@ -56,4 +56,4 @@ struct shminfo64 { unsigned long __unused4; }; -#endif /* _POWERPC_SHMBUF_H */ +#endif /* _ASM_POWERPC_SHMBUF_H */ diff --git a/include/asm-powerpc/shmparam.h b/include/asm-powerpc/shmparam.h index d6250602ae6..5cda42a6d39 100644 --- a/include/asm-powerpc/shmparam.h +++ b/include/asm-powerpc/shmparam.h @@ -1,6 +1,6 @@ -#ifndef _PPC_SHMPARAM_H -#define _PPC_SHMPARAM_H +#ifndef _ASM_POWERPC_SHMPARAM_H +#define _ASM_POWERPC_SHMPARAM_H #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ -#endif /* _PPC_SHMPARAM_H */ +#endif /* _ASM_POWERPC_SHMPARAM_H */ diff --git a/include/asm-powerpc/siginfo.h b/include/asm-powerpc/siginfo.h index ae70b8010b1..538ea8ef509 100644 --- a/include/asm-powerpc/siginfo.h +++ b/include/asm-powerpc/siginfo.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_SIGINFO_H -#define _POWERPC_SIGINFO_H +#ifndef _ASM_POWERPC_SIGINFO_H +#define _ASM_POWERPC_SIGINFO_H /* * This program is free software; you can redistribute it and/or @@ -15,4 +15,4 @@ #include -#endif /* _POWERPC_SIGINFO_H */ +#endif /* _ASM_POWERPC_SIGINFO_H */ diff --git a/include/asm-powerpc/socket.h b/include/asm-powerpc/socket.h index 51a0cf5ee9f..e4b8177d4ac 100644 --- a/include/asm-powerpc/socket.h +++ b/include/asm-powerpc/socket.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_SOCKET_H -#define _POWERPC_SOCKET_H +#ifndef _ASM_POWERPC_SOCKET_H +#define _ASM_POWERPC_SOCKET_H /* * This program is free software; you can redistribute it and/or @@ -56,4 +56,4 @@ #define SO_PEERSEC 31 -#endif /* _POWERPC_SOCKET_H */ +#endif /* _ASM_POWERPC_SOCKET_H */ diff --git a/include/asm-powerpc/sockios.h b/include/asm-powerpc/sockios.h index ef7ff664167..590078d8ed2 100644 --- a/include/asm-powerpc/sockios.h +++ b/include/asm-powerpc/sockios.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_SOCKIOS_H -#define _POWERPC_SOCKIOS_H +#ifndef _ASM_POWERPC_SOCKIOS_H +#define _ASM_POWERPC_SOCKIOS_H /* * This program is free software; you can redistribute it and/or @@ -16,4 +16,4 @@ #define SIOCATMARK 0x8905 #define SIOCGSTAMP 0x8906 /* Get stamp */ -#endif /* _POWERPC_SOCKIOS_H */ +#endif /* _ASM_POWERPC_SOCKIOS_H */ diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h index 22557599739..8606a696c08 100644 --- a/include/asm-powerpc/string.h +++ b/include/asm-powerpc/string.h @@ -1,5 +1,5 @@ -#ifndef _PPC_STRING_H_ -#define _PPC_STRING_H_ +#ifndef _ASM_POWERPC_STRING_H +#define _ASM_POWERPC_STRING_H #ifdef __KERNEL__ @@ -29,4 +29,4 @@ extern void * memchr(const void *,int,__kernel_size_t); #endif /* __KERNEL__ */ -#endif +#endif /* _ASM_POWERPC_STRING_H */ diff --git a/include/asm-powerpc/termbits.h b/include/asm-powerpc/termbits.h index 2c5bf85a8c3..ebf6055481d 100644 --- a/include/asm-powerpc/termbits.h +++ b/include/asm-powerpc/termbits.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_TERMBITS_H -#define _POWERPC_TERMBITS_H +#ifndef _ASM_POWERPC_TERMBITS_H +#define _ASM_POWERPC_TERMBITS_H /* * This program is free software; you can redistribute it and/or @@ -188,4 +188,4 @@ struct termios { #define TCSADRAIN 1 #define TCSAFLUSH 2 -#endif /* _POWERPC_TERMBITS_H */ +#endif /* _ASM_POWERPC_TERMBITS_H */ diff --git a/include/asm-powerpc/termios.h b/include/asm-powerpc/termios.h index 237533bb0e9..c5b8e5358f8 100644 --- a/include/asm-powerpc/termios.h +++ b/include/asm-powerpc/termios.h @@ -1,5 +1,5 @@ -#ifndef _POWERPC_TERMIOS_H -#define _POWERPC_TERMIOS_H +#ifndef _ASM_POWERPC_TERMIOS_H +#define _ASM_POWERPC_TERMIOS_H /* * Liberally adapted from alpha/termios.h. In particular, the c_cc[] @@ -233,4 +233,4 @@ struct termio { #endif /* __KERNEL__ */ -#endif /* _POWERPC_TERMIOS_H */ +#endif /* _ASM_POWERPC_TERMIOS_H */ diff --git a/include/asm-powerpc/unaligned.h b/include/asm-powerpc/unaligned.h index 45520d9b85d..6c95dfa2652 100644 --- a/include/asm-powerpc/unaligned.h +++ b/include/asm-powerpc/unaligned.h @@ -1,6 +1,7 @@ +#ifndef _ASM_POWERPC_UNALIGNED_H +#define _ASM_POWERPC_UNALIGNED_H + #ifdef __KERNEL__ -#ifndef __PPC_UNALIGNED_H -#define __PPC_UNALIGNED_H /* * The PowerPC can do unaligned accesses itself in big endian mode. @@ -14,5 +15,5 @@ #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) -#endif -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_UNALIGNED_H */ -- cgit v1.2.3 From 64807081e38703617cf9a5d71db14ea2b3e1cb04 Mon Sep 17 00:00:00 2001 From: "jdl@freescale.com" Date: Wed, 7 Sep 2005 15:56:20 -0500 Subject: [PATCH] powerpc: Make check_bugs() static inline Make check_bugs() static inline and remove it from syscalls.c. Signed-off-by: Jon Loeliger Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-powerpc/bugs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-powerpc/bugs.h b/include/asm-powerpc/bugs.h index f5caee8558b..42fdb73e306 100644 --- a/include/asm-powerpc/bugs.h +++ b/include/asm-powerpc/bugs.h @@ -13,6 +13,6 @@ * architecture-dependent bugs. */ -extern void check_bugs(void); +static inline void check_bugs(void) { } #endif /* _ASM_POWERPC_BUGS_H */ -- cgit v1.2.3 From dd56fdf23dfa0127d512b73d4238dbd2b5a7c1eb Mon Sep 17 00:00:00 2001 From: "jdl@freescale.com" Date: Wed, 7 Sep 2005 15:59:48 -0500 Subject: [PATCH] powerpc: Merge a few more include files Merge a few asm-ppc and asm-ppc64 header files. Note: the merge of setup.h intentionally does not carry forward the m68k cruft. That means this patch continues to break the already broken amiga on the ppc32. Signed-off-by: Jon Loeliger Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-powerpc/msgbuf.h | 33 ++++++++++++++++++++ include/asm-powerpc/param.h | 24 +++++++++++++++ include/asm-powerpc/setup.h | 9 ++++++ include/asm-powerpc/timex.h | 49 +++++++++++++++++++++++++++++ include/asm-powerpc/topology.h | 70 ++++++++++++++++++++++++++++++++++++++++++ include/asm-powerpc/user.h | 55 +++++++++++++++++++++++++++++++++ include/asm-ppc/msgbuf.h | 25 --------------- include/asm-ppc/param.h | 24 --------------- include/asm-ppc/setup.h | 14 --------- include/asm-ppc/timex.h | 40 ------------------------ include/asm-ppc/topology.h | 6 ---- include/asm-ppc/user.h | 54 -------------------------------- include/asm-ppc64/msgbuf.h | 27 ---------------- include/asm-ppc64/param.h | 31 ------------------- include/asm-ppc64/setup.h | 6 ---- include/asm-ppc64/timex.h | 26 ---------------- include/asm-ppc64/topology.h | 69 ----------------------------------------- include/asm-ppc64/user.h | 58 ---------------------------------- 18 files changed, 240 insertions(+), 380 deletions(-) create mode 100644 include/asm-powerpc/msgbuf.h create mode 100644 include/asm-powerpc/param.h create mode 100644 include/asm-powerpc/setup.h create mode 100644 include/asm-powerpc/timex.h create mode 100644 include/asm-powerpc/topology.h create mode 100644 include/asm-powerpc/user.h delete mode 100644 include/asm-ppc/msgbuf.h delete mode 100644 include/asm-ppc/param.h delete mode 100644 include/asm-ppc/setup.h delete mode 100644 include/asm-ppc/timex.h delete mode 100644 include/asm-ppc/topology.h delete mode 100644 include/asm-ppc/user.h delete mode 100644 include/asm-ppc64/msgbuf.h delete mode 100644 include/asm-ppc64/param.h delete mode 100644 include/asm-ppc64/setup.h delete mode 100644 include/asm-ppc64/timex.h delete mode 100644 include/asm-ppc64/topology.h delete mode 100644 include/asm-ppc64/user.h (limited to 'include') diff --git a/include/asm-powerpc/msgbuf.h b/include/asm-powerpc/msgbuf.h new file mode 100644 index 00000000000..dd76743c753 --- /dev/null +++ b/include/asm-powerpc/msgbuf.h @@ -0,0 +1,33 @@ +#ifndef _ASM_POWERPC_MSGBUF_H +#define _ASM_POWERPC_MSGBUF_H + +/* + * The msqid64_ds structure for the PowerPC architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + */ + +struct msqid64_ds { + struct ipc64_perm msg_perm; +#ifndef __powerpc64__ + unsigned int __unused1; +#endif + __kernel_time_t msg_stime; /* last msgsnd time */ +#ifndef __powerpc64__ + unsigned int __unused2; +#endif + __kernel_time_t msg_rtime; /* last msgrcv time */ +#ifndef __powerpc64__ + unsigned int __unused3; +#endif + __kernel_time_t msg_ctime; /* last change time */ + unsigned long msg_cbytes; /* current number of bytes on queue */ + unsigned long msg_qnum; /* number of messages in queue */ + unsigned long msg_qbytes; /* max number of bytes on queue */ + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ + __kernel_pid_t msg_lrpid; /* last receive pid */ + unsigned long __unused4; + unsigned long __unused5; +}; + +#endif /* _ASM_POWERPC_MSGBUF_H */ diff --git a/include/asm-powerpc/param.h b/include/asm-powerpc/param.h new file mode 100644 index 00000000000..bdc724f7088 --- /dev/null +++ b/include/asm-powerpc/param.h @@ -0,0 +1,24 @@ +#ifndef _ASM_POWERPC_PARAM_H +#define _ASM_POWERPC_PARAM_H + +#include + +#ifdef __KERNEL__ +#define HZ CONFIG_HZ /* internal kernel timer frequency */ +#define USER_HZ 100 /* for user interfaces in "ticks" */ +#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ +#endif /* __KERNEL__ */ + +#ifndef HZ +#define HZ 100 +#endif + +#define EXEC_PAGESIZE 4096 + +#ifndef NOGROUP +#define NOGROUP (-1) +#endif + +#define MAXHOSTNAMELEN 64 /* max length of hostname */ + +#endif /* _ASM_POWERPC_PARAM_H */ diff --git a/include/asm-powerpc/setup.h b/include/asm-powerpc/setup.h new file mode 100644 index 00000000000..3d9740aae01 --- /dev/null +++ b/include/asm-powerpc/setup.h @@ -0,0 +1,9 @@ +#ifndef _ASM_POWERPC_SETUP_H +#define _ASM_POWERPC_SETUP_H + +#ifdef __KERNEL__ + +#define COMMAND_LINE_SIZE 512 + +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_SETUP_H */ diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h new file mode 100644 index 00000000000..51c5b316be5 --- /dev/null +++ b/include/asm-powerpc/timex.h @@ -0,0 +1,49 @@ +#ifndef _ASM_POWERPC_TIMEX_H +#define _ASM_POWERPC_TIMEX_H + +#ifdef __KERNEL__ + +/* + * PowerPC architecture timex specifications + */ + +#include +#include + +#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ + +typedef unsigned long cycles_t; + +static inline cycles_t get_cycles(void) +{ + cycles_t ret; + +#ifdef __powerpc64__ + + __asm__ __volatile__("mftb %0" : "=r" (ret) : ); + +#else + /* + * For the "cycle" counter we use the timebase lower half. + * Currently only used on SMP. + */ + + ret = 0; + + __asm__ __volatile__( + "98: mftb %0\n" + "99:\n" + ".section __ftr_fixup,\"a\"\n" + " .long %1\n" + " .long 0\n" + " .long 98b\n" + " .long 99b\n" + ".previous" + : "=r" (ret) : "i" (CPU_FTR_601)); +#endif + + return ret; +} + +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_TIMEX_H */ diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h new file mode 100644 index 00000000000..2512e3836bf --- /dev/null +++ b/include/asm-powerpc/topology.h @@ -0,0 +1,70 @@ +#ifndef _ASM_POWERPC_TOPOLOGY_H +#define _ASM_POWERPC_TOPOLOGY_H + +#include + +#ifdef CONFIG_NUMA + +#include + +static inline int cpu_to_node(int cpu) +{ + int node; + + node = numa_cpu_lookup_table[cpu]; + +#ifdef DEBUG_NUMA + BUG_ON(node == -1); +#endif + + return node; +} + +#define parent_node(node) (node) + +static inline cpumask_t node_to_cpumask(int node) +{ + return numa_cpumask_lookup_table[node]; +} + +static inline int node_to_first_cpu(int node) +{ + cpumask_t tmp; + tmp = node_to_cpumask(node); + return first_cpu(tmp); +} + +#define pcibus_to_node(node) (-1) +#define pcibus_to_cpumask(bus) (cpu_online_map) + +#define nr_cpus_node(node) (nr_cpus_in_node[node]) + +/* sched_domains SD_NODE_INIT for PPC64 machines */ +#define SD_NODE_INIT (struct sched_domain) { \ + .span = CPU_MASK_NONE, \ + .parent = NULL, \ + .groups = NULL, \ + .min_interval = 8, \ + .max_interval = 32, \ + .busy_factor = 32, \ + .imbalance_pct = 125, \ + .cache_hot_time = (10*1000000), \ + .cache_nice_tries = 1, \ + .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_EXEC \ + | SD_BALANCE_NEWIDLE \ + | SD_WAKE_IDLE \ + | SD_WAKE_BALANCE, \ + .last_balance = jiffies, \ + .balance_interval = 1, \ + .nr_balance_failed = 0, \ +} + +#else + +#include + +#endif /* CONFIG_NUMA */ + +#endif /* _ASM_POWERPC_TOPOLOGY_H */ diff --git a/include/asm-powerpc/user.h b/include/asm-powerpc/user.h new file mode 100644 index 00000000000..e59ade4b3df --- /dev/null +++ b/include/asm-powerpc/user.h @@ -0,0 +1,55 @@ +#ifndef _ASM_POWERPC_USER_H +#define _ASM_POWERPC_USER_H + +#ifdef __KERNEL__ + +#include +#include + +/* + * Adapted from + * + * Core file format: The core file is written in such a way that gdb + * can understand it and provide useful information to the user (under + * linux we use the `trad-core' bfd, NOT the osf-core). The file contents + * are as follows: + * + * upage: 1 page consisting of a user struct that tells gdb + * what is present in the file. Directly after this is a + * copy of the task_struct, which is currently not used by gdb, + * but it may come in handy at some point. All of the registers + * are stored as part of the upage. The upage should always be + * only one page long. + * data: The data segment follows next. We use current->end_text to + * current->brk to pick up all of the user variables, plus any memory + * that may have been sbrk'ed. No attempt is made to determine if a + * page is demand-zero or if a page is totally unused, we just cover + * the entire range. All of the addresses are rounded in such a way + * that an integral number of pages is written. + * stack: We need the stack information in order to get a meaningful + * backtrace. We need to write the data from usp to + * current->start_stack, so we round each of these in order to be able + * to write an integer number of pages. + */ +struct user { + struct pt_regs regs; /* entire machine state */ + size_t u_tsize; /* text size (pages) */ + size_t u_dsize; /* data size (pages) */ + size_t u_ssize; /* stack size (pages) */ + unsigned long start_code; /* text starting address */ + unsigned long start_data; /* data starting address */ + unsigned long start_stack; /* stack starting address */ + long int signal; /* signal causing core dump */ + struct regs * u_ar0; /* help gdb find registers */ + unsigned long magic; /* identifies a core file */ + char u_comm[32]; /* user command name */ +}; + +#define NBPG PAGE_SIZE +#define UPAGES 1 +#define HOST_TEXT_START_ADDR (u.start_code) +#define HOST_DATA_START_ADDR (u.start_data) +#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) + +#endif /* __KERNEL__ */ +#endif /* _ASM_POWERPC_USER_H */ diff --git a/include/asm-ppc/msgbuf.h b/include/asm-ppc/msgbuf.h deleted file mode 100644 index 1053452a937..00000000000 --- a/include/asm-ppc/msgbuf.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _PPC_MSGBUF_H -#define _PPC_MSGBUF_H - -/* - * The msqid64_ds structure for the PPC architecture. - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - unsigned int __unused1; - __kernel_time_t msg_stime; /* last msgsnd time */ - unsigned int __unused2; - __kernel_time_t msg_rtime; /* last msgrcv time */ - unsigned int __unused3; - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused4; - unsigned long __unused5; -}; - -#endif /* _PPC_MSGBUF_H */ diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h deleted file mode 100644 index 6198b1657a4..00000000000 --- a/include/asm-ppc/param.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _ASM_PPC_PARAM_H -#define _ASM_PPC_PARAM_H - -#include - -#ifdef __KERNEL__ -#define HZ CONFIG_HZ /* internal timer frequency */ -#define USER_HZ 100 /* for user interfaces in "ticks" */ -#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ -#endif /* __KERNEL__ */ - -#ifndef HZ -#define HZ 100 -#endif - -#define EXEC_PAGESIZE 4096 - -#ifndef NOGROUP -#define NOGROUP (-1) -#endif - -#define MAXHOSTNAMELEN 64 /* max length of hostname */ - -#endif diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h deleted file mode 100644 index d2d19ee103d..00000000000 --- a/include/asm-ppc/setup.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifdef __KERNEL__ -#ifndef _PPC_SETUP_H -#define _PPC_SETUP_H - -#define m68k_num_memory num_memory -#define m68k_memory memory - -#include -/* We have a bigger command line buffer. */ -#undef COMMAND_LINE_SIZE -#define COMMAND_LINE_SIZE 512 - -#endif /* _PPC_SETUP_H */ -#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/timex.h b/include/asm-ppc/timex.h deleted file mode 100644 index cffc8712077..00000000000 --- a/include/asm-ppc/timex.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * include/asm-ppc/timex.h - * - * ppc architecture timex specifications - */ -#ifdef __KERNEL__ -#ifndef _ASMppc_TIMEX_H -#define _ASMppc_TIMEX_H - -#include -#include - -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - -typedef unsigned long cycles_t; - -/* - * For the "cycle" counter we use the timebase lower half. - * Currently only used on SMP. - */ - -static inline cycles_t get_cycles(void) -{ - cycles_t ret = 0; - - __asm__ __volatile__( - "98: mftb %0\n" - "99:\n" - ".section __ftr_fixup,\"a\"\n" - " .long %1\n" - " .long 0\n" - " .long 98b\n" - " .long 99b\n" - ".previous" - : "=r" (ret) : "i" (CPU_FTR_601)); - return ret; -} - -#endif -#endif /* __KERNEL__ */ diff --git a/include/asm-ppc/topology.h b/include/asm-ppc/topology.h deleted file mode 100644 index 6a029bbba6e..00000000000 --- a/include/asm-ppc/topology.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_PPC_TOPOLOGY_H -#define _ASM_PPC_TOPOLOGY_H - -#include - -#endif /* _ASM_PPC_TOPOLOGY_H */ diff --git a/include/asm-ppc/user.h b/include/asm-ppc/user.h deleted file mode 100644 index d662b215137..00000000000 --- a/include/asm-ppc/user.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifdef __KERNEL__ -#ifndef _PPC_USER_H -#define _PPC_USER_H - -/* Adapted from */ - -#include -#include - -/* - * Core file format: The core file is written in such a way that gdb - * can understand it and provide useful information to the user (under - * linux we use the `trad-core' bfd, NOT the osf-core). The file contents - * are as follows: - * - * upage: 1 page consisting of a user struct that tells gdb - * what is present in the file. Directly after this is a - * copy of the task_struct, which is currently not used by gdb, - * but it may come in handy at some point. All of the registers - * are stored as part of the upage. The upage should always be - * only one page long. - * data: The data segment follows next. We use current->end_text to - * current->brk to pick up all of the user variables, plus any memory - * that may have been sbrk'ed. No attempt is made to determine if a - * page is demand-zero or if a page is totally unused, we just cover - * the entire range. All of the addresses are rounded in such a way - * that an integral number of pages is written. - * stack: We need the stack information in order to get a meaningful - * backtrace. We need to write the data from usp to - * current->start_stack, so we round each of these in order to be able - * to write an integer number of pages. - */ -struct user { - struct pt_regs regs; /* entire machine state */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - struct regs * u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_DATA_START_ADDR (u.start_data) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif /* _PPC_USER_H */ -#endif /* __KERNEL__ */ diff --git a/include/asm-ppc64/msgbuf.h b/include/asm-ppc64/msgbuf.h deleted file mode 100644 index 31c1cbf133c..00000000000 --- a/include/asm-ppc64/msgbuf.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _PPC64_MSGBUF_H -#define _PPC64_MSGBUF_H - -/* - * The msqid64_ds structure for the PPC architecture. - * - * 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. - */ - -struct msqid64_ds { - struct ipc64_perm msg_perm; - __kernel_time_t msg_stime; /* last msgsnd time */ - __kernel_time_t msg_rtime; /* last msgrcv time */ - __kernel_time_t msg_ctime; /* last change time */ - unsigned long msg_cbytes; /* current number of bytes on queue */ - unsigned long msg_qnum; /* number of messages in queue */ - unsigned long msg_qbytes; /* max number of bytes on queue */ - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ - __kernel_pid_t msg_lrpid; /* last receive pid */ - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _PPC64_MSGBUF_H */ diff --git a/include/asm-ppc64/param.h b/include/asm-ppc64/param.h deleted file mode 100644 index 76c212d475b..00000000000 --- a/include/asm-ppc64/param.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _ASM_PPC64_PARAM_H -#define _ASM_PPC64_PARAM_H - -#include - -/* - * 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. - */ - -#ifdef __KERNEL__ -# define HZ CONFIG_HZ /* Internal kernel timer frequency */ -# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ -# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ -#endif - -#ifndef HZ -#define HZ 100 -#endif - -#define EXEC_PAGESIZE 4096 - -#ifndef NOGROUP -#define NOGROUP (-1) -#endif - -#define MAXHOSTNAMELEN 64 /* max length of hostname */ - -#endif /* _ASM_PPC64_PARAM_H */ diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h deleted file mode 100644 index b257b8348c7..00000000000 --- a/include/asm-ppc64/setup.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _PPC_SETUP_H -#define _PPC_SETUP_H - -#define COMMAND_LINE_SIZE 512 - -#endif /* _PPC_SETUP_H */ diff --git a/include/asm-ppc64/timex.h b/include/asm-ppc64/timex.h deleted file mode 100644 index 8db4da4064c..00000000000 --- a/include/asm-ppc64/timex.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * linux/include/asm-ppc/timex.h - * - * PPC64 architecture timex specifications - * - * 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 _ASMPPC64_TIMEX_H -#define _ASMPPC64_TIMEX_H - -#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ - -typedef unsigned long cycles_t; - -static inline cycles_t get_cycles(void) -{ - cycles_t ret; - - __asm__ __volatile__("mftb %0" : "=r" (ret) : ); - return ret; -} - -#endif diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h deleted file mode 100644 index 1e9b1907323..00000000000 --- a/include/asm-ppc64/topology.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _ASM_PPC64_TOPOLOGY_H -#define _ASM_PPC64_TOPOLOGY_H - -#include -#include - -#ifdef CONFIG_NUMA - -static inline int cpu_to_node(int cpu) -{ - int node; - - node = numa_cpu_lookup_table[cpu]; - -#ifdef DEBUG_NUMA - BUG_ON(node == -1); -#endif - - return node; -} - -#define parent_node(node) (node) - -static inline cpumask_t node_to_cpumask(int node) -{ - return numa_cpumask_lookup_table[node]; -} - -static inline int node_to_first_cpu(int node) -{ - cpumask_t tmp; - tmp = node_to_cpumask(node); - return first_cpu(tmp); -} - -#define pcibus_to_node(node) (-1) -#define pcibus_to_cpumask(bus) (cpu_online_map) - -#define nr_cpus_node(node) (nr_cpus_in_node[node]) - -/* sched_domains SD_NODE_INIT for PPC64 machines */ -#define SD_NODE_INIT (struct sched_domain) { \ - .span = CPU_MASK_NONE, \ - .parent = NULL, \ - .groups = NULL, \ - .min_interval = 8, \ - .max_interval = 32, \ - .busy_factor = 32, \ - .imbalance_pct = 125, \ - .cache_hot_time = (10*1000000), \ - .cache_nice_tries = 1, \ - .per_cpu_gain = 100, \ - .flags = SD_LOAD_BALANCE \ - | SD_BALANCE_EXEC \ - | SD_BALANCE_NEWIDLE \ - | SD_WAKE_IDLE \ - | SD_WAKE_BALANCE, \ - .last_balance = jiffies, \ - .balance_interval = 1, \ - .nr_balance_failed = 0, \ -} - -#else - -#include - -#endif /* CONFIG_NUMA */ - -#endif /* _ASM_PPC64_TOPOLOGY_H */ diff --git a/include/asm-ppc64/user.h b/include/asm-ppc64/user.h deleted file mode 100644 index d7d6554a421..00000000000 --- a/include/asm-ppc64/user.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _PPC_USER_H -#define _PPC_USER_H - -/* Adapted from - * - * 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. - */ - -#include -#include - -/* - * Core file format: The core file is written in such a way that gdb - * can understand it and provide useful information to the user (under - * linux we use the `trad-core' bfd, NOT the osf-core). The file contents - * are as follows: - * - * upage: 1 page consisting of a user struct that tells gdb - * what is present in the file. Directly after this is a - * copy of the task_struct, which is currently not used by gdb, - * but it may come in handy at some point. All of the registers - * are stored as part of the upage. The upage should always be - * only one page long. - * data: The data segment follows next. We use current->end_text to - * current->brk to pick up all of the user variables, plus any memory - * that may have been sbrk'ed. No attempt is made to determine if a - * page is demand-zero or if a page is totally unused, we just cover - * the entire range. All of the addresses are rounded in such a way - * that an integral number of pages is written. - * stack: We need the stack information in order to get a meaningful - * backtrace. We need to write the data from usp to - * current->start_stack, so we round each of these in order to be able - * to write an integer number of pages. - */ -struct user { - struct pt_regs regs; /* entire machine state */ - size_t u_tsize; /* text size (pages) */ - size_t u_dsize; /* data size (pages) */ - size_t u_ssize; /* stack size (pages) */ - unsigned long start_code; /* text starting address */ - unsigned long start_data; /* data starting address */ - unsigned long start_stack; /* stack starting address */ - long int signal; /* signal causing core dump */ - struct regs * u_ar0; /* help gdb find registers */ - unsigned long magic; /* identifies a core file */ - char u_comm[32]; /* user command name */ -}; - -#define NBPG PAGE_SIZE -#define UPAGES 1 -#define HOST_TEXT_START_ADDR (u.start_code) -#define HOST_DATA_START_ADDR (u.start_data) -#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) - -#endif /* _PPC_USER_H */ -- cgit v1.2.3 From f9526785d8a03fd0e21f9cfc951adc03bde1c395 Mon Sep 17 00:00:00 2001 From: "jdl@freescale.com" Date: Thu, 8 Sep 2005 14:05:49 -0500 Subject: [PATCH] powerpc: Fix __power64__ typos that should be __powerpc64__ Fix __power64__ typo that should be __powerpc64__ instead. Signed-off-by: Jon Loeliger Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-powerpc/shmbuf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/shmbuf.h b/include/asm-powerpc/shmbuf.h index dca582a4f68..8efa39698b6 100644 --- a/include/asm-powerpc/shmbuf.h +++ b/include/asm-powerpc/shmbuf.h @@ -21,19 +21,19 @@ struct shmid64_ds { struct ipc64_perm shm_perm; /* operation perms */ -#ifndef __power64__ +#ifndef __powerpc64__ unsigned long __unused1; #endif __kernel_time_t shm_atime; /* last attach time */ -#ifndef __power64__ +#ifndef __powerpc64__ unsigned long __unused2; #endif __kernel_time_t shm_dtime; /* last detach time */ -#ifndef __power64__ +#ifndef __powerpc64__ unsigned long __unused3; #endif __kernel_time_t shm_ctime; /* last change time */ -#ifndef __power64__ +#ifndef __powerpc64__ unsigned long __unused4; #endif size_t shm_segsz; /* size of segment (bytes) */ -- cgit v1.2.3 From b28d2582ce8aafe531d909bb9c4dcf29189e786e Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 24 Aug 2005 11:56:56 -0500 Subject: [PATCH] ppc64: remove use of asm/segment.h Remove asm-ppc64/segment.h now that all users are gone. Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- include/asm-ppc64/segment.h | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 include/asm-ppc64/segment.h (limited to 'include') diff --git a/include/asm-ppc64/segment.h b/include/asm-ppc64/segment.h deleted file mode 100644 index d80fb68cc79..00000000000 --- a/include/asm-ppc64/segment.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __PPC64_SEGMENT_H -#define __PPC64_SEGMENT_H - -/* Only here because we have some old header files that expect it.. */ - -#endif /* __PPC64_SEGMENT_H */ -- cgit v1.2.3 From 1635317facea3094ddf34082cd86797efb1d9f7e Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 6 Sep 2005 13:17:54 +1000 Subject: [PATCH] Separate pci bits out of struct device_node This patch pulls the PCI-related junk out of struct device_node and puts it in a separate structure, struct pci_dn. The device_node now just has a void * pointer in it, which points to a struct pci_dn for nodes that represent PCI devices. It could potentially be used in future for device-specific data for other sorts of devices, such as virtual I/O devices. Signed-off-by: Paul Mackerras --- include/asm-ppc64/pci-bridge.h | 45 ++++++++++++++++++++++++++++++++++++------ include/asm-ppc64/prom.h | 19 +----------------- 2 files changed, 40 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h index c4f9023ea5e..6b4a5b1f695 100644 --- a/include/asm-ppc64/pci-bridge.h +++ b/include/asm-ppc64/pci-bridge.h @@ -48,19 +48,52 @@ struct pci_controller { unsigned long dma_window_size; }; +/* + * PCI stuff, for nodes representing PCI devices, pointed to + * by device_node->data. + */ +struct pci_controller; +struct iommu_table; + +struct pci_dn { + int busno; /* for pci devices */ + int bussubno; /* for pci devices */ + int devfn; /* for pci devices */ + int eeh_mode; /* See eeh.h for possible EEH_MODEs */ + int eeh_config_addr; + int eeh_capable; /* from firmware */ + int eeh_check_count; /* # times driver ignored error */ + int eeh_freeze_count; /* # times this device froze up. */ + int eeh_is_bridge; /* device is pci-to-pci bridge */ + + int pci_ext_config_space; /* for pci devices */ + struct pci_controller *phb; /* for pci devices */ + struct iommu_table *iommu_table; /* for phb's or bridges */ + struct pci_dev *pcidev; /* back-pointer to the pci device */ + struct device_node *node; /* back-pointer to the device_node */ + u32 config_space[16]; /* saved PCI config space */ +}; + +/* Get the pointer to a device_node's pci_dn */ +#define PCI_DN(dn) ((struct pci_dn *) (dn)->data) + struct device_node *fetch_dev_dn(struct pci_dev *dev); -/* Get a device_node from a pci_dev. This code must be fast except in the case - * where the sysdata is incorrect and needs to be fixed up (hopefully just once) +/* Get a device_node from a pci_dev. This code must be fast except + * in the case where the sysdata is incorrect and needs to be fixed + * up (this will only happen once). + * In this case the sysdata will have been inherited from a PCI host + * bridge or a PCI-PCI bridge further up the tree, so it will point + * to a valid struct pci_dn, just not the one we want. */ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev) { struct device_node *dn = dev->sysdata; + struct pci_dn *pdn = dn->data; - if (dn->devfn == dev->devfn && dn->busno == dev->bus->number) + if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number) return dn; /* fast path. sysdata is good */ - else - return fetch_dev_dn(dev); + return fetch_dev_dn(dev); } static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) @@ -83,7 +116,7 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus) struct device_node *busdn = bus->sysdata; BUG_ON(busdn == NULL); - return busdn->phb; + return PCI_DN(busdn)->phb; } #endif diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h index dc5330b3950..c02ec1d6b90 100644 --- a/include/asm-ppc64/prom.h +++ b/include/asm-ppc64/prom.h @@ -116,14 +116,6 @@ struct property { struct property *next; }; -/* NOTE: the device_node contains PCI specific info for pci devices. - * This perhaps could be hung off the device_node with another struct, - * but for now it is directly in the node. The phb ptr is a good - * indication of a real PCI node. Other nodes leave these fields zeroed. - */ -struct pci_controller; -struct iommu_table; - struct device_node { char *name; char *type; @@ -135,16 +127,6 @@ struct device_node { struct interrupt_info *intrs; char *full_name; - /* PCI stuff probably doesn't belong here */ - int busno; /* for pci devices */ - int bussubno; /* for pci devices */ - int devfn; /* for pci devices */ - int eeh_mode; /* See eeh.h for possible EEH_MODEs */ - int eeh_config_addr; - int pci_ext_config_space; /* for pci devices */ - struct pci_controller *phb; /* for pci devices */ - struct iommu_table *iommu_table; /* for phb's or bridges */ - struct property *properties; struct device_node *parent; struct device_node *child; @@ -154,6 +136,7 @@ struct device_node { struct proc_dir_entry *pde; /* this node's proc directory */ struct kref kref; unsigned long _flags; + void *data; }; extern struct device_node *of_chosen; -- cgit v1.2.3 From 86feeaa8120bb1b0ab21efed49e9754039395ef1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 9 Sep 2005 19:28:28 +0200 Subject: kbuild: full dependency check on asm-offsets.h Building asm-offsets.h has been moved to a seperate Kbuild file located in the top-level directory. This allow us to share the functionality across the architectures. The old rules in architecture specific Makefiles will die in subsequent patches. Furhtermore the usual kbuild dependency tracking is now used when deciding to rebuild asm-offsets.s. So we no longer risk to fail a rebuild caused by asm-offsets.c dependencies being touched. With this common rule-set we now force the same name across all architectures. Following patches will fix the rest. Signed-off-by: Sam Ravnborg --- include/asm-i386/thread_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h index e2cb9fa6f56..8fbf791651b 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-i386/thread_info.h @@ -48,7 +48,7 @@ struct thread_info { #else /* !__ASSEMBLY__ */ -#include +#include #endif -- cgit v1.2.3 From 6c9afc655d4df902211d00a437e893881cdef588 Mon Sep 17 00:00:00 2001 From: "viro@ZenIV.linux.org.uk" Date: Fri, 9 Sep 2005 16:50:43 +0100 Subject: [PATCH] basic iomem annotations (ppc64) Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-ppc64/eeh.h | 39 ++++++++++++++++++++------------------- include/asm-ppc64/io.h | 42 +++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 40 deletions(-) (limited to 'include') diff --git a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h index 94298b106a4..40c8eb57493 100644 --- a/include/asm-ppc64/eeh.h +++ b/include/asm-ppc64/eeh.h @@ -219,23 +219,24 @@ static inline void eeh_raw_writeq(u64 val, volatile void __iomem *addr) static inline void eeh_memset_io(volatile void __iomem *addr, int c, unsigned long n) { + void *p = (void __force *)addr; u32 lc = c; lc |= lc << 8; lc |= lc << 16; - while(n && !EEH_CHECK_ALIGN(addr, 4)) { - *((volatile u8 *)addr) = c; - addr = (void *)((unsigned long)addr + 1); + while(n && !EEH_CHECK_ALIGN(p, 4)) { + *((volatile u8 *)p) = c; + p++; n--; } while(n >= 4) { - *((volatile u32 *)addr) = lc; - addr = (void *)((unsigned long)addr + 4); + *((volatile u32 *)p) = lc; + p += 4; n -= 4; } while(n) { - *((volatile u8 *)addr) = c; - addr = (void *)((unsigned long)addr + 1); + *((volatile u8 *)p) = c; + p++; n--; } __asm__ __volatile__ ("sync" : : : "memory"); @@ -250,22 +251,22 @@ static inline void eeh_memcpy_fromio(void *dest, const volatile void __iomem *sr while(n && (!EEH_CHECK_ALIGN(vsrc, 4) || !EEH_CHECK_ALIGN(dest, 4))) { *((u8 *)dest) = *((volatile u8 *)vsrc); __asm__ __volatile__ ("eieio" : : : "memory"); - vsrc = (void *)((unsigned long)vsrc + 1); - dest = (void *)((unsigned long)dest + 1); + vsrc++; + dest++; n--; } while(n > 4) { *((u32 *)dest) = *((volatile u32 *)vsrc); __asm__ __volatile__ ("eieio" : : : "memory"); - vsrc = (void *)((unsigned long)vsrc + 4); - dest = (void *)((unsigned long)dest + 4); + vsrc += 4; + dest += 4; n -= 4; } while(n) { *((u8 *)dest) = *((volatile u8 *)vsrc); __asm__ __volatile__ ("eieio" : : : "memory"); - vsrc = (void *)((unsigned long)vsrc + 1); - dest = (void *)((unsigned long)dest + 1); + vsrc++; + dest++; n--; } __asm__ __volatile__ ("sync" : : : "memory"); @@ -286,20 +287,20 @@ static inline void eeh_memcpy_toio(volatile void __iomem *dest, const void *src, while(n && (!EEH_CHECK_ALIGN(vdest, 4) || !EEH_CHECK_ALIGN(src, 4))) { *((volatile u8 *)vdest) = *((u8 *)src); - src = (void *)((unsigned long)src + 1); - vdest = (void *)((unsigned long)vdest + 1); + src++; + vdest++; n--; } while(n > 4) { *((volatile u32 *)vdest) = *((volatile u32 *)src); - src = (void *)((unsigned long)src + 4); - vdest = (void *)((unsigned long)vdest + 4); + src += 4; + vdest += 4; n-=4; } while(n) { *((volatile u8 *)vdest) = *((u8 *)src); - src = (void *)((unsigned long)src + 1); - vdest = (void *)((unsigned long)vdest + 1); + src++; + vdest++; n--; } __asm__ __volatile__ ("sync" : : : "memory"); diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h index aba1dfa388b..59c958aea4d 100644 --- a/include/asm-ppc64/io.h +++ b/include/asm-ppc64/io.h @@ -20,10 +20,10 @@ #include -#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 *)(p), (a), (c)) -#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 *)(p), (a), (c)) -#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 *)(p), (a), (c)) -#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 *)(p), (a), (c)) +#define __ide_mm_insw(p, a, c) _insw_ns((volatile u16 __iomem *)(p), (a), (c)) +#define __ide_mm_insl(p, a, c) _insl_ns((volatile u32 __iomem *)(p), (a), (c)) +#define __ide_mm_outsw(p, a, c) _outsw_ns((volatile u16 __iomem *)(p), (a), (c)) +#define __ide_mm_outsl(p, a, c) _outsl_ns((volatile u32 __iomem *)(p), (a), (c)) #define SIO_CONFIG_RA 0x398 @@ -71,8 +71,8 @@ extern unsigned long io_page_mask; * Neither do the standard versions now, these are just here * for older code. */ -#define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) -#define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) +#define insw_ns(port, buf, ns) _insw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) +#define insl_ns(port, buf, nl) _insl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #else static inline unsigned char __raw_readb(const volatile void __iomem *addr) @@ -136,9 +136,9 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) #define insw_ns(port, buf, ns) eeh_insw_ns((port), (buf), (ns)) #define insl_ns(port, buf, nl) eeh_insl_ns((port), (buf), (nl)) -#define outsb(port, buf, ns) _outsb((u8 *)((port)+pci_io_base), (buf), (ns)) -#define outsw(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) -#define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) +#define outsb(port, buf, ns) _outsb((u8 __iomem *)((port)+pci_io_base), (buf), (ns)) +#define outsw(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) +#define outsl(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #endif @@ -147,16 +147,16 @@ static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) #define readl_relaxed(addr) readl(addr) #define readq_relaxed(addr) readq(addr) -extern void _insb(volatile u8 *port, void *buf, int ns); -extern void _outsb(volatile u8 *port, const void *buf, int ns); -extern void _insw(volatile u16 *port, void *buf, int ns); -extern void _outsw(volatile u16 *port, const void *buf, int ns); -extern void _insl(volatile u32 *port, void *buf, int nl); -extern void _outsl(volatile u32 *port, const void *buf, int nl); -extern void _insw_ns(volatile u16 *port, void *buf, int ns); -extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); -extern void _insl_ns(volatile u32 *port, void *buf, int nl); -extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); +extern void _insb(volatile u8 __iomem *port, void *buf, int ns); +extern void _outsb(volatile u8 __iomem *port, const void *buf, int ns); +extern void _insw(volatile u16 __iomem *port, void *buf, int ns); +extern void _outsw(volatile u16 __iomem *port, const void *buf, int ns); +extern void _insl(volatile u32 __iomem *port, void *buf, int nl); +extern void _outsl(volatile u32 __iomem *port, const void *buf, int nl); +extern void _insw_ns(volatile u16 __iomem *port, void *buf, int ns); +extern void _outsw_ns(volatile u16 __iomem *port, const void *buf, int ns); +extern void _insl_ns(volatile u32 __iomem *port, void *buf, int nl); +extern void _outsl_ns(volatile u32 __iomem *port, const void *buf, int nl); #define mmiowb() @@ -176,8 +176,8 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); * Neither do the standard versions now, these are just here * for older code. */ -#define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+pci_io_base), (buf), (ns)) -#define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) +#define outsw_ns(port, buf, ns) _outsw_ns((u16 __iomem *)((port)+pci_io_base), (buf), (ns)) +#define outsl_ns(port, buf, nl) _outsl_ns((u32 __iomem *)((port)+pci_io_base), (buf), (nl)) #define IO_SPACE_LIMIT ~(0UL) -- cgit v1.2.3 From 144a50ea5e1487b8b8e722289b4177713354448a Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 9 Aug 2005 00:20:10 -0400 Subject: [PATCH] must_check attributes for PCI layer. Self explanatory really. Some newer gcc's print a warning if a function is used and we don't check its result. We do this for a bunch of things in the kernel already, this extends that to the PCI layer. Based on a patch originally from Arjan van de Ven. Signed-off-by: Dave Jones Signed-off-by: Arjan van de Ven Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 6caaba0af46..609499356e0 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -376,32 +376,32 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); } -int pci_enable_device(struct pci_dev *dev); -int pci_enable_device_bars(struct pci_dev *dev, int mask); +int __must_check pci_enable_device(struct pci_dev *dev); +int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); void pci_disable_device(struct pci_dev *dev); void pci_set_master(struct pci_dev *dev); #define HAVE_PCI_SET_MWI -int pci_set_mwi(struct pci_dev *dev); +int __must_check pci_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); void pci_intx(struct pci_dev *dev, int enable); -int pci_set_dma_mask(struct pci_dev *dev, u64 mask); -int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); +int __must_check pci_set_dma_mask(struct pci_dev *dev, u64 mask); +int __must_check pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); int pci_assign_resource(struct pci_dev *dev, int i); void pci_restore_bars(struct pci_dev *dev); /* ROM control related routines */ -void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size); -void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); +void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); +void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); void pci_remove_rom(struct pci_dev *pdev); /* Power management related routines */ int pci_save_state(struct pci_dev *dev); int pci_restore_state(struct pci_dev *dev); -int pci_set_power_state(struct pci_dev *dev, pci_power_t state); -pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); -int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); +int __must_check pci_set_power_state(struct pci_dev *dev, pci_power_t state); +pci_power_t __must_check pci_choose_state(struct pci_dev *dev, pm_message_t state); +int __must_check pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ void pci_bus_assign_resources(struct pci_bus *bus); -- cgit v1.2.3 From 47003497dd819b10874a2291e54df7dc5cf8be57 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 9 Sep 2005 20:35:55 +0200 Subject: kbuild: arm26,sparc use generic asm-offset support Rename all includes to use asm-offsets.h to match generic name Signed-off-by: Sam Ravnborg --- include/asm-sparc/ptrace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/ptrace.h b/include/asm-sparc/ptrace.h index dd9d94d7e0a..a8ecb2d6977 100644 --- a/include/asm-sparc/ptrace.h +++ b/include/asm-sparc/ptrace.h @@ -73,11 +73,11 @@ extern void show_regs(struct pt_regs *); #endif /* - * The asm_offsets.h is a generated file, so we cannot include it. + * The asm-offsets.h is a generated file, so we cannot include it. * It may be OK for glibc headers, but it's utterly pointless for C code. * The assembly code using those offsets has to include it explicitly. */ -/* #include */ +/* #include */ /* These are for pt_regs. */ #define PT_PSR 0x0 -- cgit v1.2.3 From 0013a85454c281faaf064ccb576e373a2881aac8 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 9 Sep 2005 20:57:26 +0200 Subject: kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support Delete obsoleted parts form arch makefiles and rename to asm-offsets.h Signed-off-by: Sam Ravnborg --- include/asm-ia64/ptrace.h | 2 +- include/asm-ia64/thread_info.h | 2 +- include/asm-parisc/assembly.h | 2 +- include/asm-xtensa/ptrace.h | 2 +- include/asm-xtensa/uaccess.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index 0bef1953840..c8766def9ee 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h @@ -57,7 +57,7 @@ #include #include -#include +#include /* * Base-2 logarithm of number of pages to allocate per task structure diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 7dc8951708a..b2c79f0694f 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h @@ -5,7 +5,7 @@ #ifndef _ASM_IA64_THREAD_INFO_H #define _ASM_IA64_THREAD_INFO_H -#include +#include #include #include diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index cbc286f49b3..30b023411fe 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h @@ -63,7 +63,7 @@ .level 2.0w #endif -#include +#include #include #include diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index 2848a5ff834..aa4fd7fb3ce 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h @@ -127,7 +127,7 @@ extern void show_regs(struct pt_regs *); #else /* __ASSEMBLY__ */ #ifdef __KERNEL__ -# include +# include #define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE) #endif diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h index fc268ac923c..06a22b83ba1 100644 --- a/include/asm-xtensa/uaccess.h +++ b/include/asm-xtensa/uaccess.h @@ -25,7 +25,7 @@ #define _ASMLANGUAGE #include -#include +#include #include /* -- cgit v1.2.3 From e2d5df935d8a82cb7a2c50726628fa928aa89b9b Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 9 Sep 2005 21:28:48 +0200 Subject: kbuild: alpha,x86_64 use generic asm-offsets.h support Delete obsolete stuff from arch makefiles Rename .h file to asm-offsets.h Signed-off-by: Sam Ravnborg --- include/asm-x86_64/current.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/current.h b/include/asm-x86_64/current.h index 7db560ee6f7..bc8adecee66 100644 --- a/include/asm-x86_64/current.h +++ b/include/asm-x86_64/current.h @@ -17,7 +17,7 @@ static inline struct task_struct *get_current(void) #else #ifndef ASM_OFFSET_H -#include +#include #endif #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg -- cgit v1.2.3 From 048eb582f3f89737d4a29668de9935e6feea7c36 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 9 Sep 2005 22:32:31 +0200 Subject: kbuild: mips use generic asm-offsets.h support Removed obsolete stuff from arch makefile. mips had a special rule for generating asm-offsets.h so preserved it using an architecture specific hook in top-level Kbuild file. Renamed .h file to asm-offsets.h Signed-off-by: Sam Ravnborg --- include/asm-mips/asmmacro-32.h | 2 +- include/asm-mips/asmmacro-64.h | 2 +- include/asm-mips/sim.h | 2 +- include/asm-mips/stackframe.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h index ac8823df255..11daf5ceb7b 100644 --- a/include/asm-mips/asmmacro-32.h +++ b/include/asm-mips/asmmacro-32.h @@ -7,7 +7,7 @@ #ifndef _ASM_ASMMACRO_32_H #define _ASM_ASMMACRO_32_H -#include +#include #include #include #include diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h index bbed35511f5..559c355b9b8 100644 --- a/include/asm-mips/asmmacro-64.h +++ b/include/asm-mips/asmmacro-64.h @@ -8,7 +8,7 @@ #ifndef _ASM_ASMMACRO_64_H #define _ASM_ASMMACRO_64_H -#include +#include #include #include #include diff --git a/include/asm-mips/sim.h b/include/asm-mips/sim.h index 3ccfe09fa74..9c2af1b00e1 100644 --- a/include/asm-mips/sim.h +++ b/include/asm-mips/sim.h @@ -11,7 +11,7 @@ #include -#include +#include #define __str2(x) #x #define __str(x) __str2(x) diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index fb42f99f852..7b5e64600bc 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h @@ -15,7 +15,7 @@ #include #include -#include +#include .macro SAVE_AT .set push -- cgit v1.2.3 From abda24528ac3045511fb59291a2d6ccbddf30eda Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 9 Sep 2005 13:01:23 -0700 Subject: [PATCH] i386: CONFIG_ACPI_SRAT typo fix Fix a typo involving CONFIG_ACPI_SRAT. Signed-off-by: Magnus Damm Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/mmzone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 516421300ea..348fe3a4879 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -29,7 +29,7 @@ static inline void get_memcfg_numa(void) #ifdef CONFIG_X86_NUMAQ if (get_memcfg_numaq()) return; -#elif CONFIG_ACPI_SRAT +#elif defined(CONFIG_ACPI_SRAT) if (get_memcfg_from_srat()) return; #endif -- cgit v1.2.3 From 5e41ff9e0650f327a6c819841fa412da95d57319 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Fri, 9 Sep 2005 13:01:35 -0700 Subject: [PATCH] security: enable atomic inode security labeling The following patch set enables atomic security labeling of newly created inodes by altering the fs code to invoke a new LSM hook to obtain the security attribute to apply to a newly created inode and to set up the incore inode security state during the inode creation transaction. This parallels the existing processing for setting ACLs on newly created inodes. Otherwise, it is possible for new inodes to be accessed by another thread via the dcache prior to complete security setup (presently handled by the post_create/mkdir/... LSM hooks in the VFS) and a newly created inode may be left unlabeled on the disk in the event of a crash. SELinux presently works around the issue by ensuring that the incore inode security label is initialized to a special SID that is inaccessible to unprivileged processes (in accordance with policy), thereby preventing inappropriate access but potentially causing false denials on legitimate accesses. A simple test program demonstrates such false denials on SELinux, and the patch solves the problem. Similar such false denials have been encountered in real applications. This patch defines a new inode_init_security LSM hook to obtain the security attribute to apply to a newly created inode and to set up the incore inode security state for it, and adds a corresponding hook function implementation to SELinux. Signed-off-by: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/security.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'include') diff --git a/include/linux/security.h b/include/linux/security.h index 7aab6ab7c57..d4f3b7a94ea 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -250,6 +250,25 @@ struct swap_info_struct; * @inode contains the inode structure. * Deallocate the inode security structure and set @inode->i_security to * NULL. + * @inode_init_security: + * Obtain the security attribute name suffix and value to set on a newly + * created inode and set up the incore security field for the new inode. + * This hook is called by the fs code as part of the inode creation + * transaction and provides for atomic labeling of the inode, unlike + * the post_create/mkdir/... hooks called by the VFS. The hook function + * is expected to allocate the name and value via kmalloc, with the caller + * being responsible for calling kfree after using them. + * If the security module does not use security attributes or does + * not wish to put a security attribute on this particular inode, + * then it should return -EOPNOTSUPP to skip this processing. + * @inode contains the inode structure of the newly created inode. + * @dir contains the inode structure of the parent directory. + * @name will be set to the allocated name suffix (e.g. selinux). + * @value will be set to the allocated attribute value. + * @len will be set to the length of the value. + * Returns 0 if @name and @value have been successfully set, + * -EOPNOTSUPP if no security attribute is needed, or + * -ENOMEM on memory allocation failure. * @inode_create: * Check permission to create a regular file. * @dir contains inode structure of the parent of the new file. @@ -1080,6 +1099,8 @@ struct security_operations { int (*inode_alloc_security) (struct inode *inode); void (*inode_free_security) (struct inode *inode); + int (*inode_init_security) (struct inode *inode, struct inode *dir, + char **name, void **value, size_t *len); int (*inode_create) (struct inode *dir, struct dentry *dentry, int mode); void (*inode_post_create) (struct inode *dir, @@ -1442,6 +1463,17 @@ static inline void security_inode_free (struct inode *inode) return; security_ops->inode_free_security (inode); } + +static inline int security_inode_init_security (struct inode *inode, + struct inode *dir, + char **name, + void **value, + size_t *len) +{ + if (unlikely (IS_PRIVATE (inode))) + return -EOPNOTSUPP; + return security_ops->inode_init_security (inode, dir, name, value, len); +} static inline int security_inode_create (struct inode *dir, struct dentry *dentry, @@ -2171,6 +2203,15 @@ static inline int security_inode_alloc (struct inode *inode) static inline void security_inode_free (struct inode *inode) { } + +static inline int security_inode_init_security (struct inode *inode, + struct inode *dir, + char **name, + void **value, + size_t *len) +{ + return -EOPNOTSUPP; +} static inline int security_inode_create (struct inode *dir, struct dentry *dentry, -- cgit v1.2.3 From a74574aafea3a63add3251047601611111f44562 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Fri, 9 Sep 2005 13:01:44 -0700 Subject: [PATCH] Remove security_inode_post_create/mkdir/symlink/mknod hooks This patch removes the inode_post_create/mkdir/mknod/symlink LSM hooks as they are obsoleted by the new inode_init_security hook that enables atomic inode security labeling. If anyone sees any reason to retain these hooks, please speak now. Also, is anyone using the post_rename/link hooks; if not, those could also be removed. Signed-off-by: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/security.h | 90 ------------------------------------------------ 1 file changed, 90 deletions(-) (limited to 'include') diff --git a/include/linux/security.h b/include/linux/security.h index d4f3b7a94ea..875225bf898 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -275,12 +275,6 @@ struct swap_info_struct; * @dentry contains the dentry structure for the file to be created. * @mode contains the file mode of the file to be created. * Return 0 if permission is granted. - * @inode_post_create: - * Set the security attributes on a newly created regular file. This hook - * is called after a file has been successfully created. - * @dir contains the inode structure of the parent directory of the new file. - * @dentry contains the the dentry structure for the newly created file. - * @mode contains the file mode. * @inode_link: * Check permission before creating a new hard link to a file. * @old_dentry contains the dentry structure for an existing link to the file. @@ -303,13 +297,6 @@ struct swap_info_struct; * @dentry contains the dentry structure of the symbolic link. * @old_name contains the pathname of file. * Return 0 if permission is granted. - * @inode_post_symlink: - * @dir contains the inode structure of the parent directory of the new link. - * @dentry contains the dentry structure of new symbolic link. - * @old_name contains the pathname of file. - * Set security attributes for a newly created symbolic link. Note that - * @dentry->d_inode may be NULL, since the filesystem might not - * instantiate the dentry (e.g. NFS). * @inode_mkdir: * Check permissions to create a new directory in the existing directory * associated with inode strcture @dir. @@ -317,11 +304,6 @@ struct swap_info_struct; * @dentry contains the dentry structure of new directory. * @mode contains the mode of new directory. * Return 0 if permission is granted. - * @inode_post_mkdir: - * Set security attributes on a newly created directory. - * @dir contains the inode structure of parent of the directory to be created. - * @dentry contains the dentry structure of new directory. - * @mode contains the mode of new directory. * @inode_rmdir: * Check the permission to remove a directory. * @dir contains the inode structure of parent of the directory to be removed. @@ -337,13 +319,6 @@ struct swap_info_struct; * @mode contains the mode of the new file. * @dev contains the the device number. * Return 0 if permission is granted. - * @inode_post_mknod: - * Set security attributes on a newly created special file (or socket or - * fifo file created via the mknod system call). - * @dir contains the inode structure of parent of the new node. - * @dentry contains the dentry structure of the new node. - * @mode contains the mode of the new node. - * @dev contains the the device number. * @inode_rename: * Check for permission to rename a file or directory. * @old_dir contains the inode structure for parent of the old link. @@ -1103,8 +1078,6 @@ struct security_operations { char **name, void **value, size_t *len); int (*inode_create) (struct inode *dir, struct dentry *dentry, int mode); - void (*inode_post_create) (struct inode *dir, - struct dentry *dentry, int mode); int (*inode_link) (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry); void (*inode_post_link) (struct dentry *old_dentry, @@ -1112,17 +1085,10 @@ struct security_operations { int (*inode_unlink) (struct inode *dir, struct dentry *dentry); int (*inode_symlink) (struct inode *dir, struct dentry *dentry, const char *old_name); - void (*inode_post_symlink) (struct inode *dir, - struct dentry *dentry, - const char *old_name); int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); - void (*inode_post_mkdir) (struct inode *dir, struct dentry *dentry, - int mode); int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); int (*inode_mknod) (struct inode *dir, struct dentry *dentry, int mode, dev_t dev); - void (*inode_post_mknod) (struct inode *dir, struct dentry *dentry, - int mode, dev_t dev); int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry); void (*inode_post_rename) (struct inode *old_dir, @@ -1484,15 +1450,6 @@ static inline int security_inode_create (struct inode *dir, return security_ops->inode_create (dir, dentry, mode); } -static inline void security_inode_post_create (struct inode *dir, - struct dentry *dentry, - int mode) -{ - if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) - return; - security_ops->inode_post_create (dir, dentry, mode); -} - static inline int security_inode_link (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry) @@ -1528,15 +1485,6 @@ static inline int security_inode_symlink (struct inode *dir, return security_ops->inode_symlink (dir, dentry, old_name); } -static inline void security_inode_post_symlink (struct inode *dir, - struct dentry *dentry, - const char *old_name) -{ - if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) - return; - security_ops->inode_post_symlink (dir, dentry, old_name); -} - static inline int security_inode_mkdir (struct inode *dir, struct dentry *dentry, int mode) @@ -1546,15 +1494,6 @@ static inline int security_inode_mkdir (struct inode *dir, return security_ops->inode_mkdir (dir, dentry, mode); } -static inline void security_inode_post_mkdir (struct inode *dir, - struct dentry *dentry, - int mode) -{ - if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) - return; - security_ops->inode_post_mkdir (dir, dentry, mode); -} - static inline int security_inode_rmdir (struct inode *dir, struct dentry *dentry) { @@ -1572,15 +1511,6 @@ static inline int security_inode_mknod (struct inode *dir, return security_ops->inode_mknod (dir, dentry, mode, dev); } -static inline void security_inode_post_mknod (struct inode *dir, - struct dentry *dentry, - int mode, dev_t dev) -{ - if (dentry->d_inode && unlikely (IS_PRIVATE (dentry->d_inode))) - return; - security_ops->inode_post_mknod (dir, dentry, mode, dev); -} - static inline int security_inode_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, @@ -2220,11 +2150,6 @@ static inline int security_inode_create (struct inode *dir, return 0; } -static inline void security_inode_post_create (struct inode *dir, - struct dentry *dentry, - int mode) -{ } - static inline int security_inode_link (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry) @@ -2250,11 +2175,6 @@ static inline int security_inode_symlink (struct inode *dir, return 0; } -static inline void security_inode_post_symlink (struct inode *dir, - struct dentry *dentry, - const char *old_name) -{ } - static inline int security_inode_mkdir (struct inode *dir, struct dentry *dentry, int mode) @@ -2262,11 +2182,6 @@ static inline int security_inode_mkdir (struct inode *dir, return 0; } -static inline void security_inode_post_mkdir (struct inode *dir, - struct dentry *dentry, - int mode) -{ } - static inline int security_inode_rmdir (struct inode *dir, struct dentry *dentry) { @@ -2280,11 +2195,6 @@ static inline int security_inode_mknod (struct inode *dir, return 0; } -static inline void security_inode_post_mknod (struct inode *dir, - struct dentry *dentry, - int mode, dev_t dev) -{ } - static inline int security_inode_rename (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, -- cgit v1.2.3 From e31e14ec356f36b131576be5bc31d8fef7e95483 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Fri, 9 Sep 2005 13:01:45 -0700 Subject: [PATCH] remove the inode_post_link and inode_post_rename LSM hooks This patch removes the inode_post_link and inode_post_rename LSM hooks as they are unused (and likely useless). Signed-off-by: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/security.h | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) (limited to 'include') diff --git a/include/linux/security.h b/include/linux/security.h index 875225bf898..55b02e1c73f 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -281,11 +281,6 @@ struct swap_info_struct; * @dir contains the inode structure of the parent directory of the new link. * @new_dentry contains the dentry structure for the new link. * Return 0 if permission is granted. - * @inode_post_link: - * Set security attributes for a new hard link to a file. - * @old_dentry contains the dentry structure for the existing link. - * @dir contains the inode structure of the parent directory of the new file. - * @new_dentry contains the dentry structure for the new file link. * @inode_unlink: * Check the permission to remove a hard link to a file. * @dir contains the inode structure of parent directory of the file. @@ -326,12 +321,6 @@ struct swap_info_struct; * @new_dir contains the inode structure for parent of the new link. * @new_dentry contains the dentry structure of the new link. * Return 0 if permission is granted. - * @inode_post_rename: - * Set security attributes on a renamed file or directory. - * @old_dir contains the inode structure for parent of the old link. - * @old_dentry contains the dentry structure of the old link. - * @new_dir contains the inode structure for parent of the new link. - * @new_dentry contains the dentry structure of the new link. * @inode_readlink: * Check the permission to read the symbolic link. * @dentry contains the dentry structure for the file link. @@ -1080,8 +1069,6 @@ struct security_operations { struct dentry *dentry, int mode); int (*inode_link) (struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry); - void (*inode_post_link) (struct dentry *old_dentry, - struct inode *dir, struct dentry *new_dentry); int (*inode_unlink) (struct inode *dir, struct dentry *dentry); int (*inode_symlink) (struct inode *dir, struct dentry *dentry, const char *old_name); @@ -1091,10 +1078,6 @@ struct security_operations { int mode, dev_t dev); int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry); - void (*inode_post_rename) (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry); int (*inode_readlink) (struct dentry *dentry); int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd); @@ -1459,15 +1442,6 @@ static inline int security_inode_link (struct dentry *old_dentry, return security_ops->inode_link (old_dentry, dir, new_dentry); } -static inline void security_inode_post_link (struct dentry *old_dentry, - struct inode *dir, - struct dentry *new_dentry) -{ - if (new_dentry->d_inode && unlikely (IS_PRIVATE (new_dentry->d_inode))) - return; - security_ops->inode_post_link (old_dentry, dir, new_dentry); -} - static inline int security_inode_unlink (struct inode *dir, struct dentry *dentry) { @@ -1523,18 +1497,6 @@ static inline int security_inode_rename (struct inode *old_dir, new_dir, new_dentry); } -static inline void security_inode_post_rename (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry) -{ - if (unlikely (IS_PRIVATE (old_dentry->d_inode) || - (new_dentry->d_inode && IS_PRIVATE (new_dentry->d_inode)))) - return; - security_ops->inode_post_rename (old_dir, old_dentry, - new_dir, new_dentry); -} - static inline int security_inode_readlink (struct dentry *dentry) { if (unlikely (IS_PRIVATE (dentry->d_inode))) @@ -2157,11 +2119,6 @@ static inline int security_inode_link (struct dentry *old_dentry, return 0; } -static inline void security_inode_post_link (struct dentry *old_dentry, - struct inode *dir, - struct dentry *new_dentry) -{ } - static inline int security_inode_unlink (struct inode *dir, struct dentry *dentry) { @@ -2203,12 +2160,6 @@ static inline int security_inode_rename (struct inode *old_dir, return 0; } -static inline void security_inode_post_rename (struct inode *old_dir, - struct dentry *old_dentry, - struct inode *new_dir, - struct dentry *new_dentry) -{ } - static inline int security_inode_readlink (struct dentry *dentry) { return 0; -- cgit v1.2.3 From 95409aaca734700e8dcba9db685b8600b67ba05d Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 9 Sep 2005 13:01:48 -0700 Subject: [PATCH] ppc32: Kill PVR_440* defines The following patch changes the usages of PVR_440* into strcmp's with the cpu_name field, and removes the defines altogether. The Ebony portion was briefly tested long ago. One benefit of moving from PVR-tests to string tests in general is that not all CPUs can be on and be able to do this type of comparison. See http://patchwork.ozlabs.org/linuxppc/patch?id=1250 for the original thread. Signed-off-by: Tom Rini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ppc/reg.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h index 88b4222154d..73c33e3ef9c 100644 --- a/include/asm-ppc/reg.h +++ b/include/asm-ppc/reg.h @@ -366,12 +366,6 @@ #define PVR_STB03XXX 0x40310000 #define PVR_NP405H 0x41410000 #define PVR_NP405L 0x41610000 -#define PVR_440GP_RB 0x40120440 -#define PVR_440GP_RC1 0x40120481 -#define PVR_440GP_RC2 0x40200481 -#define PVR_440GX_RA 0x51b21850 -#define PVR_440GX_RB 0x51b21851 -#define PVR_440GX_RC 0x51b21892 #define PVR_601 0x00010000 #define PVR_602 0x00050000 #define PVR_603 0x00030000 -- cgit v1.2.3 From 4d666d7ada2e14d71d463c85b8b5ef2e2e6723f2 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Fri, 9 Sep 2005 13:01:49 -0700 Subject: [PATCH] mips: add TANBAC TB0287 support Add TANBAC TB0287 support. Signed-off-by: Yoichi Yuasa Cc: Ralf Baechle Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/vr41xx/tb0287.h | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 include/asm-mips/vr41xx/tb0287.h (limited to 'include') diff --git a/include/asm-mips/vr41xx/tb0287.h b/include/asm-mips/vr41xx/tb0287.h new file mode 100644 index 00000000000..dd9832313af --- /dev/null +++ b/include/asm-mips/vr41xx/tb0287.h @@ -0,0 +1,43 @@ +/* + * tb0287.h, Include file for TANBAC TB0287 mini-ITX board. + * + * Copyright (C) 2005 Media Lab Inc. + * + * This code is largely based on tb0219.h. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __TANBAC_TB0287_H +#define __TANBAC_TB0287_H + +#include + +/* + * General-Purpose I/O Pin Number + */ +#define TB0287_PCI_SLOT_PIN 2 +#define TB0287_SM501_PIN 3 +#define TB0287_SIL680A_PIN 8 +#define TB0287_RTL8110_PIN 13 + +/* + * Interrupt Number + */ +#define TB0287_PCI_SLOT_IRQ GIU_IRQ(TB0287_PCI_SLOT_PIN) +#define TB0287_SM501_IRQ GIU_IRQ(TB0287_SM501_PIN) +#define TB0287_SIL680A_IRQ GIU_IRQ(TB0287_SIL680A_PIN) +#define TB0287_RTL8110_IRQ GIU_IRQ(TB0287_RTL8110_PIN) + +#endif /* __TANBAC_TB0287_H */ -- cgit v1.2.3 From 383f2835eb9afb723af71850037b2f074ac9db60 Mon Sep 17 00:00:00 2001 From: "Chen, Kenneth W" Date: Fri, 9 Sep 2005 13:02:02 -0700 Subject: [PATCH] Prefetch kernel stacks to speed up context switch For architecture like ia64, the switch stack structure is fairly large (currently 528 bytes). For context switch intensive application, we found that significant amount of cache misses occurs in switch_to() function. The following patch adds a hook in the schedule() function to prefetch switch stack structure as soon as 'next' task is determined. This allows maximum overlap in prefetch cache lines for that structure. Signed-off-by: Ken Chen Cc: Ingo Molnar Cc: "Luck, Tony" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/system.h | 1 + include/linux/sched.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 33256db4a7c..635235fa1e3 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -275,6 +275,7 @@ extern void ia64_load_extra (struct task_struct *task); */ #define __ARCH_WANT_UNLOCKED_CTXSW +#define ARCH_HAS_PREFETCH_SWITCH_STACK #define ia64_platform_is(x) (strcmp(x, platform_name) == 0) void cpu_idle_wait(void); diff --git a/include/linux/sched.h b/include/linux/sched.h index ea1b5f32ec5..c551e6a1447 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -604,6 +604,11 @@ extern int groups_search(struct group_info *group_info, gid_t grp); #define GROUP_AT(gi, i) \ ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) +#ifdef ARCH_HAS_PREFETCH_SWITCH_STACK +extern void prefetch_stack(struct task_struct*); +#else +static inline void prefetch_stack(struct task_struct *t) { } +#endif struct audit_context; /* See audit.c */ struct mempolicy; -- cgit v1.2.3 From fac92becdaecff64dd91daab0292c5131de92f0d Mon Sep 17 00:00:00 2001 From: Andrew Stribblehill Date: Fri, 9 Sep 2005 13:02:04 -0700 Subject: [PATCH] bfs: fix endianness, signedness; add trivial bugfix * Makes BFS code endianness-clean. * Fixes some signedness warnings. * Fixes a problem in fs/bfs/inode.c:164 where inodes not synced to disk don't get fully marked as clean. Here's how to reproduce it: # mount -o loop -t bfs /bfs.img /mnt # df -i /mnt Filesystem Inodes IUsed IFree IUse% Mounted on /bfs.img 48 1 47 3% /mnt # df -k /mnt Filesystem 1K-blocks Used Available Use% Mounted on /bfs.img 512 5 508 1% /mnt # cp 60k-archive.zip /mnt/mt.zip # df -k /mnt Filesystem 1K-blocks Used Available Use% Mounted on /bfs.img 512 65 447 13% /mnt # df -i /mnt Filesystem Inodes IUsed IFree IUse% Mounted on /bfs.img 48 2 46 5% /mnt # rm /mnt/mt.zip # echo $? 0 [If the unlink happens before the buffers flush, the following happens:] # df -i /mnt Filesystem Inodes IUsed IFree IUse% Mounted on /bfs.img 48 2 46 5% /mnt # df -k /mnt Filesystem 1K-blocks Used Available Use% Mounted on /bfs.img 512 65 447 13% /mnt fs/bfs/bfs.h | 1 Signed-off-by: Andrew Stribblehill Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/bfs_fs.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index f7f0913cd11..c1237aa92e3 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h @@ -14,8 +14,9 @@ #define BFS_INODES_PER_BLOCK 8 /* SVR4 vnode type values (bfs_inode->i_vtype) */ -#define BFS_VDIR 2 -#define BFS_VREG 1 +#define BFS_VDIR 2L +#define BFS_VREG 1L + /* BFS inode layout on disk */ struct bfs_inode { @@ -58,22 +59,22 @@ struct bfs_super_block { __u32 s_padding[118]; }; -#define BFS_NZFILESIZE(ip) \ - (((ip)->i_eoffset + 1) - (ip)->i_sblock * BFS_BSIZE) - -#define BFS_FILESIZE(ip) \ - ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) - -#define BFS_FILEBLOCKS(ip) \ - ((ip)->i_sblock == 0 ? 0 : ((ip)->i_eblock + 1) - (ip)->i_sblock) #define BFS_OFF2INO(offset) \ ((((offset) - BFS_BSIZE) / sizeof(struct bfs_inode)) + BFS_ROOT_INO) #define BFS_INO2OFF(ino) \ ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) +#define BFS_NZFILESIZE(ip) \ + ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) + +#define BFS_FILESIZE(ip) \ + ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) +#define BFS_FILEBLOCKS(ip) \ + ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) #define BFS_UNCLEAN(bfs_sb, sb) \ - ((bfs_sb->s_from != -1) && (bfs_sb->s_to != -1) && !(sb->s_flags & MS_RDONLY)) + ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) + #endif /* _LINUX_BFS_FS_H */ -- cgit v1.2.3 From 24b20ac6e1c80082889b3d6ae08aadda777519e5 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Fri, 9 Sep 2005 13:02:11 -0700 Subject: [PATCH] remove unnecessary handle_IRQ_event() prototypes The function prototype for handle_IRQ_event() in a few architctures is not needed because they use GENERIC_HARDIRQ. Signed-off-by: Kenji Kaneshige Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-mips/irq.h | 3 --- include/asm-ppc/irq.h | 4 ---- include/asm-sh/irq.h | 4 ---- include/asm-x86_64/irq.h | 4 ---- 4 files changed, 15 deletions(-) (limited to 'include') diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index b90b11d0b88..3f2470e9e67 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h @@ -49,7 +49,4 @@ do { \ extern void arch_init_irq(void); -struct irqaction; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #endif /* _ASM_IRQ_H */ diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index b4b270457ed..55752474d0d 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -404,9 +404,5 @@ extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; extern unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; extern atomic_t ppc_n_lost_interrupts; -struct irqaction; -struct pt_regs; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #endif /* _ASM_IRQ_H */ #endif /* __KERNEL__ */ diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 831e52ee45b..614a8c13b72 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h @@ -587,10 +587,6 @@ static inline int generic_irq_demux(int irq) #define irq_canonicalize(irq) (irq) #define irq_demux(irq) __irq_demux(sh_mv.mv_irq_demux(irq)) -struct irqaction; -struct pt_regs; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #if defined(CONFIG_CPU_SUBTYPE_SH73180) #include #endif diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h index 4482657777b..fb724ba37ae 100644 --- a/include/asm-x86_64/irq.h +++ b/include/asm-x86_64/irq.h @@ -48,10 +48,6 @@ static __inline__ int irq_canonicalize(int irq) #define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */ #endif -struct irqaction; -struct pt_regs; -int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); - #ifdef CONFIG_HOTPLUG_CPU #include extern void fixup_irqs(cpumask_t map); -- cgit v1.2.3 From 59f4e7d572980a521b7bdba74ab71b21f5995538 Mon Sep 17 00:00:00 2001 From: Truxton Fulton Date: Fri, 9 Sep 2005 13:02:18 -0700 Subject: [PATCH] fix reboot via keyboard controller reset I have a system (Biostar IDEQ210M mini-pc with a VIA chipset) which will not reboot unless a keyboard is plugged in to it. I have tried all combinations of the kernel "reboot=x,y" flags to no avail. Rebooting by any method will leave the system in a wedged state (at the "Restarting system" message). I finally tracked the problem down to the machine's refusal to fully reboot unless the keyboard controller status register had bit 2 set. This is the "System flag" which when set, indicates successful completion of the keyboard controller self-test (Basic Assurance Test, BAT). I suppose that something is trying to protect against sporadic reboots unless the keyboard controller is in a good state (a keyboard is present), but I need this machine to be headless. I found that setting the system flag (via the command byte) before giving the "pulse reset line" command will allow the reboot to proceed. The patch is simple, and I think it should be fine for everybody whether they have this type of machine or not. This affects the "hard" reboot (as done when the kernel boot flags "reboot=c,h" are used). Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/mach-default/mach_reboot.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-i386/mach-default/mach_reboot.h b/include/asm-i386/mach-default/mach_reboot.h index 521e227db67..06ae4d81ba6 100644 --- a/include/asm-i386/mach-default/mach_reboot.h +++ b/include/asm-i386/mach-default/mach_reboot.h @@ -22,7 +22,15 @@ static inline void mach_reboot(void) for (i = 0; i < 100; i++) { kb_wait(); udelay(50); - outb(0xfe, 0x64); /* pulse reset low */ + outb(0x60, 0x64); /* write Controller Command Byte */ + udelay(50); + kb_wait(); + udelay(50); + outb(0x14, 0x60); /* set "System flag" */ + udelay(50); + kb_wait(); + udelay(50); + outb(0xfe, 0x64); /* pulse reset low */ udelay(50); } } -- cgit v1.2.3 From 34f7373aaec80564cc87b7829e4e2a0e3c20c4b7 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 9 Sep 2005 13:02:20 -0700 Subject: [PATCH] dvb: remove version.h dependencies Remove all #include and all references to LINUX_VERSION_CODE and KERNEL_VERSION. Based on patch by Olaf Hering. Signed-off-by: Olaf Hering Signed-off-by: Johannes Stezenbach Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/media/saa7146.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'include') diff --git a/include/media/saa7146.h b/include/media/saa7146.h index 3dfb8d670eb..2a897c3a6a9 100644 --- a/include/media/saa7146.h +++ b/include/media/saa7146.h @@ -1,7 +1,6 @@ #ifndef __SAA7146__ #define __SAA7146__ -#include /* for version macros */ #include /* for module-version */ #include /* for delay-stuff */ #include /* for kmalloc/kfree */ @@ -15,12 +14,7 @@ #include /* for vmalloc() */ #include /* for vmalloc_to_page() */ -/* ugly, but necessary to build the dvb stuff under 2.4. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - #include "dvb_functions.h" -#endif - -#define SAA7146_VERSION_CODE KERNEL_VERSION(0,5,0) +#define SAA7146_VERSION_CODE 0x000500 /* 0.5.0 */ #define saa7146_write(sxy,adr,dat) writel((dat),(sxy->mem+(adr))) #define saa7146_read(sxy,adr) readl(sxy->mem+(adr)) @@ -33,13 +27,8 @@ extern unsigned int saa7146_debug; #define DEBUG_VARIABLE saa7146_debug #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) -#define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_BASENAME),__FUNCTION__) -#define INFO(x) { printk("%s: ",__stringify(KBUILD_BASENAME)); printk x; } -#else #define DEBUG_PROLOG printk("%s: %s(): ",__stringify(KBUILD_MODNAME),__FUNCTION__) #define INFO(x) { printk("%s: ",__stringify(KBUILD_MODNAME)); printk x; } -#endif #define ERR(x) { DEBUG_PROLOG; printk x; } -- cgit v1.2.3 From b3743fa4442fc172e950ff0eaf6aa96e7d5ce9be Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 9 Sep 2005 13:03:23 -0700 Subject: [PATCH] yenta: share code with PCI core Share code between setup-bus.c and yenta_socket.c: use the write-out code of resources to the bridge also in yenta_socket.c, as it provides useful debug output. In addition, it fixes the bug that the CPU-centric resource view might need to be transferred to the PCI-centric view: setup-bus.c does that, while yenta-socket.c did not. Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pci.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 6caaba0af46..c62e8927023 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -326,6 +326,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev); extern void pci_dev_put(struct pci_dev *dev); extern void pci_remove_bus(struct pci_bus *b); extern void pci_remove_bus_device(struct pci_dev *dev); +void pci_setup_cardbus(struct pci_bus *bus); /* Generic PCI functions exported to card drivers */ -- cgit v1.2.3 From bd65a68574b787304a0cd90f22cfd44540ce3695 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Fri, 9 Sep 2005 13:03:29 -0700 Subject: [PATCH] pcmcia: add pcmcia to IRQ information Add a devname parameter to the pcmcia_device structure, fills it with "pcmcia" in pcmcia_device_add, and passes it to request_irq in pcmcia_request_irq. Signed-off-by: Brice Goglin Signed-off-by: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/pcmcia/ds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index b707a603351..cb8b6e6ce66 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -151,6 +151,8 @@ struct pcmcia_device { uniquely define a pcmcia_device */ struct pcmcia_socket *socket; + char *devname; + u8 device_no; /* the hardware "function" device; certain subdevices can -- cgit v1.2.3 From 793cf9e6a54c698e109a599c8b8e303658fcaae6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 9 Sep 2005 13:03:37 -0700 Subject: [PATCH] v4l: common part Updates and tuner additions - Remove $Id CVS logs for V4L files - Included newer cards. - Added a new NEC protocol for ir based on pulse distance. - Enable ATSC support for DViCO FusionHDTV5 Gold. - Added tuner LG NTSC (TALN mini series). - Fixed tea5767 autodetection. - Resolve more tuner types. - Commented debug function removed from mainstream. - Remove comments from mainstream. Still on development tree. - linux/version dependencies removed. - BTSC Lang1 now is set to auto_stereo mode. - New tuner standby API. - i2c-core.c uses hexadecimal for the i2c address, so it should stay consistent. Signed-off-by: Uli Luckas Signed-off-by: Mac Michaels Signed-off-by: Michael Krufky Signed-off-by: Hermann Pitton Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/videodev.h | 3 --- include/linux/videodev2.h | 4 ---- include/media/audiochip.h | 1 - include/media/id.h | 1 - include/media/ir-common.h | 4 ++-- include/media/tuner.h | 25 ++++++++++++++----------- include/media/tveeprom.h | 1 - include/media/video-buf.h | 1 - 8 files changed, 16 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/linux/videodev.h b/include/linux/videodev.h index 9d6fbde3d29..1cc8c31b798 100644 --- a/include/linux/videodev.h +++ b/include/linux/videodev.h @@ -3,7 +3,6 @@ #include #include -#include #define HAVE_V4L2 1 #include @@ -29,7 +28,6 @@ struct video_device void (*release)(struct video_device *vfd); -#if 1 /* to be removed in 2.7.x */ /* obsolete -- fops->owner is used instead */ struct module *owner; /* dev->driver_data will be used instead some day. @@ -37,7 +35,6 @@ struct video_device * so the switch over will be transparent for you. * Or use {pci|usb}_{get|set}_drvdata() directly. */ void *priv; -#endif /* for videodev.c intenal usage -- please don't touch */ int users; /* video_exclusive_{open|close} ... */ diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index acbfc525576..f623a33b9ab 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -270,7 +270,6 @@ struct v4l2_timecode /* The above is based on SMPTE timecodes */ -#if 1 /* * M P E G C O M P R E S S I O N P A R A M E T E R S * @@ -357,7 +356,6 @@ struct v4l2_mpeg_compression { /* I don't expect the above being perfect yet ;) */ __u32 reserved_5[8]; }; -#endif struct v4l2_jpegcompression { @@ -871,10 +869,8 @@ struct v4l2_streamparm #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) -#if 1 /* experimental */ #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) -#endif #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) diff --git a/include/media/audiochip.h b/include/media/audiochip.h index cd831168fdc..a7ceee9fc5e 100644 --- a/include/media/audiochip.h +++ b/include/media/audiochip.h @@ -1,5 +1,4 @@ /* - * $Id: audiochip.h,v 1.5 2005/06/16 22:59:16 hhackmann Exp $ */ #ifndef AUDIOCHIP_H diff --git a/include/media/id.h b/include/media/id.h index 801ddef301a..6d02c94cdc0 100644 --- a/include/media/id.h +++ b/include/media/id.h @@ -1,5 +1,4 @@ /* - * $Id: id.h,v 1.4 2005/06/12 04:19:19 mchehab Exp $ */ /* FIXME: this temporarely, until these are included in linux/i2c-id.h */ diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 698670547f1..01b56822df4 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h @@ -1,5 +1,4 @@ /* - * $Id: ir-common.h,v 1.9 2005/05/15 19:01:26 mchehab Exp $ * * some common structs and functions to handle infrared remotes via * input layer ... @@ -21,11 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #define IR_TYPE_RC5 1 +#define IR_TYPE_PD 2 /* Pulse distance encoded IR */ #define IR_TYPE_OTHER 99 #define IR_KEYTAB_TYPE u32 @@ -60,6 +59,7 @@ void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, u32 ir_extract_bits(u32 data, u32 mask); int ir_dump_samples(u32 *samples, int count); int ir_decode_biphase(u32 *samples, int count, int low, int high); +int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); /* * Local variables: diff --git a/include/media/tuner.h b/include/media/tuner.h index eeaa15ddee8..252673bfa59 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -1,5 +1,3 @@ - -/* $Id: tuner.h,v 1.45 2005/07/28 18:41:21 mchehab Exp $ * tuner.h - definition for different tuners @@ -111,6 +109,8 @@ #define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ #define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ +#define TUNER_LG_NTSC_TALN_MINI 66 + #define NOTUNER 0 #define PAL 1 /* PAL_BG */ #define PAL_I 2 @@ -134,6 +134,7 @@ #define THOMSON 12 #define TUNER_SET_TYPE_ADDR _IOW('T',3,int) +#define TUNER_SET_STANDBY _IOW('T',4,int) #define TDA9887_SET_CONFIG _IOW('t',5,int) /* tv card specific */ @@ -153,9 +154,6 @@ #ifdef __KERNEL__ -#define I2C_ADDR_TDA8290 0x4b -#define I2C_ADDR_TDA8275 0x61 - enum tuner_mode { T_UNINITIALIZED = 0, T_RADIO = 1 << V4L2_TUNER_RADIO, @@ -198,6 +196,7 @@ struct tuner { void (*radio_freq)(struct i2c_client *c, unsigned int freq); int (*has_signal)(struct i2c_client *c); int (*is_stereo)(struct i2c_client *c); + void (*standby)(struct i2c_client *c); }; extern unsigned int tuner_debug; @@ -209,12 +208,16 @@ extern int tea5767_tuner_init(struct i2c_client *c); extern int default_tuner_init(struct i2c_client *c); extern int tea5767_autodetection(struct i2c_client *c); -#define tuner_warn(fmt, arg...) \ - dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg) -#define tuner_info(fmt, arg...) \ - dev_printk(KERN_INFO , &t->i2c.dev , fmt , ## arg) -#define tuner_dbg(fmt, arg...) \ - if (tuner_debug) dev_printk(KERN_DEBUG , &t->i2c.dev , fmt , ## arg) +#define tuner_warn(fmt, arg...) do {\ + printk(KERN_WARNING "%s %d-%04x: " fmt, t->i2c.driver->name, \ + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) +#define tuner_info(fmt, arg...) do {\ + printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.driver->name, \ + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) +#define tuner_dbg(fmt, arg...) do {\ + if (tuner_debug) \ + printk(KERN_DEBUG "%s %d-%04x: " fmt, t->i2c.driver->name, \ + t->i2c.adapter->nr, t->i2c.addr , ##arg); } while (0) #endif /* __KERNEL__ */ diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h index 854a2c2f105..e24e841c321 100644 --- a/include/media/tveeprom.h +++ b/include/media/tveeprom.h @@ -1,5 +1,4 @@ /* - * $Id: tveeprom.h,v 1.2 2005/06/12 04:19:19 mchehab Exp $ */ struct tveeprom { diff --git a/include/media/video-buf.h b/include/media/video-buf.h index ae6da6de98d..ae8d7a00044 100644 --- a/include/media/video-buf.h +++ b/include/media/video-buf.h @@ -1,5 +1,4 @@ /* - * $Id: video-buf.h,v 1.9 2004/11/07 13:17:15 kraxel Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. -- cgit v1.2.3 From 1c94aeecd3fd2aed66d9a1135f5329df622e6137 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 9 Sep 2005 13:03:52 -0700 Subject: [PATCH] v4l: normalize whitespace and comments in tuner lists - normalize whitespace and comments in tuner lists Signed-off-by: Philip Rowlands Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/media/tuner.h | 170 +++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) (limited to 'include') diff --git a/include/media/tuner.h b/include/media/tuner.h index 252673bfa59..5b01ee6b086 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -26,90 +26,90 @@ #define ADDR_UNSET (255) -#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ -#define TUNER_PHILIPS_PAL_I 1 -#define TUNER_PHILIPS_NTSC 2 -#define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */ - -#define TUNER_ABSENT 4 -#define TUNER_PHILIPS_PAL 5 -#define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */ -#define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */ - -#define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */ -#define TUNER_ALPS_TSBH1_NTSC 9 -#define TUNER_ALPS_TSBE1_PAL 10 -#define TUNER_ALPS_TSBB5_PAL_I 11 - -#define TUNER_ALPS_TSBE5_PAL 12 -#define TUNER_ALPS_TSBC5_PAL 13 -#define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */ -#define TUNER_ALPS_TSHC6_NTSC 15 - -#define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */ -#define TUNER_PHILIPS_NTSC_M 17 -#define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */ -#define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657)*/ - -#define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711)*/ -#define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732)*/ -#define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104)*/ +#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ +#define TUNER_PHILIPS_PAL_I 1 +#define TUNER_PHILIPS_NTSC 2 +#define TUNER_PHILIPS_SECAM 3 /* you must actively select B/G, L, L` */ + +#define TUNER_ABSENT 4 +#define TUNER_PHILIPS_PAL 5 +#define TUNER_TEMIC_NTSC 6 /* 4032 FY5 (3X 7004, 9498, 9789) */ +#define TUNER_TEMIC_PAL_I 7 /* 4062 FY5 (3X 8501, 9957) */ + +#define TUNER_TEMIC_4036FY5_NTSC 8 /* 4036 FY5 (3X 1223, 1981, 7686) */ +#define TUNER_ALPS_TSBH1_NTSC 9 +#define TUNER_ALPS_TSBE1_PAL 10 +#define TUNER_ALPS_TSBB5_PAL_I 11 + +#define TUNER_ALPS_TSBE5_PAL 12 +#define TUNER_ALPS_TSBC5_PAL 13 +#define TUNER_TEMIC_4006FH5_PAL 14 /* 4006 FH5 (3X 9500, 9501, 7291) */ +#define TUNER_ALPS_TSHC6_NTSC 15 + +#define TUNER_TEMIC_PAL_DK 16 /* 4016 FY5 (3X 1392, 1393) */ +#define TUNER_PHILIPS_NTSC_M 17 +#define TUNER_TEMIC_4066FY5_PAL_I 18 /* 4066 FY5 (3X 7032, 7035) */ +#define TUNER_TEMIC_4006FN5_MULTI_PAL 19 /* B/G, I and D/K autodetected (3X 7595, 7606, 7657) */ + +#define TUNER_TEMIC_4009FR5_PAL 20 /* incl. FM radio (3X 7607, 7488, 7711) */ +#define TUNER_TEMIC_4039FR5_NTSC 21 /* incl. FM radio (3X 7246, 7578, 7732) */ +#define TUNER_TEMIC_4046FM5 22 /* you must actively select B/G, D/K, I, L, L` ! (3X 7804, 7806, 8103, 8104) */ #define TUNER_PHILIPS_PAL_DK 23 -#define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */ -#define TUNER_LG_PAL_I_FM 25 -#define TUNER_LG_PAL_I 26 -#define TUNER_LG_NTSC_FM 27 +#define TUNER_PHILIPS_FQ1216ME 24 /* you must actively select B/G/D/K, I, L, L` */ +#define TUNER_LG_PAL_I_FM 25 +#define TUNER_LG_PAL_I 26 +#define TUNER_LG_NTSC_FM 27 -#define TUNER_LG_PAL_FM 28 -#define TUNER_LG_PAL 29 -#define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163)*/ -#define TUNER_SHARP_2U5JF5540_NTSC 31 +#define TUNER_LG_PAL_FM 28 +#define TUNER_LG_PAL 29 +#define TUNER_TEMIC_4009FN5_MULTI_PAL_FM 30 /* B/G, I and D/K autodetected (3X 8155, 8160, 8163) */ +#define TUNER_SHARP_2U5JF5540_NTSC 31 -#define TUNER_Samsung_PAL_TCPM9091PD27 32 -#define TUNER_MT2032 33 -#define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865)*/ -#define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099)*/ +#define TUNER_Samsung_PAL_TCPM9091PD27 32 +#define TUNER_MT2032 33 +#define TUNER_TEMIC_4106FH5 34 /* 4106 FH5 (3X 7808, 7865) */ +#define TUNER_TEMIC_4012FY5 35 /* 4012 FY5 (3X 0971, 1099) */ -#define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746)*/ -#define TUNER_LG_PAL_NEW_TAPC 37 -#define TUNER_PHILIPS_FM1216ME_MK3 38 -#define TUNER_LG_NTSC_NEW_TAPC 39 +#define TUNER_TEMIC_4136FY5 36 /* 4136 FY5 (3X 7708, 7746) */ +#define TUNER_LG_PAL_NEW_TAPC 37 +#define TUNER_PHILIPS_FM1216ME_MK3 38 +#define TUNER_LG_NTSC_NEW_TAPC 39 -#define TUNER_HITACHI_NTSC 40 -#define TUNER_PHILIPS_PAL_MK 41 -#define TUNER_PHILIPS_ATSC 42 -#define TUNER_PHILIPS_FM1236_MK3 43 +#define TUNER_HITACHI_NTSC 40 +#define TUNER_PHILIPS_PAL_MK 41 +#define TUNER_PHILIPS_ATSC 42 +#define TUNER_PHILIPS_FM1236_MK3 43 -#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ +#define TUNER_PHILIPS_4IN1 44 /* ATI TV Wonder Pro - Conexant */ /* Microtune mergeged with Temic 12/31/1999 partially financed by Alps - these may be similar to Temic */ -#define TUNER_MICROTUNE_4049FM5 45 -#define TUNER_LG_NTSC_TAPE 47 - -#define TUNER_TNF_8831BGFF 48 -#define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */ -#define TUNER_TCL_2002N 50 -#define TUNER_PHILIPS_FM1256_IH3 51 - -#define TUNER_THOMSON_DTT7610 52 -#define TUNER_PHILIPS_FQ1286 53 -#define TUNER_PHILIPS_TDA8290 54 -#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */ - -#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */ -#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */ - -#define TUNER_YMEC_TVF_8531MF 58 -#define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ -#define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ -#define TUNER_TENA_9533_DI 61 - -#define TUNER_TEA5767 62 /* Only FM Radio Tuner */ -#define TUNER_PHILIPS_FMD1216ME_MK3 63 -#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ -#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ - -#define TUNER_LG_NTSC_TALN_MINI 66 +#define TUNER_MICROTUNE_4049FM5 45 +#define TUNER_MICROTUNE_4042_FI5 46 +#define TUNER_LG_NTSC_TAPE 47 + +#define TUNER_TNF_8831BGFF 48 +#define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */ +#define TUNER_TCL_2002N 50 +#define TUNER_PHILIPS_FM1256_IH3 51 + +#define TUNER_THOMSON_DTT7610 52 +#define TUNER_PHILIPS_FQ1286 53 +#define TUNER_PHILIPS_TDA8290 54 +#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */ + +#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */ +#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */ +#define TUNER_YMEC_TVF_8531MF 58 +#define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */ + +#define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */ +#define TUNER_TENA_9533_DI 61 +#define TUNER_TEA5767 62 /* Only FM Radio Tuner */ +#define TUNER_PHILIPS_FMD1216ME_MK3 63 + +#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */ +#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */ +#define TUNER_LG_NTSC_TALN_MINI 66 #define NOTUNER 0 #define PAL 1 /* PAL_BG */ @@ -117,7 +117,7 @@ #define NTSC 3 #define SECAM 4 #define ATSC 5 -#define RADIO 6 +#define RADIO 6 #define NoTuner 0 #define Philips 1 @@ -163,21 +163,21 @@ enum tuner_mode { }; struct tuner_setup { - unsigned short addr; - unsigned int type; - unsigned int mode_mask; + unsigned short addr; + unsigned int type; + unsigned int mode_mask; }; struct tuner { /* device */ struct i2c_client i2c; - unsigned int type; /* chip type */ + unsigned int type; /* chip type */ - unsigned int mode; - unsigned int mode_mask; /* Combination of allowable modes */ + unsigned int mode; + unsigned int mode_mask; /* Combination of allowable modes */ - unsigned int freq; /* keep track of the current settings */ + unsigned int freq; /* keep track of the current settings */ unsigned int audmode; v4l2_std_id std; @@ -221,7 +221,7 @@ extern int tea5767_autodetection(struct i2c_client *c); #endif /* __KERNEL__ */ -#endif +#endif /* _TUNER_H */ /* * Overrides for Emacs so that we follow Linus's tabbing style. -- cgit v1.2.3 From 10b89ee387fd6cc38532a881f64b3d35f338ea0b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 9 Sep 2005 13:04:03 -0700 Subject: [PATCH] v4l: include saa6588 compiler option and files / fixes comments on tuner.h - Include saa6588 compiler option and files. - Fix comment on tuner.h - linux/utsname.h replaced by linux/version.h to compile on vanilla 2.6.13 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/media/tuner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/tuner.h b/include/media/tuner.h index 5b01ee6b086..4ad08e24a1a 100644 --- a/include/media/tuner.h +++ b/include/media/tuner.h @@ -1,4 +1,4 @@ - * +/* tuner.h - definition for different tuners Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de) -- cgit v1.2.3 From dc75fc1b924ccf44ca9f0446701acc0081605b49 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 9 Sep 2005 13:04:04 -0700 Subject: [PATCH] v4l: Remove kernel version dependency from tea575x-tuner.h - Removed kernel version dependency from tea575x-tuner.h Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/sound/tea575x-tuner.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index ad3c3be33c0..b82e408e758 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h @@ -34,9 +34,7 @@ struct snd_tea575x_ops { struct snd_tea575x { snd_card_t *card; struct video_device vd; /* video device */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) struct file_operations fops; -#endif int dev_nr; /* requested device number + 1 */ int vd_registered; /* video device is registered */ int tea5759; /* 5759 chip is present */ -- cgit v1.2.3 From 0f97a931b337e4662e736ca67f1fab0a187f5852 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 9 Sep 2005 13:04:05 -0700 Subject: [PATCH] v4l: tveeprom improved to support newer Hauppage cards - tveeprom improved and updated to reflect newer Hauppage cards. - CodingStyle fixes. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/media/tveeprom.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h index e24e841c321..e2035c7da09 100644 --- a/include/media/tveeprom.h +++ b/include/media/tveeprom.h @@ -3,15 +3,19 @@ struct tveeprom { u32 has_radio; + u32 has_ir; /* 0: no IR, 1: IR present, 2: unknown */ u32 tuner_type; u32 tuner_formats; + u32 tuner2_type; + u32 tuner2_formats; + u32 digitizer; u32 digitizer_formats; u32 audio_processor; - /* a_p_fmts? */ + u32 decoder_processor; u32 model; u32 revision; @@ -19,7 +23,7 @@ struct tveeprom { char rev_str[5]; }; -void tveeprom_hauppauge_analog(struct tveeprom *tvee, +void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, unsigned char *eeprom_data); int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len); -- cgit v1.2.3 From 8b6490e5faafb3a16ea45654fb55f9ff086f1495 Mon Sep 17 00:00:00 2001 From: Dipankar Sarma Date: Fri, 9 Sep 2005 13:04:07 -0700 Subject: [PATCH] files: fix rcu initializers First of a number of files_lock scaability patches. Here are the x86 numbers - tiobench on a 4(8)-way (HT) P4 system on ramdisk : (lockfree) Test 2.6.10-vanilla Stdev 2.6.10-fd Stdev ------------------------------------------------------------- Seqread 1400.8 11.52 1465.4 34.27 Randread 1594 8.86 2397.2 29.21 Seqwrite 242.72 3.47 238.46 6.53 Randwrite 445.74 9.15 446.4 9.75 The performance improvement is very significant. We are getting killed by the cacheline bouncing of the files_struct lock here. Writes on ramdisk (ext2) seems to vary just too much to get any meaningful number. Also, With Tridge's thread_perf test on a 4(8)-way (HT) P4 xeon system : 2.6.12-rc5-vanilla : Running test 'readwrite' with 8 tasks Threads 0.34 +/- 0.01 seconds Processes 0.16 +/- 0.00 seconds 2.6.12-rc5-fd : Running test 'readwrite' with 8 tasks Threads 0.17 +/- 0.02 seconds Processes 0.17 +/- 0.02 seconds I repeated the measurements on ramfs (as opposed to ext2 on ramdisk in the earlier measurement) and I got more consistent results from tiobench : 4(8) way xeon P4 ----------------- (lock-free) Test 2.6.12-rc5 Stdev 2.6.12-rc5-fd Stdev ------------------------------------------------------------- Seqread 1282 18.59 1343.6 26.37 Randread 1517 7 2415 34.27 Seqwrite 702.2 5.27 709.46 5.9 Randwrite 846.86 15.15 919.68 21.4 4-way ppc64 ------------ (lock-free) Test 2.6.12-rc5 Stdev 2.6.12-rc5-fd Stdev ------------------------------------------------------------- Seqread 1549 91.16 1569.6 47.2 Randread 1473.6 25.11 1585.4 69.99 Seqwrite 1096.8 20.03 1136 29.61 Randwrite 1189.6 4.04 1275.2 32.96 Also running Tridge's thread_perf test on ppc64 : 2.6.12-rc5-vanilla -------------------- Running test 'readwrite' with 4 tasks Threads 0.20 +/- 0.02 seconds Processes 0.16 +/- 0.01 seconds 2.6.12-rc5-fd -------------------- Running test 'readwrite' with 4 tasks Threads 0.18 +/- 0.04 seconds Processes 0.16 +/- 0.01 seconds The benefits are huge (upto ~60%) in some cases on x86 primarily due to the atomic operations during acquisition of ->file_lock and cache line bouncing in fast path. ppc64 benefits are modest due to LL/SC based locking, but still statistically significant. This patch: RCU head initilizer no longer needs the head varible name since we don't use list.h lists anymore. Signed-off-by: Dipankar Sarma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rcupdate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index fd276adf0fd..4e65eb44adf 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -52,8 +52,8 @@ struct rcu_head { void (*func)(struct rcu_head *head); }; -#define RCU_HEAD_INIT(head) { .next = NULL, .func = NULL } -#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT(head) +#define RCU_HEAD_INIT { .next = NULL, .func = NULL } +#define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT #define INIT_RCU_HEAD(ptr) do { \ (ptr)->next = NULL; (ptr)->func = NULL; \ } while (0) -- cgit v1.2.3 From c0dfb2905126e9e94edebbce8d3e05001301f52d Mon Sep 17 00:00:00 2001 From: Dipankar Sarma Date: Fri, 9 Sep 2005 13:04:09 -0700 Subject: [PATCH] files: rcuref APIs Adds a set of primitives to do reference counting for objects that are looked up without locks using RCU. Signed-off-by: Ravikiran Thirumalai Signed-off-by: Dipankar Sarma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rcuref.h | 220 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 include/linux/rcuref.h (limited to 'include') diff --git a/include/linux/rcuref.h b/include/linux/rcuref.h new file mode 100644 index 00000000000..e1adbba14b6 --- /dev/null +++ b/include/linux/rcuref.h @@ -0,0 +1,220 @@ +/* + * rcuref.h + * + * Reference counting for elements of lists/arrays protected by + * RCU. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Copyright (C) IBM Corporation, 2005 + * + * Author: Dipankar Sarma + * Ravikiran Thirumalai + * + * See Documentation/RCU/rcuref.txt for detailed user guide. + * + */ + +#ifndef _RCUREF_H_ +#define _RCUREF_H_ + +#ifdef __KERNEL__ + +#include +#include +#include +#include + +/* + * These APIs work on traditional atomic_t counters used in the + * kernel for reference counting. Under special circumstances + * where a lock-free get() operation races with a put() operation + * these APIs can be used. See Documentation/RCU/rcuref.txt. + */ + +#ifdef __HAVE_ARCH_CMPXCHG + +/** + * rcuref_inc - increment refcount for object. + * @rcuref: reference counter in the object in question. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference + * in a lock-free reader-side critical section. + */ +static inline void rcuref_inc(atomic_t *rcuref) +{ + atomic_inc(rcuref); +} + +/** + * rcuref_dec - decrement refcount for object. + * @rcuref: reference counter in the object in question. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference + * in a lock-free reader-side critical section. + */ +static inline void rcuref_dec(atomic_t *rcuref) +{ + atomic_dec(rcuref); +} + +/** + * rcuref_dec_and_test - decrement refcount for object and test + * @rcuref: reference counter in the object. + * @release: pointer to the function that will clean up the object + * when the last reference to the object is released. + * This pointer is required. + * + * Decrement the refcount, and if 0, return 1. Else return 0. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference + * in a lock-free reader-side critical section. + */ +static inline int rcuref_dec_and_test(atomic_t *rcuref) +{ + return atomic_dec_and_test(rcuref); +} + +/* + * cmpxchg is needed on UP too, if deletions to the list/array can happen + * in interrupt context. + */ + +/** + * rcuref_inc_lf - Take reference to an object in a read-side + * critical section protected by RCU. + * @rcuref: reference counter in the object in question. + * + * Try and increment the refcount by 1. The increment might fail if + * the reference counter has been through a 1 to 0 transition and + * is no longer part of the lock-free list. + * Returns non-zero on successful increment and zero otherwise. + */ +static inline int rcuref_inc_lf(atomic_t *rcuref) +{ + int c, old; + c = atomic_read(rcuref); + while (c && (old = cmpxchg(&rcuref->counter, c, c + 1)) != c) + c = old; + return c; +} + +#else /* !__HAVE_ARCH_CMPXCHG */ + +extern spinlock_t __rcuref_hash[]; + +/* + * Use a hash table of locks to protect the reference count + * since cmpxchg is not available in this arch. + */ +#ifdef CONFIG_SMP +#define RCUREF_HASH_SIZE 4 +#define RCUREF_HASH(k) \ + (&__rcuref_hash[(((unsigned long)k)>>8) & (RCUREF_HASH_SIZE-1)]) +#else +#define RCUREF_HASH_SIZE 1 +#define RCUREF_HASH(k) &__rcuref_hash[0] +#endif /* CONFIG_SMP */ + +/** + * rcuref_inc - increment refcount for object. + * @rcuref: reference counter in the object in question. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference in a lock-free + * reader-side critical section. + */ +static inline void rcuref_inc(atomic_t *rcuref) +{ + unsigned long flags; + spin_lock_irqsave(RCUREF_HASH(rcuref), flags); + rcuref->counter += 1; + spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags); +} + +/** + * rcuref_dec - decrement refcount for object. + * @rcuref: reference counter in the object in question. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference in a lock-free + * reader-side critical section. + */ +static inline void rcuref_dec(atomic_t *rcuref) +{ + unsigned long flags; + spin_lock_irqsave(RCUREF_HASH(rcuref), flags); + rcuref->counter -= 1; + spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags); +} + +/** + * rcuref_dec_and_test - decrement refcount for object and test + * @rcuref: reference counter in the object. + * @release: pointer to the function that will clean up the object + * when the last reference to the object is released. + * This pointer is required. + * + * Decrement the refcount, and if 0, return 1. Else return 0. + * + * This should be used only for objects where we use RCU and + * use the rcuref_inc_lf() api to acquire a reference in a lock-free + * reader-side critical section. + */ +static inline int rcuref_dec_and_test(atomic_t *rcuref) +{ + unsigned long flags; + spin_lock_irqsave(RCUREF_HASH(rcuref), flags); + rcuref->counter--; + if (!rcuref->counter) { + spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags); + return 1; + } else { + spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags); + return 0; + } +} + +/** + * rcuref_inc_lf - Take reference to an object of a lock-free collection + * by traversing a lock-free list/array. + * @rcuref: reference counter in the object in question. + * + * Try and increment the refcount by 1. The increment might fail if + * the reference counter has been through a 1 to 0 transition and + * object is no longer part of the lock-free list. + * Returns non-zero on successful increment and zero otherwise. + */ +static inline int rcuref_inc_lf(atomic_t *rcuref) +{ + int ret; + unsigned long flags; + spin_lock_irqsave(RCUREF_HASH(rcuref), flags); + if (rcuref->counter) + ret = rcuref->counter++; + else + ret = 0; + spin_unlock_irqrestore(RCUREF_HASH(rcuref), flags); + return ret; +} + + +#endif /* !__HAVE_ARCH_CMPXCHG */ + +#endif /* __KERNEL__ */ +#endif /* _RCUREF_H_ */ -- cgit v1.2.3 From badf16621c1f9d1ac753be056fce11b43d6e0be5 Mon Sep 17 00:00:00 2001 From: Dipankar Sarma Date: Fri, 9 Sep 2005 13:04:10 -0700 Subject: [PATCH] files: break up files struct In order for the RCU to work, the file table array, sets and their sizes must be updated atomically. Instead of ensuring this through too many memory barriers, we put the arrays and their sizes in a separate structure. This patch takes the first step of putting the file table elements in a separate structure fdtable that is embedded withing files_struct. It also changes all the users to refer to the file table using files_fdtable() macro. Subsequent applciation of RCU becomes easier after this. Signed-off-by: Dipankar Sarma Signed-Off-By: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/file.h | 23 +++++++++++++++-------- include/linux/init_task.h | 13 +++++++++---- 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/linux/file.h b/include/linux/file.h index 5206beb9a80..db372230848 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -16,23 +16,29 @@ */ #define NR_OPEN_DEFAULT BITS_PER_LONG +struct fdtable { + unsigned int max_fds; + int max_fdset; + int next_fd; + struct file ** fd; /* current fd array */ + fd_set *close_on_exec; + fd_set *open_fds; +}; + /* * Open file table structure */ struct files_struct { atomic_t count; spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ - int max_fds; - int max_fdset; - int next_fd; - struct file ** fd; /* current fd array */ - fd_set *close_on_exec; - fd_set *open_fds; + struct fdtable fdtab; fd_set close_on_exec_init; fd_set open_fds_init; struct file * fd_array[NR_OPEN_DEFAULT]; }; +#define files_fdtable(files) (&(files)->fdtab) + extern void FASTCALL(__fput(struct file *)); extern void FASTCALL(fput(struct file *)); @@ -63,9 +69,10 @@ extern int expand_files(struct files_struct *, int nr); static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) { struct file * file = NULL; + struct fdtable *fdt = files_fdtable(files); - if (fd < files->max_fds) - file = files->fd[fd]; + if (fd < fdt->max_fds) + file = fdt->fd[fd]; return file; } diff --git a/include/linux/init_task.h b/include/linux/init_task.h index c727c195a91..94aefa54a1b 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -3,16 +3,21 @@ #include -#define INIT_FILES \ -{ \ - .count = ATOMIC_INIT(1), \ - .file_lock = SPIN_LOCK_UNLOCKED, \ +#define INIT_FDTABLE \ +{ \ .max_fds = NR_OPEN_DEFAULT, \ .max_fdset = __FD_SETSIZE, \ .next_fd = 0, \ .fd = &init_files.fd_array[0], \ .close_on_exec = &init_files.close_on_exec_init, \ .open_fds = &init_files.open_fds_init, \ +} + +#define INIT_FILES \ +{ \ + .count = ATOMIC_INIT(1), \ + .file_lock = SPIN_LOCK_UNLOCKED, \ + .fdtab = INIT_FDTABLE, \ .close_on_exec_init = { { 0, } }, \ .open_fds_init = { { 0, } }, \ .fd_array = { NULL, } \ -- cgit v1.2.3 From ab2af1f5005069321c5d130f09cce577b03f43ef Mon Sep 17 00:00:00 2001 From: Dipankar Sarma Date: Fri, 9 Sep 2005 13:04:13 -0700 Subject: [PATCH] files: files struct with RCU Patch to eliminate struct files_struct.file_lock spinlock on the reader side and use rcu refcounting rcuref_xxx api for the f_count refcounter. The updates to the fdtable are done by allocating a new fdtable structure and setting files->fdt to point to the new structure. The fdtable structure is protected by RCU thereby allowing lock-free lookup. For fd arrays/sets that are vmalloced, we use keventd to free them since RCU callbacks can't sleep. A global list of fdtable to be freed is not scalable, so we use a per-cpu list. If keventd is already handling the current cpu's work, we use a timer to defer queueing of that work. Since the last publication, this patch has been re-written to avoid using explicit memory barriers and use rcu_assign_pointer(), rcu_dereference() premitives instead. This required that the fd information is kept in a separate structure (fdtable) and updated atomically. Signed-off-by: Dipankar Sarma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/file.h | 11 +++++++++-- include/linux/fs.h | 4 +++- include/linux/init_task.h | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/file.h b/include/linux/file.h index db372230848..f5bbd4c508b 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -9,6 +9,7 @@ #include #include #include +#include /* * The default fd array needs to be at least BITS_PER_LONG, @@ -23,6 +24,9 @@ struct fdtable { struct file ** fd; /* current fd array */ fd_set *close_on_exec; fd_set *open_fds; + struct rcu_head rcu; + struct files_struct *free_files; + struct fdtable *next; }; /* @@ -31,13 +35,14 @@ struct fdtable { struct files_struct { atomic_t count; spinlock_t file_lock; /* Protects all the below members. Nests inside tsk->alloc_lock */ + struct fdtable *fdt; struct fdtable fdtab; fd_set close_on_exec_init; fd_set open_fds_init; struct file * fd_array[NR_OPEN_DEFAULT]; }; -#define files_fdtable(files) (&(files)->fdtab) +#define files_fdtable(files) (rcu_dereference((files)->fdt)) extern void FASTCALL(__fput(struct file *)); extern void FASTCALL(fput(struct file *)); @@ -65,6 +70,8 @@ extern fd_set *alloc_fdset(int); extern void free_fdset(fd_set *, int); extern int expand_files(struct files_struct *, int nr); +extern void free_fdtable(struct fdtable *fdt); +extern void __init files_defer_init(void); static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) { @@ -72,7 +79,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in struct fdtable *fdt = files_fdtable(files); if (fd < fdt->max_fds) - file = fdt->fd[fd]; + file = rcu_dereference(fdt->fd[fd]); return file; } diff --git a/include/linux/fs.h b/include/linux/fs.h index fd93ab7da90..7f61227827d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -9,6 +9,7 @@ #include #include #include +#include /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change @@ -597,12 +598,13 @@ struct file { spinlock_t f_ep_lock; #endif /* #ifdef CONFIG_EPOLL */ struct address_space *f_mapping; + struct rcu_head f_rcuhead; }; extern spinlock_t files_lock; #define file_list_lock() spin_lock(&files_lock); #define file_list_unlock() spin_unlock(&files_lock); -#define get_file(x) atomic_inc(&(x)->f_count) +#define get_file(x) rcuref_inc(&(x)->f_count) #define file_count(x) atomic_read(&(x)->f_count) #define MAX_NON_LFS ((1UL<<31) - 1) diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 94aefa54a1b..68ab5f2ab9c 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -2,6 +2,7 @@ #define _LINUX__INIT_TASK_H #include +#include #define INIT_FDTABLE \ { \ @@ -11,12 +12,16 @@ .fd = &init_files.fd_array[0], \ .close_on_exec = &init_files.close_on_exec_init, \ .open_fds = &init_files.open_fds_init, \ + .rcu = RCU_HEAD_INIT, \ + .free_files = NULL, \ + .next = NULL, \ } #define INIT_FILES \ { \ .count = ATOMIC_INIT(1), \ .file_lock = SPIN_LOCK_UNLOCKED, \ + .fdt = &init_files.fdtab, \ .fdtab = INIT_FDTABLE, \ .close_on_exec_init = { { 0, } }, \ .open_fds_init = { { 0, } }, \ -- cgit v1.2.3 From 7726e9e10fc6e026ed2dc00e48f4a3ffc1254ad2 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:04:29 -0700 Subject: [PATCH] fbdev: Add fbset -a support Add capability to fbdev to listen to the FB_ACTIVATE_ALL flag. If set, it notifies fbcon that all consoles must be set to the current var. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index bc24beeed97..70da819df0f 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -495,6 +495,9 @@ struct fb_cursor_user { #define FB_EVENT_BLANK 0x08 /* Private modelist is to be replaced */ #define FB_EVENT_NEW_MODELIST 0x09 +/* The resolution of the passed in fb_info about to change and + all vc's should be changed */ +#define FB_EVENT_MODE_CHANGE_ALL 0x0A struct fb_event { struct fb_info *info; -- cgit v1.2.3 From d2d58384fc5d4c0fe2d8e34bc2d15a90a9bb372a Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:04:31 -0700 Subject: [PATCH] vesafb: Add blanking support Add rudimentary support by manipulating the VGA registers. However, not all vesa modes are VGA compatible, so VGA compatiblity is checked first. Only 2 levels are supported, powerup and powerdown. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/tty.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/tty.h b/include/linux/tty.h index 59ff42c629e..1267f88ece6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -74,7 +74,8 @@ struct screen_info { u16 vesapm_off; /* 0x30 */ u16 pages; /* 0x32 */ u16 vesa_attributes; /* 0x34 */ - /* 0x36 -- 0x3f reserved for future expansion */ + u32 capabilities; /* 0x36 */ + /* 0x3a -- 0x3f reserved for future expansion */ }; extern struct screen_info screen_info; -- cgit v1.2.3 From 5e518d7672dea4cd7c60871e40d0490c52f01d13 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:04:34 -0700 Subject: [PATCH] fbdev: Resurrect hooks to get EDID from firmware For the i386, code is already present in video.S that gets the EDID from the video BIOS. Make this visible so drivers can also use this data as fallback when i2c does not work. To ensure that the EDID block is returned for the primary graphics adapter only, by check if the IORESOURCE_ROM_SHADOW flag is set. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index 70da819df0f..e3e16f43b1b 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -859,7 +859,9 @@ extern int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, extern int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info); extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); -extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); +extern const unsigned char *fb_firmware_edid(struct device *device); +extern void fb_edid_to_monspecs(unsigned char *edid, + struct fb_monspecs *specs); extern void fb_destroy_modedb(struct fb_videomode *modedb); /* drivers/video/modedb.c */ -- cgit v1.2.3 From b8c909454f046b59065c6997b651fe20cd90c0f4 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:04:37 -0700 Subject: [PATCH] fbdev: Fix greater than 1 bit monochrome color handling Currently, fbcon assumes that the visual FB_VISUAL_MONO* is always 1 bit. According to Geert, there are old hardware where it's possible to have monochrome at 8-bit, but has only 2 colors, black - 0x00 and white - 0xff. Fix color handlers (fb_get_color_depth, and get_color) for this special case. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index e3e16f43b1b..c71a7162e09 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -823,7 +823,8 @@ extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx, u32 height, u32 shift_high, u32 shift_low, u32 mod); extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height); extern void fb_set_suspend(struct fb_info *info, int state); -extern int fb_get_color_depth(struct fb_var_screeninfo *var); +extern int fb_get_color_depth(struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix); extern int fb_get_options(char *name, char **option); extern int fb_new_modelist(struct fb_info *info); -- cgit v1.2.3 From 544393fe584d333480659a4bed30f5295355df11 Mon Sep 17 00:00:00 2001 From: Thomas Winischhofer Date: Fri, 9 Sep 2005 13:04:45 -0700 Subject: [PATCH] sisfb update This lifts sisfb from version 1.7.17 to version 1.8.9. Changes include: - Added support for XGI V3XT, V5, V8, Z7 chipsets, including POSTing of all of these chipsets. - Added support for latest SiS chipsets (761). - Added support for SiS76x memory "hybrid" mode. - Added support for new LCD resolutions (eg 1280x854, 856x480). - Fixed support for 320x240 STN panels (for embedded devices). - Fixed many HDTV modes (525p, 750p, 1080i). - Fixed PCI config register reading/writing to use proper kernel functions for this purpose. - Fixed PCI ROM handling to use the kernel's proper functions. - Removed lots of "typedef"s. - Removed lots of code which was for X.org/XFree86 only. - Fixed coding style in many places. - Removed lots of 2.4 cruft. - Reduced stack size by unifying two previously separate structs into one. - Added new hooks for memory allocation (for DRM). Now the driver can truly handle multiple cards, including memory management. - Fixed numerous minor bugs. Signed-off-by: Thomas Winischhofer Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 2 + include/video/sisfb.h | 188 ++++++++++++++++++++++++++++---------------------- 2 files changed, 109 insertions(+), 81 deletions(-) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index c71a7162e09..34814a0b237 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -107,6 +107,8 @@ #define FB_ACCEL_NV_20 44 /* nVidia Arch 20 */ #define FB_ACCEL_NV_30 45 /* nVidia Arch 30 */ #define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ +#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ +#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ #define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ #define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ #define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ diff --git a/include/video/sisfb.h b/include/video/sisfb.h index 136bf791643..e402eb5b3c7 100644 --- a/include/video/sisfb.h +++ b/include/video/sisfb.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria. + * sisfb.h - definitions for the SiS framebuffer driver + * + * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * 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 @@ -16,8 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ -#ifndef _LINUX_SISFB -#define _LINUX_SISFB +#ifndef _LINUX_SISFB_H_ +#define _LINUX_SISFB_H_ #include #include @@ -26,47 +28,35 @@ /* PUBLIC */ /**********************************************/ -/* vbflags */ -#define CRT2_DEFAULT 0x00000001 -#define CRT2_LCD 0x00000002 /* TW: Never change the order of the CRT2_XXX entries */ -#define CRT2_TV 0x00000004 /* (see SISCycleCRT2Type()) */ -#define CRT2_VGA 0x00000008 -#define TV_NTSC 0x00000010 -#define TV_PAL 0x00000020 -#define TV_HIVISION 0x00000040 -#define TV_YPBPR 0x00000080 -#define TV_AVIDEO 0x00000100 -#define TV_SVIDEO 0x00000200 -#define TV_SCART 0x00000400 -#define VB_CONEXANT 0x00000800 /* 661 series only */ -#define VB_TRUMPION VB_CONEXANT /* 300 series only */ -#define TV_PALM 0x00001000 -#define TV_PALN 0x00002000 +/* vbflags, public (others in sis.h) */ +#define CRT2_DEFAULT 0x00000001 +#define CRT2_LCD 0x00000002 +#define CRT2_TV 0x00000004 +#define CRT2_VGA 0x00000008 +#define TV_NTSC 0x00000010 +#define TV_PAL 0x00000020 +#define TV_HIVISION 0x00000040 +#define TV_YPBPR 0x00000080 +#define TV_AVIDEO 0x00000100 +#define TV_SVIDEO 0x00000200 +#define TV_SCART 0x00000400 +#define TV_PALM 0x00001000 +#define TV_PALN 0x00002000 #define TV_NTSCJ 0x00001000 -#define VB_302ELV 0x00004000 -#define TV_CHSCART 0x00008000 -#define TV_CHYPBPR525I 0x00010000 +#define TV_CHSCART 0x00008000 +#define TV_CHYPBPR525I 0x00010000 #define CRT1_VGA 0x00000000 #define CRT1_LCDA 0x00020000 #define VGA2_CONNECTED 0x00040000 -#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ -#define VB_301 0x00100000 /* Video bridge type */ -#define VB_301B 0x00200000 -#define VB_302B 0x00400000 -#define VB_30xBDH 0x00800000 /* 30xB DH version (w/o LCD support) */ -#define VB_LVDS 0x01000000 -#define VB_CHRONTEL 0x02000000 -#define VB_301LV 0x04000000 -#define VB_302LV 0x08000000 -#define VB_301C 0x10000000 -#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ -#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ -#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ +#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ +#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ +#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ +#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ /* Aliases: */ #define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) -#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) -#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) +#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) +#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) /* Only if TV_YPBPR is set: */ #define TV_YPBPR525I TV_NTSC @@ -75,89 +65,118 @@ #define TV_YPBPR1080I TV_PALN #define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I) -#define VB_SISBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV) -#define VB_SISTVBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV) -#define VB_VIDEOBRIDGE (VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT) - #define VB_DISPTYPE_DISP2 CRT2_ENABLE #define VB_DISPTYPE_CRT2 CRT2_ENABLE #define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1 #define VB_DISPMODE_SINGLE VB_SINGLE_MODE #define VB_DISPMODE_MIRROR VB_MIRROR_MODE #define VB_DISPMODE_DUAL VB_DUALVIEW_MODE -#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) +#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) /* Structure argument for SISFB_GET_INFO ioctl */ -typedef struct _SISFB_INFO sisfb_info, *psisfb_info; - -struct _SISFB_INFO { - __u32 sisfb_id; /* for identifying sisfb */ +struct sisfb_info { + __u32 sisfb_id; /* for identifying sisfb */ #ifndef SISFB_ID #define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ #endif - __u32 chip_id; /* PCI-ID of detected chip */ - __u32 memory; /* video memory in KB which sisfb manages */ - __u32 heapstart; /* heap start (= sisfb "mem" argument) in KB */ + __u32 chip_id; /* PCI-ID of detected chip */ + __u32 memory; /* total video memory in KB */ + __u32 heapstart; /* heap start offset in KB */ __u8 fbvidmode; /* current sisfb mode */ - __u8 sisfb_version; - __u8 sisfb_revision; - __u8 sisfb_patchlevel; + __u8 sisfb_version; + __u8 sisfb_revision; + __u8 sisfb_patchlevel; - __u8 sisfb_caps; /* sisfb capabilities */ + __u8 sisfb_caps; /* sisfb capabilities */ __u32 sisfb_tqlen; /* turbo queue length (in KB) */ - __u32 sisfb_pcibus; /* The card's PCI ID */ - __u32 sisfb_pcislot; - __u32 sisfb_pcifunc; + __u32 sisfb_pcibus; /* The card's PCI ID */ + __u32 sisfb_pcislot; + __u32 sisfb_pcifunc; + + __u8 sisfb_lcdpdc; /* PanelDelayCompensation */ + + __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ + + __u32 sisfb_vbflags; + __u32 sisfb_currentvbflags; + + __u32 sisfb_scalelcd; + __u32 sisfb_specialtiming; + + __u8 sisfb_haveemi; + __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; + __u8 sisfb_haveemilcd; - __u8 sisfb_lcdpdc; /* PanelDelayCompensation */ + __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ - __u8 sisfb_lcda; /* Detected status of LCDA for low res/text modes */ + __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ - __u32 sisfb_vbflags; - __u32 sisfb_currentvbflags; + __u32 sisfb_heapsize; /* heap size (in KB) */ + __u32 sisfb_videooffset; /* Offset of viewport in video memory (in bytes) */ - __u32 sisfb_scalelcd; - __u32 sisfb_specialtiming; + __u32 sisfb_curfstn; /* currently running FSTN/DSTN mode */ + __u32 sisfb_curdstn; - __u8 sisfb_haveemi; - __u8 sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; - __u8 sisfb_haveemilcd; + __u16 sisfb_pci_vendor; /* PCI vendor (SiS or XGI) */ - __u8 sisfb_lcdpdca; /* PanelDelayCompensation for LCD-via-CRT1 */ + __u32 sisfb_vbflags2; /* ivideo->vbflags2 */ - __u16 sisfb_tvxpos, sisfb_tvypos; /* Warning: Values + 32 ! */ + __u8 sisfb_can_post; /* sisfb can POST this card */ + __u8 sisfb_card_posted; /* card is POSTED */ + __u8 sisfb_was_boot_device; /* This card was the boot video device (ie is primary) */ - __u8 reserved[208]; /* for future use */ + __u8 reserved[183]; /* for future use */ +}; + +#define SISFB_CMD_GETVBFLAGS 0x55AA0001 /* no arg; result[1] = vbflags */ +#define SISFB_CMD_SWITCHCRT1 0x55AA0010 /* arg[0]: 99 = query, 0 = off, 1 = on */ +/* more to come */ + +#define SISFB_CMD_ERR_OK 0x80000000 /* command succeeded */ +#define SISFB_CMD_ERR_LOCKED 0x80000001 /* sisfb is locked */ +#define SISFB_CMD_ERR_EARLY 0x80000002 /* request before sisfb took over gfx system */ +#define SISFB_CMD_ERR_NOVB 0x80000003 /* No video bridge */ +#define SISFB_CMD_ERR_NOCRT2 0x80000004 /* can't change CRT1 status, CRT2 disabled */ +/* more to come */ +#define SISFB_CMD_ERR_UNKNOWN 0x8000ffff /* Unknown command */ +#define SISFB_CMD_ERR_OTHER 0x80010000 /* Other error */ + +/* Argument for SISFB_CMD ioctl */ +struct sisfb_cmd { + __u32 sisfb_cmd; + __u32 sisfb_arg[16]; + __u32 sisfb_result[4]; }; /* Addtional IOCTLs for communication sisfb <> X driver */ /* If changing this, vgatypes.h must also be changed (for X driver) */ /* ioctl for identifying and giving some info (esp. memory heap start) */ -#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32) -#define SISFB_GET_INFO _IOR(0xF3,0x01,struct _SISFB_INFO) +#define SISFB_GET_INFO_SIZE _IOR(0xF3,0x00,__u32) +#define SISFB_GET_INFO _IOR(0xF3,0x01,struct sisfb_info) /* ioctrl to get current vertical retrace status */ -#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32) +#define SISFB_GET_VBRSTATUS _IOR(0xF3,0x02,__u32) /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ -#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32) -#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32) +#define SISFB_GET_AUTOMAXIMIZE _IOR(0xF3,0x03,__u32) +#define SISFB_SET_AUTOMAXIMIZE _IOW(0xF3,0x03,__u32) /* ioctls to relocate TV output (x=D[31:16], y=D[15:0], + 32)*/ -#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32) -#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32) +#define SISFB_GET_TVPOSOFFSET _IOR(0xF3,0x04,__u32) +#define SISFB_SET_TVPOSOFFSET _IOW(0xF3,0x04,__u32) + +/* ioctl for internal sisfb commands (sisfbctrl) */ +#define SISFB_COMMAND _IOWR(0xF3,0x05,struct sisfb_cmd) /* ioctl for locking sisfb (no register access during lock) */ /* As of now, only used to avoid register access during * the ioctls listed above. */ -#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32) - -/* more to come soon */ +#define SISFB_SET_LOCK _IOW(0xF3,0x06,__u32) /* ioctls 0xF3 up to 0x3F reserved for sisfb */ @@ -165,7 +184,7 @@ struct _SISFB_INFO { /* The following are deprecated and should not be used anymore: */ /****************************************************************/ /* ioctl for identifying and giving some info (esp. memory heap start) */ -#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32) +#define SISFB_GET_INFO_OLD _IOR('n',0xF8,__u32) /* ioctrl to get current vertical retrace status */ #define SISFB_GET_VBRSTATUS_OLD _IOR('n',0xF9,__u32) /* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ @@ -177,8 +196,8 @@ struct _SISFB_INFO { /* For fb memory manager (FBIO_ALLOC, FBIO_FREE) */ struct sis_memreq { - __u32 offset; - __u32 size; + __u32 offset; + __u32 size; }; /**********************************************/ @@ -187,12 +206,19 @@ struct sis_memreq { /**********************************************/ #ifdef __KERNEL__ + +#include + #define UNKNOWN_VGA 0 #define SIS_300_VGA 1 #define SIS_315_VGA 2 +#define SISFB_HAVE_MALLOC_NEW extern void sis_malloc(struct sis_memreq *req); +extern void sis_malloc_new(struct pci_dev *pdev, struct sis_memreq *req); + extern void sis_free(u32 base); +extern void sis_free_new(struct pci_dev *pdev, u32 base); #endif #endif -- cgit v1.2.3 From 9fa68eae9f8291a98bfe00b94b78f72eb253165a Mon Sep 17 00:00:00 2001 From: Knut Petersen Date: Fri, 9 Sep 2005 13:04:56 -0700 Subject: [PATCH] framebuffer: new driver for cyberblade/i1 graphics core This is a framebuffer driver for the Cyberblade/i1 graphics core. Currently tridenfb claims to support the cyberblade/i1 graphics core. This is of very limited truth. Even vesafb is faster and provides more working modes and a much better quality of the video signal. There is a great number of bugs in tridentfb ... but most often it is impossible to decide if these bugs are real bugs or if fixing them for the cyberblade/i1 core would break support for one of the other supported chips. Tridentfb seems to be unmaintained,and documentation for most of the supported chips is not available. So "fixing" cyberblade/i1 support inside of tridentfb was not an option, it would have caused numerous if(CYBERBLADEi1) else ... cases and would have rendered the code to be almost unmaintainable. A first version of this driver was published on 2005-07-31. A fix for a bug reported by Jochen Hein was integrated as well as some changes requested by Antonino A. Daplas. A message has been added to tridentfb to inform current users of tridentfb to switch to cyblafb if the cyberblade/i1 graphics core is detected. This patch is one logical change, but because of the included documentation it is bigger than 70kb. Therefore it is not sent to lkml and linux-fbdev-devel, Signed-off-by: Knut Petersen Cc: Muli Ben-Yehuda Acked-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/cyblafb.h | 171 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 include/video/cyblafb.h (limited to 'include') diff --git a/include/video/cyblafb.h b/include/video/cyblafb.h new file mode 100644 index 00000000000..a9948232b13 --- /dev/null +++ b/include/video/cyblafb.h @@ -0,0 +1,171 @@ + +#ifndef CYBLAFB_DEBUG +#define CYBLAFB_DEBUG 0 +#endif + +#if CYBLAFB_DEBUG +#define debug(f,a...) printk("%s:" f, __FUNCTION__ , ## a); +#else +#define debug(f,a...) +#endif + +#define output(f, a...) printk("cyblafb: " f, ## a) + +#define Kb (1024) +#define Mb (Kb*Kb) + +/* PCI IDS of supported cards temporarily here */ + +#define CYBERBLADEi1 0x8500 + +/* these defines are for 'lcd' variable */ +#define LCD_STRETCH 0 +#define LCD_CENTER 1 +#define LCD_BIOS 2 + +/* display types */ +#define DISPLAY_CRT 0 +#define DISPLAY_FP 1 + +#define ROP_S 0xCC + +#define point(x,y) ((y)<<16|(x)) + +// +// Attribute Regs, ARxx, 3c0/3c1 +// +#define AR00 0x00 +#define AR01 0x01 +#define AR02 0x02 +#define AR03 0x03 +#define AR04 0x04 +#define AR05 0x05 +#define AR06 0x06 +#define AR07 0x07 +#define AR08 0x08 +#define AR09 0x09 +#define AR0A 0x0A +#define AR0B 0x0B +#define AR0C 0x0C +#define AR0D 0x0D +#define AR0E 0x0E +#define AR0F 0x0F +#define AR10 0x10 +#define AR12 0x12 +#define AR13 0x13 + +// +// Sequencer Regs, SRxx, 3c4/3c5 +// +#define SR00 0x00 +#define SR01 0x01 +#define SR02 0x02 +#define SR03 0x03 +#define SR04 0x04 +#define SR0D 0x0D +#define SR0E 0x0E +#define SR11 0x11 +#define SR18 0x18 +#define SR19 0x19 + +// +// +// +#define CR00 0x00 +#define CR01 0x01 +#define CR02 0x02 +#define CR03 0x03 +#define CR04 0x04 +#define CR05 0x05 +#define CR06 0x06 +#define CR07 0x07 +#define CR08 0x08 +#define CR09 0x09 +#define CR0A 0x0A +#define CR0B 0x0B +#define CR0C 0x0C +#define CR0D 0x0D +#define CR0E 0x0E +#define CR0F 0x0F +#define CR10 0x10 +#define CR11 0x11 +#define CR12 0x12 +#define CR13 0x13 +#define CR14 0x14 +#define CR15 0x15 +#define CR16 0x16 +#define CR17 0x17 +#define CR18 0x18 +#define CR19 0x19 +#define CR1A 0x1A +#define CR1B 0x1B +#define CR1C 0x1C +#define CR1D 0x1D +#define CR1E 0x1E +#define CR1F 0x1F +#define CR20 0x20 +#define CR21 0x21 +#define CR27 0x27 +#define CR29 0x29 +#define CR2A 0x2A +#define CR2B 0x2B +#define CR2D 0x2D +#define CR2F 0x2F +#define CR36 0x36 +#define CR38 0x38 +#define CR39 0x39 +#define CR3A 0x3A +#define CR55 0x55 +#define CR56 0x56 +#define CR57 0x57 +#define CR58 0x58 + +// +// +// + +#define GR00 0x01 +#define GR01 0x01 +#define GR02 0x02 +#define GR03 0x03 +#define GR04 0x04 +#define GR05 0x05 +#define GR06 0x06 +#define GR07 0x07 +#define GR08 0x08 +#define GR0F 0x0F +#define GR20 0x20 +#define GR23 0x23 +#define GR2F 0x2F +#define GR30 0x30 +#define GR31 0x31 +#define GR33 0x33 +#define GR52 0x52 +#define GR53 0x53 +#define GR5D 0x5d + + +// +// Graphics Engine +// +#define GEBase 0x2100 // could be mapped elsewhere if we like it +#define GE00 (GEBase+0x00) // source 1, p 111 +#define GE04 (GEBase+0x04) // source 2, p 111 +#define GE08 (GEBase+0x08) // destination 1, p 111 +#define GE0C (GEBase+0x0C) // destination 2, p 112 +#define GE20 (GEBase+0x20) // engine status, p 113 +#define GE24 (GEBase+0x24) // reset all GE pointers +#define GE44 (GEBase+0x44) // command register, p 126 +#define GE48 (GEBase+0x48) // raster operation, p 127 +#define GE60 (GEBase+0x60) // foreground color, p 128 +#define GE64 (GEBase+0x64) // background color, p 128 +#define GE6C (GEBase+0x6C) // Pattern and Style, p 129, ok +#define GE9C (GEBase+0x9C) // pixel engine data port, p 125 +#define GEB8 (GEBase+0xB8) // Destination Stride / Buffer Base 0, p 133 +#define GEBC (GEBase+0xBC) // Destination Stride / Buffer Base 1, p 133 +#define GEC0 (GEBase+0xC0) // Destination Stride / Buffer Base 2, p 133 +#define GEC4 (GEBase+0xC4) // Destination Stride / Buffer Base 3, p 133 +#define GEC8 (GEBase+0xC8) // Source Stride / Buffer Base 0, p 133 +#define GECC (GEBase+0xCC) // Source Stride / Buffer Base 1, p 133 +#define GED0 (GEBase+0xD0) // Source Stride / Buffer Base 2, p 133 +#define GED4 (GEBase+0xD4) // Source Stride / Buffer Base 3, p 133 -- cgit v1.2.3 From cdb9b9f730eac4f947a2c552806a3a550bf019ef Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 6 Sep 2005 09:31:03 +1000 Subject: [PATCH] PCI: Small rearrangement of PCI probing code This patch makes some small rearrangements of the PCI probing code in order to make it possible for arch code to set up the PCI tree without needing to duplicate code from the PCI layer unnecessarily. PPC64 will use this to set up the PCI tree from the Open Firmware device tree, which we need to do on logically-partitioned pSeries systems. Signed-off-by: Paul Mackerras Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 609499356e0..9c7aecf0c59 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -315,8 +315,11 @@ static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *s pci_bus_add_devices(root_bus); return root_bus; } +struct pci_bus *pci_create_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata); +struct pci_bus * pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr); int pci_scan_slot(struct pci_bus *bus, int devfn); struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); +void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); unsigned int pci_scan_child_bus(struct pci_bus *bus); void pci_bus_add_device(struct pci_dev *dev); void pci_read_bridge_bases(struct pci_bus *child); -- cgit v1.2.3 From 96fe6a2109db29cd15b90a093c16e6cb4b19371a Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:09:58 -0700 Subject: [PATCH] fbdev: Add VESA Coordinated Video Timings (CVT) support The Coordinated Video Timings (CVT) is the latest standard approved by VESA concerning video timings generation. It addresses the limitation of GTF which is designed mainly for CRT displays. CRT's have a high blanking requirement (as much as 25% of the horizontal frame length) which artificially increases the pixelclock. Digital displays, on the other hand, needs to conserve the pixelclock as much as possible. The GTF also does not take into account the different aspect ratios in its calculation. The new function added is fb_find_mode_cvt(). It is called by fb_find_mode() if it recognizes a mode option string formatted for CVT. The format is: x[M][R][-][][i][m] The 'M' tells the function to calculate using CVT. On it's own, it will compute a timing for CRT displays at 60Hz. If the 'R' is specified, 'reduced blanking' computation will be used, best for flatpanels. The 'i' and the 'm' is for 'interlaced mode' and 'with margins' respectively. To determine if CVT was used, check for dmesg for something like this: CVT Mode - M[-R], ie: .480M3-R (800x600 reduced blanking) where: pix - product of xres and yres, in MB M - is a CVT mode n - the aspect ratio (3 - 4:3; 4 - 5:4; 9 - 16:9, 15:9; A - 16:10) -R - reduced blanking Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index 34814a0b237..9a4f035e9fd 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -866,6 +866,7 @@ extern const unsigned char *fb_firmware_edid(struct device *device); extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); extern void fb_destroy_modedb(struct fb_videomode *modedb); +extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); /* drivers/video/modedb.c */ #define VESA_MODEDB_SIZE 34 -- cgit v1.2.3 From ba44cd2d8abc3271a608b42cdbf55e1e575e2ba5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 9 Sep 2005 13:10:03 -0700 Subject: [PATCH] pxafb: Add hsync time reporting hook To solve touchscreen interference problems devices like the Sharp Zaurus SL-C3000 need to know the length of the horitzontal sync pulses. This patch adds a hook to pxafb so the touchscreen driver can function correctly. Signed-Off-By: Richard Purdie Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-pxa/pxafb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h index 27d71e9d413..21c0e16dce5 100644 --- a/include/asm-arm/arch-pxa/pxafb.h +++ b/include/asm-arm/arch-pxa/pxafb.h @@ -66,3 +66,4 @@ struct pxafb_mach_info { }; void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); +unsigned long pxafb_get_hsync_time(struct device *dev); -- cgit v1.2.3 From 829e79b680210c4f4de435af6e1f90451922fc7d Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Fri, 9 Sep 2005 13:10:04 -0700 Subject: [PATCH] fbcon: Break up bit_putcs into its component functions The function bit_putcs() in drivers/video/console/bitblit.c is becoming large. Break it up into its component functions (bit_putcs_unaligned and bit_putcs_aligned). Incorporated fb_pad_aligned_buffer() optimization by Roman Zippel. Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/linux/fb.h b/include/linux/fb.h index 9a4f035e9fd..82e39cd0c4f 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -833,6 +833,21 @@ extern int fb_new_modelist(struct fb_info *info); extern struct fb_info *registered_fb[FB_MAX]; extern int num_registered_fb; +static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, + u8 *src, u32 s_pitch, u32 height) +{ + int i, j; + + d_pitch -= s_pitch; + + for (i = height; i--; ) { + /* s_pitch is a few bytes at the most, memcpy is suboptimal */ + for (j = 0; j < s_pitch; j++) + *dst++ = *src++; + dst += d_pitch; + } +} + /* drivers/video/fbsysfs.c */ extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); extern void framebuffer_release(struct fb_info *info); -- cgit v1.2.3 From 20fd5767689124a920c1deb9c380304e082f026c Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Fri, 9 Sep 2005 13:10:07 -0700 Subject: [PATCH] s3c2410fb: ARM S3C2410 framebuffer driver This set of two patches add support for the framebuffer of the Samsung S3C2410 ARM SoC. This driver was started about one year ago and is now used on iPAQ h1930/h1940, Acer n30 and probably other s3c2410-based machines I'm not aware of. I've also heard yesterday that it's working also on iPAQ rx3715/rx3115 (s3c2440-based machines). Signed-Off-By: Arnaud Patard Signed-off-by: Antonino Daplas Signed-off-by: Ben Dooks Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-s3c2410/fb.h | 69 +++++++++++++++++++++++++++++++++ include/asm-arm/arch-s3c2410/regs-lcd.h | 17 ++++++++ 2 files changed, 86 insertions(+) create mode 100644 include/asm-arm/arch-s3c2410/fb.h (limited to 'include') diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h new file mode 100644 index 00000000000..ac57bc887d8 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/fb.h @@ -0,0 +1,69 @@ +/* linux/include/asm/arch-s3c2410/fb.h + * + * Copyright (c) 2004 Arnaud Patard + * + * Inspired by pxafb.h + * + * 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. + * + * + * Changelog: + * 07-Sep-2004 RTP Created file + * 03-Nov-2004 BJD Updated and minor cleanups + * 03-Aug-2005 RTP Renamed to fb.h +*/ + +#ifndef __ASM_ARM_FB_H +#define __ASM_ARM_FB_H + +#include + +struct s3c2410fb_val { + unsigned int defval; + unsigned int min; + unsigned int max; +}; + +struct s3c2410fb_hw { + unsigned long lcdcon1; + unsigned long lcdcon2; + unsigned long lcdcon3; + unsigned long lcdcon4; + unsigned long lcdcon5; +}; + +struct s3c2410fb_mach_info { + unsigned char fixed_syncs; /* do not update sync/border */ + + /* Screen size */ + int width; + int height; + + /* Screen info */ + struct s3c2410fb_val xres; + struct s3c2410fb_val yres; + struct s3c2410fb_val bpp; + + /* lcd configuration registers */ + struct s3c2410fb_hw regs; + + /* GPIOs */ + + unsigned long gpcup; + unsigned long gpcup_mask; + unsigned long gpccon; + unsigned long gpccon_mask; + unsigned long gpdup; + unsigned long gpdup_mask; + unsigned long gpdcon; + unsigned long gpdcon_mask; + + /* lpc3600 control register */ + unsigned long lpcsel; +}; + +void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); + +#endif /* __ASM_ARM_FB_H */ diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h index 7f882ea92b2..b6b1b4e8bbe 100644 --- a/include/asm-arm/arch-s3c2410/regs-lcd.h +++ b/include/asm-arm/arch-s3c2410/regs-lcd.h @@ -51,21 +51,32 @@ #define S3C2410_LCDCON1_ENVID (1) +#define S3C2410_LCDCON1_MODEMASK 0x1E + #define S3C2410_LCDCON2_VBPD(x) ((x) << 24) #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14) #define S3C2410_LCDCON2_VFPD(x) ((x) << 6) #define S3C2410_LCDCON2_VSPW(x) ((x) << 0) +#define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF) +#define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF) +#define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F) + #define S3C2410_LCDCON3_HBPD(x) ((x) << 19) #define S3C2410_LCDCON3_WDLY(x) ((x) << 19) #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8) #define S3C2410_LCDCON3_HFPD(x) ((x) << 0) #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0) +#define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F) +#define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF) + #define S3C2410_LCDCON4_MVAL(x) ((x) << 8) #define S3C2410_LCDCON4_HSPW(x) ((x) << 0) #define S3C2410_LCDCON4_WLH(x) ((x) << 0) +#define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF) + #define S3C2410_LCDCON5_BPP24BL (1<<12) #define S3C2410_LCDCON5_FRM565 (1<<11) #define S3C2410_LCDCON5_INVVCLK (1<<10) @@ -100,10 +111,16 @@ #define S3C2410_DITHMODE S3C2410_LCDREG(0x4C) #define S3C2410_TPAL S3C2410_LCDREG(0x50) +#define S3C2410_TPAL_EN (1<<24) + /* interrupt info */ #define S3C2410_LCDINTPND S3C2410_LCDREG(0x54) #define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58) #define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C) +#define S3C2410_LCDINT_FIWSEL (1<<2) +#define S3C2410_LCDINT_FRSYNC (1<<1) +#define S3C2410_LCDINT_FICNT (1<<0) + #define S3C2410_LPCSEL S3C2410_LCDREG(0x60) #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4)) -- cgit v1.2.3 From 9d01a82e46a8dd18233121a6bc140e5576649583 Mon Sep 17 00:00:00 2001 From: Martin Waitz Date: Fri, 9 Sep 2005 13:10:17 -0700 Subject: [PATCH] DocBook: fix kernel-api documentation generation This patch changes a macro definition so that kernel-doc can understand it. Signed-off-by: Martin Waitz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/sound/pcm.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 389e8ebe9c1..d6361dab037 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -910,11 +910,10 @@ int snd_pcm_format_big_endian(snd_pcm_format_t format); * Returns 1 if the given PCM format is CPU-endian, 0 if * opposite, or a negative error code if endian not specified. */ -/* int snd_pcm_format_cpu_endian(snd_pcm_format_t format); */ #ifdef SNDRV_LITTLE_ENDIAN -#define snd_pcm_format_cpu_endian snd_pcm_format_little_endian +#define snd_pcm_format_cpu_endian(format) snd_pcm_format_little_endian(format) #else -#define snd_pcm_format_cpu_endian snd_pcm_format_big_endian +#define snd_pcm_format_cpu_endian(format) snd_pcm_format_big_endian(format) #endif int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ -- cgit v1.2.3 From d8a5ba45457e4a22aa39c939121efd7bb6c76672 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:26 -0700 Subject: [PATCH] FUSE - core This patch adds FUSE core. This contains the following files: o inode.c - superblock operations (alloc_inode, destroy_inode, read_inode, clear_inode, put_super, show_options) - registers FUSE filesystem o fuse_i.h - private header file Requirements ============ The most important difference between orinary filesystems and FUSE is the fact, that the filesystem data/metadata is provided by a userspace process run with the privileges of the mount "owner" instead of the kernel, or some remote entity usually running with elevated privileges. The security implication of this is that a non-privileged user must not be able to use this capability to compromise the system. Obvious requirements arising from this are: - mount owner should not be able to get elevated privileges with the help of the mounted filesystem - mount owner should not be able to induce undesired behavior in other users' or the super user's processes - mount owner should not get illegitimate access to information from other users' and the super user's processes These are currently ensured with the following constraints: 1) mount is only allowed to directory or file which the mount owner can modify without limitation (write access + no sticky bit for directories) 2) nosuid,nodev mount options are forced 3) any process running with fsuid different from the owner is denied all access to the filesystem 1) and 2) are ensured by the "fusermount" mount utility which is a setuid root application doing the actual mount operation. 3) is ensured by a check in the permission() method in kernel I started thinking about doing 3) in a different way because Christoph H. made a big deal out of it, saying that FUSE is unacceptable into mainline in this form. The suggested use of private namespaces would be OK, but in their current form have many limitations that make their use impractical (as discussed in this thread). Suggested improvements that would address these limitations: - implement shared subtrees - allow a process to join an existing namespace (make namespaces first-class objects) - implement the namespace creation/joining in a PAM module With all that in place the check of owner against current->fsuid may be removed from the FUSE kernel module, without compromising the security requirements. Suid programs still interesting questions, since they get access even to the private namespace causing some information leak (exact order/timing of filesystem operations performed), giving some ptrace-like capabilities to unprivileged users. BTW this problem is not strictly limited to the namespace approach, since suid programs setting fsuid and accessing users' files will succeed with the current approach too. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 include/linux/fuse.h (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h new file mode 100644 index 00000000000..2b1f4ae01e9 --- /dev/null +++ b/include/linux/fuse.h @@ -0,0 +1,38 @@ +/* + FUSE: Filesystem in Userspace + Copyright (C) 2001-2005 Miklos Szeredi + + This program can be distributed under the terms of the GNU GPL. + See the file COPYING. +*/ + +/* This file defines the kernel interface of FUSE */ + +#include + +/** Version number of this interface */ +#define FUSE_KERNEL_VERSION 5 + +/** Minor version number of this interface */ +#define FUSE_KERNEL_MINOR_VERSION 1 + +/** The node ID of the root inode */ +#define FUSE_ROOT_ID 1 + +struct fuse_attr { + __u64 ino; + __u64 size; + __u64 blocks; + __u64 atime; + __u64 mtime; + __u64 ctime; + __u32 atimensec; + __u32 mtimensec; + __u32 ctimensec; + __u32 mode; + __u32 nlink; + __u32 uid; + __u32 gid; + __u32 rdev; +}; + -- cgit v1.2.3 From 334f485df85ac7736ebe14940bf0a059c5f26d7d Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:27 -0700 Subject: [PATCH] FUSE - device functions This adds the FUSE device handling functions. This contains the following files: o dev.c - fuse device operations (read, write, release, poll) - registers misc device - support for sending requests to userspace Signed-off-by: Miklos Szeredi Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 2b1f4ae01e9..a1aebd7104c 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -11,7 +11,7 @@ #include /** Version number of this interface */ -#define FUSE_KERNEL_VERSION 5 +#define FUSE_KERNEL_VERSION 6 /** Minor version number of this interface */ #define FUSE_KERNEL_MINOR_VERSION 1 @@ -19,6 +19,12 @@ /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 +/** The major number of the fuse character device */ +#define FUSE_MAJOR 10 + +/** The minor number of the fuse character device */ +#define FUSE_MINOR 229 + struct fuse_attr { __u64 ino; __u64 size; @@ -36,3 +42,31 @@ struct fuse_attr { __u32 rdev; }; +enum fuse_opcode { + FUSE_INIT = 26 +}; + +/* Conservative buffer size for the client */ +#define FUSE_MAX_IN 8192 + +struct fuse_init_in_out { + __u32 major; + __u32 minor; +}; + +struct fuse_in_header { + __u32 len; + __u32 opcode; + __u64 unique; + __u64 nodeid; + __u32 uid; + __u32 gid; + __u32 pid; +}; + +struct fuse_out_header { + __u32 len; + __s32 error; + __u64 unique; +}; + -- cgit v1.2.3 From e5e5558e923f35839108a12718494ecb73fb782f Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:28 -0700 Subject: [PATCH] FUSE - read-only operations This patch adds the read-only filesystem operations of FUSE. This contains the following files: o dir.c - directory, symlink and file-inode operations The following operations are added: o lookup o getattr o readlink o follow_link o directory open o readdir o directory release o permission o dentry revalidate o statfs Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index a1aebd7104c..21b9ba16f8d 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -42,13 +42,61 @@ struct fuse_attr { __u32 rdev; }; +struct fuse_kstatfs { + __u64 blocks; + __u64 bfree; + __u64 bavail; + __u64 files; + __u64 ffree; + __u32 bsize; + __u32 namelen; +}; + enum fuse_opcode { + FUSE_LOOKUP = 1, + FUSE_FORGET = 2, /* no reply */ + FUSE_GETATTR = 3, + FUSE_READLINK = 5, + FUSE_GETDIR = 7, + FUSE_STATFS = 17, FUSE_INIT = 26 }; /* Conservative buffer size for the client */ #define FUSE_MAX_IN 8192 +#define FUSE_NAME_MAX 1024 + +struct fuse_entry_out { + __u64 nodeid; /* Inode ID */ + __u64 generation; /* Inode generation: nodeid:gen must + be unique for the fs's lifetime */ + __u64 entry_valid; /* Cache timeout for the name */ + __u64 attr_valid; /* Cache timeout for the attributes */ + __u32 entry_valid_nsec; + __u32 attr_valid_nsec; + struct fuse_attr attr; +}; + +struct fuse_forget_in { + __u64 version; +}; + +struct fuse_attr_out { + __u64 attr_valid; /* Cache timeout for the attributes */ + __u32 attr_valid_nsec; + __u32 dummy; + struct fuse_attr attr; +}; + +struct fuse_getdir_out { + __u32 fd; +}; + +struct fuse_statfs_out { + struct fuse_kstatfs st; +}; + struct fuse_init_in_out { __u32 major; __u32 minor; @@ -70,3 +118,15 @@ struct fuse_out_header { __u64 unique; }; +struct fuse_dirent { + __u64 ino; + __u64 off; + __u32 namelen; + __u32 type; + char name[0]; +}; + +#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) +#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) +#define FUSE_DIRENT_SIZE(d) \ + FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) -- cgit v1.2.3 From 9e6268db496a2592e89457537ea54a496feabb77 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:29 -0700 Subject: [PATCH] FUSE - read-write operations This patch adds the write filesystem operations of FUSE. The following operations are added: o setattr o symlink o mknod o mkdir o create o unlink o rmdir o rename o link Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 21b9ba16f8d..19d69a3e162 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -11,7 +11,7 @@ #include /** Version number of this interface */ -#define FUSE_KERNEL_VERSION 6 +#define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ #define FUSE_KERNEL_MINOR_VERSION 1 @@ -52,12 +52,28 @@ struct fuse_kstatfs { __u32 namelen; }; +#define FATTR_MODE (1 << 0) +#define FATTR_UID (1 << 1) +#define FATTR_GID (1 << 2) +#define FATTR_SIZE (1 << 3) +#define FATTR_ATIME (1 << 4) +#define FATTR_MTIME (1 << 5) +#define FATTR_CTIME (1 << 6) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ FUSE_GETATTR = 3, + FUSE_SETATTR = 4, FUSE_READLINK = 5, + FUSE_SYMLINK = 6, FUSE_GETDIR = 7, + FUSE_MKNOD = 8, + FUSE_MKDIR = 9, + FUSE_UNLINK = 10, + FUSE_RMDIR = 11, + FUSE_RENAME = 12, + FUSE_LINK = 13, FUSE_STATFS = 17, FUSE_INIT = 26 }; @@ -66,6 +82,7 @@ enum fuse_opcode { #define FUSE_MAX_IN 8192 #define FUSE_NAME_MAX 1024 +#define FUSE_SYMLINK_MAX 4096 struct fuse_entry_out { __u64 nodeid; /* Inode ID */ @@ -79,7 +96,7 @@ struct fuse_entry_out { }; struct fuse_forget_in { - __u64 version; + __u64 nlookup; }; struct fuse_attr_out { @@ -93,6 +110,28 @@ struct fuse_getdir_out { __u32 fd; }; +struct fuse_mknod_in { + __u32 mode; + __u32 rdev; +}; + +struct fuse_mkdir_in { + __u32 mode; +}; + +struct fuse_rename_in { + __u64 newdir; +}; + +struct fuse_link_in { + __u64 oldnodeid; +}; + +struct fuse_setattr_in { + __u32 valid; + struct fuse_attr attr; +}; + struct fuse_statfs_out { struct fuse_kstatfs st; }; -- cgit v1.2.3 From b6aeadeda22a9aa322fdfcd3f4c69ccf0da5cbdd Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:30 -0700 Subject: [PATCH] FUSE - file operations This patch adds the file operations of FUSE. The following operations are added: o open o flush o release o fsync o readpage o commit_write Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 19d69a3e162..61f34636ffb 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -74,7 +74,13 @@ enum fuse_opcode { FUSE_RMDIR = 11, FUSE_RENAME = 12, FUSE_LINK = 13, + FUSE_OPEN = 14, + FUSE_READ = 15, + FUSE_WRITE = 16, FUSE_STATFS = 17, + FUSE_RELEASE = 18, + FUSE_FSYNC = 20, + FUSE_FLUSH = 25, FUSE_INIT = 26 }; @@ -132,10 +138,51 @@ struct fuse_setattr_in { struct fuse_attr attr; }; +struct fuse_open_in { + __u32 flags; +}; + +struct fuse_open_out { + __u64 fh; + __u32 open_flags; +}; + +struct fuse_release_in { + __u64 fh; + __u32 flags; +}; + +struct fuse_flush_in { + __u64 fh; + __u32 flush_flags; +}; + +struct fuse_read_in { + __u64 fh; + __u64 offset; + __u32 size; +}; + +struct fuse_write_in { + __u64 fh; + __u64 offset; + __u32 size; + __u32 write_flags; +}; + +struct fuse_write_out { + __u32 size; +}; + struct fuse_statfs_out { struct fuse_kstatfs st; }; +struct fuse_fsync_in { + __u64 fh; + __u32 fsync_flags; +}; + struct fuse_init_in_out { __u32 major; __u32 minor; -- cgit v1.2.3 From 92a8780e1136c5ca0c7ed940000d399943d1576e Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:31 -0700 Subject: [PATCH] FUSE - extended attribute operations This patch adds the extended attribute operations to FUSE. The following operations are added: o getxattr o setxattr o listxattr o removexattr Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 61f34636ffb..bf564edf990 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -80,6 +80,10 @@ enum fuse_opcode { FUSE_STATFS = 17, FUSE_RELEASE = 18, FUSE_FSYNC = 20, + FUSE_SETXATTR = 21, + FUSE_GETXATTR = 22, + FUSE_LISTXATTR = 23, + FUSE_REMOVEXATTR = 24, FUSE_FLUSH = 25, FUSE_INIT = 26 }; @@ -89,6 +93,7 @@ enum fuse_opcode { #define FUSE_NAME_MAX 1024 #define FUSE_SYMLINK_MAX 4096 +#define FUSE_XATTR_SIZE_MAX 4096 struct fuse_entry_out { __u64 nodeid; /* Inode ID */ @@ -183,6 +188,19 @@ struct fuse_fsync_in { __u32 fsync_flags; }; +struct fuse_setxattr_in { + __u32 size; + __u32 flags; +}; + +struct fuse_getxattr_in { + __u32 size; +}; + +struct fuse_getxattr_out { + __u32 size; +}; + struct fuse_init_in_out { __u32 major; __u32 minor; -- cgit v1.2.3 From 06663267b4b1e85ece73236ea720355668d4f736 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:32 -0700 Subject: [PATCH] FUSE: add padding Add padding to structures to make sizes the same on 32bit and 64bit archs. Initial testing and test machine generously provided by Franco Broi. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index bf564edf990..e9b814e16c5 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -25,6 +25,9 @@ /** The minor number of the fuse character device */ #define FUSE_MINOR 229 +/* Make sure all structures are padded to 64bit boundary, so 32bit + userspace works under 64bit kernels */ + struct fuse_attr { __u64 ino; __u64 size; @@ -128,6 +131,7 @@ struct fuse_mknod_in { struct fuse_mkdir_in { __u32 mode; + __u32 padding; }; struct fuse_rename_in { @@ -140,32 +144,38 @@ struct fuse_link_in { struct fuse_setattr_in { __u32 valid; + __u32 padding; struct fuse_attr attr; }; struct fuse_open_in { __u32 flags; + __u32 padding; }; struct fuse_open_out { __u64 fh; __u32 open_flags; + __u32 padding; }; struct fuse_release_in { __u64 fh; __u32 flags; + __u32 padding; }; struct fuse_flush_in { __u64 fh; __u32 flush_flags; + __u32 padding; }; struct fuse_read_in { __u64 fh; __u64 offset; __u32 size; + __u32 padding; }; struct fuse_write_in { @@ -177,6 +187,7 @@ struct fuse_write_in { struct fuse_write_out { __u32 size; + __u32 padding; }; struct fuse_statfs_out { @@ -186,6 +197,7 @@ struct fuse_statfs_out { struct fuse_fsync_in { __u64 fh; __u32 fsync_flags; + __u32 padding; }; struct fuse_setxattr_in { @@ -195,10 +207,12 @@ struct fuse_setxattr_in { struct fuse_getxattr_in { __u32 size; + __u32 padding; }; struct fuse_getxattr_out { __u32 size; + __u32 padding; }; struct fuse_init_in_out { @@ -214,6 +228,7 @@ struct fuse_in_header { __u32 uid; __u32 gid; __u32 pid; + __u32 padding; }; struct fuse_out_header { -- cgit v1.2.3 From 04730fef1f9c7277e5c730b193e681ac095b0507 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:36 -0700 Subject: [PATCH] fuse: transfer readdir data through device This patch removes a long lasting "hack" in FUSE, which used a separate channel (a file descriptor refering to a disk-file) to transfer directory contents from userspace to the kernel. The patch adds three new operations (OPENDIR, READDIR, RELEASEDIR), which have semantics and implementation exactly maching the respective file operations (OPEN, READ, RELEASE). This simplifies the directory reading code. Also disk space is not necessary, which can be important in embedded systems. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index e9b814e16c5..cdfaa51b901 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -70,7 +70,6 @@ enum fuse_opcode { FUSE_SETATTR = 4, FUSE_READLINK = 5, FUSE_SYMLINK = 6, - FUSE_GETDIR = 7, FUSE_MKNOD = 8, FUSE_MKDIR = 9, FUSE_UNLINK = 10, @@ -88,7 +87,10 @@ enum fuse_opcode { FUSE_LISTXATTR = 23, FUSE_REMOVEXATTR = 24, FUSE_FLUSH = 25, - FUSE_INIT = 26 + FUSE_INIT = 26, + FUSE_OPENDIR = 27, + FUSE_READDIR = 28, + FUSE_RELEASEDIR = 29 }; /* Conservative buffer size for the client */ @@ -120,10 +122,6 @@ struct fuse_attr_out { struct fuse_attr attr; }; -struct fuse_getdir_out { - __u32 fd; -}; - struct fuse_mknod_in { __u32 mode; __u32 rdev; -- cgit v1.2.3 From 45323fb76465a9576220c7427dbac7b1e7ad3caf Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:37 -0700 Subject: [PATCH] fuse: more flexible caching Make data caching behavior selectable on a per-open basis instead of per-mount. Compatibility for the old mount options 'kernel_cache' and 'direct_io' is retained in the userspace library (version 2.4.0-pre1 or later). Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index cdfaa51b901..c65124a213a 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -14,7 +14,7 @@ #define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ -#define FUSE_KERNEL_MINOR_VERSION 1 +#define FUSE_KERNEL_MINOR_VERSION 2 /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 @@ -63,6 +63,15 @@ struct fuse_kstatfs { #define FATTR_MTIME (1 << 5) #define FATTR_CTIME (1 << 6) +/** + * Flags returned by the OPEN request + * + * FOPEN_DIRECT_IO: bypass page cache for this open file + * FOPEN_KEEP_CACHE: don't invalidate the data cache on open + */ +#define FOPEN_DIRECT_IO (1 << 0) +#define FOPEN_KEEP_CACHE (1 << 1) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ -- cgit v1.2.3 From 8254798199332966e2ab647380c990193af7e854 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 9 Sep 2005 13:10:38 -0700 Subject: [PATCH] FUSE: add fsync operation for directories This patch adds a new FSYNCDIR request, which is sent when fsync is called on directories. This operation is available in libfuse 2.3-pre1 or greater. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index c65124a213a..acbeb96a335 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -99,7 +99,8 @@ enum fuse_opcode { FUSE_INIT = 26, FUSE_OPENDIR = 27, FUSE_READDIR = 28, - FUSE_RELEASEDIR = 29 + FUSE_RELEASEDIR = 29, + FUSE_FSYNCDIR = 30 }; /* Conservative buffer size for the client */ -- cgit v1.2.3 From 8d06afab73a75f40ae2864e6c296356bab1ab473 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Fri, 9 Sep 2005 13:10:40 -0700 Subject: [PATCH] timer initialization cleanup: DEFINE_TIMER Clean up timer initialization by introducing DEFINE_TIMER a'la DEFINE_SPINLOCK. Build and boot-tested on x86. A similar patch has been been in the -RT tree for some time. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/timer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/timer.h b/include/linux/timer.h index 221f81ac200..3340f3bd135 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -32,6 +32,10 @@ extern struct timer_base_s __init_timer_base; .magic = TIMER_MAGIC, \ } +#define DEFINE_TIMER(_name, _function, _expires, _data) \ + struct timer_list _name = \ + TIMER_INITIALIZER(_function, _expires, _data) + void fastcall init_timer(struct timer_list * timer); /*** -- cgit v1.2.3 From 9c8550ee25e26d14a8f0fe1b761a676e23fe3cf0 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 9 Sep 2005 15:43:46 -0700 Subject: Remove "must_check" attributes in PCI-land Don't just irritate all other kernel developers. Fix the users first, then you can re-introduce the must-check infrastructure to avoid new cases creeping in. Signed-off-by: Linus Torvalds --- include/linux/pci.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index e5e24e13a11..7349058ed77 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -380,16 +380,16 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); } -int __must_check pci_enable_device(struct pci_dev *dev); -int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); +int pci_enable_device(struct pci_dev *dev); +int pci_enable_device_bars(struct pci_dev *dev, int mask); void pci_disable_device(struct pci_dev *dev); void pci_set_master(struct pci_dev *dev); #define HAVE_PCI_SET_MWI -int __must_check pci_set_mwi(struct pci_dev *dev); +int pci_set_mwi(struct pci_dev *dev); void pci_clear_mwi(struct pci_dev *dev); void pci_intx(struct pci_dev *dev, int enable); -int __must_check pci_set_dma_mask(struct pci_dev *dev, u64 mask); -int __must_check pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); +int pci_set_dma_mask(struct pci_dev *dev, u64 mask); +int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); int pci_assign_resource(struct pci_dev *dev, int i); void pci_restore_bars(struct pci_dev *dev); @@ -403,9 +403,9 @@ void pci_remove_rom(struct pci_dev *pdev); /* Power management related routines */ int pci_save_state(struct pci_dev *dev); int pci_restore_state(struct pci_dev *dev); -int __must_check pci_set_power_state(struct pci_dev *dev, pci_power_t state); -pci_power_t __must_check pci_choose_state(struct pci_dev *dev, pm_message_t state); -int __must_check pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); +int pci_set_power_state(struct pci_dev *dev, pci_power_t state); +pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); +int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ void pci_bus_assign_resources(struct pci_bus *bus); -- cgit v1.2.3 From 36fa30636fb84b209210299684e1be66d9e58217 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:45 -0700 Subject: [PATCH] md: all hot-add and hot-remove of md intent logging bitmaps Both file-bitmaps and superblock bitmaps are supported. If you add a bitmap file on the array device, you lose. This introduces a 'default_bitmap_offset' field in mddev, as the ioctl used for adding a superblock bitmap doesn't have room for giving an offset. Later, this value will be setable via sysfs. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_k.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 8c14ba565a4..817062bf735 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -278,6 +278,10 @@ struct mddev_s * start of bitmap. May be * negative, but not '0' */ + long default_bitmap_offset; /* this is the offset to use when + * hot-adding a bitmap. It should + * eventually be settable by sysfs. + */ struct list_head all_mddevs; }; @@ -314,6 +318,12 @@ struct mdk_personality_s int (*resize) (mddev_t *mddev, sector_t sectors); int (*reshape) (mddev_t *mddev, int raid_disks); int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); + /* quiesce moves between quiescence states + * 0 - fully active + * 1 - no new requests allowed + * others - reserved + */ + void (*quiesce) (mddev_t *mddev, int state); }; -- cgit v1.2.3 From 8ddf9efe6708f3674f0ddfeb6425fd27bea109a2 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:45 -0700 Subject: [PATCH] md: support write-mostly device in raid1 This allows a device in a raid1 to be marked as "write mostly". Read requests will only be sent if there is no other option. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_k.h | 3 +++ include/linux/raid/md_p.h | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 817062bf735..7ef78e15ce0 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -181,6 +181,9 @@ struct mdk_rdev_s int faulty; /* if faulty do not issue IO requests */ int in_sync; /* device is a full member of the array */ + unsigned long flags; /* Should include faulty and in_sync here. */ +#define WriteMostly 4 /* Avoid reading if at all possible */ + int desc_nr; /* descriptor index in the superblock */ int raid_disk; /* role of device in array */ int saved_raid_disk; /* role that device used to have in the diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index dc65cd43549..4f047f84fb1 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h @@ -79,6 +79,11 @@ #define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ #define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ +#define MD_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config. + * read requests will only be sent here in + * dire need + */ + typedef struct mdp_device_descriptor_s { __u32 number; /* 0 Device number in the entire set */ __u32 major; /* 1 Device major number */ @@ -193,7 +198,7 @@ struct mdp_superblock_1 { __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ - __u32 layout; /* only for raid5 currently */ + __u32 layout; /* only for raid5 and raid10 currently */ __u64 size; /* used size of component devices, in 512byte sectors */ __u32 chunksize; /* in 512byte sectors */ @@ -212,7 +217,9 @@ struct mdp_superblock_1 { __u32 dev_number; /* permanent identifier of this device - not role in raid */ __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ - __u8 pad2[64-56]; /* set to 0 when writing */ + __u8 devflags; /* per-device flags. Only one defined...*/ +#define WriteMostly1 1 /* mask for writemostly flag in above */ + __u8 pad2[64-57]; /* set to 0 when writing */ /* array state information - 64 bytes */ __u64 utime; /* 40 bits second, 24 btes microseconds */ -- cgit v1.2.3 From 4b6d287f627b5fb6a49f78f9e81649ff98c62bb7 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:47 -0700 Subject: [PATCH] md: add write-behind support for md/raid1 If a device is flagged 'WriteMostly' and the array has a bitmap, and the bitmap superblock indicates that write_behind is allowed, then write_behind is enabled for WriteMostly devices. Write requests will be acknowledges as complete to the caller (via b_end_io) when all non-WriteMostly devices have completed the write, but will not be cleared from the bitmap until all devices complete. This requires memory allocation to make a local copy of the data being written. If there is insufficient memory, then we fall-back on normal write semantics. Signed-Off-By: Paul Clements Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/bitmap.h | 15 ++++++++++----- include/linux/raid/md_k.h | 3 +++ include/linux/raid/raid1.h | 13 +++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 4bf1659f8aa..9de99198caf 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h @@ -7,7 +7,7 @@ #define BITMAP_H 1 #define BITMAP_MAJOR 3 -#define BITMAP_MINOR 38 +#define BITMAP_MINOR 39 /* * in-memory bitmap: @@ -147,8 +147,9 @@ typedef struct bitmap_super_s { __u32 state; /* 48 bitmap state information */ __u32 chunksize; /* 52 the bitmap chunk size in bytes */ __u32 daemon_sleep; /* 56 seconds between disk flushes */ + __u32 write_behind; /* 60 number of outstanding write-behind writes */ - __u8 pad[256 - 60]; /* set to zero */ + __u8 pad[256 - 64]; /* set to zero */ } bitmap_super_t; /* notes: @@ -226,6 +227,9 @@ struct bitmap { unsigned long flags; + unsigned long max_write_behind; /* write-behind mode */ + atomic_t behind_writes; + /* * the bitmap daemon - periodically wakes up and sweeps the bitmap * file, cleaning up bits and flushing out pages to disk as necessary @@ -260,9 +264,10 @@ int bitmap_setallbits(struct bitmap *bitmap); void bitmap_write_all(struct bitmap *bitmap); /* these are exported */ -int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); -void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, - int success); +int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, + unsigned long sectors, int behind); +void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, + unsigned long sectors, int success, int behind); int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); void bitmap_close_sync(struct bitmap *bitmap); diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 7ef78e15ce0..2514e5fcda7 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -275,6 +275,9 @@ struct mddev_s atomic_t writes_pending; request_queue_t *queue; /* for plugging ... */ + atomic_t write_behind; /* outstanding async IO */ + unsigned int max_write_behind; /* 0 = sync */ + struct bitmap *bitmap; /* the bitmap for the device */ struct file *bitmap_file; /* the bitmap file */ long bitmap_offset; /* offset from superblock of diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 9d93cf12e89..60e19b66754 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -80,6 +80,9 @@ struct r1bio_s { atomic_t remaining; /* 'have we finished' count, * used from IRQ handlers */ + atomic_t behind_remaining; /* number of write-behind ios remaining + * in this BehindIO request + */ sector_t sector; int sectors; unsigned long state; @@ -107,4 +110,14 @@ struct r1bio_s { #define R1BIO_Uptodate 0 #define R1BIO_IsSync 1 #define R1BIO_Degraded 2 +#define R1BIO_BehindIO 3 +/* For write-behind requests, we call bi_end_io when + * the last non-write-behind device completes, providing + * any write was successful. Otherwise we call when + * any write-behind write succeeds, otherwise we call + * with failure when last write completes (and all failed). + * Record that bi_end_io was called with this flag... + */ +#define R1BIO_Returned 4 + #endif -- cgit v1.2.3 From 15945fee6f09bff1f86b1a735b5888dc59cf38e3 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:47 -0700 Subject: [PATCH] md: support md/linear array with components greater than 2 terabytes. linear currently uses division by the size of the smallest componenet device to find which device a request goes to. If that smallest device is larger than 2 terabytes, then the division will not work on some systems. So we introduce a pre-shift, and take care not to make the hash table too large, much like the code in raid0. Also get rid of conf->nr_zones, which is not needed. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/linear.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h index e04c4fe45b5..7eaf290e10e 100644 --- a/include/linux/raid/linear.h +++ b/include/linux/raid/linear.h @@ -14,8 +14,8 @@ typedef struct dev_info dev_info_t; struct linear_private_data { dev_info_t **hash_table; - dev_info_t *smallest; - int nr_zones; + sector_t hash_spacing; + int preshift; /* shift before dividing by hash_spacing */ dev_info_t disks[0]; }; -- cgit v1.2.3 From 71c0805cb48462c99fbe0e5fcc6c12d7b9929c09 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:51 -0700 Subject: [PATCH] md: allow md to load a superblock with feature-bit '1' set As this is used to flag an internal bitmap. Also, introduce symbolic names for feature bits. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_p.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 4f047f84fb1..c100fa5d4bf 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h @@ -238,5 +238,10 @@ struct mdp_superblock_1 { __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ }; +/* feature_map bits */ +#define MD_FEATURE_BITMAP_OFFSET 1 + +#define MD_FEATURE_ALL 1 + #endif -- cgit v1.2.3 From 773f7834425e83144c95fbbc553ced3c2b74b828 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:53 -0700 Subject: [PATCH] md: remove old cruft from md_k.h header file These inlines haven't been used for ages, they should go. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_k.h | 64 ----------------------------------------------- 1 file changed, 64 deletions(-) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 2514e5fcda7..8042f55dd32 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -85,70 +85,6 @@ typedef struct mdk_rdev_s mdk_rdev_t; #define MAX_CHUNK_SIZE (4096*1024) -/* - * default readahead - */ - -static inline int disk_faulty(mdp_disk_t * d) -{ - return d->state & (1 << MD_DISK_FAULTY); -} - -static inline int disk_active(mdp_disk_t * d) -{ - return d->state & (1 << MD_DISK_ACTIVE); -} - -static inline int disk_sync(mdp_disk_t * d) -{ - return d->state & (1 << MD_DISK_SYNC); -} - -static inline int disk_spare(mdp_disk_t * d) -{ - return !disk_sync(d) && !disk_active(d) && !disk_faulty(d); -} - -static inline int disk_removed(mdp_disk_t * d) -{ - return d->state & (1 << MD_DISK_REMOVED); -} - -static inline void mark_disk_faulty(mdp_disk_t * d) -{ - d->state |= (1 << MD_DISK_FAULTY); -} - -static inline void mark_disk_active(mdp_disk_t * d) -{ - d->state |= (1 << MD_DISK_ACTIVE); -} - -static inline void mark_disk_sync(mdp_disk_t * d) -{ - d->state |= (1 << MD_DISK_SYNC); -} - -static inline void mark_disk_spare(mdp_disk_t * d) -{ - d->state = 0; -} - -static inline void mark_disk_removed(mdp_disk_t * d) -{ - d->state = (1 << MD_DISK_FAULTY) | (1 << MD_DISK_REMOVED); -} - -static inline void mark_disk_inactive(mdp_disk_t * d) -{ - d->state &= ~(1 << MD_DISK_ACTIVE); -} - -static inline void mark_disk_nonsync(mdp_disk_t * d) -{ - d->state &= ~(1 << MD_DISK_SYNC); -} - /* * MD's 'extended' device */ -- cgit v1.2.3 From 0002b2718dd04da67c21f8a7830de8d95a9b0345 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:53 -0700 Subject: [PATCH] md: limit size of sb read/written to appropriate amount version-1 superblocks are not (normally) 4K long, and can be of variable size. Writing the full 4K can cause corruption (but only in non-default configurations). With this patch the super-block-flavour can choose a size to read, and set a size to write based on what it finds. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/md_k.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 8042f55dd32..ebce949b144 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -102,6 +102,7 @@ struct mdk_rdev_s int sb_loaded; sector_t data_offset; /* start of data in array */ sector_t sb_offset; + int sb_size; /* bytes in the superblock */ int preferred_minor; /* autorun support */ /* A device can be in one of three states based on two flags: -- cgit v1.2.3 From 72626685dc66d455742a7f215a0535c551628b9e Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 9 Sep 2005 16:23:54 -0700 Subject: [PATCH] md: add write-intent-bitmap support to raid5 Most awkward part of this is delaying write requests until bitmap updates have been flushed. To achieve this, we have a sequence number (seq_flush) which is incremented each time the raid5 is unplugged. If the raid thread notices that this has changed, it flushes bitmap changes, and assigned the value of seq_flush to seq_write. When a write request arrives, it is given the number from seq_write, and that write request may not complete until seq_flush is larger than the saved seq number. We have a new queue for storing stripes which are waiting for a bitmap flush and an extra flag for stripes to record if the write was 'degraded' and so should not clear the a bit in the bitmap. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/raid/raid5.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index d63ddcb4afa..176fc653c28 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -134,6 +134,7 @@ struct stripe_head { unsigned long state; /* state flags */ atomic_t count; /* nr of active thread/requests */ spinlock_t lock; + int bm_seq; /* sequence number for bitmap flushes */ struct r5dev { struct bio req; struct bio_vec vec; @@ -165,12 +166,13 @@ struct stripe_head { /* * Stripe state */ -#define STRIPE_ERROR 1 #define STRIPE_HANDLE 2 #define STRIPE_SYNCING 3 #define STRIPE_INSYNC 4 #define STRIPE_PREREAD_ACTIVE 5 #define STRIPE_DELAYED 6 +#define STRIPE_DEGRADED 7 +#define STRIPE_BIT_DELAY 8 /* * Plugging: @@ -210,10 +212,20 @@ struct raid5_private_data { struct list_head handle_list; /* stripes needing handling */ struct list_head delayed_list; /* stripes that have plugged requests */ + struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ atomic_t preread_active_stripes; /* stripes with scheduled io */ char cache_name[20]; kmem_cache_t *slab_cache; /* for allocating stripes */ + + int seq_flush, seq_write; + int quiesce; + + int fullsync; /* set to 1 if a full sync is needed, + * (fresh device added). + * Cleared when a sync completes. + */ + /* * Free stripes pool */ -- cgit v1.2.3