forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asm-generic: add legacy I/O header files
The dma.h, hw_irq.h, serial.h and timex.h files originally described PC-style i8237, i8259A, i8250, i8253 and i8255 chips as well as the VGA style text mode graphics. Modern architectures live happily without these specific interfaces, but a few definitions from these headers keep getting used in common code. The new generic headers are what most architectures use anyway nowadays, just implementing the minimal definitions. Signed-off-by: Remis Lima Baima <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
- Loading branch information
Showing
6 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#ifndef __ASM_GENERIC_DMA_H | ||
#define __ASM_GENERIC_DMA_H | ||
/* | ||
* This file traditionally describes the i8237 PC style DMA controller. | ||
* Most architectures don't have these any more and can get the minimal | ||
* implementation from kernel/dma.c by not defining MAX_DMA_CHANNELS. | ||
* | ||
* Some code relies on seeing MAX_DMA_ADDRESS though. | ||
*/ | ||
#define MAX_DMA_ADDRESS PAGE_OFFSET | ||
|
||
extern int request_dma(unsigned int dmanr, const char *device_id); | ||
extern void free_dma(unsigned int dmanr); | ||
|
||
#endif /* __ASM_GENERIC_DMA_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef __ASM_GENERIC_HW_IRQ_H | ||
#define __ASM_GENERIC_HW_IRQ_H | ||
/* | ||
* hw_irq.h has internal declarations for the low-level interrupt | ||
* controller, like the original i8259A. | ||
* In general, this is not needed for new architectures. | ||
*/ | ||
|
||
#endif /* __ASM_GENERIC_HW_IRQ_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef __ASM_GENERIC_PARPORT_H | ||
#define __ASM_GENERIC_PARPORT_H | ||
|
||
/* | ||
* An ISA bus may have i8255 parallel ports at well-known | ||
* locations in the I/O space, which are scanned by | ||
* parport_pc_find_isa_ports. | ||
* | ||
* Without ISA support, the driver will only attach | ||
* to devices on the PCI bus. | ||
*/ | ||
|
||
static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); | ||
static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) | ||
{ | ||
#ifdef CONFIG_ISA | ||
return parport_pc_find_isa_ports(autoirq, autodma); | ||
#else | ||
return 0; | ||
#endif | ||
} | ||
|
||
#endif /* __ASM_GENERIC_PARPORT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef __ASM_GENERIC_SERIAL_H | ||
#define __ASM_GENERIC_SERIAL_H | ||
|
||
/* | ||
* This should not be an architecture specific #define, oh well. | ||
* | ||
* Traditionally, it just describes i8250 and related serial ports | ||
* that have this clock rate. | ||
*/ | ||
|
||
#define BASE_BAUD (1843200 / 16) | ||
|
||
#endif /* __ASM_GENERIC_SERIAL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef __ASM_GENERIC_TIMEX_H | ||
#define __ASM_GENERIC_TIMEX_H | ||
|
||
/* | ||
* If you have a cycle counter, return the value here. | ||
*/ | ||
typedef unsigned long cycles_t; | ||
#ifndef get_cycles | ||
static inline cycles_t get_cycles(void) | ||
{ | ||
return 0; | ||
} | ||
#endif | ||
|
||
/* | ||
* Architectures are encouraged to implement read_current_timer | ||
* and define this in order to avoid the expensive delay loop | ||
* calibration during boot. | ||
*/ | ||
#undef ARCH_HAS_READ_CURRENT_TIMER | ||
|
||
#endif /* __ASM_GENERIC_TIMEX_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Access to VGA videoram | ||
* | ||
* (c) 1998 Martin Mares <[email protected]> | ||
*/ | ||
#ifndef __ASM_GENERIC_VGA_H | ||
#define __ASM_GENERIC_VGA_H | ||
|
||
/* | ||
* On most architectures that support VGA, we can just | ||
* recalculate addresses and then access the videoram | ||
* directly without any black magic. | ||
* | ||
* Everyone else needs to ioremap the address and use | ||
* proper I/O accesses. | ||
*/ | ||
#ifndef VGA_MAP_MEM | ||
#define VGA_MAP_MEM(x, s) (unsigned long)phys_to_virt(x) | ||
#endif | ||
|
||
#define vga_readb(x) (*(x)) | ||
#define vga_writeb(x, y) (*(y) = (x)) | ||
|
||
#endif /* _ASM_GENERIC_VGA_H */ |