summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDave Kleikamp <jfs.adm@hostme.bitkeeper.com>2002-10-06 18:12:26 -0700
committerDave Kleikamp <jfs.adm@hostme.bitkeeper.com>2002-10-06 18:12:26 -0700
commite3489dc28c0603221d32408ed9f3c048f2cb789b (patch)
tree3c9fb7d4d74788749c7ee1ea60228aacae6fe2c8 /include/linux
parent854f96ea62977d57b644a35acbb2f66e5f44bda5 (diff)
parent258ee56ad55dd9c90fefe616411d25f143541f65 (diff)
Merge bk://linux.bkbits.net/linux-2.5
into hostme.bitkeeper.com:/ua/repos/j/jfs/linux-2.5
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/amifd.h2
-rw-r--r--include/linux/buffer_head.h4
-rw-r--r--include/linux/elevator.h4
-rw-r--r--include/linux/ext3_fs.h1
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/hpfs_fs_sb.h27
-rw-r--r--include/linux/ide.h55
-rw-r--r--include/linux/list.h5
-rw-r--r--include/linux/mm.h48
-rw-r--r--include/linux/mmzone.h4
-rw-r--r--include/linux/nbd.h2
-rw-r--r--include/linux/pci.h27
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/scx200.h56
-rw-r--r--include/linux/scx200_gpio.h98
-rw-r--r--include/linux/serial_core.h2
16 files changed, 206 insertions, 140 deletions
diff --git a/include/linux/amifd.h b/include/linux/amifd.h
index eac36f77fa8f..346993268b45 100644
--- a/include/linux/amifd.h
+++ b/include/linux/amifd.h
@@ -55,7 +55,7 @@ struct amiga_floppy_struct {
int busy; /* true when drive is active */
int dirty; /* true when trackbuf is not on disk */
int status; /* current error code for unit */
- struct gendisk disk;
+ struct gendisk *gendisk;
};
#endif
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index dd8f1bfb150e..71732e1216fc 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -140,7 +140,6 @@ void end_buffer_io_sync(struct buffer_head *bh, int uptodate);
void buffer_insert_list(spinlock_t *lock,
struct buffer_head *, struct list_head *);
void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
-int write_mapping_buffers(struct address_space *mapping);
int inode_has_buffers(struct inode *);
void invalidate_inode_buffers(struct inode *);
int fsync_buffers_list(spinlock_t *lock, struct list_head *);
@@ -168,6 +167,9 @@ void free_buffer_head(struct buffer_head * bh);
void FASTCALL(unlock_buffer(struct buffer_head *bh));
void ll_rw_block(int, int, struct buffer_head * bh[]);
int submit_bh(int, struct buffer_head *);
+void write_boundary_block(struct block_device *bdev,
+ sector_t bblock, unsigned blocksize);
+
extern int buffer_heads_over_limit;
/*
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 5c6c7db6e97e..8a54a1c5e5af 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -73,8 +73,8 @@ typedef struct blkelv_ioctl_arg_s {
#define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
#define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
-extern int elevator_init(request_queue_t *, elevator_t *, elevator_t);
-extern void elevator_exit(request_queue_t *, elevator_t *);
+extern int elevator_init(request_queue_t *, elevator_t *);
+extern void elevator_exit(request_queue_t *);
extern inline int bio_rq_in_between(struct bio *, struct request *, struct list_head *);
extern inline int elv_rq_merge_ok(struct request *, struct bio *);
extern inline int elv_try_merge(struct request *, struct bio *);
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index d4550e28f37e..3f370ab642dd 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -17,6 +17,7 @@
#define _LINUX_EXT3_FS_H
#include <linux/types.h>
+#include <linux/ext3_fs_sb.h>
/*
* The second extended filesystem constants/structures
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f0ba1e96325c..ad6648e3fd9c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -627,9 +627,6 @@ extern int send_sigurg(struct fown_struct *fown);
#define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
#define MNT_DETACH 0x00000002 /* Just detach from the tree */
-#include <linux/ext3_fs_sb.h>
-#include <linux/hpfs_fs_sb.h>
-
extern struct list_head super_blocks;
extern spinlock_t sb_lock;
@@ -670,8 +667,6 @@ struct super_block {
char s_id[32]; /* Informational name */
union {
- struct ext3_sb_info ext3_sb;
- struct hpfs_sb_info hpfs_sb;
void *generic_sbp;
} u;
/*
diff --git a/include/linux/hpfs_fs_sb.h b/include/linux/hpfs_fs_sb.h
index 068035e9a4bd..c6355adaf6f1 100644
--- a/include/linux/hpfs_fs_sb.h
+++ b/include/linux/hpfs_fs_sb.h
@@ -36,31 +36,4 @@ struct hpfs_sb_info {
int sb_timeshift;
};
-#define s_hpfs_root u.hpfs_sb.sb_root
-#define s_hpfs_fs_size u.hpfs_sb.sb_fs_size
-#define s_hpfs_bitmaps u.hpfs_sb.sb_bitmaps
-#define s_hpfs_dirband_start u.hpfs_sb.sb_dirband_start
-#define s_hpfs_dirband_size u.hpfs_sb.sb_dirband_size
-#define s_hpfs_dmap u.hpfs_sb.sb_dmap
-#define s_hpfs_uid u.hpfs_sb.sb_uid
-#define s_hpfs_gid u.hpfs_sb.sb_gid
-#define s_hpfs_mode u.hpfs_sb.sb_mode
-#define s_hpfs_n_free u.hpfs_sb.sb_n_free
-#define s_hpfs_n_free_dnodes u.hpfs_sb.sb_n_free_dnodes
-#define s_hpfs_lowercase u.hpfs_sb.sb_lowercase
-#define s_hpfs_conv u.hpfs_sb.sb_conv
-#define s_hpfs_eas u.hpfs_sb.sb_eas
-#define s_hpfs_err u.hpfs_sb.sb_err
-#define s_hpfs_chk u.hpfs_sb.sb_chk
-#define s_hpfs_was_error u.hpfs_sb.sb_was_error
-#define s_hpfs_chkdsk u.hpfs_sb.sb_chkdsk
-/*#define s_hpfs_rd_fnode u.hpfs_sb.sb_rd_fnode*/
-#define s_hpfs_rd_inode u.hpfs_sb.sb_rd_inode
-#define s_hpfs_cp_table u.hpfs_sb.sb_cp_table
-#define s_hpfs_bmp_dir u.hpfs_sb.sb_bmp_dir
-#define s_hpfs_c_bitmap u.hpfs_sb.sb_c_bitmap
-#define s_hpfs_iget_q u.hpfs_sb.sb_iget_q
-/*#define s_hpfs_mounting u.hpfs_sb.sb_mounting*/
-#define s_hpfs_timeshift u.hpfs_sb.sb_timeshift
-
#endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 74fff672eaef..7b8ebfe2c8dd 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -302,24 +302,14 @@ typedef struct ide_io_ops_s {
void (*OUTB)(u8 addr, u32 port);
void (*OUTW)(u16 addr, u32 port);
void (*OUTL)(u32 addr, u32 port);
- void (*OUTBP)(u8 addr, u32 port);
- void (*OUTWP)(u16 addr, u32 port);
- void (*OUTLP)(u32 addr, u32 port);
void (*OUTSW)(u32 port, void *addr, u32 count);
- void (*OUTSWP)(u32 port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count);
- void (*OUTSLP)(u32 port, void *addr, u32 count);
u8 (*INB)(u32 port);
u16 (*INW)(u32 port);
u32 (*INL)(u32 port);
- u8 (*INBP)(u32 port);
- u16 (*INWP)(u32 port);
- u32 (*INLP)(u32 port);
void (*INSW)(u32 port, void *addr, u32 count);
- void (*INSWP)(u32 port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count);
- void (*INSLP)(u32 port, void *addr, u32 count);
} ide_io_ops_t;
/*
@@ -375,41 +365,6 @@ extern int ide_irq_lock;
#endif /* IDE_ARCH_LOCK */
/*
- * If the arch-dependant ide.h did not declare/define any OUT_BYTE
- * or IN_BYTE functions, we make some defaults here.
- */
-
-#ifndef HAVE_ARCH_OUT_BYTE
-# ifdef REALLY_FAST_IO
-# define OUT_BYTE(b,p) outb((b),(p))
-# define OUT_WORD(w,p) outw((w),(p))
-# define OUT_LONG(l,p) outl((l),(p))
-# else
-# define OUT_BYTE(b,p) outb_p((b),(p))
-# define OUT_WORD(w,p) outw_p((w),(p))
-# define OUT_LONG(l,p) outl_p((l),(p))
-# endif
-# define OUT_BYTE_P(b,p) outb_p((b),(p))
-# define OUT_WORD_P(w,p) outw_p((w),(p))
-# define OUT_LONG_P(l,p) outl_p((l),(p))
-#endif
-
-#ifndef HAVE_ARCH_IN_BYTE
-# ifdef REALLY_FAST_IO
-# define IN_BYTE(p) (u8) inb(p)
-# define IN_WORD(p) (u16) inw(p)
-# define IN_LONG(p) (u32) inl(p)
-# else
-# define IN_BYTE(p) (u8) inb_p(p)
-# define IN_WORD(p) (u16) inw_p(p)
-# define IN_LONG(p) (u32) inl_p(p)
-# endif
-# define IN_BYTE_P(p) (u8) inb_p(p)
-# define IN_WORD_P(p) (u16) inw_p(p)
-# define IN_LONG_P(p) (u32) inl_p(p)
-#endif
-
-/*
* Now for the data we need to maintain per-drive: ide_drive_t
*/
@@ -1011,24 +966,14 @@ typedef struct hwif_s {
void (*OUTB)(u8 addr, u32 port);
void (*OUTW)(u16 addr, u32 port);
void (*OUTL)(u32 addr, u32 port);
- void (*OUTBP)(u8 addr, u32 port);
- void (*OUTWP)(u16 addr, u32 port);
- void (*OUTLP)(u32 addr, u32 port);
void (*OUTSW)(u32 port, void *addr, u32 count);
- void (*OUTSWP)(u32 port, void *addr, u32 count);
void (*OUTSL)(u32 port, void *addr, u32 count);
- void (*OUTSLP)(u32 port, void *addr, u32 count);
u8 (*INB)(u32 port);
u16 (*INW)(u32 port);
u32 (*INL)(u32 port);
- u8 (*INBP)(u32 port);
- u16 (*INWP)(u32 port);
- u32 (*INLP)(u32 port);
void (*INSW)(u32 port, void *addr, u32 count);
- void (*INSWP)(u32 port, void *addr, u32 count);
void (*INSL)(u32 port, void *addr, u32 count);
- void (*INSLP)(u32 port, void *addr, u32 count);
#endif
/* dma physical region descriptor table (cpu view) */
diff --git a/include/linux/list.h b/include/linux/list.h
index bd6f0ac3fb6b..634aab6c4c94 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -86,13 +86,12 @@ static inline void __list_del(struct list_head * prev, struct list_head * next)
/**
* list_del - deletes entry from list.
* @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ * Note: list_empty on entry does not return true after this, the entry is
+ * in an undefined state.
*/
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
- entry->next = (void *) 0;
- entry->prev = (void *) 0;
}
/**
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 4ae8eb10dcb2..a5107b5043f7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -176,7 +176,7 @@ struct page {
* Architectures with slow multiplication can define
* WANT_PAGE_VIRTUAL in asm/page.h
*/
-#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL)
+#if defined(WANT_PAGE_VIRTUAL)
void *virtual; /* Kernel virtual address (NULL if
not kmapped, ie. highmem) */
#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
@@ -289,38 +289,34 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num)
page->flags |= zone_num << ZONE_SHIFT;
}
-/*
- * In order to avoid #ifdefs within C code itself, we define
- * set_page_address to a noop for non-highmem machines, where
- * the field isn't useful.
- * The same is true for page_address() in arch-dependent code.
- */
-#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL)
+#define lowmem_page_address(page) \
+ __va( ( ((page) - page_zone(page)->zone_mem_map) \
+ + page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
+
+#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
+#define HASHED_PAGE_VIRTUAL
+#endif
+#if defined(WANT_PAGE_VIRTUAL)
+#define page_address(page) ((page)->virtual)
#define set_page_address(page, address) \
do { \
(page)->virtual = (address); \
} while(0)
+#define page_address_init() do { } while(0)
+#endif
-#else /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */
-#define set_page_address(page, address) do { } while(0)
-#endif /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */
-
-/*
- * Permanent address of a page. Obviously must never be
- * called on a highmem page.
- */
-#if defined(CONFIG_HIGHMEM) || defined(WANT_PAGE_VIRTUAL)
-
-#define page_address(page) ((page)->virtual)
-
-#else /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */
-
-#define page_address(page) \
- __va( ( ((page) - page_zone(page)->zone_mem_map) \
- + page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
+#if defined(HASHED_PAGE_VIRTUAL)
+void *page_address(struct page *page);
+void set_page_address(struct page *page, void *virtual);
+void page_address_init(void);
+#endif
-#endif /* CONFIG_HIGHMEM || WANT_PAGE_VIRTUAL */
+#if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL)
+#define page_address(page) lowmem_page_address(page)
+#define set_page_address(page, address) do { } while(0)
+#define page_address_init() do { } while(0)
+#endif
/*
* Return true if this page is mapped into pagetables. Subtle: test pte.direct
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d7d12a69f505..2b83fca9e08d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -62,7 +62,6 @@ struct zone {
spinlock_t lock;
unsigned long free_pages;
unsigned long pages_min, pages_low, pages_high;
- int need_balance;
ZONE_PADDING(_pad1_)
@@ -120,7 +119,8 @@ struct zone {
* rarely used fields:
*/
char *name;
- unsigned long size;
+ unsigned long spanned_pages; /* total size, including holes */
+ unsigned long present_pages; /* amount of memory (excluding holes) */
} ____cacheline_maxaligned_in_smp;
#define ZONE_DMA 0
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 8e4b8c236e8b..b20c045dbb79 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -79,7 +79,7 @@ struct nbd_device {
spinlock_t queue_lock;
struct list_head queue_head; /* Requests are added here... */
struct semaphore tx_lock;
- struct gendisk disk;
+ struct gendisk *disk;
};
#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ba2e997304fd..9c12d53f9dc7 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -322,15 +322,6 @@ enum pci_mmap_state {
#define PCI_ANY_ID (~0)
-#define pci_present pcibios_present
-
-
-#define pci_for_each_dev_reverse(dev) \
- for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
-
-#define pci_for_each_bus(bus) \
-for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next))
-
/*
* The pci_dev structure is used to describe both PCI and ISAPnP devices.
*/
@@ -503,8 +494,17 @@ struct pci_driver {
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
+static inline int pci_present(void)
+{
+ return !list_empty(&pci_devices);
+}
+
#define pci_for_each_dev(dev) \
for(dev = pci_dev_g(pci_devices.next); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.next))
+#define pci_for_each_dev_reverse(dev) \
+ for(dev = pci_dev_g(pci_devices.prev); dev != pci_dev_g(&pci_devices); dev = pci_dev_g(dev->global_list.prev))
+#define pci_for_each_bus(bus) \
+ for(bus = pci_bus_b(pci_root_buses.next); bus != pci_bus_b(&pci_root_buses); bus = pci_bus_b(bus->node.next))
void pcibios_fixup_bus(struct pci_bus *);
int pcibios_enable_device(struct pci_dev *, int mask);
@@ -520,7 +520,6 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
/* Backward compatibility, don't use in new code! */
-int pcibios_present(void);
int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned char *val);
int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn,
@@ -533,10 +532,6 @@ int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned short val);
int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
unsigned char where, unsigned int val);
-int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn);
-int pcibios_find_device (unsigned short vendor, unsigned short dev_id,
- unsigned short index, unsigned char *bus,
- unsigned char *dev_fn);
/* Generic PCI functions used internally */
@@ -660,9 +655,7 @@ void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
*/
#ifndef CONFIG_PCI
-static inline int pcibios_present(void) { return 0; }
-static inline int pcibios_find_class (unsigned int class_code, unsigned short index, unsigned char *bus, unsigned char *dev_fn)
-{ return PCIBIOS_DEVICE_NOT_FOUND; }
+static inline int pci_present(void) { return 0; }
#define _PCI_NOP(o,s,t) \
static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index be4d21956fc5..a652bbf6682d 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -288,6 +288,12 @@
#define PCI_DEVICE_ID_NS_87560_USB 0x0012
#define PCI_DEVICE_ID_NS_83815 0x0020
#define PCI_DEVICE_ID_NS_83820 0x0022
+#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
+#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
+#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502
+#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503
+#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504
+#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505
#define PCI_DEVICE_ID_NS_87410 0xd001
#define PCI_VENDOR_ID_TSENG 0x100c
diff --git a/include/linux/scx200.h b/include/linux/scx200.h
new file mode 100644
index 000000000000..af7d53acad99
--- /dev/null
+++ b/include/linux/scx200.h
@@ -0,0 +1,56 @@
+/* linux/include/linux/scx200.h
+
+ Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
+
+ Defines for the National Semiconductor SCx200 Processors
+*/
+
+/* Interesting stuff for the National Semiconductor SCx200 CPU */
+
+/* F0 PCI Header/Bridge Configuration Registers */
+#define SCx200_DOCCS_BASE 0x78 /* DOCCS Base Address Register */
+#define SCx200_DOCCS_CTRL 0x7c /* DOCCS Control Register */
+
+/* GPIO Register Block */
+#define SCx200_GPIO_SIZE 0x2c /* Size of GPIO register block */
+
+/* General Configuration Block */
+#define SCx200_CB_BASE 0x9000 /* Base fixed at 0x9000 according to errata */
+
+/* Watchdog Timer */
+#define SCx200_WDT_OFFSET 0x00 /* offset within configuration block */
+#define SCx200_WDT_SIZE 0x05 /* size */
+
+#define SCx200_WDT_WDTO 0x00 /* Time-Out Register */
+#define SCx200_WDT_WDCNFG 0x02 /* Configuration Register */
+#define SCx200_WDT_WDSTS 0x04 /* Status Register */
+#define SCx200_WDT_WDSTS_WDOVF (1<<0) /* Overflow bit */
+
+/* High Resolution Timer */
+#define SCx200_TIMER_OFFSET 0x08
+#define SCx200_TIMER_SIZE 0x05
+
+/* Clock Generators */
+#define SCx200_CLOCKGEN_OFFSET 0x10
+#define SCx200_CLOCKGEN_SIZE 0x10
+
+/* Pin Multiplexing and Miscellaneous Configuration Registers */
+#define SCx200_MISC_OFFSET 0x30
+#define SCx200_MISC_SIZE 0x10
+
+#define SCx200_PMR 0x30 /* Pin Multiplexing Register */
+#define SCx200_MCR 0x34 /* Miscellaneous Configuration Register */
+#define SCx200_INTSEL 0x38 /* Interrupt Selection Register */
+#define SCx200_IID 0x3c /* IA On a Chip Identification Number Reg */
+#define SCx200_REV 0x3d /* Revision Register */
+#define SCx200_CBA 0x3e /* Configuration Base Address Register */
+
+/* Verify that the configuration block really is there */
+#define scx200_cb_probe(base) (inw((base) + SCx200_CBA) == (base))
+
+/*
+ Local variables:
+ compile-command: "make -C ../.. bzImage modules"
+ c-basic-offset: 8
+ End:
+*/
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
new file mode 100644
index 000000000000..2c6d739706b6
--- /dev/null
+++ b/include/linux/scx200_gpio.h
@@ -0,0 +1,98 @@
+#include <linux/spinlock.h>
+
+u32 scx200_gpio_configure(int index, u32 set, u32 clear);
+void scx200_gpio_dump(unsigned index);
+
+extern unsigned scx200_gpio_base;
+extern spinlock_t scx200_gpio_lock;
+extern long scx200_gpio_shadow[2];
+
+#define scx200_gpio_present() (scx200_gpio_base!=0)
+
+/* Definitions to make sure I do the same thing in all functions */
+#define __SCx200_GPIO_BANK unsigned bank = index>>5
+#define __SCx200_GPIO_IOADDR unsigned short ioaddr = scx200_gpio_base+0x10*bank
+#define __SCx200_GPIO_SHADOW long *shadow = scx200_gpio_shadow+bank
+#define __SCx200_GPIO_INDEX index &= 31
+
+#define __SCx200_GPIO_OUT __asm__ __volatile__("outsl":"=mS" (shadow):"d" (ioaddr), "0" (shadow))
+
+/* returns the value of the GPIO pin */
+
+static inline int scx200_gpio_get(int index) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_IOADDR + 0x04;
+ __SCx200_GPIO_INDEX;
+
+ return (inl(ioaddr) & (1<<index)) ? 1 : 0;
+}
+
+/* return the value driven on the GPIO signal (the value that will be
+ driven if the GPIO is configured as an output, it might not be the
+ state of the GPIO right now if the GPIO is configured as an input) */
+
+static inline int scx200_gpio_current(int index) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_INDEX;
+
+ return (scx200_gpio_shadow[bank] & (1<<index)) ? 1 : 0;
+}
+
+/* drive the GPIO signal high */
+
+static inline void scx200_gpio_set_high(int index) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_IOADDR;
+ __SCx200_GPIO_SHADOW;
+ __SCx200_GPIO_INDEX;
+ set_bit(index, shadow);
+ __SCx200_GPIO_OUT;
+}
+
+/* drive the GPIO signal low */
+
+static inline void scx200_gpio_set_low(int index) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_IOADDR;
+ __SCx200_GPIO_SHADOW;
+ __SCx200_GPIO_INDEX;
+ clear_bit(index, shadow);
+ __SCx200_GPIO_OUT;
+}
+
+/* drive the GPIO signal to state */
+
+static inline void scx200_gpio_set(int index, int state) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_IOADDR;
+ __SCx200_GPIO_SHADOW;
+ __SCx200_GPIO_INDEX;
+ if (state)
+ set_bit(index, shadow);
+ else
+ clear_bit(index, shadow);
+ __SCx200_GPIO_OUT;
+}
+
+/* toggle the GPIO signal */
+static inline void scx200_gpio_change(int index) {
+ __SCx200_GPIO_BANK;
+ __SCx200_GPIO_IOADDR;
+ __SCx200_GPIO_SHADOW;
+ __SCx200_GPIO_INDEX;
+ change_bit(index, shadow);
+ __SCx200_GPIO_OUT;
+}
+
+#undef __SCx200_GPIO_BANK
+#undef __SCx200_GPIO_IOADDR
+#undef __SCx200_GPIO_SHADOW
+#undef __SCx200_GPIO_INDEX
+#undef __SCx200_GPIO_OUT
+
+/*
+ Local variables:
+ compile-command: "make -C ../.. bzImage modules"
+ c-basic-offset: 8
+ End:
+*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 8cf9eccab7c1..c38330747ee1 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -168,6 +168,8 @@ struct uart_port {
#define UPF_BUGGY_UART (1 << 14)
#define UPF_AUTOPROBE (1 << 15)
#define UPF_BOOT_AUTOCONF (1 << 28)
+#define UPF_RESOURCES (1 << 30)
+#define UPF_IOREMAP (1 << 31)
#define UPF_FLAGS (0x7fff)
#define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY)