summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:32:43 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:32:43 -0800
commita8a2069f432c5597bdf9c83ab3045b9ef32ab5e3 (patch)
tree06d1047415e70b9a6cbd0567ae1202433530dd46 /include
parent5db5272c0a5cd37e5a697e4750fbc4ce6317b7dc (diff)
v2.4.14.1 -> v2.4.14.2
- Ivan Kokshaysky: fix alpha dec_and_lock with modules, for alpha config entry - Kai Germaschewski: ISDN updates - Jeff Garzik: network driver updates, sysv fs update - Kai Mäkisara: SCSI tape update - Alan Cox: large drivers merge - Nikita Danilov: reiserfs procfs information - Andrew Morton: ext3 merge - Christoph Hellwig: vxfs livelock fix - Trond Myklebust: NFS updates - Jens Axboe: cpqarray + cciss dequeue fix - Tim Waugh: parport_serial base_baud setting - Matthew Dharm: usb-storage Freecom driver fixes - Dave McCracken: wait4() thread group race fix
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/core_apecs.h30
-rw-r--r--include/asm-alpha/core_cia.h56
-rw-r--r--include/asm-alpha/core_irongate.h30
-rw-r--r--include/asm-alpha/core_lca.h30
-rw-r--r--include/asm-alpha/core_mcpcia.h30
-rw-r--r--include/asm-alpha/core_polaris.h30
-rw-r--r--include/asm-alpha/core_t2.h28
-rw-r--r--include/asm-alpha/core_titan.h30
-rw-r--r--include/asm-alpha/core_tsunami.h28
-rw-r--r--include/asm-alpha/core_wildfire.h30
-rw-r--r--include/asm-alpha/io.h54
-rw-r--r--include/asm-alpha/jensen.h32
-rw-r--r--include/asm-alpha/machvec.h30
-rw-r--r--include/asm-alpha/unistd.h3
-rw-r--r--include/asm-arm/arch-epxa10db/hardware.h1
-rw-r--r--include/asm-arm/arch-integrator/hardware.h2
-rw-r--r--include/asm-arm/arch-sa1100/hardware.h6
-rw-r--r--include/asm-arm/pci.h3
-rw-r--r--include/asm-arm/proc-fns.h8
-rw-r--r--include/asm-arm/sizes.h (renamed from include/asm-arm/arch-integrator/sizes.h)0
-rw-r--r--include/asm-cris/etraxgpio.h11
-rw-r--r--include/asm-cris/pgtable.h5
-rw-r--r--include/asm-cris/system.h2
-rw-r--r--include/asm-cris/timex.h13
-rw-r--r--include/asm-cris/uaccess.h5
-rw-r--r--include/asm-cris/unistd.h3
-rw-r--r--include/asm-i386/hardirq.h2
-rw-r--r--include/asm-i386/keyboard.h4
-rw-r--r--include/asm-i386/mpspec.h33
-rw-r--r--include/asm-i386/pci.h42
-rw-r--r--include/asm-i386/system.h1
-rw-r--r--include/asm-ia64/acpi-ext.h9
-rw-r--r--include/asm-ia64/ia32.h111
-rw-r--r--include/asm-ia64/io.h12
-rw-r--r--include/asm-ia64/iosapic.h9
-rw-r--r--include/asm-ia64/ipc.h31
-rw-r--r--include/asm-ia64/keyboard.h9
-rw-r--r--include/asm-ia64/kregs.h3
-rw-r--r--include/asm-ia64/machvec.h12
-rw-r--r--include/asm-ia64/machvec_sn1.h2
-rw-r--r--include/asm-ia64/mca.h18
-rw-r--r--include/asm-ia64/mca_asm.h29
-rw-r--r--include/asm-ia64/mmu_context.h1
-rw-r--r--include/asm-ia64/module.h40
-rw-r--r--include/asm-ia64/msgbuf.h2
-rw-r--r--include/asm-ia64/namei.h25
-rw-r--r--include/asm-ia64/offsets.h20
-rw-r--r--include/asm-ia64/page.h3
-rw-r--r--include/asm-ia64/pal.h465
-rw-r--r--include/asm-ia64/pci.h23
-rw-r--r--include/asm-ia64/perfmon.h11
-rw-r--r--include/asm-ia64/pgalloc.h7
-rw-r--r--include/asm-ia64/pgtable.h22
-rw-r--r--include/asm-ia64/processor.h97
-rw-r--r--include/asm-ia64/sal.h566
-rw-r--r--include/asm-ia64/scatterlist.h6
-rw-r--r--include/asm-ia64/semaphore.h2
-rw-r--r--include/asm-ia64/sembuf.h2
-rw-r--r--include/asm-ia64/shmbuf.h2
-rw-r--r--include/asm-ia64/sigcontext.h23
-rw-r--r--include/asm-ia64/signal.h20
-rw-r--r--include/asm-ia64/smp.h10
-rw-r--r--include/asm-ia64/smplock.h8
-rw-r--r--include/asm-ia64/spinlock.h24
-rw-r--r--include/asm-ia64/system.h29
-rw-r--r--include/asm-ia64/unistd.h7
-rw-r--r--include/asm-ia64/user.h5
-rw-r--r--include/asm-s390/atomic.h2
-rw-r--r--include/asm-s390/fcntl.h2
-rw-r--r--include/asm-s390/gdb-stub.h2
-rw-r--r--include/asm-s390/irq.h2
-rw-r--r--include/asm-s390/sigcontext.h4
-rw-r--r--include/asm-s390/vtoc.h2
-rw-r--r--include/asm-s390x/atomic.h2
-rw-r--r--include/asm-s390x/fcntl.h2
-rw-r--r--include/asm-s390x/irq.h2
-rw-r--r--include/asm-s390x/s390-regs-common.h115
-rw-r--r--include/asm-s390x/sigcontext.h4
-rw-r--r--include/asm-s390x/spinlock.h2
-rw-r--r--include/asm-s390x/vtoc.h131
-rw-r--r--include/linux/acpi_serial.h103
-rw-r--r--include/linux/agp_backend.h3
-rw-r--r--include/linux/atm.h1
-rw-r--r--include/linux/atmapi.h4
-rw-r--r--include/linux/atmdev.h11
-rw-r--r--include/linux/atmioc.h4
-rw-r--r--include/linux/atmppp.h24
-rw-r--r--include/linux/blk.h4
-rw-r--r--include/linux/capability.h2
-rw-r--r--include/linux/ethtool.h29
-rw-r--r--include/linux/ext3_fs.h715
-rw-r--r--include/linux/ext3_fs_i.h78
-rw-r--r--include/linux/ext3_fs_sb.h77
-rw-r--r--include/linux/ext3_jbd.h290
-rw-r--r--include/linux/fs.h18
-rw-r--r--include/linux/i2o.h3
-rw-r--r--include/linux/irda.h1
-rw-r--r--include/linux/jbd.h881
-rw-r--r--include/linux/journal-head.h70
-rw-r--r--include/linux/malloc.h2
-rw-r--r--include/linux/module.h16
-rw-r--r--include/linux/mtd/jedec.h4
-rw-r--r--include/linux/mtio.h5
-rw-r--r--include/linux/nfs_flushd.h8
-rw-r--r--include/linux/nfs_fs.h12
-rw-r--r--include/linux/nfs_fs_sb.h6
-rw-r--r--include/linux/nfs_page.h86
-rw-r--r--include/linux/parport.h4
-rw-r--r--include/linux/pci_ids.h26
-rw-r--r--include/linux/reiserfs_fs.h66
-rw-r--r--include/linux/reiserfs_fs_sb.h70
-rw-r--r--include/linux/sched.h7
-rw-r--r--include/linux/serial.h6
-rw-r--r--include/linux/sisfb.h151
-rw-r--r--include/linux/soundcard.h2
-rw-r--r--include/linux/sysv_fs.h48
-rw-r--r--include/linux/sysv_fs_i.h1
-rw-r--r--include/linux/sysv_fs_sb.h2
-rw-r--r--include/linux/videodev.h2
-rw-r--r--include/linux/watchdog.h1
-rw-r--r--include/net/dn.h1
-rw-r--r--include/net/irda/irda-usb.h5
-rw-r--r--include/net/irda/irda.h6
-rw-r--r--include/net/irda/irlap_event.h2
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/irda/irlmp_event.h5
-rw-r--r--include/net/irda/irmod.h108
-rw-r--r--include/net/irda/parameters.h7
-rw-r--r--include/net/irda/timer.h5
129 files changed, 4075 insertions, 1428 deletions
diff --git a/include/asm-alpha/core_apecs.h b/include/asm-alpha/core_apecs.h
index 4b27586c8266..b32084e51c98 100644
--- a/include/asm-alpha/core_apecs.h
+++ b/include/asm-alpha/core_apecs.h
@@ -374,13 +374,13 @@ struct el_apecs_procdata
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int apecs_inb(unsigned long addr)
+__EXTERN_INLINE u8 apecs_inb(unsigned long addr)
{
long result = *(vip) ((addr << 5) + APECS_IO + 0x00);
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE void apecs_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void apecs_outb(u8 b, unsigned long addr)
{
unsigned long w;
@@ -389,13 +389,13 @@ __EXTERN_INLINE void apecs_outb(unsigned char b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int apecs_inw(unsigned long addr)
+__EXTERN_INLINE u16 apecs_inw(unsigned long addr)
{
long result = *(vip) ((addr << 5) + APECS_IO + 0x08);
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void apecs_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void apecs_outw(u16 b, unsigned long addr)
{
unsigned long w;
@@ -404,12 +404,12 @@ __EXTERN_INLINE void apecs_outw(unsigned short b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int apecs_inl(unsigned long addr)
+__EXTERN_INLINE u32 apecs_inl(unsigned long addr)
{
return *(vuip) ((addr << 5) + APECS_IO + 0x18);
}
-__EXTERN_INLINE void apecs_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void apecs_outl(u32 b, unsigned long addr)
{
*(vuip) ((addr << 5) + APECS_IO + 0x18) = b;
mb();
@@ -421,7 +421,7 @@ __EXTERN_INLINE void apecs_outl(unsigned int b, unsigned long addr)
* dense memory space, everything else through sparse space.
*/
-__EXTERN_INLINE unsigned long apecs_readb(unsigned long addr)
+__EXTERN_INLINE u8 apecs_readb(unsigned long addr)
{
unsigned long result, msb;
@@ -435,7 +435,7 @@ __EXTERN_INLINE unsigned long apecs_readb(unsigned long addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long apecs_readw(unsigned long addr)
+__EXTERN_INLINE u16 apecs_readw(unsigned long addr)
{
unsigned long result, msb;
@@ -449,17 +449,17 @@ __EXTERN_INLINE unsigned long apecs_readw(unsigned long addr)
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long apecs_readl(unsigned long addr)
+__EXTERN_INLINE u32 apecs_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long apecs_readq(unsigned long addr)
+__EXTERN_INLINE u64 apecs_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void apecs_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void apecs_writeb(u8 b, unsigned long addr)
{
unsigned long msb;
@@ -472,7 +472,7 @@ __EXTERN_INLINE void apecs_writeb(unsigned char b, unsigned long addr)
*(vuip) ((addr << 5) + APECS_SPARSE_MEM + 0x00) = b * 0x01010101;
}
-__EXTERN_INLINE void apecs_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void apecs_writew(u16 b, unsigned long addr)
{
unsigned long msb;
@@ -485,12 +485,12 @@ __EXTERN_INLINE void apecs_writew(unsigned short b, unsigned long addr)
*(vuip) ((addr << 5) + APECS_SPARSE_MEM + 0x08) = b * 0x00010001;
}
-__EXTERN_INLINE void apecs_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void apecs_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void apecs_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void apecs_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_cia.h b/include/asm-alpha/core_cia.h
index 835a546e46c0..827f9bbf0d3c 100644
--- a/include/asm-alpha/core_cia.h
+++ b/include/asm-alpha/core_cia.h
@@ -307,46 +307,46 @@ struct el_CIA_sysdata_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int cia_inb(unsigned long addr)
+__EXTERN_INLINE u8 cia_inb(unsigned long addr)
{
long result;
result = *(vip) ((addr << 5) + CIA_IO + 0x00);
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE void cia_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void cia_outb(u8 b, unsigned long addr)
{
unsigned long w = __kernel_insbl(b, addr & 3);
*(vuip) ((addr << 5) + CIA_IO + 0x00) = w;
mb();
}
-__EXTERN_INLINE unsigned int cia_inw(unsigned long addr)
+__EXTERN_INLINE u16 cia_inw(unsigned long addr)
{
long result;
result = *(vip) ((addr << 5) + CIA_IO + 0x08);
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void cia_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void cia_outw(u16 b, unsigned long addr)
{
unsigned long w = __kernel_inswl(b, addr & 3);
*(vuip) ((addr << 5) + CIA_IO + 0x08) = w;
mb();
}
-__EXTERN_INLINE unsigned int cia_inl(unsigned long addr)
+__EXTERN_INLINE u32 cia_inl(unsigned long addr)
{
return *(vuip) ((addr << 5) + CIA_IO + 0x18);
}
-__EXTERN_INLINE void cia_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void cia_outl(u32 b, unsigned long addr)
{
*(vuip) ((addr << 5) + CIA_IO + 0x18) = b;
mb();
}
-__EXTERN_INLINE unsigned int cia_bwx_inb(unsigned long addr)
+__EXTERN_INLINE u8 cia_bwx_inb(unsigned long addr)
{
/* ??? I wish I could get rid of this. But there's no ioremap
equivalent for I/O space. PCI I/O can be forced into the
@@ -356,29 +356,29 @@ __EXTERN_INLINE unsigned int cia_bwx_inb(unsigned long addr)
return __kernel_ldbu(*(vucp)(addr+CIA_BW_IO));
}
-__EXTERN_INLINE void cia_bwx_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_outb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)(addr+CIA_BW_IO));
mb();
}
-__EXTERN_INLINE unsigned int cia_bwx_inw(unsigned long addr)
+__EXTERN_INLINE u16 cia_bwx_inw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)(addr+CIA_BW_IO));
}
-__EXTERN_INLINE void cia_bwx_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_outw(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)(addr+CIA_BW_IO));
mb();
}
-__EXTERN_INLINE unsigned int cia_bwx_inl(unsigned long addr)
+__EXTERN_INLINE u32 cia_bwx_inl(unsigned long addr)
{
return *(vuip)(addr+CIA_BW_IO);
}
-__EXTERN_INLINE void cia_bwx_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_outl(u32 b, unsigned long addr)
{
*(vuip)(addr+CIA_BW_IO) = b;
mb();
@@ -417,7 +417,7 @@ __EXTERN_INLINE void cia_bwx_outl(unsigned int b, unsigned long addr)
*
*/
-__EXTERN_INLINE unsigned long cia_readb(unsigned long addr)
+__EXTERN_INLINE u8 cia_readb(unsigned long addr)
{
unsigned long result;
@@ -426,7 +426,7 @@ __EXTERN_INLINE unsigned long cia_readb(unsigned long addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long cia_readw(unsigned long addr)
+__EXTERN_INLINE u16 cia_readw(unsigned long addr)
{
unsigned long result;
@@ -435,7 +435,7 @@ __EXTERN_INLINE unsigned long cia_readw(unsigned long addr)
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void cia_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void cia_writeb(u8 b, unsigned long addr)
{
unsigned long w;
@@ -444,7 +444,7 @@ __EXTERN_INLINE void cia_writeb(unsigned char b, unsigned long addr)
*(vuip) ((addr << 5) + CIA_SPARSE_MEM + 0x00) = w;
}
-__EXTERN_INLINE void cia_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void cia_writew(u16 b, unsigned long addr)
{
unsigned long w;
@@ -453,22 +453,22 @@ __EXTERN_INLINE void cia_writew(unsigned short b, unsigned long addr)
*(vuip) ((addr << 5) + CIA_SPARSE_MEM + 0x08) = w;
}
-__EXTERN_INLINE unsigned long cia_readl(unsigned long addr)
+__EXTERN_INLINE u32 cia_readl(unsigned long addr)
{
return *(vuip)addr;
}
-__EXTERN_INLINE unsigned long cia_readq(unsigned long addr)
+__EXTERN_INLINE u64 cia_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void cia_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void cia_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void cia_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void cia_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
@@ -485,42 +485,42 @@ __EXTERN_INLINE void cia_iounmap(unsigned long addr)
return;
}
-__EXTERN_INLINE unsigned long cia_bwx_readb(unsigned long addr)
+__EXTERN_INLINE u8 cia_bwx_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long cia_bwx_readw(unsigned long addr)
+__EXTERN_INLINE u16 cia_bwx_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long cia_bwx_readl(unsigned long addr)
+__EXTERN_INLINE u32 cia_bwx_readl(unsigned long addr)
{
return *(vuip)addr;
}
-__EXTERN_INLINE unsigned long cia_bwx_readq(unsigned long addr)
+__EXTERN_INLINE u64 cia_bwx_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void cia_bwx_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void cia_bwx_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void cia_bwx_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void cia_bwx_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void cia_bwx_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_irongate.h b/include/asm-alpha/core_irongate.h
index 71a89c6e0882..4a4e6fa4c0e8 100644
--- a/include/asm-alpha/core_irongate.h
+++ b/include/asm-alpha/core_irongate.h
@@ -190,34 +190,34 @@ struct el_IRONGATE_sysdata_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int irongate_inb(unsigned long addr)
+__EXTERN_INLINE u8 irongate_inb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)(addr + IRONGATE_IO));
}
-__EXTERN_INLINE void irongate_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void irongate_outb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)(addr + IRONGATE_IO));
mb();
}
-__EXTERN_INLINE unsigned int irongate_inw(unsigned long addr)
+__EXTERN_INLINE u16 irongate_inw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)(addr + IRONGATE_IO));
}
-__EXTERN_INLINE void irongate_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void irongate_outw(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)(addr + IRONGATE_IO));
mb();
}
-__EXTERN_INLINE unsigned int irongate_inl(unsigned long addr)
+__EXTERN_INLINE u32 irongate_inl(unsigned long addr)
{
return *(vuip)(addr + IRONGATE_IO);
}
-__EXTERN_INLINE void irongate_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void irongate_outl(u32 b, unsigned long addr)
{
*(vuip)(addr + IRONGATE_IO) = b;
mb();
@@ -227,42 +227,42 @@ __EXTERN_INLINE void irongate_outl(unsigned int b, unsigned long addr)
* Memory functions. All accesses are done through linear space.
*/
-__EXTERN_INLINE unsigned long irongate_readb(unsigned long addr)
+__EXTERN_INLINE u8 irongate_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long irongate_readw(unsigned long addr)
+__EXTERN_INLINE u16 irongate_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long irongate_readl(unsigned long addr)
+__EXTERN_INLINE u32 irongate_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long irongate_readq(unsigned long addr)
+__EXTERN_INLINE u64 irongate_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void irongate_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void irongate_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void irongate_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void irongate_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void irongate_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void irongate_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void irongate_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void irongate_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_lca.h b/include/asm-alpha/core_lca.h
index 32d31741a1c5..d4f397543540 100644
--- a/include/asm-alpha/core_lca.h
+++ b/include/asm-alpha/core_lca.h
@@ -219,13 +219,13 @@ union el_lca {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int lca_inb(unsigned long addr)
+__EXTERN_INLINE u8 lca_inb(unsigned long addr)
{
long result = *(vip) ((addr << 5) + LCA_IO + 0x00);
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE void lca_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void lca_outb(u8 b, unsigned long addr)
{
unsigned long w;
@@ -234,13 +234,13 @@ __EXTERN_INLINE void lca_outb(unsigned char b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int lca_inw(unsigned long addr)
+__EXTERN_INLINE u16 lca_inw(unsigned long addr)
{
long result = *(vip) ((addr << 5) + LCA_IO + 0x08);
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void lca_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void lca_outw(u16 b, unsigned long addr)
{
unsigned long w;
@@ -249,12 +249,12 @@ __EXTERN_INLINE void lca_outw(unsigned short b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int lca_inl(unsigned long addr)
+__EXTERN_INLINE u32 lca_inl(unsigned long addr)
{
return *(vuip) ((addr << 5) + LCA_IO + 0x18);
}
-__EXTERN_INLINE void lca_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void lca_outl(u32 b, unsigned long addr)
{
*(vuip) ((addr << 5) + LCA_IO + 0x18) = b;
mb();
@@ -266,7 +266,7 @@ __EXTERN_INLINE void lca_outl(unsigned int b, unsigned long addr)
* dense memory space, everything else through sparse space.
*/
-__EXTERN_INLINE unsigned long lca_readb(unsigned long addr)
+__EXTERN_INLINE u8 lca_readb(unsigned long addr)
{
unsigned long result, msb;
@@ -280,7 +280,7 @@ __EXTERN_INLINE unsigned long lca_readb(unsigned long addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long lca_readw(unsigned long addr)
+__EXTERN_INLINE u16 lca_readw(unsigned long addr)
{
unsigned long result, msb;
@@ -294,17 +294,17 @@ __EXTERN_INLINE unsigned long lca_readw(unsigned long addr)
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long lca_readl(unsigned long addr)
+__EXTERN_INLINE u32 lca_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long lca_readq(unsigned long addr)
+__EXTERN_INLINE u64 lca_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void lca_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void lca_writeb(u8 b, unsigned long addr)
{
unsigned long msb;
unsigned long w;
@@ -319,7 +319,7 @@ __EXTERN_INLINE void lca_writeb(unsigned char b, unsigned long addr)
*(vuip) ((addr << 5) + LCA_SPARSE_MEM + 0x00) = w;
}
-__EXTERN_INLINE void lca_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void lca_writew(u16 b, unsigned long addr)
{
unsigned long msb;
unsigned long w;
@@ -334,12 +334,12 @@ __EXTERN_INLINE void lca_writew(unsigned short b, unsigned long addr)
*(vuip) ((addr << 5) + LCA_SPARSE_MEM + 0x08) = w;
}
-__EXTERN_INLINE void lca_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void lca_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void lca_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void lca_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_mcpcia.h b/include/asm-alpha/core_mcpcia.h
index 67526b969377..e75eab24e06f 100644
--- a/include/asm-alpha/core_mcpcia.h
+++ b/include/asm-alpha/core_mcpcia.h
@@ -217,7 +217,7 @@ struct el_MCPCIA_uncorrected_frame_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int mcpcia_inb(unsigned long in_addr)
+__EXTERN_INLINE u8 mcpcia_inb(unsigned long in_addr)
{
unsigned long addr, hose, result;
@@ -234,7 +234,7 @@ __EXTERN_INLINE unsigned int mcpcia_inb(unsigned long in_addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE void mcpcia_outb(unsigned char b, unsigned long in_addr)
+__EXTERN_INLINE void mcpcia_outb(u8 b, unsigned long in_addr)
{
unsigned long addr, hose, w;
@@ -247,7 +247,7 @@ __EXTERN_INLINE void mcpcia_outb(unsigned char b, unsigned long in_addr)
mb();
}
-__EXTERN_INLINE unsigned int mcpcia_inw(unsigned long in_addr)
+__EXTERN_INLINE u16 mcpcia_inw(unsigned long in_addr)
{
unsigned long addr, hose, result;
@@ -259,7 +259,7 @@ __EXTERN_INLINE unsigned int mcpcia_inw(unsigned long in_addr)
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void mcpcia_outw(unsigned short b, unsigned long in_addr)
+__EXTERN_INLINE void mcpcia_outw(u16 b, unsigned long in_addr)
{
unsigned long addr, hose, w;
@@ -272,7 +272,7 @@ __EXTERN_INLINE void mcpcia_outw(unsigned short b, unsigned long in_addr)
mb();
}
-__EXTERN_INLINE unsigned int mcpcia_inl(unsigned long in_addr)
+__EXTERN_INLINE u32 mcpcia_inl(unsigned long in_addr)
{
unsigned long addr, hose;
@@ -283,7 +283,7 @@ __EXTERN_INLINE unsigned int mcpcia_inl(unsigned long in_addr)
return *(vuip) ((addr << 5) + hose + 0x18);
}
-__EXTERN_INLINE void mcpcia_outl(unsigned int b, unsigned long in_addr)
+__EXTERN_INLINE void mcpcia_outl(u32 b, unsigned long in_addr)
{
unsigned long addr, hose;
@@ -345,7 +345,7 @@ __EXTERN_INLINE int mcpcia_is_ioaddr(unsigned long addr)
return addr >= MCPCIA_SPARSE(0);
}
-__EXTERN_INLINE unsigned long mcpcia_readb(unsigned long in_addr)
+__EXTERN_INLINE u8 mcpcia_readb(unsigned long in_addr)
{
unsigned long addr = in_addr & 0xffffffffUL;
unsigned long hose = in_addr & ~0xffffffffUL;
@@ -364,7 +364,7 @@ __EXTERN_INLINE unsigned long mcpcia_readb(unsigned long in_addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long mcpcia_readw(unsigned long in_addr)
+__EXTERN_INLINE u16 mcpcia_readw(unsigned long in_addr)
{
unsigned long addr = in_addr & 0xffffffffUL;
unsigned long hose = in_addr & ~0xffffffffUL;
@@ -383,7 +383,7 @@ __EXTERN_INLINE unsigned long mcpcia_readw(unsigned long in_addr)
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void mcpcia_writeb(unsigned char b, unsigned long in_addr)
+__EXTERN_INLINE void mcpcia_writeb(u8 b, unsigned long in_addr)
{
unsigned long addr = in_addr & 0xffffffffUL;
unsigned long hose = in_addr & ~0xffffffffUL;
@@ -401,7 +401,7 @@ __EXTERN_INLINE void mcpcia_writeb(unsigned char b, unsigned long in_addr)
*(vuip) ((addr << 5) + hose + 0x00) = w;
}
-__EXTERN_INLINE void mcpcia_writew(unsigned short b, unsigned long in_addr)
+__EXTERN_INLINE void mcpcia_writew(u16 b, unsigned long in_addr)
{
unsigned long addr = in_addr & 0xffffffffUL;
unsigned long hose = in_addr & ~0xffffffffUL;
@@ -419,22 +419,22 @@ __EXTERN_INLINE void mcpcia_writew(unsigned short b, unsigned long in_addr)
*(vuip) ((addr << 5) + hose + 0x08) = w;
}
-__EXTERN_INLINE unsigned long mcpcia_readl(unsigned long addr)
+__EXTERN_INLINE u32 mcpcia_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long mcpcia_readq(unsigned long addr)
+__EXTERN_INLINE u64 mcpcia_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void mcpcia_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void mcpcia_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void mcpcia_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void mcpcia_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_polaris.h b/include/asm-alpha/core_polaris.h
index 03aec4f73454..ee7bdceed830 100644
--- a/include/asm-alpha/core_polaris.h
+++ b/include/asm-alpha/core_polaris.h
@@ -68,7 +68,7 @@ struct el_POLARIS_sysdata_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int polaris_inb(unsigned long addr)
+__EXTERN_INLINE u8 polaris_inb(unsigned long addr)
{
/* ??? I wish I could get rid of this. But there's no ioremap
equivalent for I/O space. PCI I/O can be forced into the
@@ -78,29 +78,29 @@ __EXTERN_INLINE unsigned int polaris_inb(unsigned long addr)
return __kernel_ldbu(*(vucp)(addr + POLARIS_DENSE_IO_BASE));
}
-__EXTERN_INLINE void polaris_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void polaris_outb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)(addr + POLARIS_DENSE_IO_BASE));
mb();
}
-__EXTERN_INLINE unsigned int polaris_inw(unsigned long addr)
+__EXTERN_INLINE u16 polaris_inw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)(addr + POLARIS_DENSE_IO_BASE));
}
-__EXTERN_INLINE void polaris_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void polaris_outw(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)(addr + POLARIS_DENSE_IO_BASE));
mb();
}
-__EXTERN_INLINE unsigned int polaris_inl(unsigned long addr)
+__EXTERN_INLINE u32 polaris_inl(unsigned long addr)
{
return *(vuip)(addr + POLARIS_DENSE_IO_BASE);
}
-__EXTERN_INLINE void polaris_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void polaris_outl(u32 b, unsigned long addr)
{
*(vuip)(addr + POLARIS_DENSE_IO_BASE) = b;
mb();
@@ -113,42 +113,42 @@ __EXTERN_INLINE void polaris_outl(unsigned int b, unsigned long addr)
* We will only support DENSE access via BWX insns.
*/
-__EXTERN_INLINE unsigned long polaris_readb(unsigned long addr)
+__EXTERN_INLINE u8 polaris_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long polaris_readw(unsigned long addr)
+__EXTERN_INLINE u16 polaris_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long polaris_readl(unsigned long addr)
+__EXTERN_INLINE u32 polaris_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long polaris_readq(unsigned long addr)
+__EXTERN_INLINE u64 polaris_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void polaris_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void polaris_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void polaris_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void polaris_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void polaris_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void polaris_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void polaris_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void polaris_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_t2.h b/include/asm-alpha/core_t2.h
index c5f29a9fed3f..007cf43baf10 100644
--- a/include/asm-alpha/core_t2.h
+++ b/include/asm-alpha/core_t2.h
@@ -329,13 +329,13 @@ struct el_t2_frame_corrected {
#define vip volatile int *
#define vuip volatile unsigned int *
-__EXTERN_INLINE unsigned int t2_inb(unsigned long addr)
+__EXTERN_INLINE u8 t2_inb(unsigned long addr)
{
long result = *(vip) ((addr << 5) + T2_IO + 0x00);
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE void t2_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void t2_outb(u8 b, unsigned long addr)
{
unsigned long w;
@@ -344,13 +344,13 @@ __EXTERN_INLINE void t2_outb(unsigned char b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int t2_inw(unsigned long addr)
+__EXTERN_INLINE u16 t2_inw(unsigned long addr)
{
long result = *(vip) ((addr << 5) + T2_IO + 0x08);
return __kernel_extwl(result, addr & 3);
}
-__EXTERN_INLINE void t2_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void t2_outw(u16 b, unsigned long addr)
{
unsigned long w;
@@ -359,12 +359,12 @@ __EXTERN_INLINE void t2_outw(unsigned short b, unsigned long addr)
mb();
}
-__EXTERN_INLINE unsigned int t2_inl(unsigned long addr)
+__EXTERN_INLINE u32 t2_inl(unsigned long addr)
{
return *(vuip) ((addr << 5) + T2_IO + 0x18);
}
-__EXTERN_INLINE void t2_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void t2_outl(u32 b, unsigned long addr)
{
*(vuip) ((addr << 5) + T2_IO + 0x18) = b;
mb();
@@ -402,7 +402,7 @@ __EXTERN_INLINE void t2_outl(unsigned int b, unsigned long addr)
*
*/
-__EXTERN_INLINE unsigned long t2_readb(unsigned long addr)
+__EXTERN_INLINE u8 t2_readb(unsigned long addr)
{
unsigned long result, msb;
@@ -414,7 +414,7 @@ __EXTERN_INLINE unsigned long t2_readb(unsigned long addr)
return __kernel_extbl(result, addr & 3);
}
-__EXTERN_INLINE unsigned long t2_readw(unsigned long addr)
+__EXTERN_INLINE u16 t2_readw(unsigned long addr)
{
unsigned long result, msb;
@@ -427,7 +427,7 @@ __EXTERN_INLINE unsigned long t2_readw(unsigned long addr)
}
/* On SABLE with T2, we must use SPARSE memory even for 32-bit access. */
-__EXTERN_INLINE unsigned long t2_readl(unsigned long addr)
+__EXTERN_INLINE u32 t2_readl(unsigned long addr)
{
unsigned long msb;
@@ -438,7 +438,7 @@ __EXTERN_INLINE unsigned long t2_readl(unsigned long addr)
return *(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18);
}
-__EXTERN_INLINE unsigned long t2_readq(unsigned long addr)
+__EXTERN_INLINE u64 t2_readq(unsigned long addr)
{
unsigned long r0, r1, work, msb;
@@ -452,7 +452,7 @@ __EXTERN_INLINE unsigned long t2_readq(unsigned long addr)
return r1 << 32 | r0;
}
-__EXTERN_INLINE void t2_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void t2_writeb(u8 b, unsigned long addr)
{
unsigned long msb, w;
@@ -464,7 +464,7 @@ __EXTERN_INLINE void t2_writeb(unsigned char b, unsigned long addr)
*(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x00) = w;
}
-__EXTERN_INLINE void t2_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void t2_writew(u16 b, unsigned long addr)
{
unsigned long msb, w;
@@ -477,7 +477,7 @@ __EXTERN_INLINE void t2_writew(unsigned short b, unsigned long addr)
}
/* On SABLE with T2, we must use SPARSE memory even for 32-bit access. */
-__EXTERN_INLINE void t2_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void t2_writel(u32 b, unsigned long addr)
{
unsigned long msb;
@@ -488,7 +488,7 @@ __EXTERN_INLINE void t2_writel(unsigned int b, unsigned long addr)
*(vuip) ((addr << 5) + T2_SPARSE_MEM + 0x18) = b;
}
-__EXTERN_INLINE void t2_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void t2_writeq(u64 b, unsigned long addr)
{
unsigned long msb, work;
diff --git a/include/asm-alpha/core_titan.h b/include/asm-alpha/core_titan.h
index e8511636ff23..192b5eb6f28e 100644
--- a/include/asm-alpha/core_titan.h
+++ b/include/asm-alpha/core_titan.h
@@ -379,7 +379,7 @@ struct el_PRIVATEER_envdata_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int titan_inb(unsigned long addr)
+__EXTERN_INLINE u8 titan_inb(unsigned long addr)
{
/* ??? I wish I could get rid of this. But there's no ioremap
equivalent for I/O space. PCI I/O can be forced into the
@@ -390,33 +390,33 @@ __EXTERN_INLINE unsigned int titan_inb(unsigned long addr)
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE void titan_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void titan_outb(u8 b, unsigned long addr)
{
addr += TITAN_IO_BIAS;
__kernel_stb(b, *(vucp)addr);
mb();
}
-__EXTERN_INLINE unsigned int titan_inw(unsigned long addr)
+__EXTERN_INLINE u16 titan_inw(unsigned long addr)
{
addr += TITAN_IO_BIAS;
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE void titan_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void titan_outw(u16 b, unsigned long addr)
{
addr += TITAN_IO_BIAS;
__kernel_stw(b, *(vusp)addr);
mb();
}
-__EXTERN_INLINE unsigned int titan_inl(unsigned long addr)
+__EXTERN_INLINE u32 titan_inl(unsigned long addr)
{
addr += TITAN_IO_BIAS;
return *(vuip)addr;
}
-__EXTERN_INLINE void titan_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void titan_outl(u32 b, unsigned long addr)
{
addr += TITAN_IO_BIAS;
*(vuip)addr = b;
@@ -444,42 +444,42 @@ __EXTERN_INLINE int titan_is_ioaddr(unsigned long addr)
return addr >= TITAN_BASE;
}
-__EXTERN_INLINE unsigned long titan_readb(unsigned long addr)
+__EXTERN_INLINE u8 titan_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long titan_readw(unsigned long addr)
+__EXTERN_INLINE u16 titan_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long titan_readl(unsigned long addr)
+__EXTERN_INLINE u32 titan_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long titan_readq(unsigned long addr)
+__EXTERN_INLINE u64 titan_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void titan_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void titan_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void titan_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void titan_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void titan_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void titan_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void titan_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void titan_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_tsunami.h b/include/asm-alpha/core_tsunami.h
index d1caef8036e6..7c815eb42c30 100644
--- a/include/asm-alpha/core_tsunami.h
+++ b/include/asm-alpha/core_tsunami.h
@@ -304,7 +304,7 @@ struct el_TSUNAMI_sysdata_mcheck {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int tsunami_inb(unsigned long addr)
+__EXTERN_INLINE u8 tsunami_inb(unsigned long addr)
{
/* ??? I wish I could get rid of this. But there's no ioremap
equivalent for I/O space. PCI I/O can be forced into the
@@ -315,33 +315,33 @@ __EXTERN_INLINE unsigned int tsunami_inb(unsigned long addr)
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE void tsunami_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void tsunami_outb(u8 b, unsigned long addr)
{
addr += TSUNAMI_IO_BIAS;
__kernel_stb(b, *(vucp)addr);
mb();
}
-__EXTERN_INLINE unsigned int tsunami_inw(unsigned long addr)
+__EXTERN_INLINE u16 tsunami_inw(unsigned long addr)
{
addr += TSUNAMI_IO_BIAS;
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE void tsunami_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void tsunami_outw(u16 b, unsigned long addr)
{
addr += TSUNAMI_IO_BIAS;
__kernel_stw(b, *(vusp)addr);
mb();
}
-__EXTERN_INLINE unsigned int tsunami_inl(unsigned long addr)
+__EXTERN_INLINE u32 tsunami_inl(unsigned long addr)
{
addr += TSUNAMI_IO_BIAS;
return *(vuip)addr;
}
-__EXTERN_INLINE void tsunami_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void tsunami_outl(u32 b, unsigned long addr)
{
addr += TSUNAMI_IO_BIAS;
*(vuip)addr = b;
@@ -369,42 +369,42 @@ __EXTERN_INLINE int tsunami_is_ioaddr(unsigned long addr)
return addr >= TSUNAMI_BASE;
}
-__EXTERN_INLINE unsigned long tsunami_readb(unsigned long addr)
+__EXTERN_INLINE u8 tsunami_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long tsunami_readw(unsigned long addr)
+__EXTERN_INLINE u16 tsunami_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long tsunami_readl(unsigned long addr)
+__EXTERN_INLINE u32 tsunami_readl(unsigned long addr)
{
return *(vuip)addr;
}
-__EXTERN_INLINE unsigned long tsunami_readq(unsigned long addr)
+__EXTERN_INLINE u64 tsunami_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void tsunami_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void tsunami_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void tsunami_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void tsunami_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void tsunami_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void tsunami_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void tsunami_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void tsunami_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/core_wildfire.h b/include/asm-alpha/core_wildfire.h
index f0724389b3cb..7b8bbd11798f 100644
--- a/include/asm-alpha/core_wildfire.h
+++ b/include/asm-alpha/core_wildfire.h
@@ -278,7 +278,7 @@ typedef struct {
#define vuip volatile unsigned int *
#define vulp volatile unsigned long *
-__EXTERN_INLINE unsigned int wildfire_inb(unsigned long addr)
+__EXTERN_INLINE u8 wildfire_inb(unsigned long addr)
{
/* ??? I wish I could get rid of this. But there's no ioremap
equivalent for I/O space. PCI I/O can be forced into the
@@ -289,33 +289,33 @@ __EXTERN_INLINE unsigned int wildfire_inb(unsigned long addr)
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE void wildfire_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void wildfire_outb(u8 b, unsigned long addr)
{
addr += WILDFIRE_IO_BIAS;
__kernel_stb(b, *(vucp)addr);
mb();
}
-__EXTERN_INLINE unsigned int wildfire_inw(unsigned long addr)
+__EXTERN_INLINE u16 wildfire_inw(unsigned long addr)
{
addr += WILDFIRE_IO_BIAS;
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE void wildfire_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void wildfire_outw(u16 b, unsigned long addr)
{
addr += WILDFIRE_IO_BIAS;
__kernel_stw(b, *(vusp)addr);
mb();
}
-__EXTERN_INLINE unsigned int wildfire_inl(unsigned long addr)
+__EXTERN_INLINE u32 wildfire_inl(unsigned long addr)
{
addr += WILDFIRE_IO_BIAS;
return *(vuip)addr;
}
-__EXTERN_INLINE void wildfire_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void wildfire_outl(u32 b, unsigned long addr)
{
addr += WILDFIRE_IO_BIAS;
*(vuip)addr = b;
@@ -343,42 +343,42 @@ __EXTERN_INLINE int wildfire_is_ioaddr(unsigned long addr)
return addr >= WILDFIRE_BASE;
}
-__EXTERN_INLINE unsigned long wildfire_readb(unsigned long addr)
+__EXTERN_INLINE u8 wildfire_readb(unsigned long addr)
{
return __kernel_ldbu(*(vucp)addr);
}
-__EXTERN_INLINE unsigned long wildfire_readw(unsigned long addr)
+__EXTERN_INLINE u16 wildfire_readw(unsigned long addr)
{
return __kernel_ldwu(*(vusp)addr);
}
-__EXTERN_INLINE unsigned long wildfire_readl(unsigned long addr)
+__EXTERN_INLINE u32 wildfire_readl(unsigned long addr)
{
- return *(vuip)addr;
+ return (*(vuip)addr) & 0xffffffff;
}
-__EXTERN_INLINE unsigned long wildfire_readq(unsigned long addr)
+__EXTERN_INLINE u64 wildfire_readq(unsigned long addr)
{
return *(vulp)addr;
}
-__EXTERN_INLINE void wildfire_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void wildfire_writeb(u8 b, unsigned long addr)
{
__kernel_stb(b, *(vucp)addr);
}
-__EXTERN_INLINE void wildfire_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void wildfire_writew(u16 b, unsigned long addr)
{
__kernel_stw(b, *(vusp)addr);
}
-__EXTERN_INLINE void wildfire_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void wildfire_writel(u32 b, unsigned long addr)
{
*(vuip)addr = b;
}
-__EXTERN_INLINE void wildfire_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void wildfire_writeq(u64 b, unsigned long addr)
{
*(vulp)addr = b;
}
diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h
index 59d578364b18..bd4e5b18f60c 100644
--- a/include/asm-alpha/io.h
+++ b/include/asm-alpha/io.h
@@ -192,20 +192,20 @@ extern void _sethae (unsigned long addr); /* cached version */
* to convince yourself that it won't break anything (in particular
* module support).
*/
-extern unsigned int _inb (unsigned long port);
-extern unsigned int _inw (unsigned long port);
-extern unsigned int _inl (unsigned long port);
-extern void _outb (unsigned char b,unsigned long port);
-extern void _outw (unsigned short w,unsigned long port);
-extern void _outl (unsigned int l,unsigned long port);
-extern unsigned long _readb(unsigned long addr);
-extern unsigned long _readw(unsigned long addr);
-extern unsigned long _readl(unsigned long addr);
-extern unsigned long _readq(unsigned long addr);
-extern void _writeb(unsigned char b, unsigned long addr);
-extern void _writew(unsigned short b, unsigned long addr);
-extern void _writel(unsigned int b, unsigned long addr);
-extern void _writeq(unsigned long b, unsigned long addr);
+extern u8 _inb (unsigned long port);
+extern u16 _inw (unsigned long port);
+extern u32 _inl (unsigned long port);
+extern void _outb (u8 b,unsigned long port);
+extern void _outw (u16 w,unsigned long port);
+extern void _outl (u32 l,unsigned long port);
+extern u8 _readb(unsigned long addr);
+extern u16 _readw(unsigned long addr);
+extern u32 _readl(unsigned long addr);
+extern u64 _readq(unsigned long addr);
+extern void _writeb(u8 b, unsigned long addr);
+extern void _writew(u16 b, unsigned long addr);
+extern void _writel(u32 b, unsigned long addr);
+extern void _writeq(u64 b, unsigned long addr);
#ifdef __KERNEL__
/*
@@ -256,7 +256,7 @@ extern void _writeq(unsigned long b, unsigned long addr);
#else
-/* Userspace declarations. */
+/* Userspace declarations. Kill in 2.5. */
extern unsigned int inb(unsigned long port);
extern unsigned int inw(unsigned long port);
@@ -308,26 +308,26 @@ static inline void * ioremap_nocache(unsigned long offset, unsigned long size)
/* Indirect back to the macros provided. */
-extern unsigned long ___raw_readb(unsigned long addr);
-extern unsigned long ___raw_readw(unsigned long addr);
-extern unsigned long ___raw_readl(unsigned long addr);
-extern unsigned long ___raw_readq(unsigned long addr);
-extern void ___raw_writeb(unsigned char b, unsigned long addr);
-extern void ___raw_writew(unsigned short b, unsigned long addr);
-extern void ___raw_writel(unsigned int b, unsigned long addr);
-extern void ___raw_writeq(unsigned long b, unsigned long addr);
+extern u8 ___raw_readb(unsigned long addr);
+extern u16 ___raw_readw(unsigned long addr);
+extern u32 ___raw_readl(unsigned long addr);
+extern u64 ___raw_readq(unsigned long addr);
+extern void ___raw_writeb(u8 b, unsigned long addr);
+extern void ___raw_writew(u16 b, unsigned long addr);
+extern void ___raw_writel(u32 b, unsigned long addr);
+extern void ___raw_writeq(u64 b, unsigned long addr);
#ifdef __raw_readb
-# define readb(a) ({ unsigned long r_ = __raw_readb(a); mb(); r_; })
+# define readb(a) ({ u8 r_ = __raw_readb(a); mb(); r_; })
#endif
#ifdef __raw_readw
-# define readw(a) ({ unsigned long r_ = __raw_readw(a); mb(); r_; })
+# define readw(a) ({ u16 r_ = __raw_readw(a); mb(); r_; })
#endif
#ifdef __raw_readl
-# define readl(a) ({ unsigned long r_ = __raw_readl(a); mb(); r_; })
+# define readl(a) ({ u32 r_ = __raw_readl(a); mb(); r_; })
#endif
#ifdef __raw_readq
-# define readq(a) ({ unsigned long r_ = __raw_readq(a); mb(); r_; })
+# define readq(a) ({ u64 r_ = __raw_readq(a); mb(); r_; })
#endif
#ifdef __raw_writeb
diff --git a/include/asm-alpha/jensen.h b/include/asm-alpha/jensen.h
index 8872cd25488f..49129cefeafb 100644
--- a/include/asm-alpha/jensen.h
+++ b/include/asm-alpha/jensen.h
@@ -118,7 +118,7 @@ static inline unsigned int jensen_local_inb(unsigned long addr)
return 0xff & *(vuip)((addr << 9) + EISA_VL82C106);
}
-static inline void jensen_local_outb(unsigned char b, unsigned long addr)
+static inline void jensen_local_outb(u8 b, unsigned long addr)
{
*(vuip)((addr << 9) + EISA_VL82C106) = b;
mb();
@@ -133,7 +133,7 @@ static inline unsigned int jensen_bus_inb(unsigned long addr)
return __kernel_extbl(result, addr & 3);
}
-static inline void jensen_bus_outb(unsigned char b, unsigned long addr)
+static inline void jensen_bus_outb(u8 b, unsigned long addr)
{
jensen_set_hae(0);
*(vuip)((addr << 7) + EISA_IO + 0x00) = b * 0x01010101;
@@ -153,7 +153,7 @@ static inline void jensen_bus_outb(unsigned char b, unsigned long addr)
/* mb LPT1 */ (addr >= 0x3bc && addr <= 0x3be) || \
/* mb COM2 */ (addr >= 0x3f8 && addr <= 0x3ff))
-__EXTERN_INLINE unsigned int jensen_inb(unsigned long addr)
+__EXTERN_INLINE u8 jensen_inb(unsigned long addr)
{
if (jensen_is_local(addr))
return jensen_local_inb(addr);
@@ -161,7 +161,7 @@ __EXTERN_INLINE unsigned int jensen_inb(unsigned long addr)
return jensen_bus_inb(addr);
}
-__EXTERN_INLINE void jensen_outb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void jensen_outb(u8 b, unsigned long addr)
{
if (jensen_is_local(addr))
jensen_local_outb(b, addr);
@@ -169,7 +169,7 @@ __EXTERN_INLINE void jensen_outb(unsigned char b, unsigned long addr)
jensen_bus_outb(b, addr);
}
-__EXTERN_INLINE unsigned int jensen_inw(unsigned long addr)
+__EXTERN_INLINE u16 jensen_inw(unsigned long addr)
{
long result;
@@ -179,20 +179,20 @@ __EXTERN_INLINE unsigned int jensen_inw(unsigned long addr)
return 0xffffUL & result;
}
-__EXTERN_INLINE unsigned int jensen_inl(unsigned long addr)
+__EXTERN_INLINE u32 jensen_inl(unsigned long addr)
{
jensen_set_hae(0);
return *(vuip) ((addr << 7) + EISA_IO + 0x60);
}
-__EXTERN_INLINE void jensen_outw(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void jensen_outw(u16 b, unsigned long addr)
{
jensen_set_hae(0);
*(vuip) ((addr << 7) + EISA_IO + 0x20) = b * 0x00010001;
mb();
}
-__EXTERN_INLINE void jensen_outl(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void jensen_outl(u32 b, unsigned long addr)
{
jensen_set_hae(0);
*(vuip) ((addr << 7) + EISA_IO + 0x60) = b;
@@ -203,7 +203,7 @@ __EXTERN_INLINE void jensen_outl(unsigned int b, unsigned long addr)
* Memory functions.
*/
-__EXTERN_INLINE unsigned long jensen_readb(unsigned long addr)
+__EXTERN_INLINE u8 jensen_readb(unsigned long addr)
{
long result;
@@ -214,7 +214,7 @@ __EXTERN_INLINE unsigned long jensen_readb(unsigned long addr)
return 0xffUL & result;
}
-__EXTERN_INLINE unsigned long jensen_readw(unsigned long addr)
+__EXTERN_INLINE u16 jensen_readw(unsigned long addr)
{
long result;
@@ -225,14 +225,14 @@ __EXTERN_INLINE unsigned long jensen_readw(unsigned long addr)
return 0xffffUL & result;
}
-__EXTERN_INLINE unsigned long jensen_readl(unsigned long addr)
+__EXTERN_INLINE u32 jensen_readl(unsigned long addr)
{
jensen_set_hae(addr);
addr &= JENSEN_HAE_MASK;
return *(vuip) ((addr << 7) + EISA_MEM + 0x60);
}
-__EXTERN_INLINE unsigned long jensen_readq(unsigned long addr)
+__EXTERN_INLINE u64 jensen_readq(unsigned long addr)
{
unsigned long r0, r1;
@@ -244,28 +244,28 @@ __EXTERN_INLINE unsigned long jensen_readq(unsigned long addr)
return r1 << 32 | r0;
}
-__EXTERN_INLINE void jensen_writeb(unsigned char b, unsigned long addr)
+__EXTERN_INLINE void jensen_writeb(u8 b, unsigned long addr)
{
jensen_set_hae(addr);
addr &= JENSEN_HAE_MASK;
*(vuip) ((addr << 7) + EISA_MEM + 0x00) = b * 0x01010101;
}
-__EXTERN_INLINE void jensen_writew(unsigned short b, unsigned long addr)
+__EXTERN_INLINE void jensen_writew(u16 b, unsigned long addr)
{
jensen_set_hae(addr);
addr &= JENSEN_HAE_MASK;
*(vuip) ((addr << 7) + EISA_MEM + 0x20) = b * 0x00010001;
}
-__EXTERN_INLINE void jensen_writel(unsigned int b, unsigned long addr)
+__EXTERN_INLINE void jensen_writel(u32 b, unsigned long addr)
{
jensen_set_hae(addr);
addr &= JENSEN_HAE_MASK;
*(vuip) ((addr << 7) + EISA_MEM + 0x60) = b;
}
-__EXTERN_INLINE void jensen_writeq(unsigned long b, unsigned long addr)
+__EXTERN_INLINE void jensen_writeq(u64 b, unsigned long addr)
{
jensen_set_hae(addr);
addr &= JENSEN_HAE_MASK;
diff --git a/include/asm-alpha/machvec.h b/include/asm-alpha/machvec.h
index cddd18475cdf..ca6bbf25cb12 100644
--- a/include/asm-alpha/machvec.h
+++ b/include/asm-alpha/machvec.h
@@ -44,23 +44,23 @@ struct alpha_machine_vector
void (*mv_pci_tbi)(struct pci_controller *hose,
dma_addr_t start, dma_addr_t end);
- unsigned int (*mv_inb)(unsigned long);
- unsigned int (*mv_inw)(unsigned long);
- unsigned int (*mv_inl)(unsigned long);
+ u8 (*mv_inb)(unsigned long);
+ u16 (*mv_inw)(unsigned long);
+ u32 (*mv_inl)(unsigned long);
- void (*mv_outb)(unsigned char, unsigned long);
- void (*mv_outw)(unsigned short, unsigned long);
- void (*mv_outl)(unsigned int, unsigned long);
+ void (*mv_outb)(u8, unsigned long);
+ void (*mv_outw)(u16, unsigned long);
+ void (*mv_outl)(u32, unsigned long);
- unsigned long (*mv_readb)(unsigned long);
- unsigned long (*mv_readw)(unsigned long);
- unsigned long (*mv_readl)(unsigned long);
- unsigned long (*mv_readq)(unsigned long);
-
- void (*mv_writeb)(unsigned char, unsigned long);
- void (*mv_writew)(unsigned short, unsigned long);
- void (*mv_writel)(unsigned int, unsigned long);
- void (*mv_writeq)(unsigned long, unsigned long);
+ u8 (*mv_readb)(unsigned long);
+ u16 (*mv_readw)(unsigned long);
+ u32 (*mv_readl)(unsigned long);
+ u64 (*mv_readq)(unsigned long);
+
+ void (*mv_writeb)(u8, unsigned long);
+ void (*mv_writew)(u16, unsigned long);
+ void (*mv_writel)(u32, unsigned long);
+ void (*mv_writeq)(u64, unsigned long);
unsigned long (*mv_ioremap)(unsigned long, unsigned long);
void (*mv_iounmap)(unsigned long);
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 265c1b2dcf41..b16c49d2e9d7 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -315,6 +315,9 @@
#define __NR_mincore 375
#define __NR_pciconfig_iobase 376
#define __NR_getdents64 377
+#define __NR_gettid 378
+#define __NR_readahead 379
+#define __NR_security 380 /* syscall for security modules */
#if defined(__GNUC__)
diff --git a/include/asm-arm/arch-epxa10db/hardware.h b/include/asm-arm/arch-epxa10db/hardware.h
index 9847f46fb85e..b992c2924a77 100644
--- a/include/asm-arm/arch-epxa10db/hardware.h
+++ b/include/asm-arm/arch-epxa10db/hardware.h
@@ -23,7 +23,6 @@
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
-#include <asm/arch/sizes.h>
#include <asm/arch/platform.h>
/*
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h
index d10bbfe6a196..be2716eeaa02 100644
--- a/include/asm-arm/arch-integrator/hardware.h
+++ b/include/asm-arm/arch-integrator/hardware.h
@@ -22,7 +22,7 @@
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
-#include <asm/arch/sizes.h>
+#include <asm/sizes.h>
#include <asm/arch/platform.h>
/*
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h
index 6948e7453946..e29df3d215c5 100644
--- a/include/asm-arm/arch-sa1100/hardware.h
+++ b/include/asm-arm/arch-sa1100/hardware.h
@@ -62,7 +62,7 @@
#ifndef __ASSEMBLY__
#if 0
-# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
+# define __REG(x) (*((volatile u32 *)io_p2v(x)))
#else
/*
* This __REG() version gives the same results as the one above, except
@@ -70,12 +70,12 @@
* assembly code for access to contigous registers. It's a shame that gcc
* doesn't guess this by itself.
*/
-typedef struct { volatile unsigned long offset[4096]; } __regbase;
+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((unsigned long)&(x)))
+# define __PREG(x) (io_v2p((u32)&(x)))
#else
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index 3bddfd0ae0bb..bc88160ec936 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -165,6 +165,9 @@ static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
return 1;
}
+/* This isn't fine. */
+#define pci_dac_dma_supported(pci_dev, mask) (0)
+
/* Return the index of the PCI controller for device PDEV. */
#define pci_controller_num(PDEV) (0)
diff --git a/include/asm-arm/proc-fns.h b/include/asm-arm/proc-fns.h
index 904001d64ad0..44f1cd429ee0 100644
--- a/include/asm-arm/proc-fns.h
+++ b/include/asm-arm/proc-fns.h
@@ -60,6 +60,14 @@
# define CPU_NAME arm920
# endif
# endif
+# ifdef CONFIG_CPU_ARM926T
+# ifdef CPU_NAME
+# undef MULTI_CPU
+# define MULTI_CPU
+# else
+# define CPU_NAME arm926
+# endif
+# endif
# ifdef CONFIG_CPU_SA110
# ifdef CPU_NAME
# undef MULTI_CPU
diff --git a/include/asm-arm/arch-integrator/sizes.h b/include/asm-arm/sizes.h
index f8d92ca12040..f8d92ca12040 100644
--- a/include/asm-arm/arch-integrator/sizes.h
+++ b/include/asm-arm/sizes.h
diff --git a/include/asm-cris/etraxgpio.h b/include/asm-cris/etraxgpio.h
index ecca55ed59b7..0395953e883e 100644
--- a/include/asm-cris/etraxgpio.h
+++ b/include/asm-cris/etraxgpio.h
@@ -35,4 +35,15 @@
/* SHUTDOWN ioctl */
#define IO_SHUTDOWN 0xD
#define IO_GET_PWR_BT 0xE
+
+/* Bit toggling in driver settings */
+/* bit set in low byte0 is CLK mask (0x00FF),
+ bit set in byte1 is DATA mask (0xFF00)
+ msb, data_mask[7:0] , clk_mask[7:0]
+ */
+#define IO_CFG_WRITE_MODE 0xF
+#define IO_CFG_WRITE_MODE_VALUE(msb, data_mask, clk_mask) \
+ ( (((msb)&1) << 16) | (((data_mask) &0xFF) << 8) | ((clk_mask) & 0xFF) )
+
+
#endif
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index afe60fc7d9e5..2f2955b8ad60 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -504,4 +504,9 @@ static inline void update_mmu_cache(struct vm_area_struct * vma,
#include <asm-generic/pgtable.h>
+/*
+ * No page table caches to initialise
+ */
+#define pgtable_cache_init() do { } while (0)
+
#endif /* _CRIS_PGTABLE_H */
diff --git a/include/asm-cris/system.h b/include/asm-cris/system.h
index 95c6c4198da5..0674811a31c5 100644
--- a/include/asm-cris/system.h
+++ b/include/asm-cris/system.h
@@ -17,7 +17,7 @@ extern struct task_struct *resume(struct task_struct *prev, struct task_struct *
/* read the CPU version register */
static inline unsigned long rdvr(void) {
- unsigned long vr;
+ unsigned char vr;
__asm__ volatile ("move $vr,%0" : "=rm" (vr));
return vr;
}
diff --git a/include/asm-cris/timex.h b/include/asm-cris/timex.h
index 2ab263cf7b63..5bf3edbd6698 100644
--- a/include/asm-cris/timex.h
+++ b/include/asm-cris/timex.h
@@ -8,6 +8,19 @@
#define CLOCK_TICK_RATE 19200 /* Underlying frequency of the HZ timer */
+/* The timer0 values gives ~52.1us resolution (1/19200) but interrupts at HZ*/
+#define TIMER0_FREQ (CLOCK_TICK_RATE)
+#define TIMER0_CLKSEL c19k2Hz
+#define TIMER0_DIV (TIMER0_FREQ/(HZ))
+/* This is the slow one: */
+/*
+#define GET_JIFFIES_USEC() \
+ ( (*R_TIMER0_DATA - TIMER0_DIV) * (1000000/HZ)/TIMER0_DIV )
+*/
+/* This is the fast version: */
+extern unsigned short cris_timer0_value_us[TIMER0_DIV+1]; /* in kernel/time.c */
+#define GET_JIFFIES_USEC() (cris_timer0_value_us[*R_TIMER0_DATA])
+
/*
* We don't have a cycle-counter.. but we do not support SMP anyway where this is
* used so it does not matter.
diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h
index 8cc79775254c..8010498bf2ca 100644
--- a/include/asm-cris/uaccess.h
+++ b/include/asm-cris/uaccess.h
@@ -3,6 +3,9 @@
* Hans-Peter Nilsson (hp@axis.com)
*
* $Log: uaccess.h,v $
+ * Revision 1.8 2001/10/29 13:01:48 bjornw
+ * Removed unused variable tmp2 in strnlen_user
+ *
* Revision 1.7 2001/10/02 12:44:52 hp
* Add support for 64-bit put_user/get_user
*
@@ -1057,7 +1060,7 @@ __generic_clear_user_nocheck(void *to, unsigned long n)
static inline long
strnlen_user(const char *s, long n)
{
- long res, tmp1, tmp2;
+ long res, tmp1;
if (!access_ok(VERIFY_READ, s, 0))
return 0;
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index ec715c9f137c..d42c6b383fad 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -227,6 +227,9 @@
#define __NR_madvise 219
#define __NR_getdents64 220
#define __NR_fcntl64 221
+#define __NR_security 223 /* syscall for security modules */
+#define __NR_gettid 224
+#define __NR_readahead 225
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index 69921aaa68f6..4acb4b09ddc3 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -68,7 +68,7 @@ static inline void irq_enter(int cpu, int irq)
++local_irq_count(cpu);
while (test_bit(0,&global_irq_lock)) {
- /* nothing */;
+ cpu_relax();
}
}
diff --git a/include/asm-i386/keyboard.h b/include/asm-i386/keyboard.h
index 0922ecaa023c..1507890e5b40 100644
--- a/include/asm-i386/keyboard.h
+++ b/include/asm-i386/keyboard.h
@@ -16,6 +16,7 @@
#include <linux/kernel.h>
#include <linux/ioport.h>
#include <linux/kd.h>
+#include <linux/pm.h>
#include <asm/io.h>
#define KEYBOARD_IRQ 1
@@ -28,7 +29,8 @@ extern int pckbd_translate(unsigned char scancode, unsigned char *keycode,
extern char pckbd_unexpected_up(unsigned char keycode);
extern void pckbd_leds(unsigned char leds);
extern void pckbd_init_hw(void);
-extern void pckbd_pm_resume(void);
+extern int pckbd_pm_resume(struct pm_dev *, pm_request_t, void *);
+extern pm_callback pm_kbd_request_override;
extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_setkeycode pckbd_setkeycode
diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h
index 0304eb24a0ed..b5719c0bb046 100644
--- a/include/asm-i386/mpspec.h
+++ b/include/asm-i386/mpspec.h
@@ -16,7 +16,13 @@
/*
* a maximum of 16 APICs with the current APIC ID architecture.
*/
+#ifdef CONFIG_MULTIQUAD
+#define MAX_APICS 256
+#else /* !CONFIG_MULTIQUAD */
#define MAX_APICS 16
+#endif /* CONFIG_MULTIQUAD */
+
+#define MAX_MPC_ENTRY 1024
struct intel_mp_floating
{
@@ -55,6 +61,7 @@ struct mp_config_table
#define MP_IOAPIC 2
#define MP_INTSRC 3
#define MP_LINTSRC 4
+#define MP_TRANSLATION 192 /* Used by IBM NUMA-Q to describe node locality */
struct mpc_config_processor
{
@@ -144,6 +151,27 @@ struct mpc_config_lintsrc
unsigned char mpc_destapiclint;
};
+struct mp_config_oemtable
+{
+ char oem_signature[4];
+#define MPC_OEM_SIGNATURE "_OEM"
+ unsigned short oem_length; /* Size of table */
+ char oem_rev; /* 0x01 */
+ char oem_checksum;
+ char mpc_oem[8];
+};
+
+struct mpc_config_translation
+{
+ unsigned char mpc_type;
+ unsigned char trans_len;
+ unsigned char trans_type;
+ unsigned char trans_quad;
+ unsigned char trans_global;
+ unsigned char trans_local;
+ unsigned short trans_reserved;
+};
+
/*
* Default configurations
*
@@ -156,7 +184,12 @@ struct mpc_config_lintsrc
* 7 2 CPU MCA+PCI
*/
+#ifdef CONFIG_MULTIQUAD
+#define MAX_IRQ_SOURCES 512
+#else /* !CONFIG_MULTIQUAD */
#define MAX_IRQ_SOURCES 256
+#endif /* CONFIG_MULTIQUAD */
+
#define MAX_MP_BUSSES 32
enum mp_bustype {
MP_BUS_ISA = 1,
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index 2a33579fbf4d..d794eb61d33e 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -21,6 +21,8 @@ extern unsigned long pci_mem_start;
void pcibios_set_master(struct pci_dev *dev);
void pcibios_penalize_isa_irq(int irq);
+struct irq_routing_table *pcibios_get_irq_routing_table(void);
+int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
/* Dynamic DMA mapping stuff.
* i386 has everything mapped statically.
@@ -72,6 +74,7 @@ static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,
{
if (direction == PCI_DMA_NONE)
BUG();
+ flush_write_buffers();
return virt_to_bus(ptr);
}
@@ -133,22 +136,23 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
if (direction == PCI_DMA_NONE)
BUG();
-
- /*
- * temporary 2.4 hack
- */
- for (i = 0; i < nents; i++ ) {
- if (sg[i].address && sg[i].page)
- BUG();
- else if (!sg[i].address && !sg[i].page)
- BUG();
-
- if (sg[i].address)
- sg[i].dma_address = virt_to_bus(sg[i].address);
- else
- sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
- }
-
+
+ /*
+ * temporary 2.4 hack
+ */
+ for (i = 0; i < nents; i++ ) {
+ if (sg[i].address && sg[i].page)
+ BUG();
+ else if (!sg[i].address && !sg[i].page)
+ BUG();
+
+ if (sg[i].address)
+ sg[i].dma_address = virt_to_bus(sg[i].address);
+ else
+ sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset;
+ }
+
+ flush_write_buffers();
return nents;
}
@@ -179,7 +183,7 @@ static inline void pci_dma_sync_single(struct pci_dev *hwdev,
{
if (direction == PCI_DMA_NONE)
BUG();
- /* Nothing to do */
+ flush_write_buffers();
}
/* Make physical memory consistent for a set of streaming
@@ -194,7 +198,7 @@ static inline void pci_dma_sync_sg(struct pci_dev *hwdev,
{
if (direction == PCI_DMA_NONE)
BUG();
- /* Nothing to do */
+ flush_write_buffers();
}
/* Return whether the given PCI device DMA address mask can
@@ -242,7 +246,7 @@ pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
static __inline__ void
pci_dac_dma_sync_single(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
{
- /* Nothing to do. */
+ flush_write_buffers();
}
/* These macros should be used after a pci_map_sg call has been done
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index 1c056176ea2d..e2fbc2817b3e 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -3,6 +3,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
+#include <linux/init.h>
#include <asm/segment.h>
#include <linux/bitops.h> /* for LOCK_PREFIX */
diff --git a/include/asm-ia64/acpi-ext.h b/include/asm-ia64/acpi-ext.h
index b11c49e9d415..70f4073c3eb9 100644
--- a/include/asm-ia64/acpi-ext.h
+++ b/include/asm-ia64/acpi-ext.h
@@ -9,7 +9,7 @@
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 2000 Intel Corp.
- * Copyright (C) 2000 J.I. Lee <jung-ik.lee@intel.com>
+ * Copyright (C) 2000,2001 J.I. Lee <jung-ik.lee@intel.com>
* ACPI 2.0 specification
*/
@@ -189,9 +189,16 @@ typedef struct {
u32 global_vector;
} acpi20_entry_platform_src_t;
+/* constants for interrupt routing API for device drivers */
+#define ACPI20_ENTRY_PIS_PMI 1
+#define ACPI20_ENTRY_PIS_INIT 2
+#define ACPI20_ENTRY_PIS_CPEI 3
+#define ACPI_MAX_PLATFORM_IRQS 4
+
extern int acpi20_parse(acpi20_rsdp_t *);
extern int acpi_parse(acpi_rsdp_t *);
extern const char *acpi_get_sysname (void);
+extern int acpi_request_vector(u32 int_type);
extern void (*acpi_idle) (void); /* power-management idle function, if any */
#pragma pack()
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index 7b2f88f8f80d..c088ac4865e7 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -12,31 +12,40 @@
*/
/* 32bit compatibility types */
-typedef unsigned int __kernel_size_t32;
-typedef int __kernel_ssize_t32;
-typedef int __kernel_ptrdiff_t32;
-typedef int __kernel_time_t32;
-typedef int __kernel_clock_t32;
-typedef int __kernel_pid_t32;
-typedef unsigned short __kernel_ipc_pid_t32;
-typedef unsigned short __kernel_uid_t32;
-typedef unsigned short __kernel_gid_t32;
-typedef unsigned short __kernel_dev_t32;
-typedef unsigned int __kernel_ino_t32;
-typedef unsigned short __kernel_mode_t32;
-typedef unsigned short __kernel_umode_t32;
-typedef short __kernel_nlink_t32;
-typedef int __kernel_daddr_t32;
-typedef int __kernel_off_t32;
-typedef unsigned int __kernel_caddr_t32;
-typedef long __kernel_loff_t32;
-typedef __kernel_fsid_t __kernel_fsid_t32;
+typedef unsigned int __kernel_size_t32;
+typedef int __kernel_ssize_t32;
+typedef int __kernel_ptrdiff_t32;
+typedef int __kernel_time_t32;
+typedef int __kernel_clock_t32;
+typedef int __kernel_pid_t32;
+typedef unsigned short __kernel_ipc_pid_t32;
+typedef unsigned short __kernel_uid_t32;
+typedef unsigned int __kernel_uid32_t32;
+typedef unsigned short __kernel_gid_t32;
+typedef unsigned int __kernel_gid32_t32;
+typedef unsigned short __kernel_dev_t32;
+typedef unsigned int __kernel_ino_t32;
+typedef unsigned short __kernel_mode_t32;
+typedef unsigned short __kernel_umode_t32;
+typedef short __kernel_nlink_t32;
+typedef int __kernel_daddr_t32;
+typedef int __kernel_off_t32;
+typedef unsigned int __kernel_caddr_t32;
+typedef long __kernel_loff_t32;
+typedef __kernel_fsid_t __kernel_fsid_t32;
#define IA32_PAGE_SHIFT 12 /* 4KB pages */
-#define IA32_PAGE_SIZE (1ULL << IA32_PAGE_SHIFT)
+#define IA32_PAGE_SIZE (1UL << IA32_PAGE_SHIFT)
+#define IA32_PAGE_MASK (~(IA32_PAGE_SIZE - 1))
+#define IA32_PAGE_ALIGN(addr) (((addr) + IA32_PAGE_SIZE - 1) & IA32_PAGE_MASK)
#define IA32_CLOCKS_PER_SEC 100 /* Cast in stone for IA32 Linux */
#define IA32_TICK(tick) ((unsigned long long)(tick) * IA32_CLOCKS_PER_SEC / CLOCKS_PER_SEC)
+struct timespec32 {
+ int tv_sec;
+ int tv_nsec;
+};
+
/* fcntl.h */
struct flock32 {
short l_type;
@@ -46,6 +55,9 @@ struct flock32 {
__kernel_pid_t32 l_pid;
};
+#define F_GETLK64 12
+#define F_SETLK64 13
+#define F_SETLKW64 14
/* sigcontext.h */
/*
@@ -103,13 +115,19 @@ struct sigcontext_ia32 {
#define _IA32_NSIG_BPW 32
#define _IA32_NSIG_WORDS (_IA32_NSIG / _IA32_NSIG_BPW)
+#define IA32_SET_SA_HANDLER(ka,handler,restorer) \
+ ((ka)->sa.sa_handler = (__sighandler_t) \
+ (((unsigned long)(restorer) << 32) \
+ | ((handler) & 0xffffffff)))
+#define IA32_SA_HANDLER(ka) ((unsigned long) (ka)->sa.sa_handler & 0xffffffff)
+#define IA32_SA_RESTORER(ka) ((unsigned long) (ka)->sa.sa_handler >> 32)
+
typedef struct {
unsigned int sig[_IA32_NSIG_WORDS];
} sigset32_t;
struct sigaction32 {
- unsigned int sa_handler; /* Really a pointer, but need to deal
- with 32 bits */
+ unsigned int sa_handler; /* Really a pointer, but need to deal with 32 bits */
unsigned int sa_flags;
unsigned int sa_restorer; /* Another 32 bit pointer */
sigset32_t sa_mask; /* A 32 bit mask */
@@ -162,6 +180,31 @@ struct stat32 {
unsigned int __unused5;
};
+struct stat64 {
+ unsigned short st_dev;
+ unsigned char __pad0[10];
+ unsigned int __st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned short st_rdev;
+ unsigned char __pad3[10];
+ unsigned int st_size_lo;
+ unsigned int st_size_hi;
+ unsigned int st_blksize;
+ unsigned int st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned int __pad4; /* future possible st_blocks high bits */
+ unsigned int st_atime;
+ unsigned int __pad5;
+ unsigned int st_mtime;
+ unsigned int __pad6;
+ unsigned int st_ctime;
+ unsigned int __pad7; /* will be high 32 bits of ctime someday */
+ unsigned int st_ino_lo;
+ unsigned int st_ino_hi;
+};
+
struct statfs32 {
int f_type;
int f_bsize;
@@ -229,6 +272,19 @@ typedef struct siginfo32 {
} _sifields;
} siginfo_t32;
+struct linux32_dirent {
+ u32 d_ino;
+ u32 d_off;
+ u16 d_reclen;
+ char d_name[256];
+};
+
+struct old_linux32_dirent {
+ u32 d_ino;
+ u32 d_offset;
+ u16 d_namlen;
+ char d_name[1];
+};
/*
* IA-32 ELF specific definitions for IA-64.
@@ -252,7 +308,7 @@ typedef struct siginfo32 {
#define ELF_ARCH EM_386
#define IA32_PAGE_OFFSET 0xc0000000
-#define IA32_STACK_TOP ((IA32_PAGE_OFFSET/3) * 2)
+#define IA32_STACK_TOP IA32_PAGE_OFFSET
/*
* The system segments (GDT, TSS, LDT) have to be mapped below 4GB so the IA-32 engine can
@@ -322,6 +378,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#define _TSS(n) ((((unsigned long) n)<<4)+(FIRST_TSS_ENTRY<<3))
#define _LDT(n) ((((unsigned long) n)<<4)+(FIRST_LDT_ENTRY<<3))
+#define IA32_SEGSEL_RPL (0x3 << 0)
+#define IA32_SEGSEL_TI (0x1 << 2)
+#define IA32_SEGSEL_INDEX_SHIFT 3
+
#define IA32_SEG_BASE 16
#define IA32_SEG_TYPE 40
#define IA32_SEG_SYS 44
@@ -377,7 +437,7 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
*/
#define IA32_FSR_DEFAULT 0x55550000 /* set all tag bits */
-#define IA32_FCR_DEFAULT 0x17800000037fULL /* extended precision, all masks */
+#define IA32_FCR_DEFAULT 0x17800000037fUL /* extended precision, all masks */
#define IA32_PTRACE_GETREGS 12
#define IA32_PTRACE_SETREGS 13
@@ -421,6 +481,9 @@ extern int ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
extern void ia32_init_addr_space (struct pt_regs *regs);
extern int ia32_setup_arg_pages (struct linux_binprm *bprm);
extern int ia32_exception (struct pt_regs *regs, unsigned long isr);
+extern int ia32_intercept (struct pt_regs *regs, unsigned long isr);
+extern unsigned long ia32_do_mmap (struct file *, unsigned long, unsigned long, int, int, loff_t);
+extern void ia32_load_segment_descriptors (struct task_struct *task);
#endif /* !CONFIG_IA32_SUPPORT */
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index ae5b7781a746..9e01f4813285 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -14,7 +14,7 @@
* mistake somewhere.
*
* Copyright (C) 1998-2001 Hewlett-Packard Co
- * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
*/
@@ -25,7 +25,12 @@
#define __IA64_UNCACHED_OFFSET 0xc000000000000000 /* region 6 */
-#define IO_SPACE_LIMIT 0xffff
+/*
+ * The legacy I/O space defined by the ia64 architecture supports only 65536 ports, but
+ * large machines may have multiple other I/O spaces so we can't place any a priori limit
+ * on IO_SPACE_LIMIT. These additional spaces are described in ACPI.
+ */
+#define IO_SPACE_LIMIT 0xffffffffffffffffUL
# ifdef __KERNEL__
@@ -43,7 +48,7 @@ virt_to_phys (volatile void *address)
}
static inline void*
-phys_to_virt(unsigned long address)
+phys_to_virt (unsigned long address)
{
return (void *) (address + PAGE_OFFSET);
}
@@ -54,6 +59,7 @@ phys_to_virt(unsigned long address)
*/
#define bus_to_virt phys_to_virt
#define virt_to_bus virt_to_phys
+#define page_to_bus page_to_phys
# endif /* KERNEL */
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index f3a199013c17..ec2641f45b47 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -53,8 +53,17 @@
extern void __init iosapic_init (unsigned long address, unsigned int base_irq,
int pcat_compat);
+extern int iosapic_register_irq (u32 global_vector, unsigned long polarity,
+ unsigned long edge_triggered, u32 base_irq,
+ char *iosapic_address);
extern void iosapic_register_legacy_irq (unsigned long irq, unsigned long pin,
unsigned long polarity, unsigned long trigger);
+extern int iosapic_register_platform_irq (u32 int_type, u32 global_vector, u32 iosapic_vector,
+ u16 eid, u16 id, unsigned long polarity,
+ unsigned long edge_triggered, u32 base_irq,
+ char *iosapic_address);
+extern unsigned int iosapic_version (char *addr);
+
extern void iosapic_pci_fixup (int);
# endif /* !__ASSEMBLY__ */
diff --git a/include/asm-ia64/ipc.h b/include/asm-ia64/ipc.h
deleted file mode 100644
index 36f43063adcd..000000000000
--- a/include/asm-ia64/ipc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __i386_IPC_H__
-#define __i386_IPC_H__
-
-/*
- * These are used to wrap system calls on x86.
- *
- * See arch/i386/kernel/sys_i386.c for ugly details..
- */
-struct ipc_kludge {
- struct msgbuf *msgp;
- long msgtyp;
-};
-
-#define SEMOP 1
-#define SEMGET 2
-#define SEMCTL 3
-#define MSGSND 11
-#define MSGRCV 12
-#define MSGGET 13
-#define MSGCTL 14
-#define SHMAT 21
-#define SHMDT 22
-#define SHMGET 23
-#define SHMCTL 24
-
-/* Used by the DIPC package, try and avoid reusing it */
-#define DIPC 25
-
-#define IPCCALL(version,op) ((version)<<16 | (op))
-
-#endif
diff --git a/include/asm-ia64/keyboard.h b/include/asm-ia64/keyboard.h
index 9259e163c0fb..cfb781aae625 100644
--- a/include/asm-ia64/keyboard.h
+++ b/include/asm-ia64/keyboard.h
@@ -2,16 +2,16 @@
#define _ASM_IA64_KEYBOARD_H
/*
- * This file contains the ia-64 architecture specific keyboard
- * definitions.
+ * This file contains the ia64 architecture specific keyboard definitions.
*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
*/
# ifdef __KERNEL__
#include <linux/irq.h>
+#include <linux/kd.h>
#define KEYBOARD_IRQ isa_irq_to_vector(1)
#define DISABLE_KBD_DURING_INTERRUPTS 0
@@ -38,6 +38,7 @@ extern unsigned char pckbd_sysrq_xlate[128];
#define INIT_KBD
#define SYSRQ_KEY 0x54
+#define E1_PAUSE 119 /* PAUSE key */
/* resource allocation */
#define kbd_request_region()
diff --git a/include/asm-ia64/kregs.h b/include/asm-ia64/kregs.h
index efa74f298e85..d768cd6533de 100644
--- a/include/asm-ia64/kregs.h
+++ b/include/asm-ia64/kregs.h
@@ -13,6 +13,7 @@
* Kernel registers:
*/
#define IA64_KR_IO_BASE 0 /* ar.k0: legacy I/O base address */
+#define IA64_KR_TSSD 1 /* ar.k1: IVE uses this as the TSSD */
#define IA64_KR_CURRENT_STACK 4 /* ar.k4: what's mapped in IA64_TR_CURRENT_STACK */
#define IA64_KR_FPU_OWNER 5 /* ar.k5: fpu-owner (UP only, at the moment) */
#define IA64_KR_CURRENT 6 /* ar.k6: "current" task pointer */
@@ -28,6 +29,6 @@
#define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */
#define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */
#define IA64_TR_PERCPU_DATA 1 /* dtr1: percpu data */
-#define IA64_TR_CURRENT_STACK 2 /* dtr2: maps kernel memory & register stacks */
+#define IA64_TR_CURRENT_STACK 2 /* dtr2: maps kernel's memory- & register-stacks */
#endif /* _ASM_IA64_kREGS_H */
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
index a5a532da7fe4..2132a2a45dd8 100644
--- a/include/asm-ia64/machvec.h
+++ b/include/asm-ia64/machvec.h
@@ -1,11 +1,11 @@
/*
* Machine vector for IA-64.
- *
+ *
* Copyright (C) 1999 Silicon Graphics, Inc.
* Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
* Copyright (C) Vijay Chander <vijay@engr.sgi.com>
* Copyright (C) 1999-2001 Hewlett-Packard Co.
- * Copyright (C) 1999-2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef _ASM_IA64_MACHVEC_H
#define _ASM_IA64_MACHVEC_H
@@ -28,6 +28,7 @@ typedef void ia64_mv_mca_handler_t (void);
typedef void ia64_mv_cmci_handler_t (int, void *, struct pt_regs *);
typedef void ia64_mv_log_print_t (void);
typedef void ia64_mv_send_ipi_t (int, int, int, int);
+typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long);
typedef struct irq_desc *ia64_mv_irq_desc (unsigned int);
typedef u8 ia64_mv_irq_to_vector (u8);
typedef unsigned int ia64_mv_local_vector_to_irq (u8 vector);
@@ -67,6 +68,8 @@ extern void machvec_noop (void);
# include <asm/machvec_dig.h>
# elif defined (CONFIG_IA64_SGI_SN1)
# include <asm/machvec_sn1.h>
+# elif defined (CONFIG_IA64_SGI_SN2)
+# include <asm/machvec_sn2.h>
# elif defined (CONFIG_IA64_GENERIC)
# ifdef MACHVEC_PLATFORM_HEADER
@@ -82,6 +85,7 @@ extern void machvec_noop (void);
# define platform_log_print ia64_mv.log_print
# define platform_pci_fixup ia64_mv.pci_fixup
# define platform_send_ipi ia64_mv.send_ipi
+# define platform_global_tlb_purge ia64_mv.global_tlb_purge
# define platform_pci_dma_init ia64_mv.dma_init
# define platform_pci_alloc_consistent ia64_mv.alloc_consistent
# define platform_pci_free_consistent ia64_mv.free_consistent
@@ -147,6 +151,7 @@ struct ia64_machine_vector {
platform_cmci_handler, \
platform_log_print, \
platform_send_ipi, \
+ platform_global_tlb_purge, \
platform_pci_dma_init, \
platform_pci_alloc_consistent, \
platform_pci_free_consistent, \
@@ -217,6 +222,9 @@ extern ia64_mv_pci_dma_address swiotlb_dma_address;
#ifndef platform_send_ipi
# define platform_send_ipi ia64_send_ipi /* default to architected version */
#endif
+#ifndef platform_global_tlb_purge
+# define platform_global_tlb_purge ia64_global_tlb_purge /* default to architected version */
+#endif
#ifndef platform_pci_dma_init
# define platform_pci_dma_init swiotlb_init
#endif
diff --git a/include/asm-ia64/machvec_sn1.h b/include/asm-ia64/machvec_sn1.h
index ace2d4aeda1b..c110c56427da 100644
--- a/include/asm-ia64/machvec_sn1.h
+++ b/include/asm-ia64/machvec_sn1.h
@@ -5,6 +5,7 @@ extern ia64_mv_setup_t sn1_setup;
extern ia64_mv_irq_init_t sn1_irq_init;
extern ia64_mv_map_nr_t sn1_map_nr;
extern ia64_mv_send_ipi_t sn1_send_IPI;
+extern ia64_mv_global_tlb_purge_t sn1_global_tlb_purge;
extern ia64_mv_pci_fixup_t sn1_pci_fixup;
extern ia64_mv_inb_t sn1_inb;
extern ia64_mv_inw_t sn1_inw;
@@ -34,6 +35,7 @@ extern ia64_mv_pci_dma_address sn1_dma_address;
#define platform_irq_init sn1_irq_init
#define platform_map_nr sn1_map_nr
#define platform_send_ipi sn1_send_IPI
+#define platform_global_tlb_purge sn1_global_tlb_purge
#define platform_pci_fixup sn1_pci_fixup
#define platform_inb sn1_inb
#define platform_inw sn1_inw
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index bea905c1d61e..68fea8565acd 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -8,7 +8,7 @@
*/
/* XXX use this temporary define for MP systems trying to INIT */
-#define SAL_MPINIT_WORKAROUND
+#undef SAL_MPINIT_WORKAROUND
#ifndef _ASM_IA64_MCA_H
#define _ASM_IA64_MCA_H
@@ -61,8 +61,6 @@ enum {
IA64_MCA_RENDEZ_CHECKIN_DONE = 0x1
};
-#define IA64_MAXCPUS 64 /* Need to do something about this */
-
/* Information maintained by the MC infrastructure */
typedef struct ia64_mc_info_s {
u64 imi_mca_handler;
@@ -71,7 +69,7 @@ typedef struct ia64_mc_info_s {
size_t imi_monarch_init_handler_size;
u64 imi_slave_init_handler;
size_t imi_slave_init_handler_size;
- u8 imi_rendez_checkin[IA64_MAXCPUS];
+ u8 imi_rendez_checkin[NR_CPUS];
} ia64_mc_info_t;
@@ -128,18 +126,22 @@ extern void ia64_slave_init_handler(void);
extern void ia64_mca_rendez_int_handler(int,void *,struct pt_regs *);
extern void ia64_mca_wakeup_int_handler(int,void *,struct pt_regs *);
extern void ia64_mca_cmc_int_handler(int,void *,struct pt_regs *);
-extern void ia64_log_print(int,int,prfunc_t);
+extern void ia64_mca_cpe_int_handler(int,void *,struct pt_regs *);
+extern void ia64_log_print(int,prfunc_t);
+extern void ia64_mca_cmc_vector_setup(void);
+extern void ia64_mca_check_errors( void );
+extern u64 ia64_log_get(int, prfunc_t);
#define PLATFORM_CALL(fn, args) printk("Platform call TBD\n")
#undef MCA_TEST
-#define IA64_MCA_DEBUG_INFO 1
+#undef IA64_MCA_DEBUG_INFO
#if defined(IA64_MCA_DEBUG_INFO)
-# define IA64_MCA_DEBUG printk
+# define IA64_MCA_DEBUG(fmt...) printk(fmt)
#else
-# define IA64_MCA_DEBUG
+# define IA64_MCA_DEBUG(fmt...)
#endif
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_MCA_H */
diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h
index b1d32e556c97..2448d64c1fb7 100644
--- a/include/asm-ia64/mca_asm.h
+++ b/include/asm-ia64/mca_asm.h
@@ -41,7 +41,7 @@
*/
#define DATA_PA_TO_VA(addr,temp) \
mov temp = 0x7 ;; \
- dep addr = temp, addr, 61, 3;
+ dep addr = temp, addr, 61, 3;;
/*
* This macro jumps to the instruction at the given virtual address
@@ -74,6 +74,7 @@
\
mov ar.rsc = 0 ; \
;; \
+ srlz.d; \
mov temp2 = ar.bspstore; \
;; \
DATA_VA_TO_PA(temp2); \
@@ -102,6 +103,8 @@
;; \
dep temp1 = 0, temp1, PSR_I, 1; \
;; \
+ dep temp1 = 0, temp1, PSR_IC, 1; \
+ ;; \
movl temp2 = start_addr; \
mov cr.ipsr = temp1; \
;; \
@@ -145,6 +148,8 @@
#define VIRTUAL_MODE_ENTER(temp1, temp2, start_addr, old_psr) \
mov temp2 = psr; \
;; \
+ mov old_psr = temp2; \
+ ;; \
dep temp2 = 0, temp2, PSR_IC, 2; \
;; \
mov psr.l = temp2; \
@@ -163,7 +168,7 @@
;; \
mov temp1 = old_psr; \
;; \
- mov temp2 = 1 \
+ mov temp2 = 1; \
;; \
dep temp1 = temp2, temp1, PSR_I, 1; \
;; \
@@ -182,8 +187,10 @@
movl temp2 = start_addr; \
;; \
mov cr.iip = temp2; \
+ ;; \
DATA_PA_TO_VA(sp, temp1); \
DATA_PA_TO_VA(gp, temp2); \
+ srlz.i; \
;; \
nop 1; \
nop 2; \
@@ -246,7 +253,7 @@
mov ar.bspstore=p_bspstore;; \
mov temp=ar.bsp;; \
sub temp=temp,p_bspstore;; \
- st8 [p_stackframe]=temp,8
+ st8 [p_stackframe]=temp,8;;
/*
* rse_return_context
@@ -278,28 +285,20 @@
mov ar.rnat=temp;; \
add p_stackframe=-rse_rnat_offset+rse_pfs_offset,p_stackframe;; \
ld8 temp=[p_stackframe];; \
- mov ar.pfs=temp; \
+ mov ar.pfs=temp;; \
add p_stackframe=-rse_pfs_offset+rse_ifs_offset,p_stackframe;; \
ld8 temp=[p_stackframe];; \
- mov cr.ifs=temp; \
+ mov cr.ifs=temp;; \
add p_stackframe=-rse_ifs_offset+rse_rsc_offset,p_stackframe;; \
ld8 temp=[p_stackframe];; \
mov ar.rsc=temp ; \
- add p_stackframe=-rse_rsc_offset,p_stackframe; \
- mov temp=cr.ipsr;; \
- st8 [p_stackframe]=temp,8; \
- mov temp=cr.iip;; \
- st8 [p_stackframe]=temp,-8; \
mov temp=psr;; \
or temp=temp,psr_mask_reg;; \
mov cr.ipsr=temp;; \
mov temp=ip;; \
add temp=0x30,temp;; \
mov cr.iip=temp;; \
- rfi;; \
- ld8 temp=[p_stackframe],8;; \
- mov cr.ipsr=temp;; \
- ld8 temp=[p_stackframe];; \
- mov cr.iip=temp
+ srlz.i;; \
+ rfi;;
#endif /* _ASM_IA64_MCA_ASM_H */
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h
index 53e11715502a..1a0024cfc3f3 100644
--- a/include/asm-ia64/mmu_context.h
+++ b/include/asm-ia64/mmu_context.h
@@ -60,7 +60,6 @@ get_new_mmu_context (struct mm_struct *mm)
static inline void
get_mmu_context (struct mm_struct *mm)
{
- /* check if our ASN is of an older generation and thus invalid: */
if (mm->context == 0)
get_new_mmu_context(mm);
}
diff --git a/include/asm-ia64/module.h b/include/asm-ia64/module.h
index 52f500a875a8..931469ebe4a8 100644
--- a/include/asm-ia64/module.h
+++ b/include/asm-ia64/module.h
@@ -14,13 +14,6 @@
#define module_map(x) vmalloc(x)
#define module_unmap(x) ia64_module_unmap(x)
#define module_arch_init(x) ia64_module_init(x)
-#define arch_init_modules(x) { static struct archdata archdata; \
- register char *kernel_gp asm ("gp");\
- archdata.gp = kernel_gp; \
- kernel_module.archdata_start = (const char *) &archdata; \
- kernel_module.archdata_end = (const char *) (&archdata + 1); \
- }
-
/*
* This must match in size and layout the data created by
@@ -34,12 +27,23 @@ struct archdata {
const char *gp;
};
+static inline void
+arch_init_modules (struct module *kmod)
+{
+ static struct archdata archdata;
+ register char *kernel_gp asm ("gp");
+
+ archdata.gp = kernel_gp;
+ kmod->archdata_start = (const char *) &archdata;
+ kmod->archdata_end = (const char *) (&archdata + 1);
+}
+
/*
* functions to add/remove a modules unwind info when
* it is loaded or unloaded.
*/
static inline int
-ia64_module_init(struct module *mod)
+ia64_module_init (struct module *mod)
{
struct archdata *archdata;
@@ -51,28 +55,23 @@ ia64_module_init(struct module *mod)
* Make sure the unwind pointers are sane.
*/
- if (archdata->unw_table)
- {
+ if (archdata->unw_table) {
printk(KERN_ERR "module_arch_init: archdata->unw_table must be zero.\n");
return 1;
}
- if (!mod_bound(archdata->gp, 0, mod))
- {
+ if (!mod_bound(archdata->gp, 0, mod)) {
printk(KERN_ERR "module_arch_init: archdata->gp out of bounds.\n");
return 1;
}
- if (!mod_bound(archdata->unw_start, 0, mod))
- {
+ if (!mod_bound(archdata->unw_start, 0, mod)) {
printk(KERN_ERR "module_arch_init: archdata->unw_start out of bounds.\n");
return 1;
}
- if (!mod_bound(archdata->unw_end, 0, mod))
- {
+ if (!mod_bound(archdata->unw_end, 0, mod)) {
printk(KERN_ERR "module_arch_init: archdata->unw_end out of bounds.\n");
return 1;
}
- if (!mod_bound(archdata->segment_base, 0, mod))
- {
+ if (!mod_bound(archdata->segment_base, 0, mod)) {
printk(KERN_ERR "module_arch_init: archdata->unw_table out of bounds.\n");
return 1;
}
@@ -88,7 +87,7 @@ ia64_module_init(struct module *mod)
}
static inline void
-ia64_module_unmap(void * addr)
+ia64_module_unmap (void * addr)
{
struct module *mod = (struct module *) addr;
struct archdata *archdata;
@@ -96,8 +95,7 @@ ia64_module_unmap(void * addr)
/*
* Before freeing the module memory remove the unwind table entry
*/
- if (mod_member_present(mod, archdata_start) && mod->archdata_start)
- {
+ if (mod_member_present(mod, archdata_start) && mod->archdata_start) {
archdata = (struct archdata *)(mod->archdata_start);
if (archdata->unw_table != NULL)
diff --git a/include/asm-ia64/msgbuf.h b/include/asm-ia64/msgbuf.h
index 8dfa06dd0174..6c64c0d2aae1 100644
--- a/include/asm-ia64/msgbuf.h
+++ b/include/asm-ia64/msgbuf.h
@@ -1,7 +1,7 @@
#ifndef _ASM_IA64_MSGBUF_H
#define _ASM_IA64_MSGBUF_H
-/*
+/*
* The msqid64_ds structure for IA-64 architecture.
* Note extra padding because this structure is passed back and forth
* between kernel and user space.
diff --git a/include/asm-ia64/namei.h b/include/asm-ia64/namei.h
index 0507e03dcfc9..b35693c6a0c3 100644
--- a/include/asm-ia64/namei.h
+++ b/include/asm-ia64/namei.h
@@ -2,15 +2,24 @@
#define _ASM_IA64_NAMEI_H
/*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
-/*
- * This dummy routine maybe changed to something useful
- * for /usr/gnemul/ emulation stuff.
- * Look at asm-sparc/namei.h for details.
- */
-#define __emul_prefix() NULL
+#include <asm/ptrace.h>
+#include <asm/system.h>
+
+#define EMUL_PREFIX_LINUX_IA32 "emul/ia32-linux/"
+
+static inline char *
+__emul_prefix (void)
+{
+ switch (current->personality) {
+ case PER_LINUX32:
+ return EMUL_PREFIX_LINUX_IA32;
+ default:
+ return NULL;
+ }
+}
#endif /* _ASM_IA64_NAMEI_H */
diff --git a/include/asm-ia64/offsets.h b/include/asm-ia64/offsets.h
index 82cb9553aa64..076fe962ef56 100644
--- a/include/asm-ia64/offsets.h
+++ b/include/asm-ia64/offsets.h
@@ -8,23 +8,22 @@
*/
#define PT_PTRACED_BIT 0
#define PT_TRACESYS_BIT 1
-#define IA64_TASK_SIZE 3904 /* 0xf40 */
+#define IA64_TASK_SIZE 3408 /* 0xd50 */
#define IA64_PT_REGS_SIZE 400 /* 0x190 */
#define IA64_SWITCH_STACK_SIZE 560 /* 0x230 */
#define IA64_SIGINFO_SIZE 128 /* 0x80 */
#define IA64_CPU_SIZE 16384 /* 0x4000 */
-#define SIGFRAME_SIZE 2832 /* 0xb10 */
+#define SIGFRAME_SIZE 2816 /* 0xb00 */
#define UNW_FRAME_INFO_SIZE 448 /* 0x1c0 */
#define IA64_TASK_PTRACE_OFFSET 48 /* 0x30 */
#define IA64_TASK_SIGPENDING_OFFSET 16 /* 0x10 */
#define IA64_TASK_NEED_RESCHED_OFFSET 40 /* 0x28 */
#define IA64_TASK_PROCESSOR_OFFSET 100 /* 0x64 */
-#define IA64_TASK_THREAD_OFFSET 1456 /* 0x5b0 */
-#define IA64_TASK_THREAD_KSP_OFFSET 1456 /* 0x5b0 */
-#define IA64_TASK_THREAD_SIGMASK_OFFSET 1568 /* 0x620 */
-#define IA64_TASK_PFM_NOTIFY_OFFSET 2088 /* 0x828 */
-#define IA64_TASK_PID_OFFSET 196 /* 0xc4 */
+#define IA64_TASK_THREAD_OFFSET 976 /* 0x3d0 */
+#define IA64_TASK_THREAD_KSP_OFFSET 976 /* 0x3d0 */
+#define IA64_TASK_PFM_MUST_BLOCK_OFFSET 1600 /* 0x640 */
+#define IA64_TASK_PID_OFFSET 220 /* 0xdc */
#define IA64_TASK_MM_OFFSET 88 /* 0x58 */
#define IA64_PT_REGS_CR_IPSR_OFFSET 0 /* 0x0 */
#define IA64_PT_REGS_CR_IIP_OFFSET 8 /* 0x8 */
@@ -126,12 +125,13 @@
#define IA64_SIGCONTEXT_FR6_OFFSET 560 /* 0x230 */
#define IA64_SIGCONTEXT_PR_OFFSET 128 /* 0x80 */
#define IA64_SIGCONTEXT_R12_OFFSET 296 /* 0x128 */
+#define IA64_SIGCONTEXT_RBS_BASE_OFFSET 2512 /* 0x9d0 */
+#define IA64_SIGCONTEXT_LOADRS_OFFSET 2520 /* 0x9d8 */
#define IA64_SIGFRAME_ARG0_OFFSET 0 /* 0x0 */
#define IA64_SIGFRAME_ARG1_OFFSET 8 /* 0x8 */
#define IA64_SIGFRAME_ARG2_OFFSET 16 /* 0x10 */
-#define IA64_SIGFRAME_RBS_BASE_OFFSET 24 /* 0x18 */
-#define IA64_SIGFRAME_HANDLER_OFFSET 32 /* 0x20 */
-#define IA64_SIGFRAME_SIGCONTEXT_OFFSET 176 /* 0xb0 */
+#define IA64_SIGFRAME_HANDLER_OFFSET 24 /* 0x18 */
+#define IA64_SIGFRAME_SIGCONTEXT_OFFSET 160 /* 0xa0 */
#define IA64_CLONE_VFORK 16384 /* 0x4000 */
#define IA64_CLONE_VM 256 /* 0x100 */
#define IA64_CPU_IRQ_COUNT_OFFSET 0 /* 0x0 */
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index a0567376d452..2ac1b2c9b9cb 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -55,12 +55,15 @@ extern void copy_page (void *to, void *from);
#ifdef CONFIG_IA64_GENERIC
# include <asm/machvec.h>
# define virt_to_page(kaddr) (mem_map + platform_map_nr(kaddr))
+# define page_to_phys(page) XXX fix me
#elif defined (CONFIG_IA64_SGI_SN1)
# ifndef CONFIG_DISCONTIGMEM
# define virt_to_page(kaddr) (mem_map + MAP_NR_DENSE(kaddr))
+# define page_to_phys(page) XXX fix me
# endif
#else
# define virt_to_page(kaddr) (mem_map + MAP_NR_DENSE(kaddr))
+# define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
#endif
#define VALID_PAGE(page) ((page - mem_map) < max_mapnr)
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h
index 64cf1fdc4038..f429cdec4ec9 100644
--- a/include/asm-ia64/pal.h
+++ b/include/asm-ia64/pal.h
@@ -7,9 +7,9 @@
* This is based on Intel IA-64 Architecture Software Developer's Manual rev 1.0
* chapter 11 IA-64 Processor Abstraction Layer
*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (C) 2000 Stephane Eranian <eranian@hpl.hp.com>
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
+ * Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
@@ -17,7 +17,7 @@
* 99/10/01 davidm Make sure we pass zero for reserved parameters.
* 00/03/07 davidm Updated pal_cache_flush() to be in sync with PAL v2.6.
* 00/03/23 cfleck Modified processor min-state save area to match updated PAL & SAL info
- * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added
+ * 00/05/24 eranian Updated to latest PAL spec, fix structures bugs, added
* 00/05/25 eranian Support for stack calls, and static physical calls
* 00/06/18 eranian Support for stacked physical calls
*/
@@ -91,9 +91,9 @@ typedef s64 pal_status_t;
#define PAL_STATUS_UNIMPLEMENTED -1 /* Unimplemented procedure */
#define PAL_STATUS_EINVAL -2 /* Invalid argument */
#define PAL_STATUS_ERROR -3 /* Error */
-#define PAL_STATUS_CACHE_INIT_FAIL -4 /* Could not initialize the
+#define PAL_STATUS_CACHE_INIT_FAIL -4 /* Could not initialize the
* specified level and type of
- * cache without sideeffects
+ * cache without sideeffects
* and "restrict" was 1
*/
@@ -189,8 +189,8 @@ typedef struct pal_cache_config_info_s {
#define PAL_CACHE_ATTR_WT 0 /* Write through cache */
#define PAL_CACHE_ATTR_WB 1 /* Write back cache */
-#define PAL_CACHE_ATTR_WT_OR_WB 2 /* Either write thru or write
- * back depending on TLB
+#define PAL_CACHE_ATTR_WT_OR_WB 2 /* Either write thru or write
+ * back depending on TLB
* memory attributes
*/
@@ -211,13 +211,13 @@ typedef union pal_cache_protection_element_u {
tagprot_lsb : 6, /* Least -do- */
tagprot_msb : 6, /* Most Sig. tag address
- * bit that this
+ * bit that this
* protection covers.
*/
prot_bits : 6, /* # of protection bits */
method : 4, /* Protection method */
- t_d : 2; /* Indicates which part
- * of the cache this
+ t_d : 2; /* Indicates which part
+ * of the cache this
* protection encoding
* applies.
*/
@@ -239,7 +239,7 @@ typedef union pal_cache_protection_element_u {
*/
#define PAL_CACHE_PROT_PART_DATA_TAG 3 /* Data+tag protection (data is
* more significant )
- */
+ */
#define PAL_CACHE_PROT_PART_MAX 6
@@ -247,7 +247,7 @@ typedef struct pal_cache_protection_info_s {
pal_status_t pcpi_status;
pal_cache_protection_element_t pcp_info[PAL_CACHE_PROT_PART_MAX];
} pal_cache_protection_info_t;
-
+
/* Processor cache protection method encodings */
#define PAL_CACHE_PROT_METHOD_NONE 0 /* No protection */
@@ -262,41 +262,41 @@ typedef union pal_cache_line_id_u {
struct {
u64 cache_type : 8, /* 7-0 cache type */
level : 8, /* 15-8 level of the
- * cache in the
+ * cache in the
* heirarchy.
*/
way : 8, /* 23-16 way in the set
*/
part : 8, /* 31-24 part of the
- * cache
+ * cache
*/
reserved : 32; /* 63-32 is reserved*/
} pclid_info_read;
struct {
u64 cache_type : 8, /* 7-0 cache type */
level : 8, /* 15-8 level of the
- * cache in the
+ * cache in the
* heirarchy.
*/
way : 8, /* 23-16 way in the set
*/
part : 8, /* 31-24 part of the
- * cache
+ * cache
*/
- mesi : 8, /* 39-32 cache line
+ mesi : 8, /* 39-32 cache line
* state
*/
start : 8, /* 47-40 lsb of data to
* invert
*/
length : 8, /* 55-48 #bits to
- * invert
+ * invert
*/
trigger : 8; /* 63-56 Trigger error
- * by doing a load
- * after the write
- */
-
+ * by doing a load
+ * after the write
+ */
+
} pclid_info_write;
} pal_cache_line_id_u_t;
@@ -319,11 +319,11 @@ typedef union pal_cache_line_id_u {
#define PAL_CACHE_LINE_ID_PART_TAG 1 /* Tag */
#define PAL_CACHE_LINE_ID_PART_DATA_PROT 2 /* Data protection */
#define PAL_CACHE_LINE_ID_PART_TAG_PROT 3 /* Tag protection */
-#define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT 4 /* Data+tag
+#define PAL_CACHE_LINE_ID_PART_DATA_TAG_PROT 4 /* Data+tag
* protection
*/
typedef struct pal_cache_line_info_s {
- pal_status_t pcli_status; /* Return status of the read cache line
+ pal_status_t pcli_status; /* Return status of the read cache line
* info call.
*/
u64 pcli_data; /* 64-bit data, tag, protection bits .. */
@@ -351,15 +351,15 @@ typedef u64 pal_mc_info_index_t;
#define PAL_MC_INFO_REQ_ADDR 4 /* Requestor address */
#define PAL_MC_INFO_RESP_ADDR 5 /* Responder address */
#define PAL_MC_INFO_TARGET_ADDR 6 /* Target address */
-#define PAL_MC_INFO_IMPL_DEP 7 /* Implementation
- * dependent
+#define PAL_MC_INFO_IMPL_DEP 7 /* Implementation
+ * dependent
*/
typedef struct pal_process_state_info_s {
u64 reserved1 : 2,
rz : 1, /* PAL_CHECK processor
- * rendezvous
+ * rendezvous
* successful.
*/
@@ -370,13 +370,13 @@ typedef struct pal_process_state_info_s {
* errors occurred
*/
- mn : 1, /* Min. state save
- * area has been
+ mn : 1, /* Min. state save
+ * area has been
* registered with PAL
*/
sy : 1, /* Storage integrity
- * synched
+ * synched
*/
@@ -389,8 +389,8 @@ typedef struct pal_process_state_info_s {
hd : 1, /* Non-essential hw
* lost (no loss of
- * functionality)
- * causing the
+ * functionality)
+ * causing the
* processor to run in
* degraded mode.
*/
@@ -398,9 +398,9 @@ typedef struct pal_process_state_info_s {
tl : 1, /* 1 => MC occurred
* after an instr was
* executed but before
- * the trap that
+ * the trap that
* resulted from instr
- * execution was
+ * execution was
* generated.
* (Trap Lost )
*/
@@ -410,7 +410,7 @@ typedef struct pal_process_state_info_s {
*/
dy : 1, /* Processor dynamic
- * state valid
+ * state valid
*/
@@ -441,10 +441,10 @@ typedef struct pal_process_state_info_s {
* are valid
*/
gr : 1, /* General registers
- * are valid
+ * are valid
* (excl. banked regs)
*/
- dsize : 16, /* size of dynamic
+ dsize : 16, /* size of dynamic
* state returned
* by the processor
*/
@@ -459,8 +459,8 @@ typedef struct pal_process_state_info_s {
typedef struct pal_cache_check_info_s {
u64 reserved1 : 16,
- way : 5, /* Way in which the
- * error occurred
+ way : 5, /* Way in which the
+ * error occurred
*/
reserved2 : 1,
mc : 1, /* Machine check corrected */
@@ -469,8 +469,8 @@ typedef struct pal_cache_check_info_s {
*/
wv : 1, /* Way field valid */
- op : 3, /* Type of cache
- * operation that
+ op : 3, /* Type of cache
+ * operation that
* caused the machine
* check.
*/
@@ -493,7 +493,7 @@ typedef struct pal_cache_check_info_s {
typedef struct pal_tlb_check_info_s {
u64 tr_slot : 8, /* Slot# of TR where
- * error occurred
+ * error occurred
*/
reserved2 : 8,
dtr : 1, /* Fail in data TR */
@@ -509,7 +509,7 @@ typedef struct pal_bus_check_info_s {
u64 size : 5, /* Xaction size*/
ib : 1, /* Internal bus error */
eb : 1, /* External bus error */
- cc : 1, /* Error occurred
+ cc : 1, /* Error occurred
* during cache-cache
* transfer.
*/
@@ -518,7 +518,7 @@ typedef struct pal_bus_check_info_s {
tv : 1, /* Targ addr valid */
rp : 1, /* Resp addr valid */
rq : 1, /* Req addr valid */
- bsi : 8, /* Bus error status
+ bsi : 8, /* Bus error status
* info
*/
mc : 1, /* Machine check corrected */
@@ -601,8 +601,8 @@ typedef union pal_mc_error_info_u {
#define pmci_bus_external_error pme_bus.eb
#define pmci_bus_mc pme_bus.mc
-/*
- * NOTE: this min_state_save area struct only includes the 1KB
+/*
+ * NOTE: this min_state_save area struct only includes the 1KB
* architectural state save area. The other 3 KB is scratch space
* for PAL.
*/
@@ -703,12 +703,12 @@ typedef union pal_bus_features_u {
u64 pbf_disable_bus_addr_err_signal : 1;
u64 pbf_disable_bus_data_err_check : 1;
} pal_bus_features_s;
-} pal_bus_features_u_t;
+} pal_bus_features_u_t;
extern void pal_bus_features_print (u64);
/* Provide information about configurable processor bus features */
-static inline s64
+static inline s64
ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
pal_bus_features_u_t *features_status,
pal_bus_features_u_t *features_control)
@@ -721,13 +721,13 @@ ia64_pal_bus_get_features (pal_bus_features_u_t *features_avail,
features_status->pal_bus_features_val = iprv.v1;
if (features_control)
features_control->pal_bus_features_val = iprv.v2;
- return iprv.status;
+ return iprv.status;
}
/* Enables/disables specific processor bus features */
-static inline s64
-ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
-{
+static inline s64
+ia64_pal_bus_set_features (pal_bus_features_u_t feature_select)
+{
struct ia64_pal_retval iprv;
PAL_CALL_PHYS(iprv, PAL_BUS_SET_FEATURES, feature_select.pal_bus_features_val, 0, 0);
return iprv.status;
@@ -739,7 +739,7 @@ ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_in
{
struct ia64_pal_retval iprv;
- PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
+ PAL_CALL(iprv, PAL_CACHE_INFO, cache_level, cache_type, 0);
if (iprv.status == 0) {
conf->pcci_status = iprv.status;
@@ -747,7 +747,7 @@ ia64_pal_cache_config_info (u64 cache_level, u64 cache_type, pal_cache_config_in
conf->pcci_info_2.pcci2_data = iprv.v1;
conf->pcci_reserved = iprv.v2;
}
- return iprv.status;
+ return iprv.status;
}
@@ -757,7 +757,7 @@ ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_
{
struct ia64_pal_retval iprv;
- PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
+ PAL_CALL(iprv, PAL_CACHE_PROT_INFO, cache_level, cache_type, 0);
if (iprv.status == 0) {
prot->pcpi_status = iprv.status;
@@ -768,106 +768,108 @@ ia64_pal_cache_prot_info (u64 cache_level, u64 cache_type, pal_cache_protection_
prot->pcp_info[4].pcpi_data = iprv.v2 & 0xffffffff;
prot->pcp_info[5].pcpi_data = iprv.v2 >> 32;
}
- return iprv.status;
+ return iprv.status;
}
-
+
/*
* Flush the processor instruction or data caches. *PROGRESS must be
* initialized to zero before calling this for the first time..
*/
-static inline s64
-ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress)
-{
+static inline s64
+ia64_pal_cache_flush (u64 cache_type, u64 invalidate, u64 *progress, u64 *vector)
+{
struct ia64_pal_retval iprv;
- PAL_CALL_IC_OFF(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
+ PAL_CALL_IC_OFF(iprv, PAL_CACHE_FLUSH, cache_type, invalidate, *progress);
+ if (vector)
+ *vector = iprv.v0;
*progress = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
/* Initialize the processor controlled caches */
-static inline s64
-ia64_pal_cache_init (u64 level, u64 cache_type, u64 restrict)
-{
+static inline s64
+ia64_pal_cache_init (u64 level, u64 cache_type, u64 restrict)
+{
struct ia64_pal_retval iprv;
- PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, restrict);
- return iprv.status;
+ PAL_CALL(iprv, PAL_CACHE_INIT, level, cache_type, restrict);
+ return iprv.status;
}
-/* Initialize the tags and data of a data or unified cache line of
- * processor controlled cache to known values without the availability
+/* Initialize the tags and data of a data or unified cache line of
+ * processor controlled cache to known values without the availability
* of backing memory.
*/
-static inline s64
-ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
-{
+static inline s64
+ia64_pal_cache_line_init (u64 physical_addr, u64 data_value)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_CACHE_LINE_INIT, physical_addr, data_value, 0);
- return iprv.status;
+ return iprv.status;
}
/* Read the data and tag of a processor controlled cache line for diags */
-static inline s64
-ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
-{
+static inline s64
+ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_CACHE_READ, line_id.pclid_data, physical_addr, 0);
- return iprv.status;
+ return iprv.status;
}
/* Return summary information about the heirarchy of caches controlled by the processor */
-static inline s64
-ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
-{
+static inline s64
+ia64_pal_cache_summary (u64 *cache_levels, u64 *unique_caches)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_CACHE_SUMMARY, 0, 0, 0);
if (cache_levels)
*cache_levels = iprv.v0;
if (unique_caches)
*unique_caches = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
/* Write the data and tag of a processor-controlled cache line for diags */
-static inline s64
-ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
-{
- struct ia64_pal_retval iprv;
+static inline s64
+ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data)
+{
+ struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_CACHE_WRITE, line_id.pclid_data, physical_addr, data);
- return iprv.status;
+ return iprv.status;
}
/* Return the parameters needed to copy relocatable PAL procedures from ROM to memory */
-static inline s64
+static inline s64
ia64_pal_copy_info (u64 copy_type, u64 num_procs, u64 num_iopics,
- u64 *buffer_size, u64 *buffer_align)
-{
+ u64 *buffer_size, u64 *buffer_align)
+{
struct ia64_pal_retval iprv;
- PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
+ PAL_CALL(iprv, PAL_COPY_INFO, copy_type, num_procs, num_iopics);
if (buffer_size)
*buffer_size = iprv.v0;
if (buffer_align)
*buffer_align = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
/* Copy relocatable PAL procedures from ROM to memory */
-static inline s64
-ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
-{
+static inline s64
+ia64_pal_copy_pal (u64 target_addr, u64 alloc_size, u64 processor, u64 *pal_proc_offset)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_COPY_PAL, target_addr, alloc_size, processor);
if (pal_proc_offset)
*pal_proc_offset = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
/* Return the number of instruction and data debug register pairs */
-static inline s64
-ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
-{
+static inline s64
+ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_DEBUG_INFO, 0, 0, 0);
if (inst_regs)
@@ -875,50 +877,50 @@ ia64_pal_debug_info (u64 *inst_regs, u64 *data_regs)
if (data_regs)
*data_regs = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
#ifdef TBD
/* Switch from IA64-system environment to IA-32 system environment */
-static inline s64
-ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
-{
+static inline s64
+ia64_pal_enter_ia32_env (ia32_env1, ia32_env2, ia32_env3)
+{
struct ia64_pal_retval iprv;
- PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
- return iprv.status;
+ PAL_CALL(iprv, PAL_ENTER_IA_32_ENV, ia32_env1, ia32_env2, ia32_env3);
+ return iprv.status;
}
#endif
/* Get unique geographical address of this processor on its bus */
-static inline s64
-ia64_pal_fixed_addr (u64 *global_unique_addr)
-{
+static inline s64
+ia64_pal_fixed_addr (u64 *global_unique_addr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_FIXED_ADDR, 0, 0, 0);
if (global_unique_addr)
*global_unique_addr = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
/* Get base frequency of the platform if generated by the processor */
-static inline s64
-ia64_pal_freq_base (u64 *platform_base_freq)
-{
+static inline s64
+ia64_pal_freq_base (u64 *platform_base_freq)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_FREQ_BASE, 0, 0, 0);
if (platform_base_freq)
*platform_base_freq = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
/*
* Get the ratios for processor frequency, bus frequency and interval timer to
- * to base frequency of the platform
+ * to base frequency of the platform
*/
-static inline s64
+static inline s64
ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *bus_ratio,
- struct pal_freq_ratio *itc_ratio)
-{
+ struct pal_freq_ratio *itc_ratio)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_FREQ_RATIOS, 0, 0, 0);
if (proc_ratio)
@@ -927,20 +929,21 @@ ia64_pal_freq_ratios (struct pal_freq_ratio *proc_ratio, struct pal_freq_ratio *
*(u64 *)bus_ratio = iprv.v1;
if (itc_ratio)
*(u64 *)itc_ratio = iprv.v2;
- return iprv.status;
+ return iprv.status;
}
-/* Make the processor enter HALT or one of the implementation dependent low
+/* Make the processor enter HALT or one of the implementation dependent low
* power states where prefetching and execution are suspended and cache and
* TLB coherency is not maintained.
*/
-static inline s64
-ia64_pal_halt (u64 halt_state)
-{
+static inline s64
+ia64_pal_halt (u64 halt_state)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_HALT, halt_state, 0, 0);
- return iprv.status;
+ return iprv.status;
}
+
typedef union pal_power_mgmt_info_u {
u64 ppmi_data;
struct {
@@ -954,87 +957,87 @@ typedef union pal_power_mgmt_info_u {
} pal_power_mgmt_info_u_t;
/* Return information about processor's optional power management capabilities. */
-static inline s64
-ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
-{
+static inline s64
+ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf)
+{
struct ia64_pal_retval iprv;
PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/* Cause the processor to enter LIGHT HALT state, where prefetching and execution are
* suspended, but cache and TLB coherency is maintained.
*/
-static inline s64
-ia64_pal_halt_light (void)
-{
+static inline s64
+ia64_pal_halt_light (void)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_HALT_LIGHT, 0, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/* Clear all the processor error logging registers and reset the indicator that allows
* the error logging registers to be written. This procedure also checks the pending
* machine check bit and pending INIT bit and reports their states.
*/
-static inline s64
-ia64_pal_mc_clear_log (u64 *pending_vector)
-{
+static inline s64
+ia64_pal_mc_clear_log (u64 *pending_vector)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_CLEAR_LOG, 0, 0, 0);
if (pending_vector)
*pending_vector = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
-/* Ensure that all outstanding transactions in a processor are completed or that any
+/* Ensure that all outstanding transactions in a processor are completed or that any
* MCA due to thes outstanding transaction is taken.
*/
-static inline s64
-ia64_pal_mc_drain (void)
-{
+static inline s64
+ia64_pal_mc_drain (void)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_DRAIN, 0, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/* Return the machine check dynamic processor state */
-static inline s64
-ia64_pal_mc_dynamic_state (u64 offset, u64 *size, u64 *pds)
-{
+static inline s64
+ia64_pal_mc_dynamic_state (u64 offset, u64 *size, u64 *pds)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_DYNAMIC_STATE, offset, 0, 0);
if (size)
*size = iprv.v0;
if (pds)
*pds = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
/* Return processor machine check information */
-static inline s64
-ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
-{
+static inline s64
+ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_info)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_ERROR_INFO, info_index, type_index, 0);
if (size)
*size = iprv.v0;
if (error_info)
- *error_info = iprv.v1;
- return iprv.status;
+ *error_info = iprv.v1;
+ return iprv.status;
}
/* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot
* attempt to correct any expected machine checks.
*/
-static inline s64
-ia64_pal_mc_expected (u64 expected, u64 *previous)
-{
+static inline s64
+ia64_pal_mc_expected (u64 expected, u64 *previous)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_EXPECTED, expected, 0, 0);
if (previous)
*previous = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
/* Register a platform dependent location with PAL to which it can save
@@ -1042,39 +1045,39 @@ ia64_pal_mc_expected (u64 expected, u64 *previous)
* event.
*/
static inline s64
-ia64_pal_mc_register_mem (u64 physical_addr)
-{
+ia64_pal_mc_register_mem (u64 physical_addr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_REGISTER_MEM, physical_addr, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/* Restore minimal architectural processor state, set CMC interrupt if necessary
* and resume execution
*/
-static inline s64
-ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
-{
+static inline s64
+ia64_pal_mc_resume (u64 set_cmci, u64 save_ptr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MC_RESUME, set_cmci, save_ptr, 0);
- return iprv.status;
+ return iprv.status;
}
/* Return the memory attributes implemented by the processor */
-static inline s64
-ia64_pal_mem_attrib (u64 *mem_attrib)
-{
+static inline s64
+ia64_pal_mem_attrib (u64 *mem_attrib)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_MEM_ATTRIB, 0, 0, 0);
if (mem_attrib)
*mem_attrib = iprv.v0 & 0xff;
- return iprv.status;
+ return iprv.status;
}
/* Return the amount of memory needed for second phase of processor
* self-test and the required alignment of memory.
*/
-static inline s64
+static inline s64
ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
{
struct ia64_pal_retval iprv;
@@ -1083,60 +1086,60 @@ ia64_pal_mem_for_test (u64 *bytes_needed, u64 *alignment)
*bytes_needed = iprv.v0;
if (alignment)
*alignment = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
typedef union pal_perf_mon_info_u {
u64 ppmi_data;
struct {
u64 generic : 8,
- width : 8,
- cycles : 8,
+ width : 8,
+ cycles : 8,
retired : 8,
reserved : 32;
} pal_perf_mon_info_s;
} pal_perf_mon_info_u_t;
-
+
/* Return the performance monitor information about what can be counted
* and how to configure the monitors to count the desired events.
*/
-static inline s64
-ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
-{
+static inline s64
+ia64_pal_perf_mon_info (u64 *pm_buffer, pal_perf_mon_info_u_t *pm_info)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_PERF_MON_INFO, (unsigned long) pm_buffer, 0, 0);
if (pm_info)
pm_info->ppmi_data = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
/* Specifies the physical address of the processor interrupt block
* and I/O port space.
*/
-static inline s64
-ia64_pal_platform_addr (u64 type, u64 physical_addr)
-{
+static inline s64
+ia64_pal_platform_addr (u64 type, u64 physical_addr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_PLATFORM_ADDR, type, physical_addr, 0);
- return iprv.status;
+ return iprv.status;
}
/* Set the SAL PMI entrypoint in memory */
-static inline s64
-ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
-{
+static inline s64
+ia64_pal_pmi_entrypoint (u64 sal_pmi_entry_addr)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_PMI_ENTRYPOINT, sal_pmi_entry_addr, 0, 0);
- return iprv.status;
+ return iprv.status;
}
struct pal_features_s;
/* Provide information about configurable processor features */
-static inline s64
-ia64_pal_proc_get_features (u64 *features_avail,
- u64 *features_status,
+static inline s64
+ia64_pal_proc_get_features (u64 *features_avail,
+ u64 *features_status,
u64 *features_control)
-{
+{
struct ia64_pal_retval iprv;
PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0);
if (iprv.status == 0) {
@@ -1144,16 +1147,16 @@ ia64_pal_proc_get_features (u64 *features_avail,
*features_status = iprv.v1;
*features_control = iprv.v2;
}
- return iprv.status;
+ return iprv.status;
}
/* Enable/disable processor dependent features */
-static inline s64
-ia64_pal_proc_set_features (u64 feature_select)
-{
+static inline s64
+ia64_pal_proc_set_features (u64 feature_select)
+{
struct ia64_pal_retval iprv;
PAL_CALL_PHYS(iprv, PAL_PROC_SET_FEATURES, feature_select, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/*
@@ -1162,7 +1165,7 @@ ia64_pal_proc_set_features (u64 feature_select)
*/
typedef struct ia64_ptce_info_s {
u64 base;
- u32 count[2];
+ u32 count[2];
u32 stride[2];
} ia64_ptce_info_t;
@@ -1189,9 +1192,9 @@ ia64_get_ptce (ia64_ptce_info_t *ptce)
}
/* Return info about implemented application and control registers. */
-static inline s64
-ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
-{
+static inline s64
+ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_REGISTER_INFO, info_request, 0, 0);
if (reg_info_1)
@@ -1199,7 +1202,7 @@ ia64_pal_register_info (u64 info_request, u64 *reg_info_1, u64 *reg_info_2)
if (reg_info_2)
*reg_info_2 = iprv.v1;
return iprv.status;
-}
+}
typedef union pal_hints_u {
u64 ph_data;
@@ -1210,62 +1213,62 @@ typedef union pal_hints_u {
} pal_hints_s;
} pal_hints_u_t;
-/* Return information about the register stack and RSE for this processor
+/* Return information about the register stack and RSE for this processor
* implementation.
*/
-static inline s64
+static inline s64
ia64_pal_rse_info (u64 *num_phys_stacked, pal_hints_u_t *hints)
-{
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_RSE_INFO, 0, 0, 0);
if (num_phys_stacked)
*num_phys_stacked = iprv.v0;
if (hints)
hints->ph_data = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
-/* Cause the processor to enter SHUTDOWN state, where prefetching and execution are
+/* Cause the processor to enter SHUTDOWN state, where prefetching and execution are
* suspended, but cause cache and TLB coherency to be maintained.
* This is usually called in IA-32 mode.
*/
-static inline s64
-ia64_pal_shutdown (void)
-{
+static inline s64
+ia64_pal_shutdown (void)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_SHUTDOWN, 0, 0, 0);
- return iprv.status;
+ return iprv.status;
}
/* Perform the second phase of processor self-test. */
-static inline s64
+static inline s64
ia64_pal_test_proc (u64 test_addr, u64 test_size, u64 attributes, u64 *self_test_state)
{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_TEST_PROC, test_addr, test_size, attributes);
if (self_test_state)
*self_test_state = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
typedef union pal_version_u {
u64 pal_version_val;
struct {
- u64 pv_pal_b_rev : 8;
+ u64 pv_pal_b_rev : 8;
u64 pv_pal_b_model : 8;
u64 pv_reserved1 : 8;
u64 pv_pal_vendor : 8;
u64 pv_pal_a_rev : 8;
u64 pv_pal_a_model : 8;
- u64 pv_reserved2 : 16;
+ u64 pv_reserved2 : 16;
} pal_version_s;
} pal_version_u_t;
/* Return PAL version information */
-static inline s64
-ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
-{
+static inline s64
+ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)
+{
struct ia64_pal_retval iprv;
PAL_CALL_PHYS(iprv, PAL_VERSION, 0, 0, 0);
if (pal_min_version)
@@ -1274,7 +1277,7 @@ ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_ver
if (pal_cur_version)
pal_cur_version->pal_version_val = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
typedef union pal_tc_info_u {
@@ -1288,8 +1291,8 @@ typedef union pal_tc_info_u {
reduce_tr : 1,
reserved : 29;
} pal_tc_info_s;
-} pal_tc_info_u_t;
-
+} pal_tc_info_u_t;
+
#define tc_reduce_tr pal_tc_info_s.reduce_tr
#define tc_unified pal_tc_info_s.unified
#define tc_pf pal_tc_info_s.pf
@@ -1298,10 +1301,10 @@ typedef union pal_tc_info_u {
#define tc_num_sets pal_tc_info_s.num_sets
-/* Return information about the virtual memory characteristics of the processor
+/* Return information about the virtual memory characteristics of the processor
* implementation.
*/
-static inline s64
+static inline s64
ia64_pal_vm_info (u64 tc_level, u64 tc_type, pal_tc_info_u_t *tc_info, u64 *tc_pages)
{
struct ia64_pal_retval iprv;
@@ -1309,14 +1312,14 @@ ia64_pal_vm_info (u64 tc_level, u64 tc_type, pal_tc_info_u_t *tc_info, u64 *tc_
if (tc_info)
tc_info->pti_val = iprv.v0;
if (tc_pages)
- *tc_pages = iprv.v1;
- return iprv.status;
+ *tc_pages = iprv.v1;
+ return iprv.status;
}
-/* Get page size information about the virtual memory characteristics of the processor
+/* Get page size information about the virtual memory characteristics of the processor
* implementation.
*/
-static inline s64
+static inline s64
ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
{
struct ia64_pal_retval iprv;
@@ -1324,8 +1327,8 @@ ia64_pal_vm_page_size (u64 *tr_pages, u64 *vw_pages)
if (tr_pages)
*tr_pages = iprv.v0;
if (vw_pages)
- *vw_pages = iprv.v1;
- return iprv.status;
+ *vw_pages = iprv.v1;
+ return iprv.status;
}
typedef union pal_vm_info_1_u {
@@ -1348,23 +1351,23 @@ typedef union pal_vm_info_2_u {
struct {
u64 impl_va_msb : 8,
rid_size : 8,
- reserved : 48;
+ reserved : 48;
} pal_vm_info_2_s;
} pal_vm_info_2_u_t;
-
-/* Get summary information about the virtual memory characteristics of the processor
+
+/* Get summary information about the virtual memory characteristics of the processor
* implementation.
*/
-static inline s64
-ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
-{
+static inline s64
+ia64_pal_vm_summary (pal_vm_info_1_u_t *vm_info_1, pal_vm_info_2_u_t *vm_info_2)
+{
struct ia64_pal_retval iprv;
PAL_CALL(iprv, PAL_VM_SUMMARY, 0, 0, 0);
if (vm_info_1)
vm_info_1->pvi1_val = iprv.v0;
if (vm_info_2)
vm_info_2->pvi2_val = iprv.v1;
- return iprv.status;
+ return iprv.status;
}
typedef union pal_itr_valid_u {
@@ -1379,14 +1382,14 @@ typedef union pal_itr_valid_u {
} pal_tr_valid_u_t;
/* Read a translation register */
-static inline s64
+static inline s64
ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
{
struct ia64_pal_retval iprv;
PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)__pa(tr_buffer));
if (tr_valid)
tr_valid->piv_val = iprv.v0;
- return iprv.status;
+ return iprv.status;
}
static inline s64
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index c996156ac057..9d5392d07b85 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -10,9 +10,9 @@
#include <asm/scatterlist.h>
/*
- * Can be used to override the logic in pci_scan_bus for skipping
- * already-configured bus numbers - to be used for buggy BIOSes or
- * architectures with incomplete PCI setup by the loader.
+ * Can be used to override the logic in pci_scan_bus for skipping already-configured bus
+ * numbers - to be used for buggy BIOSes or architectures with incomplete PCI setup by the
+ * loader.
*/
#define pcibios_assign_all_busses() 0
@@ -57,9 +57,26 @@ pci_dma_supported (struct pci_dev *hwdev, u64 mask)
return 1;
}
+#define pci_map_page(dev,pg,off,size,dir) \
+ pci_map_single((dev), page_address(pg) + (off), (size), (dir))
+#define pci_unmap_page(dev,dma_addr,size,dir) \
+ pci_unmap_single((dev), (dma_addr), (size), (dir))
+
+/* The ia64 platform always supports 64-bit addressing. */
+#define pci_dac_dma_supported(pci_dev, mask) (1)
+
+#define pci_dac_page_to_dma(dev,pg,off,dir) ((dma64_addr_t) page_to_bus(pg) + (off))
+#define pci_dac_dma_to_page(dev,dma_addr) (virt_to_page(bus_to_virt(dma_addr)))
+#define pci_dac_dma_to_offset(dev,dma_addr) ((dma_addr) & ~PAGE_MASK)
+#define pci_dac_dma_sync_single(dev,dma_addr,len,dir) do { /* nothing */ } while (0)
+
/* Return the index of the PCI controller for device PDEV. */
#define pci_controller_num(PDEV) (0)
#define sg_dma_len(sg) ((sg)->length)
+#define HAVE_PCI_MMAP
+extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
+ enum pci_mmap_state mmap_state, int write_combine);
+
#endif /* _ASM_IA64_PCI_H */
diff --git a/include/asm-ia64/perfmon.h b/include/asm-ia64/perfmon.h
index 11fe7192e0ab..0f3498bc7226 100644
--- a/include/asm-ia64/perfmon.h
+++ b/include/asm-ia64/perfmon.h
@@ -9,7 +9,7 @@
#include <linux/types.h>
/*
- * Structure used to define a context
+ * Request structure used to define a context
*/
typedef struct {
unsigned long smpl_entries; /* how many entries in sampling buffer */
@@ -23,7 +23,7 @@ typedef struct {
} pfreq_context_t;
/*
- * Structure used to configure a PMC or PMD
+ * Request structure used to write/read a PMC or PMD
*/
typedef struct {
unsigned long reg_num; /* which register */
@@ -41,11 +41,16 @@ typedef union {
pfreq_reg_t pfr_reg; /* request to configure a PMD/PMC */
} perfmon_req_t;
+#ifdef __KERNEL__
+
extern void pfm_save_regs (struct task_struct *);
extern void pfm_load_regs (struct task_struct *);
-extern int pfm_inherit (struct task_struct *);
+extern int pfm_inherit (struct task_struct *, struct pt_regs *);
extern void pfm_context_exit (struct task_struct *);
extern void pfm_flush_regs (struct task_struct *);
+extern void pfm_cleanup_notifiers (struct task_struct *);
+
+#endif /* __KERNEL__ */
#endif /* _ASM_IA64_PERFMON_H */
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index df0fd548653b..671ab4351af6 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -9,7 +9,7 @@
* in <asm/page.h> (currently 8192).
*
* Copyright (C) 1998-2001 Hewlett-Packard Co
- * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 2000, Goutham Rao <goutham.rao@intel.com>
*/
@@ -166,11 +166,6 @@ extern void __flush_tlb_all (void);
#endif
/*
- * Serialize usage of ptc.g:
- */
-extern spinlock_t ptcg_lock;
-
-/*
* Flush a specified user mapping
*/
static inline void
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index 51942aeee818..c6279c8f7264 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -9,7 +9,7 @@
* in <asm/page.h> (currently 8192).
*
* Copyright (C) 1998-2001 Hewlett-Packard Co
- * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/config.h>
@@ -466,11 +466,21 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
# endif /* !__ASSEMBLY__ */
/*
- * Identity-mapped regions use a large page size. KERNEL_PG_NUM is the
- * number of the (large) page frame that mapps the kernel.
+ * Identity-mapped regions use a large page size. We'll call such large pages
+ * "granules". If you can think of a better name that's unambiguous, let me
+ * know...
*/
-#define KERNEL_PG_SHIFT _PAGE_SIZE_64M
-#define KERNEL_PG_SIZE (1 << KERNEL_PG_SHIFT)
-#define KERNEL_PG_NUM ((KERNEL_START - PAGE_OFFSET) / KERNEL_PG_SIZE)
+#if defined(CONFIG_IA64_GRANULE_64MB)
+# define IA64_GRANULE_SHIFT _PAGE_SIZE_64M
+#elif defined(CONFIG_IA64_GRANULE_16MB)
+# define IA64_GRANULE_SHIFT _PAGE_SIZE_16M
+#endif
+#define IA64_GRANULE_SIZE (1 << IA64_GRANULE_SHIFT)
+/*
+ * log2() of the page size we use to map the kernel image (IA64_TR_KERNEL):
+ */
+#define KERNEL_TR_PAGE_SHIFT _PAGE_SIZE_64M
+#define KERNEL_TR_PAGE_SIZE (1 << KERNEL_TR_PAGE_SHIFT)
+#define KERNEL_TR_PAGE_NUM ((KERNEL_START - PAGE_OFFSET) / KERNEL_TR_PAGE_SIZE)
#endif /* _ASM_IA64_PGTABLE_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index dda22a4c91e4..3acfdab97ad3 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -168,10 +168,13 @@
#define IA64_THREAD_UAC_NOPRINT (__IA64_UL(1) << 3) /* don't log unaligned accesses */
#define IA64_THREAD_UAC_SIGBUS (__IA64_UL(1) << 4) /* generate SIGBUS on unaligned acc. */
#define IA64_THREAD_KRBS_SYNCED (__IA64_UL(1) << 5) /* krbs synced with process vm? */
-#define IA64_KERNEL_DEATH (__IA64_UL(1) << 63) /* see die_if_kernel()... */
+#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */
+#define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */
#define IA64_THREAD_UAC_SHIFT 3
#define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
+#define IA64_THREAD_FPEMU_SHIFT 6
+#define IA64_THREAD_FPEMU_MASK (IA64_THREAD_FPEMU_NOPRINT | IA64_THREAD_FPEMU_SIGFPE)
/*
@@ -190,6 +193,7 @@
#include <asm/page.h>
#include <asm/rse.h>
#include <asm/unwind.h>
+#include <asm/atomic.h>
/* like above but expressed as bitfields for more efficient access: */
struct ia64_psr {
@@ -324,6 +328,18 @@ typedef struct {
(int *) (addr)); \
})
+#define SET_FPEMU_CTL(task,value) \
+({ \
+ (task)->thread.flags = (((task)->thread.flags & ~IA64_THREAD_FPEMU_MASK) \
+ | (((value) << IA64_THREAD_FPEMU_SHIFT) & IA64_THREAD_FPEMU_MASK)); \
+ 0; \
+})
+#define GET_FPEMU_CTL(task,addr) \
+({ \
+ put_user(((task)->thread.flags & IA64_THREAD_FPEMU_MASK) >> IA64_THREAD_FPEMU_SHIFT, \
+ (int *) (addr)); \
+})
+
struct siginfo;
struct thread_struct {
@@ -341,21 +357,19 @@ struct thread_struct {
__u64 fdr; /* IA32 fp except. data reg */
__u64 csd; /* IA32 code selector descriptor */
__u64 ssd; /* IA32 stack selector descriptor */
- __u64 tssd; /* IA32 TSS descriptor */
+ __u64 old_k1; /* old value of ar.k1 */
__u64 old_iob; /* old IOBase value */
- union {
- __u64 sigmask; /* aligned mask for sigsuspend scall */
- } un;
-# define INIT_THREAD_IA32 0, 0, 0x17800000037fULL, 0, 0, 0, 0, 0, 0, {0},
+# define INIT_THREAD_IA32 0, 0, 0x17800000037fULL, 0, 0, 0, 0, 0, 0,
#else
# define INIT_THREAD_IA32
#endif /* CONFIG_IA32_SUPPORT */
#ifdef CONFIG_PERFMON
__u64 pmc[IA64_NUM_PMC_REGS];
__u64 pmd[IA64_NUM_PMD_REGS];
- unsigned long pfm_pend_notify; /* non-zero if we need to notify and block */
+ unsigned long pfm_must_block; /* non-zero if we need to block on overflow */
void *pfm_context; /* pointer to detailed PMU context */
-# define INIT_THREAD_PM {0, }, {0, }, 0, 0,
+ atomic_t pfm_notifiers_check; /* indicate if release_thread much check tasklist */
+# define INIT_THREAD_PM {0, }, {0, }, 0, 0, {0},
#else
# define INIT_THREAD_PM
#endif
@@ -628,10 +642,11 @@ ia64_invala (void)
}
/*
- * Save the processor status flags in FLAGS and then clear the
- * interrupt collection and interrupt enable bits.
+ * Save the processor status flags in FLAGS and then clear the interrupt collection and
+ * interrupt enable bits. Don't trigger any mandatory RSE references while this bit is
+ * off!
*/
-#define ia64_clear_ic(flags) \
+#define ia64_clear_ic(flags) \
asm volatile ("mov %0=psr;; rsm psr.i | psr.ic;; srlz.i;;" \
: "=r"(flags) :: "memory");
@@ -720,6 +735,8 @@ ia64_set_lrr0 (unsigned long val)
asm volatile ("mov cr.lrr0=%0;; srlz.d" :: "r"(val) : "memory");
}
+#define cpu_relax() do { } while (0)
+
static inline void
ia64_set_lrr1 (unsigned long val)
@@ -816,7 +833,7 @@ thread_saved_pc (struct thread_struct *t)
/* NOTE: The task struct and the stacks are allocated together. */
#define alloc_task_struct() \
((struct task_struct *) __get_free_pages(GFP_KERNEL, IA64_TASK_STRUCT_LOG_NUM_PAGES))
-#define free_task_struct(p) free_pages((unsigned long)(p), IA64_TASK_STRUCT_LOG_NUM_PAGES)
+#define free_task_struct(p) free_pages((unsigned long)(p), IA64_TASK_STRUCT_LOG_NUM_PAGES)
#define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count)
#define init_task (init_task_union.task)
@@ -942,6 +959,42 @@ ia64_get_gp(void)
return val;
}
+static inline void
+ia64_set_ibr (__u64 regnum, __u64 value)
+{
+ asm volatile ("mov ibr[%0]=%1" :: "r"(regnum), "r"(value));
+}
+
+static inline void
+ia64_set_dbr (__u64 regnum, __u64 value)
+{
+ asm volatile ("mov dbr[%0]=%1" :: "r"(regnum), "r"(value));
+#ifdef CONFIG_ITANIUM
+ asm volatile (";; srlz.d");
+#endif
+}
+
+static inline __u64
+ia64_get_ibr (__u64 regnum)
+{
+ __u64 retval;
+
+ asm volatile ("mov %0=ibr[%1]" : "=r"(retval) : "r"(regnum));
+ return retval;
+}
+
+static inline __u64
+ia64_get_dbr (__u64 regnum)
+{
+ __u64 retval;
+
+ asm volatile ("mov %0=dbr[%1]" : "=r"(retval) : "r"(regnum));
+#ifdef CONFIG_ITANIUM
+ asm volatile (";; srlz.d");
+#endif
+ return retval;
+}
+
/* XXX remove the handcoded version once we have a sufficiently clever compiler... */
#ifdef SMART_COMPILER
# define ia64_rotr(w,n) \
@@ -969,27 +1022,33 @@ ia64_thash (__u64 addr)
return result;
}
-#define cpu_relax() do { } while (0)
-
+static inline __u64
+ia64_tpa (__u64 addr)
+{
+ __u64 result;
+ asm ("tpa %0=%1" : "=r"(result) : "r"(addr));
+ return result;
+}
#define ARCH_HAS_PREFETCH
#define ARCH_HAS_PREFETCHW
#define ARCH_HAS_SPINLOCK_PREFETCH
#define PREFETCH_STRIDE 256
-extern inline void prefetch(const void *x)
+extern inline void
+prefetch (const void *x)
{
__asm__ __volatile__ ("lfetch [%0]" : : "r"(x));
}
-
-extern inline void prefetchw(const void *x)
+
+extern inline void
+prefetchw (const void *x)
{
__asm__ __volatile__ ("lfetch.excl [%0]" : : "r"(x));
}
-#define spin_lock_prefetch(x) prefetchw(x)
+#define spin_lock_prefetch(x) prefetchw(x)
-
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_PROCESSOR_H */
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 64e652b2721b..904cb502ce68 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -7,10 +7,14 @@
* This is based on version 2.5 of the manual "IA-64 System
* Abstraction Layer".
*
+ * Copyright (C) 2001 Intel
+ * Copyright (C) 2001 Fred Lewis <frederick.v.lewis@intel.com>
* Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
* Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 Srinivasa Prasad Thirumalachar <sprasad@sprasad.engr.sgi.com>
*
+ * 01/01/03 fvlewis Updated Error Record Structures to conform with Nov. 2000
+ * revision of the SAL spec.
* 99/09/29 davidm Updated for SAL 2.6.
* 00/03/29 cfleck Updated SAL Error Logging info for processor (SAL 2.6)
* (plus examples of platform error info structures from smariset @ Intel)
@@ -19,7 +23,9 @@
#include <linux/spinlock.h>
#include <asm/pal.h>
+#include <asm/efi.h>
#include <asm/system.h>
+#include <asm/fpu.h>
extern spinlock_t sal_lock;
@@ -173,10 +179,8 @@ typedef struct ia64_sal_ptc_domain_info {
} ia64_sal_ptc_domain_info_t;
typedef struct ia64_sal_ptc_domain_proc_entry {
- u64 reserved : 16;
- u64 eid : 8; /* eid of processor */
u64 id : 8; /* id of processor */
- u64 ignored : 32;
+ u64 eid : 8; /* eid of processor */
} ia64_sal_ptc_domain_proc_entry_t;
@@ -199,19 +203,15 @@ extern void ia64_sal_init (struct ia64_sal_systab *sal_systab);
enum {
SAL_INFO_TYPE_MCA = 0, /* Machine check abort information */
SAL_INFO_TYPE_INIT = 1, /* Init information */
- SAL_INFO_TYPE_CMC = 2 /* Corrected machine check information */
-};
-
-/* Sub information type encodings */
-enum {
- SAL_SUB_INFO_TYPE_PROCESSOR = 0, /* Processor information */
- SAL_SUB_INFO_TYPE_PLATFORM = 1 /* Platform information */
+ SAL_INFO_TYPE_CMC = 2, /* Corrected machine check information */
+ SAL_INFO_TYPE_CPE = 3 /* Corrected platform error information */
};
/* Encodings for machine check parameter types */
enum {
SAL_MC_PARAM_RENDEZ_INT = 1, /* Rendezevous interrupt */
- SAL_MC_PARAM_RENDEZ_WAKEUP = 2 /* Wakeup */
+ SAL_MC_PARAM_RENDEZ_WAKEUP = 2, /* Wakeup */
+ SAL_MC_PARAM_CPE_INT = 3 /* Corrected Platform Error Int */
};
/* Encodings for rendezvous mechanisms */
@@ -227,174 +227,389 @@ enum {
SAL_VECTOR_OS_BOOT_RENDEZ = 2
};
-/* Definition of the SAL Error Log from the SAL spec */
+/*
+** Definition of the SAL Error Log from the SAL spec
+*/
+
+/* SAL Error Record Section GUID Definitions */
+#define SAL_PROC_DEV_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf1, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_MEM_DEV_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf2, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_SEL_DEV_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf3, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_PCI_BUS_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf4, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_SMBIOS_DEV_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf5, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_PCI_COMP_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf6, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_SPECIFIC_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf7, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_HOST_CTLR_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf8, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
+#define SAL_PLAT_BUS_ERR_SECT_GUID \
+ ((efi_guid_t) { 0xe429faf9, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, \
+ 0xc7, 0x3c, 0x88, 0x81 }} )
-/* Definition of timestamp according to SAL spec for logging purposes */
+#define MAX_CACHE_ERRORS 6
+#define MAX_TLB_ERRORS 6
+#define MAX_BUS_ERRORS 1
+
+/* Definition of version according to SAL spec for logging purposes */
+typedef struct sal_log_revision
+{
+ u8 minor; /* BCD (0..99) */
+ u8 major; /* BCD (0..99) */
+} sal_log_revision_t;
-typedef struct sal_log_timestamp {
- u8 slh_century; /* Century (19, 20, 21, ...) */
- u8 slh_year; /* Year (00..99) */
- u8 slh_month; /* Month (1..12) */
- u8 slh_day; /* Day (1..31) */
- u8 slh_reserved;
- u8 slh_hour; /* Hour (0..23) */
- u8 slh_minute; /* Minute (0..59) */
+/* Definition of timestamp according to SAL spec for logging purposes */
+typedef struct sal_log_timestamp
+{
u8 slh_second; /* Second (0..59) */
+ u8 slh_minute; /* Minute (0..59) */
+ u8 slh_hour; /* Hour (0..23) */
+ u8 slh_reserved;
+ u8 slh_day; /* Day (1..31) */
+ u8 slh_month; /* Month (1..12) */
+ u8 slh_year; /* Year (00..99) */
+ u8 slh_century; /* Century (19, 20, 21, ...) */
} sal_log_timestamp_t;
+/* Definition of log record header structures */
+typedef struct sal_log_record_header
+{
+ u64 id; /* Unique monotonically increasing ID */
+ sal_log_revision_t revision; /* Major and Minor revision of header */
+ u16 severity; /* Error Severity */
+ u32 len; /* Length of this error log in bytes */
+ sal_log_timestamp_t timestamp; /* Timestamp */
+ efi_guid_t platform_guid; /* Unique OEM Platform ID */
+} sal_log_record_header_t;
+
+/* Definition of log section header structures */
+typedef struct sal_log_sec_header
+{
+ efi_guid_t guid; /* Unique Section ID */
+ sal_log_revision_t revision; /* Major and Minor revision of Section */
+ u16 reserved;
+ u32 len; /* Section length */
+} sal_log_section_hdr_t;
-#define MAX_CACHE_ERRORS 6
-#define MAX_TLB_ERRORS 6
-#define MAX_BUS_ERRORS 1
-
-typedef struct sal_log_processor_info {
- struct {
- u64 slpi_psi : 1,
- slpi_cache_check: MAX_CACHE_ERRORS,
- slpi_tlb_check : MAX_TLB_ERRORS,
- slpi_bus_check : MAX_BUS_ERRORS,
- slpi_reserved2 : (31 - (MAX_TLB_ERRORS + MAX_CACHE_ERRORS
- + MAX_BUS_ERRORS)),
- slpi_minstate : 1,
- slpi_bank1_gr : 1,
- slpi_br : 1,
- slpi_cr : 1,
- slpi_ar : 1,
- slpi_rr : 1,
- slpi_fr : 1,
- slpi_reserved1 : 25;
- } slpi_valid;
-
- pal_processor_state_info_t slpi_processor_state_info;
-
- struct {
- pal_cache_check_info_t slpi_cache_check;
- u64 slpi_target_address;
- } slpi_cache_check_info[MAX_CACHE_ERRORS];
-
- pal_tlb_check_info_t slpi_tlb_check_info[MAX_TLB_ERRORS];
-
- struct {
- pal_bus_check_info_t slpi_bus_check;
- u64 slpi_requestor_addr;
- u64 slpi_responder_addr;
- u64 slpi_target_addr;
- } slpi_bus_check_info[MAX_BUS_ERRORS];
-
- pal_min_state_area_t slpi_min_state_area;
- u64 slpi_br[8];
- u64 slpi_cr[128];
- u64 slpi_ar[128];
- u64 slpi_rr[8];
- u64 slpi_fr[128];
+typedef struct sal_log_mod_error_info
+{
+ struct
+ {
+ u64 check_info : 1,
+ requestor_identifier : 1,
+ responder_identifier : 1,
+ target_identifier : 1,
+ precise_ip : 1,
+ reserved : 59;
+ } valid;
+ u64 check_info;
+ u64 requestor_identifier;
+ u64 responder_identifier;
+ u64 target_identifier;
+ u64 precise_ip;
+} sal_log_mod_error_info_t;
+
+typedef struct sal_processor_static_info
+{
+ struct
+ {
+ u64 minstate : 1,
+ br : 1,
+ cr : 1,
+ ar : 1,
+ rr : 1,
+ fr : 1,
+ reserved : 58;
+ } valid;
+ pal_min_state_area_t min_state_area;
+ u64 br[8];
+ u64 cr[128];
+ u64 ar[128];
+ u64 rr[8];
+ struct ia64_fpreg fr[128];
+} sal_processor_static_info_t;
+
+typedef struct sal_log_processor_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 proc_error_map : 1,
+ proc_state_param : 1,
+ proc_cr_lid : 1,
+ psi_static_struct : 1,
+ num_cache_check : 4,
+ num_tlb_check : 4,
+ num_bus_check : 4,
+ num_reg_file_check : 4,
+ num_ms_check : 4,
+ cpuid_info : 1,
+ reserved1 : 39;
+ } valid;
+ u64 proc_error_map;
+ u64 proc_state_parameter;
+ u64 proc_cr_lid;
+ sal_log_mod_error_info_t cache_check_info[16];
+ sal_log_mod_error_info_t tlb_check_info[16];
+ sal_log_mod_error_info_t bus_check_info[16];
+ sal_log_mod_error_info_t reg_file_check_info[16];
+ sal_log_mod_error_info_t ms_check_info[16];
+ struct
+ {
+ u64 regs[5];
+ u64 reserved;
+ } cpuid_info;
+ sal_processor_static_info_t processor_static_info;
} sal_log_processor_info_t;
/* platform error log structures */
-typedef struct platerr_logheader {
- u64 nextlog; /* next log offset if present */
- u64 loglength; /* log length */
- u64 logsubtype; /* log subtype memory/bus/component */
- u64 eseverity; /* error severity */
-} ehdr_t;
-
-typedef struct sysmem_errlog {
- ehdr_t lhdr; /* header */
- u64 vflag; /* valid bits for each field in the log */
- u64 addr; /* memory address */
- u64 data; /* memory data */
- u64 cmd; /* command bus value if any */
- u64 ctrl; /* control bus value if any */
- u64 addrsyndrome; /* memory address ecc/parity syndrome bits */
- u64 datasyndrome; /* data ecc/parity syndrome */
- u64 cacheinfo; /* platform cache info as defined in pal spec. table 7-34 */
-} merrlog_t;
-
-typedef struct sysbus_errlog {
- ehdr_t lhdr; /* linkded list header */
- u64 vflag; /* valid bits for each field in the log */
- u64 busnum; /* bus number in error */
- u64 reqaddr; /* requestor address */
- u64 resaddr; /* responder address */
- u64 taraddr; /* target address */
- u64 data; /* requester r/w data */
- u64 cmd; /* bus commands */
- u64 ctrl; /* bus controls (be# &-0) */
- u64 addrsyndrome; /* addr bus ecc/parity bits */
- u64 datasyndrome; /* data bus ecc/parity bits */
- u64 cmdsyndrome; /* command bus ecc/parity bits */
- u64 ctrlsyndrome; /* control bus ecc/parity bits */
-} berrlog_t;
-/* platform error log structures */
-typedef struct syserr_chdr { /* one header per component */
- u64 busnum; /* bus number on which the component resides */
- u64 devnum; /* same as device select */
- u64 funcid; /* function id of the device */
- u64 devid; /* pci device id */
- u64 classcode; /* pci class code for the device */
- u64 cmdreg; /* pci command reg value */
- u64 statreg; /* pci status reg value */
-} chdr_t;
-
-typedef struct cfginfo {
- u64 cfgaddr;
- u64 cfgval;
-} cfginfo_t;
-
-typedef struct sys_comperr { /* per component */
- ehdr_t lhdr; /* linked list header */
- u64 vflag; /* valid bits for each field in the log */
- chdr_t scomphdr;
- u64 numregpair; /* number of reg addr/value pairs */
- cfginfo_t cfginfo;
-} cerrlog_t;
-
-typedef struct sel_records {
- ehdr_t lhdr;
- u64 seldata;
-} isel_t;
-
-typedef struct plat_errlog {
- u64 mbcsvalid; /* valid bits for each type of log */
- merrlog_t smemerrlog; /* platform memory error logs */
- berrlog_t sbuserrlog; /* platform bus error logs */
- cerrlog_t scomperrlog; /* platform chipset error logs */
- isel_t selrecord; /* ipmi sel record */
-} platforminfo_t;
-
-/* over all log structure (processor+platform) */
-
-typedef union udev_specific_log {
- sal_log_processor_info_t proclog;
- platforminfo_t platlog;
-} devicelog_t;
-
-
-#define sal_log_processor_info_psi_valid slpi_valid.spli_psi
-#define sal_log_processor_info_cache_check_valid slpi_valid.spli_cache_check
-#define sal_log_processor_info_tlb_check_valid slpi_valid.spli_tlb_check
-#define sal_log_processor_info_bus_check_valid slpi_valid.spli_bus_check
-#define sal_log_processor_info_minstate_valid slpi_valid.spli_minstate
-#define sal_log_processor_info_bank1_gr_valid slpi_valid.slpi_bank1_gr
-#define sal_log_processor_info_br_valid slpi_valid.slpi_br
-#define sal_log_processor_info_cr_valid slpi_valid.slpi_cr
-#define sal_log_processor_info_ar_valid slpi_valid.slpi_ar
-#define sal_log_processor_info_rr_valid slpi_valid.slpi_rr
-#define sal_log_processor_info_fr_valid slpi_valid.slpi_fr
-
-typedef struct sal_log_header {
- u64 slh_next_log; /* Offset of the next log from the beginning of this structure */
- u32 slh_log_len; /* Length of this error log in bytes */
- u16 slh_log_type; /* Type of log (0 - cpu ,1 - platform) */
- u16 slh_log_sub_type; /* SGI specific sub type */
- sal_log_timestamp_t slh_log_timestamp; /* Timestamp */
-} sal_log_header_t;
-
-/* SAL PSI log structure */
-typedef struct psilog {
- sal_log_header_t sal_elog_header;
- devicelog_t devlog;
-} ia64_psilog_t;
+typedef struct sal_log_mem_dev_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 error_status : 1,
+ physical_addr : 1,
+ addr_mask : 1,
+ node : 1,
+ card : 1,
+ module : 1,
+ bank : 1,
+ device : 1,
+ row : 1,
+ column : 1,
+ bit_position : 1,
+ requestor_id : 1,
+ responder_id : 1,
+ target_id : 1,
+ bus_spec_data : 1,
+ oem_id : 1,
+ oem_data : 1,
+ reserved : 47;
+ } valid;
+ u64 error_status;
+ u64 physical_addr;
+ u64 addr_mask;
+ u16 node;
+ u16 card;
+ u16 module;
+ u16 bank;
+ u16 device;
+ u16 row;
+ u16 column;
+ u16 bit_position;
+ u64 requestor_id;
+ u64 responder_id;
+ u64 target_id;
+ u64 bus_spec_data;
+ u8 oem_id[16];
+ u8 oem_data[1]; /* Variable length data */
+} sal_log_mem_dev_err_info_t;
+
+typedef struct sal_log_sel_dev_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 record_id : 1,
+ record_type : 1,
+ generator_id : 1,
+ evm_rev : 1,
+ sensor_type : 1,
+ sensor_num : 1,
+ event_dir : 1,
+ event_data1 : 1,
+ event_data2 : 1,
+ event_data3 : 1,
+ reserved : 54;
+ } valid;
+ u16 record_id;
+ u8 record_type;
+ u8 timestamp[4];
+ u16 generator_id;
+ u8 evm_rev;
+ u8 sensor_type;
+ u8 sensor_num;
+ u8 event_dir;
+ u8 event_data1;
+ u8 event_data2;
+ u8 event_data3;
+} sal_log_sel_dev_err_info_t;
+
+typedef struct sal_log_pci_bus_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 err_status : 1,
+ err_type : 1,
+ bus_id : 1,
+ bus_address : 1,
+ bus_data : 1,
+ bus_cmd : 1,
+ requestor_id : 1,
+ responder_id : 1,
+ target_id : 1,
+ oem_data : 1,
+ reserved : 54;
+ } valid;
+ u64 err_status;
+ u16 err_type;
+ u16 bus_id;
+ u32 reserved;
+ u64 bus_address;
+ u64 bus_data;
+ u64 bus_cmd;
+ u64 requestor_id;
+ u64 responder_id;
+ u64 target_id;
+ u8 oem_data[1]; /* Variable length data */
+} sal_log_pci_bus_err_info_t;
+
+typedef struct sal_log_smbios_dev_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 event_type : 1,
+ length : 1,
+ time_stamp : 1,
+ data : 1,
+ reserved1 : 60;
+ } valid;
+ u8 event_type;
+ u8 length;
+ u8 time_stamp[6];
+ u8 data[1]; // data of variable length, length == slsmb_length
+} sal_log_smbios_dev_err_info_t;
+
+typedef struct sal_log_pci_comp_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 err_status : 1,
+ comp_info : 1,
+ num_mem_regs : 1,
+ num_io_regs : 1,
+ reg_data_pairs : 1,
+ oem_data : 1,
+ reserved : 58;
+ } valid;
+ u64 err_status;
+ struct
+ {
+ u16 vendor_id;
+ u16 device_id;
+ u16 class_code;
+ u8 func_num;
+ u8 dev_num;
+ u8 bus_num;
+ u8 seg_num;
+ u8 reserved[6];
+ } comp_info;
+ u32 num_mem_regs;
+ u32 num_io_regs;
+ u64 reg_data_pairs[1];
+ /* array of address/data register pairs is num_mem_regs + num_io_regs
+ elements long. Each array element consists of a u64 address followed
+ by a u64 data value. The oem_data array immediately follows the the
+ reg_data_pairs array */
+ u8 oem_data[1]; /* Variable length data */
+} sal_log_pci_comp_err_info_t;
+
+typedef struct sal_log_plat_specific_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 err_status : 1,
+ guid : 1,
+ oem_data : 1,
+ reserved : 61;
+ } valid;
+ u64 err_status;
+ efi_guid_t guid;
+ u8 oem_data[1]; /* platform specific variable length data */
+} sal_log_plat_specific_err_info_t;
+
+typedef struct sal_log_host_ctlr_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 err_status : 1,
+ requestor_id : 1,
+ responder_id : 1,
+ target_id : 1,
+ bus_spec_data : 1,
+ oem_data : 1,
+ reserved : 58;
+ } valid;
+ u64 err_status;
+ u64 requestor_id;
+ u64 responder_id;
+ u64 target_id;
+ u64 bus_spec_data;
+ u8 oem_data[1]; /* Variable length OEM data */
+} sal_log_host_ctlr_err_info_t;
+
+typedef struct sal_log_plat_bus_err_info
+{
+ sal_log_section_hdr_t header;
+ struct
+ {
+ u64 err_status : 1,
+ requestor_id : 1,
+ responder_id : 1,
+ target_id : 1,
+ bus_spec_data : 1,
+ oem_data : 1,
+ reserved : 58;
+ } valid;
+ u64 err_status;
+ u64 requestor_id;
+ u64 responder_id;
+ u64 target_id;
+ u64 bus_spec_data;
+ u8 oem_data[1]; /* Variable length OEM data */
+} sal_log_plat_bus_err_info_t;
+
+/* Overall platform error section structure */
+typedef union sal_log_platform_err_info
+{
+ sal_log_mem_dev_err_info_t mem_dev_err;
+ sal_log_sel_dev_err_info_t sel_dev_err;
+ sal_log_pci_bus_err_info_t pci_bus_err;
+ sal_log_smbios_dev_err_info_t smbios_dev_err;
+ sal_log_pci_comp_err_info_t pci_comp_err;
+ sal_log_plat_specific_err_info_t plat_specific_err;
+ sal_log_host_ctlr_err_info_t host_ctlr_err;
+ sal_log_plat_bus_err_info_t plat_bus_err;
+} sal_log_platform_err_info_t;
+
+/* SAL log over-all, multi-section error record structure (processor+platform) */
+typedef struct err_rec
+{
+ sal_log_record_header_t sal_elog_header;
+ sal_log_processor_info_t proc_err;
+ sal_log_platform_err_info_t plat_err;
+ u8 oem_data_pad[1024];
+} ia64_err_rec_t;
/*
* Now define a couple of inline functions for improved type checking
@@ -433,19 +648,20 @@ ia64_sal_cache_init (void)
}
/* Clear the processor and platform information logged by SAL with respect to the
- * machine state at the time of MCA's, INITs or CMCs
+ * machine state at the time of MCA's, INITs, CMCs, or CPEs.
*/
static inline s64
ia64_sal_clear_state_info (u64 sal_info_type)
{
struct ia64_sal_retval isrv;
- SAL_CALL(isrv, SAL_CLEAR_STATE_INFO, sal_info_type, 0, 0, 0, 0, 0, 0);
+ SAL_CALL(isrv, SAL_CLEAR_STATE_INFO, sal_info_type, 0,
+ 0, 0, 0, 0, 0);
return isrv.status;
}
/* Get the processor and platform information logged by SAL with respect to the machine
- * state at the time of the MCAs, INITs or CMCs.
+ * state at the time of the MCAs, INITs, CMCs, or CPEs.
*/
static inline u64
ia64_sal_get_state_info (u64 sal_info_type, u64 *sal_info)
@@ -455,16 +671,18 @@ ia64_sal_get_state_info (u64 sal_info_type, u64 *sal_info)
sal_info, 0, 0, 0, 0);
if (isrv.status)
return 0;
+
return isrv.v0;
}
/* Get the maximum size of the information logged by SAL with respect to the machine
- * state at the time of MCAs, INITs or CMCs
+ * state at the time of MCAs, INITs, CMCs, or CPEs.
*/
static inline u64
ia64_sal_get_state_info_size (u64 sal_info_type)
{
struct ia64_sal_retval isrv;
- SAL_CALL(isrv, SAL_GET_STATE_INFO_SIZE, sal_info_type, 0, 0, 0, 0, 0, 0);
+ SAL_CALL(isrv, SAL_GET_STATE_INFO_SIZE, sal_info_type, 0,
+ 0, 0, 0, 0, 0);
if (isrv.status)
return 0;
return isrv.v0;
diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h
index cd431795de13..2b4f7afa9bd9 100644
--- a/include/asm-ia64/scatterlist.h
+++ b/include/asm-ia64/scatterlist.h
@@ -2,13 +2,13 @@
#define _ASM_IA64_SCATTERLIST_H
/*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
struct scatterlist {
char *address; /* location data is to be transferred to */
- char *orig_address; /* Save away the original buffer address (used by pci-dma.c) */
+ void *page; /* stupid: SCSI code insists on a member of this name... */
unsigned int length; /* buffer length */
};
diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h
index e3e5a9df9ffd..dd0eade35495 100644
--- a/include/asm-ia64/semaphore.h
+++ b/include/asm-ia64/semaphore.h
@@ -63,8 +63,6 @@ extern int __down_interruptible (struct semaphore * sem);
extern int __down_trylock (struct semaphore * sem);
extern void __up (struct semaphore * sem);
-extern spinlock_t semaphore_wake_lock;
-
/*
* Atomically decrement the semaphore's count. If it goes negative,
* block the calling thread in the TASK_UNINTERRUPTIBLE state.
diff --git a/include/asm-ia64/sembuf.h b/include/asm-ia64/sembuf.h
index 1f5ea49b4304..1340fbc04d3e 100644
--- a/include/asm-ia64/sembuf.h
+++ b/include/asm-ia64/sembuf.h
@@ -1,7 +1,7 @@
#ifndef _ASM_IA64_SEMBUF_H
#define _ASM_IA64_SEMBUF_H
-/*
+/*
* The semid64_ds structure for IA-64 architecture.
* Note extra padding because this structure is passed back and forth
* between kernel and user space.
diff --git a/include/asm-ia64/shmbuf.h b/include/asm-ia64/shmbuf.h
index 6def08993c7d..585002a77acd 100644
--- a/include/asm-ia64/shmbuf.h
+++ b/include/asm-ia64/shmbuf.h
@@ -1,7 +1,7 @@
#ifndef _ASM_IA64_SHMBUF_H
#define _ASM_IA64_SHMBUF_H
-/*
+/*
* The shmid64_ds structure for IA-64 architecture.
* Note extra padding because this structure is passed back and forth
* between kernel and user space.
diff --git a/include/asm-ia64/sigcontext.h b/include/asm-ia64/sigcontext.h
index 5ff4a2ff67b7..4cb91706f27c 100644
--- a/include/asm-ia64/sigcontext.h
+++ b/include/asm-ia64/sigcontext.h
@@ -2,13 +2,13 @@
#define _ASM_IA64_SIGCONTEXT_H
/*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <asm/fpu.h>
-#define IA64_SC_FLAG_ONSTACK_BIT 1 /* is handler running on signal stack? */
+#define IA64_SC_FLAG_ONSTACK_BIT 0 /* is handler running on signal stack? */
#define IA64_SC_FLAG_IN_SYSCALL_BIT 1 /* did signal interrupt a syscall? */
#define IA64_SC_FLAG_FPH_VALID_BIT 2 /* is state in f[32]-f[127] valid? */
@@ -18,6 +18,19 @@
# ifndef __ASSEMBLY__
+/*
+ * Note on handling of register backing store: sc_ar_bsp contains the address that would
+ * be found in ar.bsp after executing a "cover" instruction the context in which the
+ * signal was raised. If signal delivery required switching to an alternate signal stack
+ * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the
+ * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the
+ * original one. In this case, sc_rbs_base contains the base address of the new register
+ * backing store. The number of registers in the dirty partition can be calculated as:
+ *
+ * ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16))
+ *
+ */
+
struct sigcontext {
unsigned long sc_flags; /* see manifest constants above */
unsigned long sc_nat; /* bit i == 1 iff scratch reg gr[i] is a NaT */
@@ -40,8 +53,10 @@ struct sigcontext {
unsigned long sc_gr[32]; /* general registers (static partition) */
struct ia64_fpreg sc_fr[128]; /* floating-point registers */
- unsigned long sc_rsvd[16]; /* reserved for future use */
+ unsigned long sc_rbs_base; /* NULL or new base of sighandler's rbs */
+ unsigned long sc_loadrs; /* see description above */
+ unsigned long sc_rsvd[14]; /* reserved for future use */
/*
* The mask must come last so we can increase _NSIG_WORDS
* without breaking binary compatibility.
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
index 45dd55e59b1c..af34e0074869 100644
--- a/include/asm-ia64/signal.h
+++ b/include/asm-ia64/signal.h
@@ -2,8 +2,8 @@
#define _ASM_IA64_SIGNAL_H
/*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*
* Unfortunately, this file is being included by bits/signal.h in
* glibc-2.x. Hence the #ifdef __KERNEL__ ugliness.
@@ -80,14 +80,24 @@
#define SA_RESTORER 0x04000000
-/*
+/*
* sigaltstack controls
*/
#define SS_ONSTACK 1
#define SS_DISABLE 2
-#define MINSIGSTKSZ 2048
-#define SIGSTKSZ 8192
+/*
+ * The minimum stack size needs to be fairly large because we want to
+ * be sure that an app compiled for today's CPUs will continue to run
+ * on all future CPU models. The CPU model matters because the signal
+ * frame needs to have space for the complete machine state, including
+ * all physical stacked registers. The number of physical stacked
+ * registers is CPU model dependent, but given that the width of
+ * ar.rsc.loadrs is 14 bits, we can assume that they'll never take up
+ * more than 16KB of space.
+ */
+#define MINSIGSTKSZ 131027 /* min. stack size for sigaltstack() */
+#define SIGSTKSZ 262144 /* default stack size for sigaltstack() */
#ifdef __KERNEL__
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
index a4bab219f605..654911d32ab6 100644
--- a/include/asm-ia64/smp.h
+++ b/include/asm-ia64/smp.h
@@ -4,7 +4,7 @@
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 2001 Hewlett-Packard Co
- * Copyright (C) 2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef _ASM_IA64_SMP_H
#define _ASM_IA64_SMP_H
@@ -18,6 +18,7 @@
#include <linux/kernel.h>
#include <asm/io.h>
+#include <asm/param.h>
#include <asm/processor.h>
#include <asm/ptrace.h>
@@ -107,7 +108,12 @@ hard_smp_processor_id (void)
return lid.f.id << 8 | lid.f.eid;
}
-#define NO_PROC_ID (-1)
+#define NO_PROC_ID 0xffffffff /* no processor magic marker */
+
+/*
+ * Extra overhead to move a task from one cpu to another (due to TLB and cache misses).
+ * Expressed in "negative nice value" units (larger number means higher priority/penalty).
+ */
#define PROC_CHANGE_PENALTY 20
extern void __init init_smp_config (void);
diff --git a/include/asm-ia64/smplock.h b/include/asm-ia64/smplock.h
index aa47e7b8c755..a4b46657293e 100644
--- a/include/asm-ia64/smplock.h
+++ b/include/asm-ia64/smplock.h
@@ -17,7 +17,7 @@ extern spinlock_t kernel_flag;
/*
* Release global kernel lock and global interrupt lock
*/
-static __inline__ void
+static __inline__ void
release_kernel_lock(struct task_struct *task, int cpu)
{
if (task->lock_depth >= 0)
@@ -29,7 +29,7 @@ release_kernel_lock(struct task_struct *task, int cpu)
/*
* Re-acquire the kernel lock
*/
-static __inline__ void
+static __inline__ void
reacquire_kernel_lock(struct task_struct *task)
{
if (task->lock_depth >= 0)
@@ -43,14 +43,14 @@ reacquire_kernel_lock(struct task_struct *task)
* so we only need to worry about other
* CPU's.
*/
-static __inline__ void
+static __inline__ void
lock_kernel(void)
{
if (!++current->lock_depth)
spin_lock(&kernel_flag);
}
-static __inline__ void
+static __inline__ void
unlock_kernel(void)
{
if (--current->lock_depth < 0)
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
index 3a6d2e0e7cf4..7e4d3863ce19 100644
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -2,8 +2,8 @@
#define _ASM_IA64_SPINLOCK_H
/*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
*
* This file is used for SMP configurations only.
@@ -39,7 +39,7 @@ typedef struct {
"mov r30=1\n" \
"mov ar.ccv=r0\n" \
";;\n" \
- IA64_SEMFIX"cmpxchg4.acq r30=[%0],r30,ar.ccv\n" \
+ "cmpxchg4.acq r30=[%0],r30,ar.ccv\n" \
";;\n" \
"cmp.ne p15,p0=r30,r0\n" \
"(p15) br.call.spnt.few b7=ia64_spinlock_contention\n" \
@@ -56,7 +56,7 @@ typedef struct {
__asm__ __volatile__ ( \
"mov ar.ccv=r0\n" \
";;\n" \
- IA64_SEMFIX"cmpxchg4.acq %0=[%2],%1,ar.ccv\n" \
+ "cmpxchg4.acq %0=[%2],%1,ar.ccv\n" \
: "=r"(result) : "r"(1), "r"(&(x)->lock) : "ar.ccv", "memory"); \
(result == 0); \
})
@@ -84,11 +84,11 @@ typedef struct {
"mov r29 = 1\n" \
";;\n" \
"1:\n" \
- "ld4 r2 = [%0]\n" \
+ "ld4.bias r2 = [%0]\n" \
";;\n" \
"cmp4.eq p0,p7 = r0,r2\n" \
"(p7) br.cond.spnt.few 1b \n" \
- IA64_SEMFIX"cmpxchg4.acq r2 = [%0], r29, ar.ccv\n" \
+ "cmpxchg4.acq r2 = [%0], r29, ar.ccv\n" \
";;\n" \
"cmp4.eq p0,p7 = r0, r2\n" \
"(p7) br.cond.spnt.few 1b\n" \
@@ -108,15 +108,17 @@ typedef struct {
} rwlock_t;
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0 }
+#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while(0)
+
#define read_lock(rw) \
do { \
int tmp = 0; \
- __asm__ __volatile__ ("1:\t"IA64_SEMFIX"fetchadd4.acq %0 = [%1], 1\n" \
+ __asm__ __volatile__ ("1:\tfetchadd4.acq %0 = [%1], 1\n" \
";;\n" \
"tbit.nz p6,p0 = %0, 31\n" \
"(p6) br.cond.sptk.few 2f\n" \
".section .text.lock,\"ax\"\n" \
- "2:\t"IA64_SEMFIX"fetchadd4.rel %0 = [%1], -1\n" \
+ "2:\tfetchadd4.rel %0 = [%1], -1\n" \
";;\n" \
"3:\tld4.acq %0 = [%1]\n" \
";;\n" \
@@ -132,7 +134,7 @@ do { \
#define read_unlock(rw) \
do { \
int tmp = 0; \
- __asm__ __volatile__ (IA64_SEMFIX"fetchadd4.rel %0 = [%1], -1\n" \
+ __asm__ __volatile__ ("fetchadd4.rel %0 = [%1], -1\n" \
: "=r" (tmp) \
: "r" (rw) \
: "memory"); \
@@ -142,14 +144,14 @@ do { \
do { \
__asm__ __volatile__ ( \
"mov ar.ccv = r0\n" \
- "movl r29 = 0x80000000\n" \
+ "dep r29 = -1, r0, 31, 1\n" \
";;\n" \
"1:\n" \
"ld4 r2 = [%0]\n" \
";;\n" \
"cmp4.eq p0,p7 = r0,r2\n" \
"(p7) br.cond.spnt.few 1b \n" \
- IA64_SEMFIX"cmpxchg4.acq r2 = [%0], r29, ar.ccv\n" \
+ "cmpxchg4.acq r2 = [%0], r29, ar.ccv\n" \
";;\n" \
"cmp4.eq p0,p7 = r0, r2\n" \
"(p7) br.cond.spnt.few 1b\n" \
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index f44f3777de01..777e2ab81080 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -29,15 +29,6 @@
#define GATE_ADDR (0xa000000000000000 + PAGE_SIZE)
#define PERCPU_ADDR (0xa000000000000000 + 2*PAGE_SIZE)
-#if defined(CONFIG_ITANIUM_B0_SPECIFIC) || defined(CONFIG_ITANIUM_B1_SPECIFIC)
- /* Workaround for Errata 97. */
-# define IA64_SEMFIX_INSN mf;
-# define IA64_SEMFIX "mf;"
-#else
-# define IA64_SEMFIX_INSN
-# define IA64_SEMFIX ""
-#endif
-
#ifndef __ASSEMBLY__
#include <linux/kernel.h>
@@ -210,12 +201,12 @@ extern unsigned long __bad_increment_for_ia64_fetch_and_add (void);
({ \
switch (sz) { \
case 4: \
- __asm__ __volatile__ (IA64_SEMFIX"fetchadd4.rel %0=[%1],%2" \
+ __asm__ __volatile__ ("fetchadd4.rel %0=[%1],%2" \
: "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
break; \
\
case 8: \
- __asm__ __volatile__ (IA64_SEMFIX"fetchadd8.rel %0=[%1],%2" \
+ __asm__ __volatile__ ("fetchadd8.rel %0=[%1],%2" \
: "=r"(tmp) : "r"(v), "i"(n) : "memory"); \
break; \
\
@@ -257,22 +248,22 @@ __xchg (unsigned long x, volatile void *ptr, int size)
switch (size) {
case 1:
- __asm__ __volatile (IA64_SEMFIX"xchg1 %0=[%1],%2" : "=r" (result)
+ __asm__ __volatile ("xchg1 %0=[%1],%2" : "=r" (result)
: "r" (ptr), "r" (x) : "memory");
return result;
case 2:
- __asm__ __volatile (IA64_SEMFIX"xchg2 %0=[%1],%2" : "=r" (result)
+ __asm__ __volatile ("xchg2 %0=[%1],%2" : "=r" (result)
: "r" (ptr), "r" (x) : "memory");
return result;
case 4:
- __asm__ __volatile (IA64_SEMFIX"xchg4 %0=[%1],%2" : "=r" (result)
+ __asm__ __volatile ("xchg4 %0=[%1],%2" : "=r" (result)
: "r" (ptr), "r" (x) : "memory");
return result;
case 8:
- __asm__ __volatile (IA64_SEMFIX"xchg8 %0=[%1],%2" : "=r" (result)
+ __asm__ __volatile ("xchg8 %0=[%1],%2" : "=r" (result)
: "r" (ptr), "r" (x) : "memory");
return result;
}
@@ -313,22 +304,22 @@ extern long __cmpxchg_called_with_bad_pointer(void);
__asm__ __volatile__ ("mov ar.ccv=%0;;" :: "rO"(_o_)); \
switch (size) { \
case 1: \
- __asm__ __volatile__ (IA64_SEMFIX"cmpxchg1."sem" %0=[%1],%2,ar.ccv" \
+ __asm__ __volatile__ ("cmpxchg1."sem" %0=[%1],%2,ar.ccv" \
: "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
break; \
\
case 2: \
- __asm__ __volatile__ (IA64_SEMFIX"cmpxchg2."sem" %0=[%1],%2,ar.ccv" \
+ __asm__ __volatile__ ("cmpxchg2."sem" %0=[%1],%2,ar.ccv" \
: "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
break; \
\
case 4: \
- __asm__ __volatile__ (IA64_SEMFIX"cmpxchg4."sem" %0=[%1],%2,ar.ccv" \
+ __asm__ __volatile__ ("cmpxchg4."sem" %0=[%1],%2,ar.ccv" \
: "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
break; \
\
case 8: \
- __asm__ __volatile__ (IA64_SEMFIX"cmpxchg8."sem" %0=[%1],%2,ar.ccv" \
+ __asm__ __volatile__ ("cmpxchg8."sem" %0=[%1],%2,ar.ccv" \
: "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \
break; \
\
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index e2f8d278e727..4ca8ff0fd67c 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -4,8 +4,8 @@
/*
* IA-64 Linux syscall numbers and inline-functions.
*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <asm/break.h>
@@ -93,7 +93,7 @@
#define __NR_setpriority 1102
#define __NR_statfs 1103
#define __NR_fstatfs 1104
-/* unused; used to be __NR_ioperm */
+#define __NR_gettid 1105
#define __NR_semget 1106
#define __NR_semop 1107
#define __NR_semctl 1108
@@ -205,6 +205,7 @@
#define __NR_clone2 1213
#define __NR_getdents64 1214
#define __NR_getunwind 1215
+#define __NR_readahead 1216
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
diff --git a/include/asm-ia64/user.h b/include/asm-ia64/user.h
index 84fbe50fdabe..a6ff8db22b66 100644
--- a/include/asm-ia64/user.h
+++ b/include/asm-ia64/user.h
@@ -24,11 +24,12 @@
* current->start_stack, so we round each of these in order to be able
* to write an integer number of pages.
*
- * Copyright (C) 1998, 1999 Hewlett-Packard Co
- * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/ptrace.h>
+#include <linux/types.h>
#include <asm/page.h>
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index 1d3c1957f580..074e2ca82f6c 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -20,7 +20,7 @@
* S390 uses 'Compare And Swap' for atomicity in SMP enviroment
*/
-typedef struct { volatile int counter; } atomic_t __attribute__ ((aligned (4)));
+typedef struct { volatile int counter; } __attribute__ ((aligned (4))) atomic_t;
#define ATOMIC_INIT(i) { (i) }
#define atomic_eieio() __asm__ __volatile__ ("BCR 15,0")
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 80fdd6c2e912..65be6c7f4c03 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -23,7 +23,7 @@
#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_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 */
diff --git a/include/asm-s390/gdb-stub.h b/include/asm-s390/gdb-stub.h
index e97c80b76bba..fce5f82b5bad 100644
--- a/include/asm-s390/gdb-stub.h
+++ b/include/asm-s390/gdb-stub.h
@@ -14,7 +14,7 @@
extern int gdb_stub_initialised;
extern void gdb_stub_handle_exception(struct gdb_pt_regs *regs,int sigval);
struct net_device;
-struct net_device *gdb_dev;
+extern struct net_device *gdb_dev;
void gdb_do_timers(void);
extern int putDebugChar(char c); /* write a single character */
extern char getDebugChar(void); /* read and return a single char */
diff --git a/include/asm-s390/irq.h b/include/asm-s390/irq.h
index 626af86e574d..49a2ba0fd36d 100644
--- a/include/asm-s390/irq.h
+++ b/include/asm-s390/irq.h
@@ -313,7 +313,7 @@ typedef struct {
scsw_t scsw; /* subchannel status word */
esw_t esw; /* extended status word */
__u8 ecw[32]; /* extended control word */
- } irb_t __attribute__ ((packed,aligned(4)));
+ } __attribute__ ((packed,aligned(4))) irb_t;
#ifdef __KERNEL__
/*
diff --git a/include/asm-s390/sigcontext.h b/include/asm-s390/sigcontext.h
index 25c65e26a85f..eb7cc38df7bb 100644
--- a/include/asm-s390/sigcontext.h
+++ b/include/asm-s390/sigcontext.h
@@ -26,14 +26,14 @@ typedef struct
{
unsigned long mask;
unsigned long addr;
-} _psw_t __attribute__ ((aligned(8)));
+} __attribute__ ((aligned(8))) _psw_t;
typedef struct
{
_psw_t psw;
unsigned long gprs[__NUM_GPRS];
unsigned int acrs[__NUM_ACRS];
-} _s390_regs_common __attribute__ ((packed));
+} _s390_regs_common;
typedef struct
{
diff --git a/include/asm-s390/vtoc.h b/include/asm-s390/vtoc.h
index f3310604374e..894abe2b8c50 100644
--- a/include/asm-s390/vtoc.h
+++ b/include/asm-s390/vtoc.h
@@ -190,7 +190,7 @@ typedef struct format5_label
ds5ext_t DS5EXTAV[7]; /* seven available extents */
__u8 DS5FMTID; /* format identifier */
ds5ext_t DS5MAVET[18]; /* eighteen available extents */
- cchhb_t DS5PTRDS[5]; /* pointer to next format5 DSCB */
+ cchhb_t DS5PTRDS; /* pointer to next format5 DSCB */
} __attribute__ ((packed)) format5_label_t;
diff --git a/include/asm-s390x/atomic.h b/include/asm-s390x/atomic.h
index a96e1786c058..f1385247c69b 100644
--- a/include/asm-s390x/atomic.h
+++ b/include/asm-s390x/atomic.h
@@ -20,7 +20,7 @@
* S390 uses 'Compare And Swap' for atomicity in SMP enviroment
*/
-typedef struct { volatile int counter; } atomic_t __attribute__ ((aligned (4)));
+typedef struct { volatile int counter; } __attribute__ ((aligned (4))) atomic_t;
#define ATOMIC_INIT(i) { (i) }
#define atomic_eieio() __asm__ __volatile__ ("BCR 15,0")
diff --git a/include/asm-s390x/fcntl.h b/include/asm-s390x/fcntl.h
index 63c92ded4994..72d6e75623e0 100644
--- a/include/asm-s390x/fcntl.h
+++ b/include/asm-s390x/fcntl.h
@@ -23,7 +23,7 @@
#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_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 */
diff --git a/include/asm-s390x/irq.h b/include/asm-s390x/irq.h
index 626af86e574d..49a2ba0fd36d 100644
--- a/include/asm-s390x/irq.h
+++ b/include/asm-s390x/irq.h
@@ -313,7 +313,7 @@ typedef struct {
scsw_t scsw; /* subchannel status word */
esw_t esw; /* extended status word */
__u8 ecw[32]; /* extended control word */
- } irb_t __attribute__ ((packed,aligned(4)));
+ } __attribute__ ((packed,aligned(4))) irb_t;
#ifdef __KERNEL__
/*
diff --git a/include/asm-s390x/s390-regs-common.h b/include/asm-s390x/s390-regs-common.h
deleted file mode 100644
index cd93f3ef40e9..000000000000
--- a/include/asm-s390x/s390-regs-common.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * include/asm-s390/s390-regs-common.h
- *
- * S390 version
- * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
- * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
- *
- * this file is designed to keep as much compatibility between
- * gdb's representation of registers & the kernels representation of registers
- * as possible so as to minimise translation between gdb registers &
- * kernel registers please keep this matched with gdb & strace
- */
-
-#ifndef _S390_REGS_COMMON_H
-#define _S390_REGS_COMMON_H
-#ifndef __ASSEMBLY__
-#include <asm/types.h>
-#endif
-#if defined(WANT_S390_TGT_DEFS) || defined(__KERNEL__)
-#define REGISTER_SIZE 8
-#endif
-#define NUM_GPRS 16
-#define GPR_SIZE 8
-#define PSW_MASK_SIZE 8
-#define PSW_ADDR_SIZE 8
-#define NUM_FPRS 16
-#define FPR_SIZE 8
-#define FPC_SIZE 4
-#define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */
-#define NUM_CRS 16
-#define CR_SIZE 8
-#define NUM_ACRS 16
-#define ACR_SIZE 4
-
-#define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */
-
-#ifndef __ASSEMBLY__
-/* this typedef defines how a Program Status Word looks like */
-typedef struct
-{
- __u64 mask;
- __u64 addr;
-} psw_t __attribute__ ((aligned(8)));
-
-typedef __u64 gpr_t;
-
-/* 2 __u32's are used for floats instead to compile with a __STRICT_ANSI__ defined */
-typedef union
-{
-#ifdef __KERNEL__
- __u64 d; /* mathemu.h gets upset otherwise */
-#else
- double d; /* ansi c dosen't like long longs & make sure that */
- /* alignments are identical for both compiles */
-#endif
- struct
- {
- __u32 hi;
- __u32 lo;
- } fp;
- __u32 f;
-} freg_t;
-
-typedef struct
-{
-/*
- The compiler appears to like aligning freg_t on an 8 byte boundary
- so I always access fpregs, this was causing fun when I was doing
- coersions.
- */
- __u32 fpc;
- freg_t fprs[NUM_FPRS];
-} s390_fp_regs;
-
-#define FPC_EXCEPTION_MASK 0xF8000000
-#define FPC_FLAGS_MASK 0x00F80000
-#define FPC_DXC_MASK 0x0000FF00
-#define FPC_RM_MASK 0x00000003
-#define FPC_VALID_MASK ((FPC_EXCEPTION_MASK|FPC_FLAGS_MASK| \
- FPC_DXC_MASK|FPC_RM_MASK))
-
-
-/*
- gdb structures & the kernel have this much always in common
- */
-#define S390_REGS_COMMON \
-psw_t psw; \
-__u64 gprs[NUM_GPRS]; \
-__u32 acrs[NUM_ACRS]; \
-
-typedef struct
-{
- S390_REGS_COMMON
-} s390_regs_common __attribute__ ((packed));
-
-
-/* Sequence of bytes for breakpoint illegal instruction. */
-#define S390_BREAKPOINT {0x0,0x1}
-#define S390_BREAKPOINT_U16 ((__u16)0x0001)
-#define S390_SYSCALL_OPCODE ((__u16)0x0a00)
-#define S390_SYSCALL_SIZE 2
-#if defined(WANT_S390_TGT_DEFS) || defined(__KERNEL__)
-#define ADDR_BITS_REMOVE(addr) ((addr))
-#endif
-#endif
-#endif
-
-
-
-
-
-
-
-
-
diff --git a/include/asm-s390x/sigcontext.h b/include/asm-s390x/sigcontext.h
index 68aaebfbe669..6799affcec85 100644
--- a/include/asm-s390x/sigcontext.h
+++ b/include/asm-s390x/sigcontext.h
@@ -24,14 +24,14 @@ typedef struct
{
unsigned long mask;
unsigned long addr;
-} _psw_t __attribute__ ((aligned(8)));
+} __attribute__ ((aligned(8))) _psw_t;
typedef struct
{
_psw_t psw;
unsigned long gprs[__NUM_GPRS];
unsigned int acrs[__NUM_ACRS];
-} _s390_regs_common __attribute__ ((packed));
+} _s390_regs_common;
typedef struct
{
diff --git a/include/asm-s390x/spinlock.h b/include/asm-s390x/spinlock.h
index b0dc918b395c..56d4148d1c45 100644
--- a/include/asm-s390x/spinlock.h
+++ b/include/asm-s390x/spinlock.h
@@ -20,7 +20,7 @@
typedef struct {
volatile unsigned int lock;
-} spinlock_t __attribute__ ((aligned (8)));
+} __attribute__ ((aligned (4))) spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#define spin_lock_init(lp) do { (lp)->lock = 0; } while(0)
diff --git a/include/asm-s390x/vtoc.h b/include/asm-s390x/vtoc.h
index 4a7927896ed5..894abe2b8c50 100644
--- a/include/asm-s390x/vtoc.h
+++ b/include/asm-s390x/vtoc.h
@@ -39,135 +39,6 @@
#define VTOC_ERROR "VTOC error:"
-enum failure {unable_to_open,
- unable_to_seek,
- unable_to_write,
- unable_to_read};
-
-unsigned char ASCtoEBC[256] =
-{
- /*00 NL SH SX EX ET NQ AK BL */
- 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F,
- /*08 BS HT LF VT FF CR SO SI */
- 0x16, 0x05, 0x15, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- /*10 DL D1 D2 D3 D4 NK SN EB */
- 0x10, 0x11, 0x12, 0x13, 0x3C, 0x15, 0x32, 0x26,
- /*18 CN EM SB EC FS GS RS US */
- 0x18, 0x19, 0x3F, 0x27, 0x1C, 0x1D, 0x1E, 0x1F,
- /*20 SP ! " # $ % & ' */
- 0x40, 0x5A, 0x7F, 0x7B, 0x5B, 0x6C, 0x50, 0x7D,
- /*28 ( ) * + , - . / */
- 0x4D, 0x5D, 0x5C, 0x4E, 0x6B, 0x60, 0x4B, 0x61,
- /*30 0 1 2 3 4 5 6 7 */
- 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
- /*38 8 9 : ; < = > ? */
- 0xF8, 0xF9, 0x7A, 0x5E, 0x4C, 0x7E, 0x6E, 0x6F,
- /*40 @ A B C D E F G */
- 0x7C, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
- /*48 H I J K L M N O */
- 0xC8, 0xC9, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6,
- /*50 P Q R S T U V W */
- 0xD7, 0xD8, 0xD9, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6,
- /*58 X Y Z [ \ ] ^ _ */
- 0xE7, 0xE8, 0xE9, 0xAD, 0xE0, 0xBD, 0x5F, 0x6D,
- /*60 ` a b c d e f g */
- 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
- /*68 h i j k l m n o */
- 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
- /*70 p q r s t u v w */
- 0x97, 0x98, 0x99, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6,
- /*78 x y z { | } ~ DL */
- 0xA7, 0xA8, 0xA9, 0xC0, 0x4F, 0xD0, 0xA1, 0x07,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
- 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0xFF
-};
-
-
-unsigned char EBCtoASC[256] =
-{
- /* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
- 0x00, 0x01, 0x02, 0x03, 0x07, 0x09, 0x07, 0x7F,
- /* 0x08 -GE -SPS -RPT VT FF CR SO SI */
- 0x07, 0x07, 0x07, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- /* 0x10 DLE DC1 DC2 DC3 -RES -NL BS -POC
- -ENP ->LF */
- 0x10, 0x11, 0x12, 0x13, 0x07, 0x0A, 0x08, 0x07,
- /* 0x18 CAN EM -UBS -CU1 -IFS -IGS -IRS -ITB
- -IUS */
- 0x18, 0x19, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- /* 0x20 -DS -SOS FS -WUS -BYP LF ETB ESC
- -INP */
- 0x07, 0x07, 0x1C, 0x07, 0x07, 0x0A, 0x17, 0x1B,
- /* 0x28 -SA -SFE -SM -CSP -MFA ENQ ACK BEL
- -SW */
- 0x07, 0x07, 0x07, 0x07, 0x07, 0x05, 0x06, 0x07,
- /* 0x30 ---- ---- SYN -IR -PP -TRN -NBS EOT */
- 0x07, 0x07, 0x16, 0x07, 0x07, 0x07, 0x07, 0x04,
- /* 0x38 -SBS -IT -RFF -CU3 DC4 NAK ---- SUB */
- 0x07, 0x07, 0x07, 0x07, 0x14, 0x15, 0x07, 0x1A,
- /* 0x40 SP RSP ä ---- */
- 0x20, 0xFF, 0x83, 0x84, 0x85, 0xA0, 0x07, 0x86,
- /* 0x48 . < ( + | */
- 0x87, 0xA4, 0x9B, 0x2E, 0x3C, 0x28, 0x2B, 0x7C,
- /* 0x50 & ---- */
- 0x26, 0x82, 0x88, 0x89, 0x8A, 0xA1, 0x8C, 0x07,
- /* 0x58 ß ! $ * ) ; */
- 0x8D, 0xE1, 0x21, 0x24, 0x2A, 0x29, 0x3B, 0xAA,
- /* 0x60 - / ---- Ä ---- ---- ---- */
- 0x2D, 0x2F, 0x07, 0x8E, 0x07, 0x07, 0x07, 0x8F,
- /* 0x68 ---- , % _ > ? */
- 0x80, 0xA5, 0x07, 0x2C, 0x25, 0x5F, 0x3E, 0x3F,
- /* 0x70 ---- ---- ---- ---- ---- ---- ---- */
- 0x07, 0x90, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
- /* 0x78 * ` : # @ ' = " */
- 0x70, 0x60, 0x3A, 0x23, 0x40, 0x27, 0x3D, 0x22,
- /* 0x80 * a b c d e f g */
- 0x07, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
- /* 0x88 h i ---- ---- ---- */
- 0x68, 0x69, 0xAE, 0xAF, 0x07, 0x07, 0x07, 0xF1,
- /* 0x90 ° j k l m n o p */
- 0xF8, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70,
- /* 0x98 q r ---- ---- */
- 0x71, 0x72, 0xA6, 0xA7, 0x91, 0x07, 0x92, 0x07,
- /* 0xA0 ~ s t u v w x */
- 0xE6, 0x7E, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
- /* 0xA8 y z ---- ---- ---- ---- */
- 0x79, 0x7A, 0xAD, 0xAB, 0x07, 0x07, 0x07, 0x07,
- /* 0xB0 ^ ---- § ---- */
- 0x5E, 0x9C, 0x9D, 0xFA, 0x07, 0x07, 0x07, 0xAC,
- /* 0xB8 ---- [ ] ---- ---- ---- ---- */
- 0xAB, 0x07, 0x5B, 0x5D, 0x07, 0x07, 0x07, 0x07,
- /* 0xC0 { A B C D E F G */
- 0x7B, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
- /* 0xC8 H I ---- ö ---- */
- 0x48, 0x49, 0x07, 0x93, 0x94, 0x95, 0xA2, 0x07,
- /* 0xD0 } J K L M N O P */
- 0x7D, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
- /* 0xD8 Q R ---- ü */
- 0x51, 0x52, 0x07, 0x96, 0x81, 0x97, 0xA3, 0x98,
- /* 0xE0 \ S T U V W X */
- 0x5C, 0xF6, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
- /* 0xE8 Y Z ---- Ö ---- ---- ---- */
- 0x59, 0x5A, 0xFD, 0x07, 0x99, 0x07, 0x07, 0x07,
- /* 0xF0 0 1 2 3 4 5 6 7 */
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- /* 0xF8 8 9 ---- ---- Ü ---- ---- ---- */
- 0x38, 0x39, 0x07, 0x07, 0x9A, 0x07, 0x07, 0x07
-};
typedef struct ttr
{
@@ -319,7 +190,7 @@ typedef struct format5_label
ds5ext_t DS5EXTAV[7]; /* seven available extents */
__u8 DS5FMTID; /* format identifier */
ds5ext_t DS5MAVET[18]; /* eighteen available extents */
- cchhb_t DS5PTRDS[5]; /* pointer to next format5 DSCB */
+ cchhb_t DS5PTRDS; /* pointer to next format5 DSCB */
} __attribute__ ((packed)) format5_label_t;
diff --git a/include/linux/acpi_serial.h b/include/linux/acpi_serial.h
new file mode 100644
index 000000000000..c48e64ae12a9
--- /dev/null
+++ b/include/linux/acpi_serial.h
@@ -0,0 +1,103 @@
+/*
+ * linux/include/linux/acpi_serial.h
+ *
+ * Copyright (C) 2000 Hewlett-Packard Co.
+ * Copyright (C) 2000 Khalid Aziz <khalid_aziz@hp.com>
+ *
+ * Definitions for ACPI defined serial ports (headless console and
+ * debug ports)
+ *
+ */
+
+extern void setup_serial_acpi(void *);
+
+/* ACPI table signatures */
+#define ACPI_SPCRT_SIGNATURE "SPCR"
+#define ACPI_DBGPT_SIGNATURE "DBGP"
+
+/* Interface type as defined in ACPI serial port tables */
+#define ACPI_SERIAL_INTFC_16550 0
+#define ACPI_SERIAL_INTFC_16450 1
+
+/* Interrupt types for ACPI serial port tables */
+#define ACPI_SERIAL_INT_PCAT 0x01
+#define ACPI_SERIAL_INT_APIC 0x02
+#define ACPI_SERIAL_INT_SAPIC 0x04
+
+/* Baud rates as defined in ACPI serial port tables */
+#define ACPI_SERIAL_BAUD_9600 3
+#define ACPI_SERIAL_BAUD_19200 4
+#define ACPI_SERIAL_BAUD_57600 6
+#define ACPI_SERIAL_BAUD_115200 7
+
+/* Parity as defined in ACPI serial port tables */
+#define ACPI_SERIAL_PARITY_NONE 0
+
+/* Flow control methods as defined in ACPI serial port tables */
+#define ACPI_SERIAL_FLOW_DCD 0x01
+#define ACPI_SERIAL_FLOW_RTS 0x02
+#define ACPI_SERIAL_FLOW_XON 0x04
+
+/* Terminal types as defined in ACPI serial port tables */
+#define ACPI_SERIAL_TERM_VT100 0
+#define ACPI_SERIAL_TERM_VT100X 1
+
+/* PCI Flags as defined by SPCR table */
+#define ACPI_SERIAL_PCIFLAG_PNP 0x00000001
+
+/* Space ID as defined in base address structure in ACPI serial port tables */
+#define ACPI_SERIAL_MEM_SPACE 0
+#define ACPI_SERIAL_IO_SPACE 1
+#define ACPI_SERIAL_PCICONF_SPACE 2
+
+/*
+ * Generic Register Address Structure - as defined by Microsoft
+ * in http://www.microsoft.com/hwdev/onnow/download/LFreeACPI.doc
+ *
+*/
+typedef struct {
+ u8 space_id;
+ u8 bit_width;
+ u8 bit_offset;
+ u8 resv;
+ u32 addrl;
+ u32 addrh;
+} gen_regaddr;
+
+/* Space ID for generic register address structure */
+#define REGADDR_SPACE_SYSMEM 0
+#define REGADDR_SPACE_SYSIO 1
+#define REGADDR_SPACE_PCICONFIG 2
+
+/* Serial Port Console Redirection and Debug Port Table formats */
+typedef struct {
+ u8 signature[4];
+ u32 length;
+ u8 rev;
+ u8 chksum;
+ u8 oemid[6];
+ u8 oem_tabid[8];
+ u32 oem_rev;
+ u8 creator_id[4];
+ u32 creator_rev;
+ u8 intfc_type;
+ u8 resv1[3];
+ gen_regaddr base_addr;
+ u8 int_type;
+ u8 irq;
+ u8 global_int[4];
+ u8 baud;
+ u8 parity;
+ u8 stop_bits;
+ u8 flow_ctrl;
+ u8 termtype;
+ u8 language;
+ u16 pci_dev_id;
+ u16 pci_vendor_id;
+ u8 pci_bus;
+ u8 pci_dev;
+ u8 pci_func;
+ u8 pci_flags[4];
+ u8 pci_seg;
+ u32 resv2;
+} acpi_ser_t;
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index c8e54a3bb703..7a6cdf75d237 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -46,9 +46,12 @@ enum chipset_type {
INTEL_GX,
INTEL_I810,
INTEL_I815,
+ INTEL_I820,
INTEL_I830_M,
INTEL_I840,
+ INTEL_I845,
INTEL_I850,
+ INTEL_I860,
VIA_GENERIC,
VIA_VP3,
VIA_MVP3,
diff --git a/include/linux/atm.h b/include/linux/atm.h
index ed917611fe7a..b5d4c29ba6c4 100644
--- a/include/linux/atm.h
+++ b/include/linux/atm.h
@@ -235,6 +235,7 @@ struct atmif_sioc {
void *arg;
};
+typedef unsigned short atm_backend_t;
#ifdef __KERNEL__
diff --git a/include/linux/atmapi.h b/include/linux/atmapi.h
index bdf01ef9cbc6..8fe54d90d95b 100644
--- a/include/linux/atmapi.h
+++ b/include/linux/atmapi.h
@@ -6,7 +6,7 @@
#ifndef _LINUX_ATMAPI_H
#define _LINUX_ATMAPI_H
-#ifdef __sparc__
+#if defined(__sparc__) || defined(__ia64__)
/* such alignment is not required on 32 bit sparcs, but we can't
figure that we are on a sparc64 while compiling user-space programs. */
#define __ATM_API_ALIGN __attribute__((aligned(8)))
@@ -24,6 +24,6 @@
* Convention: NULL pointers are passed as a field of all zeroes.
*/
-typedef struct { unsigned char _[8]; } atm_kptr_t;
+typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
#endif
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 2b14cb90f604..6cbbfc53e87f 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -93,6 +93,17 @@ struct atm_dev_stats {
/* query supported loopback modes */
#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
/* enable or disable single-copy */
+#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+ /* set backend handler */
+
+/*
+ * These are backend handkers that can be set via the ATM_SETBACKEND call
+ * above. In the future we may support dynamic loading of these - for now,
+ * they're just being used to share the ATMIOC_BACKEND ioctls
+ */
+#define ATM_BACKEND_RAW 0
+#define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */
+#define ATM_BACKEND_BR_2684 2 /* Bridged RFC1483/2684 */
/* for ATM_GETTYPE */
#define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */
diff --git a/include/linux/atmioc.h b/include/linux/atmioc.h
index 920ac56c5b0b..37f67aa8f1c1 100644
--- a/include/linux/atmioc.h
+++ b/include/linux/atmioc.h
@@ -27,7 +27,9 @@
#define ATMIOC_SARPRV_END 0x7f
#define ATMIOC_ITF 0x80 /* Interface ioctls, globally unique */
#define ATMIOC_ITF_END 0x8f
-/* 0x90-0xbf: Reserved for future use */
+#define ATMIOC_BACKEND 0x90 /* ATM generic backend ioctls, u. per backend */
+#define ATMIOC_BACKEND_END 0xaf
+/* 0xb0-0xbf: Reserved for future use */
#define ATMIOC_AREQUIPA 0xc0 /* Application requested IP over ATM, glob. u. */
#define ATMIOC_LANE 0xd0 /* LAN Emulation, globally unique */
#define ATMIOC_MPOA 0xd8 /* MPOA, globally unique */
diff --git a/include/linux/atmppp.h b/include/linux/atmppp.h
new file mode 100644
index 000000000000..300dcce0c83f
--- /dev/null
+++ b/include/linux/atmppp.h
@@ -0,0 +1,24 @@
+/* atmppp.h - RFC2364 PPPoATM */
+
+/* Written 2000 by Mitchell Blank Jr */
+
+#ifndef _LINUX_ATMPPP_H
+#define _LINUX_ATMPPP_H
+
+#include <linux/atm.h>
+
+#define PPPOATM_ENCAPS_AUTODETECT (0)
+#define PPPOATM_ENCAPS_VC (1)
+#define PPPOATM_ENCAPS_LLC (2)
+
+/*
+ * This is for the ATM_SETBACKEND call - these are like socket families:
+ * the first element of the structure is the backend number and the rest
+ * is per-backend specific
+ */
+struct atm_backend_ppp {
+ atm_backend_t backend_num; /* ATM_BACKEND_PPP */
+ int encaps; /* PPPOATM_ENCAPS_* */
+};
+
+#endif /* _LINUX_ATMPPP_H */
diff --git a/include/linux/blk.h b/include/linux/blk.h
index f9ac09edbcd4..b09f5afa9156 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -46,11 +46,13 @@ extern int ez_init(void);
extern int bpcd_init(void);
extern int ps2esdi_init(void);
extern int jsfd_init(void);
+extern int viodasd_init(void);
+extern int viocd_init(void);
#if defined(CONFIG_ARCH_S390)
-extern int mdisk_init(void);
extern int dasd_init(void);
extern int xpram_init(void);
+extern int tapeblock_init(void);
#endif /* CONFIG_ARCH_S390 */
extern void set_device_ro(kdev_t dev,int flag);
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 945fabb5e2a8..73e972803015 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -249,6 +249,8 @@ typedef __u32 kernel_cap_t;
/* Override resource limits. Set resource limits. */
/* Override quota limits. */
/* Override reserved space on ext2 filesystem */
+/* Modify data journaling mode on ext3 filesystem (uses journaling
+ resources) */
/* NOTE: ext2 honors fsuid when checking for resource overrides, so
you can override using fsuid too */
/* Override size restrictions on IPC message queues */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index bac34263ade0..b1f8185eb47c 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -3,6 +3,7 @@
*
* Copyright (C) 1998 David S. Miller (davem@redhat.com)
* Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com>
+ * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
*/
#ifndef _LINUX_ETHTOOL_H
@@ -25,17 +26,18 @@ struct ethtool_cmd {
u32 reserved[4];
};
+#define ETHTOOL_BUSINFO_LEN 32
/* these strings are set to whatever the driver author decides... */
struct ethtool_drvinfo {
u32 cmd;
char driver[32]; /* driver short name, "tulip", "eepro100" */
char version[32]; /* driver version string */
char fw_version[32]; /* firmware version string, if applicable */
- char bus_info[32]; /* Bus info for this interface. For PCI
- * devices, use pci_dev->slot_name. */
+ char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */
+ /* For PCI devices, use pci_dev->slot_name. */
char reserved1[32];
char reserved2[28];
- u32 regdump_len; /* Amount of data from ETHTOOL_GREGS */
+ u32 regdump_len; /* Amount of data from ETHTOOL_GREGS (u32s) */
};
#define SOPASS_MAX 6
@@ -47,6 +49,20 @@ struct ethtool_wolinfo {
u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
};
+/* for passing single values */
+struct ethtool_value {
+ u32 cmd;
+ u32 data;
+};
+
+/* for passing big chunks of data */
+struct ethtool_regs {
+ u32 cmd;
+ u32 version; /* driver-specific, indicates different chips/revs */
+ u32 len; /* in u32 increments */
+ u32 data[0];
+};
+
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
#define ETHTOOL_SSET 0x00000002 /* Set settings, privileged. */
@@ -56,7 +72,8 @@ struct ethtool_wolinfo {
#define ETHTOOL_SWOL 0x00000006 /* Set wake-on-lan options, priv. */
#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level, priv. */
-#define ETHTOOL_NWAY_RST 0X00000009 /* Restart autonegotiation, priv. */
+#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation, priv. */
+#define ETHTOOL_GLINK 0x0000000a /* Get link status */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -74,7 +91,7 @@ struct ethtool_wolinfo {
#define SUPPORTED_AUI (1 << 8)
#define SUPPORTED_MII (1 << 9)
#define SUPPORTED_FIBRE (1 << 10)
-#define SUPPORTED_10base2 (1 << 11)
+#define SUPPORTED_BNC (1 << 11)
/* Indicates what features are advertised by the interface. */
#define ADVERTISED_10baseT_Half (1 << 0)
@@ -88,7 +105,7 @@ struct ethtool_wolinfo {
#define ADVERTISED_AUI (1 << 8)
#define ADVERTISED_MII (1 << 9)
#define ADVERTISED_FIBRE (1 << 10)
-#define ADVERTISED_10base2 (1 << 11)
+#define ADVERTISED_BNC (1 << 11)
/* The following are all involved in forcing a particular link
* mode for the device for setting things. When getting the
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
new file mode 100644
index 000000000000..f227747b2c58
--- /dev/null
+++ b/include/linux/ext3_fs.h
@@ -0,0 +1,715 @@
+/*
+ * linux/include/linux/ext3_fs.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT3_FS_H
+#define _LINUX_EXT3_FS_H
+
+#include <linux/types.h>
+
+/*
+ * The second extended filesystem constants/structures
+ */
+
+/*
+ * Define EXT3FS_DEBUG to produce debug messages
+ */
+#undef EXT3FS_DEBUG
+
+/*
+ * Define EXT3_PREALLOCATE to preallocate data blocks for expanding files
+ */
+#undef EXT3_PREALLOCATE /* @@@ Fix this! */
+#define EXT3_DEFAULT_PREALLOC_BLOCKS 8
+
+/*
+ * The second extended file system version
+ */
+#define EXT3FS_DATE "06 Nov 2001"
+#define EXT3FS_VERSION "2.4-0.9.15"
+
+/*
+ * Debug code
+ */
+#ifdef EXT3FS_DEBUG
+#define ext3_debug(f, a...) \
+ do { \
+ printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:", \
+ __FILE__, __LINE__, __FUNCTION__); \
+ printk (KERN_DEBUG f, ## a); \
+ } while (0)
+#else
+#define ext3_debug(f, a...) do {} while (0)
+#endif
+
+/*
+ * Special inodes numbers
+ */
+#define EXT3_BAD_INO 1 /* Bad blocks inode */
+#define EXT3_ROOT_INO 2 /* Root inode */
+#define EXT3_ACL_IDX_INO 3 /* ACL inode */
+#define EXT3_ACL_DATA_INO 4 /* ACL inode */
+#define EXT3_BOOT_LOADER_INO 5 /* Boot loader inode */
+#define EXT3_UNDEL_DIR_INO 6 /* Undelete directory inode */
+#define EXT3_RESIZE_INO 7 /* Reserved group descriptors inode */
+#define EXT3_JOURNAL_INO 8 /* Journal inode */
+
+/* First non-reserved inode for old ext3 filesystems */
+#define EXT3_GOOD_OLD_FIRST_INO 11
+
+/*
+ * The second extended file system magic number
+ */
+#define EXT3_SUPER_MAGIC 0xEF53
+
+/*
+ * Maximal count of links to a file
+ */
+#define EXT3_LINK_MAX 32000
+
+/*
+ * Macro-instructions used to manage several block sizes
+ */
+#define EXT3_MIN_BLOCK_SIZE 1024
+#define EXT3_MAX_BLOCK_SIZE 4096
+#define EXT3_MIN_BLOCK_LOG_SIZE 10
+#ifdef __KERNEL__
+# define EXT3_BLOCK_SIZE(s) ((s)->s_blocksize)
+#else
+# define EXT3_BLOCK_SIZE(s) (EXT3_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#endif
+#define EXT3_ACLE_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (struct ext3_acl_entry))
+#define EXT3_ADDR_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (__u32))
+#ifdef __KERNEL__
+# define EXT3_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
+#else
+# define EXT3_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#endif
+#ifdef __KERNEL__
+#define EXT3_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext3_sb.s_addr_per_block_bits)
+#define EXT3_INODE_SIZE(s) ((s)->u.ext3_sb.s_inode_size)
+#define EXT3_FIRST_INO(s) ((s)->u.ext3_sb.s_first_ino)
+#else
+#define EXT3_INODE_SIZE(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? \
+ EXT3_GOOD_OLD_INODE_SIZE : \
+ (s)->s_inode_size)
+#define EXT3_FIRST_INO(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ? \
+ EXT3_GOOD_OLD_FIRST_INO : \
+ (s)->s_first_ino)
+#endif
+
+/*
+ * Macro-instructions used to manage fragments
+ */
+#define EXT3_MIN_FRAG_SIZE 1024
+#define EXT3_MAX_FRAG_SIZE 4096
+#define EXT3_MIN_FRAG_LOG_SIZE 10
+#ifdef __KERNEL__
+# define EXT3_FRAG_SIZE(s) ((s)->u.ext3_sb.s_frag_size)
+# define EXT3_FRAGS_PER_BLOCK(s) ((s)->u.ext3_sb.s_frags_per_block)
+#else
+# define EXT3_FRAG_SIZE(s) (EXT3_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+# define EXT3_FRAGS_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / EXT3_FRAG_SIZE(s))
+#endif
+
+/*
+ * ACL structures
+ */
+struct ext3_acl_header /* Header of Access Control Lists */
+{
+ __u32 aclh_size;
+ __u32 aclh_file_count;
+ __u32 aclh_acle_count;
+ __u32 aclh_first_acle;
+};
+
+struct ext3_acl_entry /* Access Control List Entry */
+{
+ __u32 acle_size;
+ __u16 acle_perms; /* Access permissions */
+ __u16 acle_type; /* Type of entry */
+ __u16 acle_tag; /* User or group identity */
+ __u16 acle_pad1;
+ __u32 acle_next; /* Pointer on next entry for the */
+ /* same inode or on next free entry */
+};
+
+/*
+ * Structure of a blocks group descriptor
+ */
+struct ext3_group_desc
+{
+ __u32 bg_block_bitmap; /* Blocks bitmap block */
+ __u32 bg_inode_bitmap; /* Inodes bitmap block */
+ __u32 bg_inode_table; /* Inodes table block */
+ __u16 bg_free_blocks_count; /* Free blocks count */
+ __u16 bg_free_inodes_count; /* Free inodes count */
+ __u16 bg_used_dirs_count; /* Directories count */
+ __u16 bg_pad;
+ __u32 bg_reserved[3];
+};
+
+/*
+ * Macro-instructions used to manage group descriptors
+ */
+#ifdef __KERNEL__
+# define EXT3_BLOCKS_PER_GROUP(s) ((s)->u.ext3_sb.s_blocks_per_group)
+# define EXT3_DESC_PER_BLOCK(s) ((s)->u.ext3_sb.s_desc_per_block)
+# define EXT3_INODES_PER_GROUP(s) ((s)->u.ext3_sb.s_inodes_per_group)
+# define EXT3_DESC_PER_BLOCK_BITS(s) ((s)->u.ext3_sb.s_desc_per_block_bits)
+#else
+# define EXT3_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+# define EXT3_DESC_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (struct ext3_group_desc))
+# define EXT3_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+#endif
+
+/*
+ * Constants relative to the data blocks
+ */
+#define EXT3_NDIR_BLOCKS 12
+#define EXT3_IND_BLOCK EXT3_NDIR_BLOCKS
+#define EXT3_DIND_BLOCK (EXT3_IND_BLOCK + 1)
+#define EXT3_TIND_BLOCK (EXT3_DIND_BLOCK + 1)
+#define EXT3_N_BLOCKS (EXT3_TIND_BLOCK + 1)
+
+/*
+ * Inode flags
+ */
+#define EXT3_SECRM_FL 0x00000001 /* Secure deletion */
+#define EXT3_UNRM_FL 0x00000002 /* Undelete */
+#define EXT3_COMPR_FL 0x00000004 /* Compress file */
+#define EXT3_SYNC_FL 0x00000008 /* Synchronous updates */
+#define EXT3_IMMUTABLE_FL 0x00000010 /* Immutable file */
+#define EXT3_APPEND_FL 0x00000020 /* writes to file may only append */
+#define EXT3_NODUMP_FL 0x00000040 /* do not dump file */
+#define EXT3_NOATIME_FL 0x00000080 /* do not update atime */
+/* Reserved for compression usage... */
+#define EXT3_DIRTY_FL 0x00000100
+#define EXT3_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */
+#define EXT3_NOCOMPR_FL 0x00000400 /* Don't compress */
+#define EXT3_ECOMPR_FL 0x00000800 /* Compression error */
+/* End compression flags --- maybe not all used */
+#define EXT3_INDEX_FL 0x00001000 /* hash-indexed directory */
+#define EXT3_IMAGIC_FL 0x00002000 /* AFS directory */
+#define EXT3_JOURNAL_DATA_FL 0x00004000 /* file data should be journaled */
+#define EXT3_RESERVED_FL 0x80000000 /* reserved for ext3 lib */
+
+#define EXT3_FL_USER_VISIBLE 0x00005FFF /* User visible flags */
+#define EXT3_FL_USER_MODIFIABLE 0x000000FF /* User modifiable flags */
+
+/*
+ * Inode dynamic state flags
+ */
+#define EXT3_STATE_JDATA 0x00000001 /* journaled data exists */
+#define EXT3_STATE_NEW 0x00000002 /* inode is newly created */
+
+/*
+ * ioctl commands
+ */
+#define EXT3_IOC_GETFLAGS _IOR('f', 1, long)
+#define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
+#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
+#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
+#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
+#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
+#ifdef CONFIG_JBD_DEBUG
+#define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
+#endif
+
+/*
+ * Structure of an inode on the disk
+ */
+struct ext3_inode {
+ __u16 i_mode; /* File mode */
+ __u16 i_uid; /* Low 16 bits of Owner Uid */
+ __u32 i_size; /* Size in bytes */
+ __u32 i_atime; /* Access time */
+ __u32 i_ctime; /* Creation time */
+ __u32 i_mtime; /* Modification time */
+ __u32 i_dtime; /* Deletion Time */
+ __u16 i_gid; /* Low 16 bits of Group Id */
+ __u16 i_links_count; /* Links count */
+ __u32 i_blocks; /* Blocks count */
+ __u32 i_flags; /* File flags */
+ union {
+ struct {
+ __u32 l_i_reserved1;
+ } linux1;
+ struct {
+ __u32 h_i_translator;
+ } hurd1;
+ struct {
+ __u32 m_i_reserved1;
+ } masix1;
+ } osd1; /* OS dependent 1 */
+ __u32 i_block[EXT3_N_BLOCKS];/* Pointers to blocks */
+ __u32 i_generation; /* File version (for NFS) */
+ __u32 i_file_acl; /* File ACL */
+ __u32 i_dir_acl; /* Directory ACL */
+ __u32 i_faddr; /* Fragment address */
+ union {
+ struct {
+ __u8 l_i_frag; /* Fragment number */
+ __u8 l_i_fsize; /* Fragment size */
+ __u16 i_pad1;
+ __u16 l_i_uid_high; /* these 2 fields */
+ __u16 l_i_gid_high; /* were reserved2[0] */
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag; /* Fragment number */
+ __u8 h_i_fsize; /* Fragment size */
+ __u16 h_i_mode_high;
+ __u16 h_i_uid_high;
+ __u16 h_i_gid_high;
+ __u32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag; /* Fragment number */
+ __u8 m_i_fsize; /* Fragment size */
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2; /* OS dependent 2 */
+};
+
+#define i_size_high i_dir_acl
+
+#if defined(__KERNEL__) || defined(__linux__)
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+
+#elif defined(__GNU__)
+
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag;
+#define i_fsize osd2.hurd2.h_i_fsize;
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+
+#elif defined(__masix__)
+
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+
+#endif /* defined(__KERNEL__) || defined(__linux__) */
+
+/*
+ * File system states
+ */
+#define EXT3_VALID_FS 0x0001 /* Unmounted cleanly */
+#define EXT3_ERROR_FS 0x0002 /* Errors detected */
+#define EXT3_ORPHAN_FS 0x0004 /* Orphans being recovered */
+
+/*
+ * Mount flags
+ */
+#define EXT3_MOUNT_CHECK 0x0001 /* Do mount-time checks */
+#define EXT3_MOUNT_GRPID 0x0004 /* Create files with directory's group */
+#define EXT3_MOUNT_DEBUG 0x0008 /* Some debugging messages */
+#define EXT3_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */
+#define EXT3_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */
+#define EXT3_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */
+#define EXT3_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */
+#define EXT3_MOUNT_NOLOAD 0x0100 /* Don't use existing journal*/
+#define EXT3_MOUNT_ABORT 0x0200 /* Fatal error detected */
+#define EXT3_MOUNT_DATA_FLAGS 0x0C00 /* Mode for data writes: */
+ #define EXT3_MOUNT_JOURNAL_DATA 0x0400 /* Write data to journal */
+ #define EXT3_MOUNT_ORDERED_DATA 0x0800 /* Flush data before commit */
+ #define EXT3_MOUNT_WRITEBACK_DATA 0x0C00 /* No data ordering */
+#define EXT3_MOUNT_UPDATE_JOURNAL 0x1000 /* Update the journal format */
+#define EXT3_MOUNT_NO_UID32 0x2000 /* Disable 32-bit UIDs */
+
+/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
+#ifndef _LINUX_EXT2_FS_H
+#define clear_opt(o, opt) o &= ~EXT3_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT3_MOUNT_##opt
+#define test_opt(sb, opt) ((sb)->u.ext3_sb.s_mount_opt & \
+ EXT3_MOUNT_##opt)
+#else
+#define EXT2_MOUNT_NOLOAD EXT3_MOUNT_NOLOAD
+#define EXT2_MOUNT_ABORT EXT3_MOUNT_ABORT
+#endif
+
+#define ext3_set_bit ext2_set_bit
+#define ext3_clear_bit ext2_clear_bit
+#define ext3_test_bit ext2_test_bit
+#define ext3_find_first_zero_bit ext2_find_first_zero_bit
+#define ext3_find_next_zero_bit ext2_find_next_zero_bit
+
+/*
+ * Maximal mount counts between two filesystem checks
+ */
+#define EXT3_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */
+#define EXT3_DFL_CHECKINTERVAL 0 /* Don't use interval check */
+
+/*
+ * Behaviour when detecting errors
+ */
+#define EXT3_ERRORS_CONTINUE 1 /* Continue execution */
+#define EXT3_ERRORS_RO 2 /* Remount fs read-only */
+#define EXT3_ERRORS_PANIC 3 /* Panic */
+#define EXT3_ERRORS_DEFAULT EXT3_ERRORS_CONTINUE
+
+/*
+ * Structure of the super block
+ */
+struct ext3_super_block {
+/*00*/ __u32 s_inodes_count; /* Inodes count */
+ __u32 s_blocks_count; /* Blocks count */
+ __u32 s_r_blocks_count; /* Reserved blocks count */
+ __u32 s_free_blocks_count; /* Free blocks count */
+/*10*/ __u32 s_free_inodes_count; /* Free inodes count */
+ __u32 s_first_data_block; /* First Data Block */
+ __u32 s_log_block_size; /* Block size */
+ __s32 s_log_frag_size; /* Fragment size */
+/*20*/ __u32 s_blocks_per_group; /* # Blocks per group */
+ __u32 s_frags_per_group; /* # Fragments per group */
+ __u32 s_inodes_per_group; /* # Inodes per group */
+ __u32 s_mtime; /* Mount time */
+/*30*/ __u32 s_wtime; /* Write time */
+ __u16 s_mnt_count; /* Mount count */
+ __s16 s_max_mnt_count; /* Maximal mount count */
+ __u16 s_magic; /* Magic signature */
+ __u16 s_state; /* File system state */
+ __u16 s_errors; /* Behaviour when detecting errors */
+ __u16 s_minor_rev_level; /* minor revision level */
+/*40*/ __u32 s_lastcheck; /* time of last check */
+ __u32 s_checkinterval; /* max. time between checks */
+ __u32 s_creator_os; /* OS */
+ __u32 s_rev_level; /* Revision level */
+/*50*/ __u16 s_def_resuid; /* Default uid for reserved blocks */
+ __u16 s_def_resgid; /* Default gid for reserved blocks */
+ /*
+ * These fields are for EXT3_DYNAMIC_REV superblocks only.
+ *
+ * Note: the difference between the compatible feature set and
+ * the incompatible feature set is that if there is a bit set
+ * in the incompatible feature set that the kernel doesn't
+ * know about, it should refuse to mount the filesystem.
+ *
+ * e2fsck's requirements are more strict; if it doesn't know
+ * about a feature in either the compatible or incompatible
+ * feature set, it must abort and not try to meddle with
+ * things it doesn't understand...
+ */
+ __u32 s_first_ino; /* First non-reserved inode */
+ __u16 s_inode_size; /* size of inode structure */
+ __u16 s_block_group_nr; /* block group # of this superblock */
+ __u32 s_feature_compat; /* compatible feature set */
+/*60*/ __u32 s_feature_incompat; /* incompatible feature set */
+ __u32 s_feature_ro_compat; /* readonly-compatible feature set */
+/*68*/ __u8 s_uuid[16]; /* 128-bit uuid for volume */
+/*78*/ char s_volume_name[16]; /* volume name */
+/*88*/ char s_last_mounted[64]; /* directory where last mounted */
+/*C8*/ __u32 s_algorithm_usage_bitmap; /* For compression */
+ /*
+ * Performance hints. Directory preallocation should only
+ * happen if the EXT3_FEATURE_COMPAT_DIR_PREALLOC flag is on.
+ */
+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
+ __u16 s_padding1;
+ /*
+ * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set.
+ */
+/*D0*/ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
+/*E0*/ __u32 s_journal_inum; /* inode number of journal file */
+ __u32 s_journal_dev; /* device number of journal file */
+ __u32 s_last_orphan; /* start of list of inodes to delete */
+
+/*EC*/ __u32 s_reserved[197]; /* Padding to the end of the block */
+};
+
+#ifdef __KERNEL__
+#define EXT3_SB(sb) (&((sb)->u.ext3_sb))
+#define EXT3_I(inode) (&((inode)->u.ext3_i))
+#else
+/* Assume that user mode programs are passing in an ext3fs superblock, not
+ * a kernel struct super_block. This will allow us to call the feature-test
+ * macros from user land. */
+#define EXT3_SB(sb) (sb)
+#endif
+
+#define NEXT_ORPHAN(inode) (inode)->u.ext3_i.i_dtime
+
+/*
+ * Codes for operating systems
+ */
+#define EXT3_OS_LINUX 0
+#define EXT3_OS_HURD 1
+#define EXT3_OS_MASIX 2
+#define EXT3_OS_FREEBSD 3
+#define EXT3_OS_LITES 4
+
+/*
+ * Revision levels
+ */
+#define EXT3_GOOD_OLD_REV 0 /* The good old (original) format */
+#define EXT3_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
+
+#define EXT3_CURRENT_REV EXT3_GOOD_OLD_REV
+#define EXT3_MAX_SUPP_REV EXT3_DYNAMIC_REV
+
+#define EXT3_GOOD_OLD_INODE_SIZE 128
+
+/*
+ * Feature set definitions
+ */
+
+#define EXT3_HAS_COMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_RO_COMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_INCOMPAT_FEATURE(sb,mask) \
+ ( EXT3_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT3_SET_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT3_SET_RO_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT3_SET_INCOMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT3_CLEAR_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_RO_COMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_INCOMPAT_FEATURE(sb,mask) \
+ EXT3_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT3_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT3_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT3_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT3_FEATURE_COMPAT_RESIZE_INODE 0x0010
+#define EXT3_FEATURE_COMPAT_DIR_INDEX 0x0020
+
+#define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+
+#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */
+
+#define EXT3_FEATURE_COMPAT_SUPP 0
+#define EXT3_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_FILETYPE| \
+ EXT3_FEATURE_INCOMPAT_RECOVER)
+#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+ EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+
+/*
+ * Default values for user and/or group using reserved blocks
+ */
+#define EXT3_DEF_RESUID 0
+#define EXT3_DEF_RESGID 0
+
+/*
+ * Structure of a directory entry
+ */
+#define EXT3_NAME_LEN 255
+
+struct ext3_dir_entry {
+ __u32 inode; /* Inode number */
+ __u16 rec_len; /* Directory entry length */
+ __u16 name_len; /* Name length */
+ char name[EXT3_NAME_LEN]; /* File name */
+};
+
+/*
+ * The new version of the directory entry. Since EXT3 structures are
+ * stored in intel byte order, and the name_len field could never be
+ * bigger than 255 chars, it's safe to reclaim the extra byte for the
+ * file_type field.
+ */
+struct ext3_dir_entry_2 {
+ __u32 inode; /* Inode number */
+ __u16 rec_len; /* Directory entry length */
+ __u8 name_len; /* Name length */
+ __u8 file_type;
+ char name[EXT3_NAME_LEN]; /* File name */
+};
+
+/*
+ * Ext3 directory file types. Only the low 3 bits are used. The
+ * other bits are reserved for now.
+ */
+#define EXT3_FT_UNKNOWN 0
+#define EXT3_FT_REG_FILE 1
+#define EXT3_FT_DIR 2
+#define EXT3_FT_CHRDEV 3
+#define EXT3_FT_BLKDEV 4
+#define EXT3_FT_FIFO 5
+#define EXT3_FT_SOCK 6
+#define EXT3_FT_SYMLINK 7
+
+#define EXT3_FT_MAX 8
+
+/*
+ * EXT3_DIR_PAD defines the directory entries boundaries
+ *
+ * NOTE: It must be a multiple of 4
+ */
+#define EXT3_DIR_PAD 4
+#define EXT3_DIR_ROUND (EXT3_DIR_PAD - 1)
+#define EXT3_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT3_DIR_ROUND) & \
+ ~EXT3_DIR_ROUND)
+
+#ifdef __KERNEL__
+
+/* Filesize hard limits for 64-bit file offsets */
+extern long long ext3_max_sizes[];
+
+/*
+ * Describe an inode's exact location on disk and in memory
+ */
+struct ext3_iloc
+{
+ struct buffer_head *bh;
+ struct ext3_inode *raw_inode;
+ unsigned long block_group;
+};
+
+/*
+ * Function prototypes
+ */
+
+/*
+ * Ok, these declarations are also in <linux/kernel.h> but none of the
+ * ext3 source programs needs to include it so they are duplicated here.
+ */
+# define NORET_TYPE /**/
+# define ATTRIB_NORET __attribute__((noreturn))
+# define NORET_AND noreturn,
+
+/* acl.c */
+extern int ext3_permission (struct inode *, int);
+
+/* balloc.c */
+extern int ext3_bg_has_super(struct super_block *sb, int group);
+extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
+extern int ext3_new_block (handle_t *, struct inode *, unsigned long,
+ __u32 *, __u32 *, int *);
+extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
+ unsigned long);
+extern unsigned long ext3_count_free_blocks (struct super_block *);
+extern void ext3_check_blocks_bitmap (struct super_block *);
+extern struct ext3_group_desc * ext3_get_group_desc(struct super_block * sb,
+ unsigned int block_group,
+ struct buffer_head ** bh);
+
+/* bitmap.c */
+extern unsigned long ext3_count_free (struct buffer_head *, unsigned);
+
+/* dir.c */
+extern int ext3_check_dir_entry(const char *, struct inode *,
+ struct ext3_dir_entry_2 *, struct buffer_head *,
+ unsigned long);
+
+/* file.c */
+
+/* fsync.c */
+extern int ext3_sync_file (struct file *, struct dentry *, int);
+
+/* ialloc.c */
+extern struct inode * ext3_new_inode (handle_t *, const struct inode *, int);
+extern void ext3_free_inode (handle_t *, struct inode *);
+extern struct inode * ext3_orphan_get (struct super_block *, ino_t);
+extern unsigned long ext3_count_free_inodes (struct super_block *);
+extern void ext3_check_inodes_bitmap (struct super_block *);
+
+/* inode.c */
+
+extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *);
+extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *);
+
+extern int ext3_get_inode_loc (struct inode *, struct ext3_iloc *);
+extern void ext3_read_inode (struct inode *);
+extern void ext3_write_inode (struct inode *, int);
+extern int ext3_setattr (struct dentry *, struct iattr *);
+extern void ext3_put_inode (struct inode *);
+extern void ext3_delete_inode (struct inode *);
+extern int ext3_sync_inode (handle_t *, struct inode *);
+extern void ext3_discard_prealloc (struct inode *);
+extern void ext3_dirty_inode(struct inode *);
+extern int ext3_change_inode_journal_flag(struct inode *, int);
+
+/* ioctl.c */
+extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
+ unsigned long);
+
+/* namei.c */
+extern struct inode_operations ext3_dir_inode_operations;
+extern int ext3_orphan_add(handle_t *, struct inode *);
+extern int ext3_orphan_del(handle_t *, struct inode *);
+
+/* super.c */
+extern void ext3_error (struct super_block *, const char *, const char *, ...)
+ __attribute__ ((format (printf, 3, 4)));
+extern void __ext3_std_error (struct super_block *, const char *, int);
+extern void ext3_abort (struct super_block *, const char *, const char *, ...)
+ __attribute__ ((format (printf, 3, 4)));
+extern NORET_TYPE void ext3_panic (struct super_block *, const char *,
+ const char *, ...)
+ __attribute__ ((NORET_AND format (printf, 3, 4)));
+extern void ext3_warning (struct super_block *, const char *, const char *, ...)
+ __attribute__ ((format (printf, 3, 4)));
+extern void ext3_update_dynamic_rev (struct super_block *sb);
+extern void ext3_put_super (struct super_block *);
+extern void ext3_write_super (struct super_block *);
+extern void ext3_write_super_lockfs (struct super_block *);
+extern void ext3_unlockfs (struct super_block *);
+extern int ext3_remount (struct super_block *, int *, char *);
+extern struct super_block * ext3_read_super (struct super_block *,void *,int);
+extern int ext3_statfs (struct super_block *, struct statfs *);
+
+/* truncate.c */
+extern void ext3_truncate (struct inode *);
+
+#define ext3_std_error(sb, errno) \
+do { \
+ if ((errno)) \
+ __ext3_std_error((sb), __FUNCTION__, (errno)); \
+} while (0)
+extern const char *ext3_decode_error(struct super_block *sb, int errno, char nbuf[16]);
+
+/*
+ * Inodes and files operations
+ */
+
+/* dir.c */
+extern struct file_operations ext3_dir_operations;
+
+/* file.c */
+extern struct inode_operations ext3_file_inode_operations;
+extern struct file_operations ext3_file_operations;
+
+/* symlink.c */
+extern struct inode_operations ext3_fast_symlink_inode_operations;
+
+extern struct address_space_operations ext3_aops;
+
+#endif /* __KERNEL__ */
+
+#endif /* _LINUX_EXT3_FS_H */
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
new file mode 100644
index 000000000000..3c8d398a8103
--- /dev/null
+++ b/include/linux/ext3_fs_i.h
@@ -0,0 +1,78 @@
+/*
+ * linux/include/linux/ext3_fs_i.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs_i.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT3_FS_I
+#define _LINUX_EXT3_FS_I
+
+#include <linux/rwsem.h>
+
+/*
+ * second extended file system inode data in memory
+ */
+struct ext3_inode_info {
+ __u32 i_data[15];
+ __u32 i_flags;
+#ifdef EXT3_FRAGMENTS
+ __u32 i_faddr;
+ __u8 i_frag_no;
+ __u8 i_frag_size;
+ __u16 unused; /* formerly i_osync */
+#endif
+ __u32 i_file_acl;
+ __u32 i_dir_acl;
+ __u32 i_dtime;
+ __u32 i_block_group;
+ __u32 i_state; /* Dynamic state flags for ext3 */
+ __u32 i_next_alloc_block;
+ __u32 i_next_alloc_goal;
+#ifdef EXT3_PREALLOCATE
+ __u32 i_prealloc_block;
+ __u32 i_prealloc_count;
+#endif
+ __u32 i_dir_start_lookup;
+
+ struct list_head i_orphan; /* unlinked but open inodes */
+
+ /*
+ * i_disksize keeps track of what the inode size is ON DISK, not
+ * in memory. During truncate, i_size is set to the new size by
+ * the VFS prior to calling ext3_truncate(), but the filesystem won't
+ * set i_disksize to 0 until the truncate is actually under way.
+ *
+ * The intent is that i_disksize always represents the blocks which
+ * are used by this file. This allows recovery to restart truncate
+ * on orphans if we crash during truncate. We actually write i_disksize
+ * into the on-disk inode when writing inodes out, instead of i_size.
+ *
+ * The only time when i_disksize and i_size may be different is when
+ * a truncate is in progress. The only things which change i_disksize
+ * are ext3_get_block (growth) and ext3_truncate (shrinkth).
+ */
+ loff_t i_disksize;
+
+ /*
+ * truncate_sem is for serialising ext3_truncate() against
+ * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's
+ * data tree are chopped off during truncate. We can't do that in
+ * ext3 because whenever we perform intermediate commits during
+ * truncate, the inode and all the metadata blocks *must* be in a
+ * consistent state which allows truncation of the orphans to restart
+ * during recovery. Hence we must fix the get_block-vs-truncate race
+ * by other means, so we have truncate_sem.
+ */
+ struct rw_semaphore truncate_sem;
+};
+
+#endif /* _LINUX_EXT3_FS_I */
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
new file mode 100644
index 000000000000..cf248c3aae41
--- /dev/null
+++ b/include/linux/ext3_fs_sb.h
@@ -0,0 +1,77 @@
+/*
+ * linux/include/linux/ext3_fs_sb.h
+ *
+ * Copyright (C) 1992, 1993, 1994, 1995
+ * Remy Card (card@masi.ibp.fr)
+ * Laboratoire MASI - Institut Blaise Pascal
+ * Universite Pierre et Marie Curie (Paris VI)
+ *
+ * from
+ *
+ * linux/include/linux/minix_fs_sb.h
+ *
+ * Copyright (C) 1991, 1992 Linus Torvalds
+ */
+
+#ifndef _LINUX_EXT3_FS_SB
+#define _LINUX_EXT3_FS_SB
+
+#ifdef __KERNEL__
+#include <linux/timer.h>
+#include <linux/wait.h>
+#endif
+
+/*
+ * The following is not needed anymore since the descriptors buffer
+ * heads are now dynamically allocated
+ */
+/* #define EXT3_MAX_GROUP_DESC 8 */
+
+#define EXT3_MAX_GROUP_LOADED 8
+
+/*
+ * third extended-fs super-block data in memory
+ */
+struct ext3_sb_info {
+ unsigned long s_frag_size; /* Size of a fragment in bytes */
+ unsigned long s_frags_per_block;/* Number of fragments per block */
+ unsigned long s_inodes_per_block;/* Number of inodes per block */
+ unsigned long s_frags_per_group;/* Number of fragments in a group */
+ unsigned long s_blocks_per_group;/* Number of blocks in a group */
+ unsigned long s_inodes_per_group;/* Number of inodes in a group */
+ unsigned long s_itb_per_group; /* Number of inode table blocks per group */
+ unsigned long s_gdb_count; /* Number of group descriptor blocks */
+ unsigned long s_desc_per_block; /* Number of group descriptors per block */
+ unsigned long s_groups_count; /* Number of groups in the fs */
+ struct buffer_head * s_sbh; /* Buffer containing the super block */
+ struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */
+ struct buffer_head ** s_group_desc;
+ unsigned short s_loaded_inode_bitmaps;
+ unsigned short s_loaded_block_bitmaps;
+ unsigned long s_inode_bitmap_number[EXT3_MAX_GROUP_LOADED];
+ struct buffer_head * s_inode_bitmap[EXT3_MAX_GROUP_LOADED];
+ unsigned long s_block_bitmap_number[EXT3_MAX_GROUP_LOADED];
+ struct buffer_head * s_block_bitmap[EXT3_MAX_GROUP_LOADED];
+ unsigned long s_mount_opt;
+ uid_t s_resuid;
+ gid_t s_resgid;
+ unsigned short s_mount_state;
+ unsigned short s_pad;
+ int s_addr_per_block_bits;
+ int s_desc_per_block_bits;
+ int s_inode_size;
+ int s_first_ino;
+
+ /* Journaling */
+ struct inode * s_journal_inode;
+ struct journal_s * s_journal;
+ struct list_head s_orphan;
+ unsigned long s_commit_interval;
+ struct block_device *journal_bdev;
+#ifdef CONFIG_JBD_DEBUG
+ struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
+ wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
+#endif
+};
+
+#endif /* _LINUX_EXT3_FS_SB */
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
new file mode 100644
index 000000000000..9e4002b52b51
--- /dev/null
+++ b/include/linux/ext3_jbd.h
@@ -0,0 +1,290 @@
+/*
+ * linux/include/linux/ext3_jbd.h
+ *
+ * Written by Stephen C. Tweedie <sct@redhat.com>, 1999
+ *
+ * Copyright 1998--1999 Red Hat corp --- All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * Ext3-specific journaling extensions.
+ */
+
+#ifndef _LINUX_EXT3_JBD_H
+#define _LINUX_EXT3_JBD_H
+
+#include <linux/fs.h>
+#include <linux/jbd.h>
+#include <linux/ext3_fs.h>
+
+#define EXT3_JOURNAL(inode) (EXT3_SB((inode)->i_sb)->s_journal)
+
+/* Define the number of blocks we need to account to a transaction to
+ * modify one block of data.
+ *
+ * We may have to touch one inode, one bitmap buffer, up to three
+ * indirection blocks, the group and superblock summaries, and the data
+ * block to complete the transaction. */
+
+#define EXT3_SINGLEDATA_TRANS_BLOCKS 8
+
+/* Define the minimum size for a transaction which modifies data. This
+ * needs to take into account the fact that we may end up modifying two
+ * quota files too (one for the group, one for the user quota). The
+ * superblock only gets updated once, of course, so don't bother
+ * counting that again for the quota updates. */
+
+#define EXT3_DATA_TRANS_BLOCKS (3 * EXT3_SINGLEDATA_TRANS_BLOCKS - 2)
+
+extern int ext3_writepage_trans_blocks(struct inode *inode);
+
+/* Delete operations potentially hit one directory's namespace plus an
+ * entire inode, plus arbitrary amounts of bitmap/indirection data. Be
+ * generous. We can grow the delete transaction later if necessary. */
+
+#define EXT3_DELETE_TRANS_BLOCKS (2 * EXT3_DATA_TRANS_BLOCKS + 64)
+
+/* Define an arbitrary limit for the amount of data we will anticipate
+ * writing to any given transaction. For unbounded transactions such as
+ * write(2) and truncate(2) we can write more than this, but we always
+ * start off at the maximum transaction size and grow the transaction
+ * optimistically as we go. */
+
+#define EXT3_MAX_TRANS_DATA 64
+
+/* We break up a large truncate or write transaction once the handle's
+ * buffer credits gets this low, we need either to extend the
+ * transaction or to start a new one. Reserve enough space here for
+ * inode, bitmap, superblock, group and indirection updates for at least
+ * one block, plus two quota updates. Quota allocations are not
+ * needed. */
+
+#define EXT3_RESERVE_TRANS_BLOCKS 12
+
+int
+ext3_mark_iloc_dirty(handle_t *handle,
+ struct inode *inode,
+ struct ext3_iloc *iloc);
+
+/*
+ * On success, We end up with an outstanding reference count against
+ * iloc->bh. This _must_ be cleaned up later.
+ */
+
+int ext3_reserve_inode_write(handle_t *handle, struct inode *inode,
+ struct ext3_iloc *iloc);
+
+int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode);
+
+/*
+ * Wrapper functions with which ext3 calls into JBD. The intent here is
+ * to allow these to be turned into appropriate stubs so ext3 can control
+ * ext2 filesystems, so ext2+ext3 systems only nee one fs. This work hasn't
+ * been done yet.
+ */
+
+static inline void ext3_journal_abort_handle(const char *caller,
+ const char *err_fn,
+ struct buffer_head *bh,
+ handle_t *handle,
+ int err)
+{
+ char nbuf[16];
+ const char *errstr = ext3_decode_error(NULL, err, nbuf);
+
+ printk(KERN_ERR "%s: aborting transaction: %s in %s",
+ caller, errstr, err_fn);
+
+ if (bh)
+ BUFFER_TRACE(bh, "abort");
+ journal_abort_handle(handle);
+ if (!handle->h_err)
+ handle->h_err = err;
+}
+
+static inline int
+__ext3_journal_get_undo_access(const char *where,
+ handle_t *handle, struct buffer_head *bh)
+{
+ int err = journal_get_undo_access(handle, bh);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+static inline int
+__ext3_journal_get_write_access(const char *where,
+ handle_t *handle, struct buffer_head *bh)
+{
+ int err = journal_get_write_access(handle, bh);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+static inline int
+__ext3_journal_dirty_data(const char *where,
+ handle_t *handle, struct buffer_head *bh, int async)
+{
+ int err = journal_dirty_data(handle, bh, async);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+static inline void
+ext3_journal_forget(handle_t *handle, struct buffer_head *bh)
+{
+ journal_forget(handle, bh);
+}
+
+static inline int
+__ext3_journal_revoke(const char *where, handle_t *handle,
+ unsigned long blocknr, struct buffer_head *bh)
+{
+ int err = journal_revoke(handle, blocknr, bh);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+static inline int
+__ext3_journal_get_create_access(const char *where,
+ handle_t *handle, struct buffer_head *bh)
+{
+ int err = journal_get_create_access(handle, bh);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+static inline int
+__ext3_journal_dirty_metadata(const char *where,
+ handle_t *handle, struct buffer_head *bh)
+{
+ int err = journal_dirty_metadata(handle, bh);
+ if (err)
+ ext3_journal_abort_handle(where, __FUNCTION__, bh, handle,err);
+ return err;
+}
+
+
+#define ext3_journal_get_undo_access(handle, bh) \
+ __ext3_journal_get_undo_access(__FUNCTION__, (handle), (bh))
+#define ext3_journal_get_write_access(handle, bh) \
+ __ext3_journal_get_write_access(__FUNCTION__, (handle), (bh))
+#define ext3_journal_dirty_data(handle, bh, async) \
+ __ext3_journal_dirty_data(__FUNCTION__, (handle), (bh), (async))
+#define ext3_journal_revoke(handle, blocknr, bh) \
+ __ext3_journal_revoke(__FUNCTION__, (handle), (blocknr), (bh))
+#define ext3_journal_get_create_access(handle, bh) \
+ __ext3_journal_get_create_access(__FUNCTION__, (handle), (bh))
+#define ext3_journal_dirty_metadata(handle, bh) \
+ __ext3_journal_dirty_metadata(__FUNCTION__, (handle), (bh))
+
+
+
+/*
+ * Wrappers for journal_start/end.
+ *
+ * The only special thing we need to do here is to make sure that all
+ * journal_end calls result in the superblock being marked dirty, so
+ * that sync() will call the filesystem's write_super callback if
+ * appropriate.
+ */
+static inline handle_t *ext3_journal_start(struct inode *inode, int nblocks)
+{
+ if (inode->i_sb->s_flags & MS_RDONLY)
+ return ERR_PTR(-EROFS);
+ return journal_start(EXT3_JOURNAL(inode), nblocks);
+}
+
+static inline handle_t *
+ext3_journal_try_start(struct inode *inode, int nblocks)
+{
+ if (inode->i_sb->s_flags & MS_RDONLY)
+ return ERR_PTR(-EROFS);
+ return journal_try_start(EXT3_JOURNAL(inode), nblocks);
+}
+
+/*
+ * The only special thing we need to do here is to make sure that all
+ * journal_stop calls result in the superblock being marked dirty, so
+ * that sync() will call the filesystem's write_super callback if
+ * appropriate.
+ */
+static inline int __ext3_journal_stop(const char *where,
+ handle_t *handle, struct inode *inode)
+{
+ int err = handle->h_err;
+ int rc = journal_stop(handle);
+
+ inode->i_sb->s_dirt = 1;
+ if (!err)
+ err = rc;
+ if (err)
+ __ext3_std_error(inode->i_sb, where, err);
+ return err;
+}
+#define ext3_journal_stop(handle, inode) \
+ __ext3_journal_stop(__FUNCTION__, (handle), (inode))
+
+static inline handle_t *ext3_journal_current_handle(void)
+{
+ return journal_current_handle();
+}
+
+static inline void
+ext3_log_start_commit(journal_t *journal, transaction_t *transaction)
+{
+ log_start_commit(journal, transaction);
+}
+
+static inline void ext3_log_wait_commit(journal_t *journal, tid_t tid)
+{
+ log_wait_commit(journal, tid);
+}
+
+static inline int ext3_journal_extend(handle_t *handle, int nblocks)
+{
+ return journal_extend(handle, nblocks);
+}
+
+static inline int ext3_journal_restart(handle_t *handle, int nblocks)
+{
+ return journal_restart(handle, nblocks);
+}
+
+static inline int ext3_journal_blocks_per_page(struct inode *inode)
+{
+ return journal_blocks_per_page(inode);
+}
+
+static inline int ext3_journal_force_commit(journal_t *journal)
+{
+ return journal_force_commit(journal);
+}
+
+/* super.c */
+int ext3_force_commit(struct super_block *sb);
+
+static inline int ext3_should_journal_data(struct inode *inode)
+{
+ if (!S_ISREG(inode->i_mode))
+ return 1;
+ if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_JOURNAL_DATA)
+ return 1;
+ if (inode->u.ext3_i.i_flags & EXT3_JOURNAL_DATA_FL)
+ return 1;
+ return 0;
+}
+
+static inline int ext3_should_order_data(struct inode *inode)
+{
+ return (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA);
+}
+
+
+#endif /* _LINUX_EXT3_JBD_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 33f3bb92af40..935c6e9bfee8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -216,6 +216,7 @@ enum bh_state_bits {
BH_Async, /* 1 if the buffer is under end_buffer_io_async I/O */
BH_Wait_IO, /* 1 if we should write out this buffer */
BH_launder, /* 1 if we should throttle on this buffer */
+ BH_JBD, /* 1 if it has an attached journal_head */
BH_PrivateStart,/* not a state bit, but the first bit available
* for private allocation by other entities
@@ -287,6 +288,7 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long
#include <linux/pipe_fs_i.h>
#include <linux/minix_fs_i.h>
#include <linux/ext2_fs_i.h>
+#include <linux/ext3_fs_i.h>
#include <linux/hpfs_fs_i.h>
#include <linux/ntfs_fs_i.h>
#include <linux/msdos_fs_i.h>
@@ -376,10 +378,16 @@ struct address_space_operations {
int (*writepage)(struct page *);
int (*readpage)(struct file *, struct page *);
int (*sync_page)(struct page *);
+ /*
+ * ext3 requires that a successful prepare_write() call be followed
+ * by a commit_write() call - they must be balanced
+ */
int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
/* Unfortunately this kludge is needed for FIBMAP. Don't use it */
int (*bmap)(struct address_space *, long);
+ int (*flushpage) (struct page *, unsigned long);
+ int (*releasepage) (struct page *, int);
#define KERNEL_HAS_O_DIRECT /* this is for modules out of the kernel */
int (*direct_IO)(int, struct inode *, struct kiobuf *, unsigned long, int);
};
@@ -470,6 +478,7 @@ struct inode {
union {
struct minix_inode_info minix_i;
struct ext2_inode_info ext2_i;
+ struct ext3_inode_info ext3_i;
struct hpfs_inode_info hpfs_i;
struct ntfs_inode_info ntfs_i;
struct msdos_inode_info msdos_i;
@@ -658,6 +667,7 @@ struct quota_mount_options
#include <linux/minix_fs_sb.h>
#include <linux/ext2_fs_sb.h>
+#include <linux/ext3_fs_sb.h>
#include <linux/hpfs_fs_sb.h>
#include <linux/ntfs_fs_sb.h>
#include <linux/msdos_fs_sb.h>
@@ -714,6 +724,7 @@ struct super_block {
union {
struct minix_sb_info minix_sb;
struct ext2_sb_info ext2_sb;
+ struct ext3_sb_info ext3_sb;
struct hpfs_sb_info hpfs_sb;
struct ntfs_sb_info ntfs_sb;
struct msdos_sb_info msdos_sb;
@@ -1088,6 +1099,7 @@ extern int fs_may_remount_ro(struct super_block *);
extern int try_to_free_buffers(struct page *, unsigned int);
extern void refile_buffer(struct buffer_head * buf);
+extern void create_empty_buffers(struct page *, kdev_t, unsigned long);
extern void end_buffer_io_sync(struct buffer_head *bh, int uptodate);
/* reiserfs_writepage needs this */
@@ -1170,6 +1182,7 @@ static inline void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode
buffer_insert_inode_queue(bh, inode);
}
+extern void set_buffer_flushtime(struct buffer_head *);
extern void balance_dirty(void);
extern int check_disk_change(kdev_t);
extern int invalidate_inodes(struct super_block *);
@@ -1349,12 +1362,15 @@ static inline void bforget(struct buffer_head *buf)
extern int set_blocksize(kdev_t, int);
extern struct buffer_head * bread(kdev_t, int, int);
extern void wakeup_bdflush(void);
+extern void put_unused_buffer_head(struct buffer_head * bh);
+extern struct buffer_head * get_unused_buffer_head(int async);
extern int brw_page(int, struct page *, kdev_t, int [], int);
typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int);
/* Generic buffer handling for block filesystems.. */
+extern int try_to_release_page(struct page * page, int gfp_mask);
extern int discard_bh_page(struct page *, unsigned long, int);
#define block_flushpage(page, offset) discard_bh_page(page, offset, 1)
#define block_invalidate_page(page) discard_bh_page(page, 0, 0)
@@ -1416,7 +1432,7 @@ extern void show_buffers(void);
extern void mount_root(void);
#ifdef CONFIG_BLK_DEV_INITRD
-extern kdev_t real_root_dev;
+extern unsigned int real_root_dev;
extern int change_root(kdev_t, const char *);
#endif
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 81a50b2e9005..a82e39ad25c6 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -31,7 +31,6 @@
#include <asm/semaphore.h> /* Needed for MUTEX init macros */
#include <linux/config.h>
#include <linux/notifier.h>
-#include <linux/ioport.h> /* Needed for struct resource */
#include <asm/atomic.h>
/*
@@ -82,7 +81,7 @@ struct i2o_device
struct i2o_pci
{
int irq;
- int queue_buggy:1; /* Don't send a lot of messages */
+ int queue_buggy:3; /* Don't send a lot of messages */
int short_req:1; /* Use small block sizes */
int dpt:1; /* Don't quiesce */
#ifdef CONFIG_MTRR
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 50370a7e70da..37ba774ab3fa 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -66,6 +66,7 @@ typedef enum {
IRDA_LITELINK_DONGLE = 5,
IRDA_AIRPORT_DONGLE = 6,
IRDA_OLD_BELKIN_DONGLE = 7,
+ IRDA_EP7211_IR = 8,
} IRDA_DONGLE;
/* Protocol types to be used for SOCK_DGRAM */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
new file mode 100644
index 000000000000..5de8528ef196
--- /dev/null
+++ b/include/linux/jbd.h
@@ -0,0 +1,881 @@
+/*
+ * linux/include/linux/jbd.h
+ *
+ * Written by Stephen C. Tweedie <sct@redhat.com>
+ *
+ * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved
+ *
+ * This file is part of the Linux kernel and is made available under
+ * the terms of the GNU General Public License, version 2, or at your
+ * option, any later version, incorporated herein by reference.
+ *
+ * Definitions for transaction data structures for the buffer cache
+ * filesystem journaling support.
+ */
+
+#ifndef _LINUX_JBD_H
+#define _LINUX_JBD_H
+
+#if defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE) || !defined(__KERNEL__)
+
+/* Allow this file to be included directly into e2fsprogs */
+#ifndef __KERNEL__
+#include "jfs_compat.h"
+#define JFS_DEBUG
+#define jfs_debug jbd_debug
+#else
+
+#include <linux/journal-head.h>
+#include <linux/stddef.h>
+#include <asm/semaphore.h>
+#endif
+
+#define journal_oom_retry 1
+
+#ifdef CONFIG_JBD_DEBUG
+/*
+ * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
+ * consistency checks. By default we don't do this unless
+ * CONFIG_JBD_DEBUG is on.
+ */
+#define JBD_EXPENSIVE_CHECKING
+extern int journal_enable_debug;
+
+#define jbd_debug(n, f, a...) \
+ do { \
+ if ((n) <= journal_enable_debug) { \
+ printk (KERN_DEBUG "(%s, %d): %s: ", \
+ __FILE__, __LINE__, __FUNCTION__); \
+ printk (f, ## a); \
+ } \
+ } while (0)
+#else
+#define jbd_debug(f, a...) /**/
+#endif
+
+extern void * __jbd_kmalloc (char *where, size_t size, int flags, int retry);
+#define jbd_kmalloc(size, flags) \
+ __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
+#define jbd_rep_kmalloc(size, flags) \
+ __jbd_kmalloc(__FUNCTION__, (size), (flags), 1)
+
+#define JFS_MIN_JOURNAL_BLOCKS 1024
+
+#ifdef __KERNEL__
+typedef struct handle_s handle_t; /* Atomic operation type */
+typedef struct journal_s journal_t; /* Journal control structure */
+#endif
+
+/*
+ * Internal structures used by the logging mechanism:
+ */
+
+#define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */
+
+/*
+ * On-disk structures
+ */
+
+/*
+ * Descriptor block types:
+ */
+
+#define JFS_DESCRIPTOR_BLOCK 1
+#define JFS_COMMIT_BLOCK 2
+#define JFS_SUPERBLOCK_V1 3
+#define JFS_SUPERBLOCK_V2 4
+#define JFS_REVOKE_BLOCK 5
+
+/*
+ * Standard header for all descriptor blocks:
+ */
+typedef struct journal_header_s
+{
+ __u32 h_magic;
+ __u32 h_blocktype;
+ __u32 h_sequence;
+} journal_header_t;
+
+
+/*
+ * The block tag: used to describe a single buffer in the journal
+ */
+typedef struct journal_block_tag_s
+{
+ __u32 t_blocknr; /* The on-disk block number */
+ __u32 t_flags; /* See below */
+} journal_block_tag_t;
+
+/*
+ * The revoke descriptor: used on disk to describe a series of blocks to
+ * be revoked from the log
+ */
+typedef struct journal_revoke_header_s
+{
+ journal_header_t r_header;
+ int r_count; /* Count of bytes used in the block */
+} journal_revoke_header_t;
+
+
+/* Definitions for the journal tag flags word: */
+#define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */
+#define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */
+#define JFS_FLAG_DELETED 4 /* block deleted by this transaction */
+#define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */
+
+
+/*
+ * The journal superblock. All fields are in big-endian byte order.
+ */
+typedef struct journal_superblock_s
+{
+/* 0x0000 */
+ journal_header_t s_header;
+
+/* 0x000C */
+ /* Static information describing the journal */
+ __u32 s_blocksize; /* journal device blocksize */
+ __u32 s_maxlen; /* total blocks in journal file */
+ __u32 s_first; /* first block of log information */
+
+/* 0x0018 */
+ /* Dynamic information describing the current state of the log */
+ __u32 s_sequence; /* first commit ID expected in log */
+ __u32 s_start; /* blocknr of start of log */
+
+/* 0x0020 */
+ /* Error value, as set by journal_abort(). */
+ __s32 s_errno;
+
+/* 0x0024 */
+ /* Remaining fields are only valid in a version-2 superblock */
+ __u32 s_feature_compat; /* compatible feature set */
+ __u32 s_feature_incompat; /* incompatible feature set */
+ __u32 s_feature_ro_compat; /* readonly-compatible feature set */
+/* 0x0030 */
+ __u8 s_uuid[16]; /* 128-bit uuid for journal */
+
+/* 0x0040 */
+ __u32 s_nr_users; /* Nr of filesystems sharing log */
+
+ __u32 s_dynsuper; /* Blocknr of dynamic superblock copy*/
+
+/* 0x0048 */
+ __u32 s_max_transaction; /* Limit of journal blocks per trans.*/
+ __u32 s_max_trans_data; /* Limit of data blocks per trans. */
+
+/* 0x0050 */
+ __u32 s_padding[44];
+
+/* 0x0100 */
+ __u8 s_users[16*48]; /* ids of all fs'es sharing the log */
+/* 0x0400 */
+} journal_superblock_t;
+
+#define JFS_HAS_COMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask))))
+#define JFS_HAS_RO_COMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask))))
+#define JFS_HAS_INCOMPAT_FEATURE(j,mask) \
+ ((j)->j_format_version >= 2 && \
+ ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
+
+#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
+
+/* Features known to this kernel version: */
+#define JFS_KNOWN_COMPAT_FEATURES 0
+#define JFS_KNOWN_ROCOMPAT_FEATURES 0
+#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/sched.h>
+
+#define JBD_ASSERTIONS
+#ifdef JBD_ASSERTIONS
+#define J_ASSERT(assert) \
+do { \
+ if (!(assert)) { \
+ printk (KERN_EMERG \
+ "Assertion failure in %s() at %s:%d: \"%s\"\n", \
+ __FUNCTION__, __FILE__, __LINE__, # assert); \
+ BUG(); \
+ } \
+} while (0)
+
+#if defined(CONFIG_BUFFER_DEBUG)
+void buffer_assertion_failure(struct buffer_head *bh);
+#define J_ASSERT_BH(bh, expr) \
+ do { \
+ if (!(expr)) \
+ buffer_assertion_failure(bh); \
+ J_ASSERT(expr); \
+ } while (0)
+#define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr)
+#else
+#define J_ASSERT_BH(bh, expr) J_ASSERT(expr)
+#define J_ASSERT_JH(jh, expr) J_ASSERT(expr)
+#endif
+
+#else
+#define J_ASSERT(assert)
+#endif /* JBD_ASSERTIONS */
+
+enum jbd_state_bits {
+ BH_JWrite
+ = BH_PrivateStart, /* 1 if being written to log (@@@ DEBUGGING) */
+ BH_Freed, /* 1 if buffer has been freed (truncated) */
+ BH_Revoked, /* 1 if buffer has been revoked from the log */
+ BH_RevokeValid, /* 1 if buffer revoked flag is valid */
+ BH_JBDDirty, /* 1 if buffer is dirty but journaled */
+};
+
+/* Return true if the buffer is one which JBD is managing */
+static inline int buffer_jbd(struct buffer_head *bh)
+{
+ return __buffer_state(bh, JBD);
+}
+
+static inline struct buffer_head *jh2bh(struct journal_head *jh)
+{
+ return jh->b_bh;
+}
+
+static inline struct journal_head *bh2jh(struct buffer_head *bh)
+{
+ return bh->b_private;
+}
+
+struct jbd_revoke_table_s;
+
+/* The handle_t type represents a single atomic update being performed
+ * by some process. All filesystem modifications made by the process go
+ * through this handle. Recursive operations (such as quota operations)
+ * are gathered into a single update.
+ *
+ * The buffer credits field is used to account for journaled buffers
+ * being modified by the running process. To ensure that there is
+ * enough log space for all outstanding operations, we need to limit the
+ * number of outstanding buffers possible at any time. When the
+ * operation completes, any buffer credits not used are credited back to
+ * the transaction, so that at all times we know how many buffers the
+ * outstanding updates on a transaction might possibly touch. */
+
+struct handle_s
+{
+ /* Which compound transaction is this update a part of? */
+ transaction_t * h_transaction;
+
+ /* Number of remaining buffers we are allowed to dirty: */
+ int h_buffer_credits;
+
+ /* Reference count on this handle */
+ int h_ref;
+
+ /* Field for caller's use to track errors through large fs
+ operations */
+ int h_err;
+
+ /* Flags */
+ unsigned int h_sync: 1; /* sync-on-close */
+ unsigned int h_jdata: 1; /* force data journaling */
+ unsigned int h_aborted: 1; /* fatal error on handle */
+};
+
+
+/* The transaction_t type is the guts of the journaling mechanism. It
+ * tracks a compound transaction through its various states:
+ *
+ * RUNNING: accepting new updates
+ * LOCKED: Updates still running but we don't accept new ones
+ * RUNDOWN: Updates are tidying up but have finished requesting
+ * new buffers to modify (state not used for now)
+ * FLUSH: All updates complete, but we are still writing to disk
+ * COMMIT: All data on disk, writing commit record
+ * FINISHED: We still have to keep the transaction for checkpointing.
+ *
+ * The transaction keeps track of all of the buffers modified by a
+ * running transaction, and all of the buffers committed but not yet
+ * flushed to home for finished transactions.
+ */
+
+struct transaction_s
+{
+ /* Pointer to the journal for this transaction. */
+ journal_t * t_journal;
+
+ /* Sequence number for this transaction */
+ tid_t t_tid;
+
+ /* Transaction's current state */
+ enum {
+ T_RUNNING,
+ T_LOCKED,
+ T_RUNDOWN,
+ T_FLUSH,
+ T_COMMIT,
+ T_FINISHED
+ } t_state;
+
+ /* Where in the log does this transaction's commit start? */
+ unsigned long t_log_start;
+
+ /* Doubly-linked circular list of all inodes owned by this
+ transaction */ /* AKPM: unused */
+ struct inode * t_ilist;
+
+ /* Number of buffers on the t_buffers list */
+ int t_nr_buffers;
+
+ /* Doubly-linked circular list of all buffers reserved but not
+ yet modified by this transaction */
+ struct journal_head * t_reserved_list;
+
+ /* Doubly-linked circular list of all metadata buffers owned by this
+ transaction */
+ struct journal_head * t_buffers;
+
+ /*
+ * Doubly-linked circular list of all data buffers still to be
+ * flushed before this transaction can be committed.
+ * Protected by journal_datalist_lock.
+ */
+ struct journal_head * t_sync_datalist;
+
+ /*
+ * Doubly-linked circular list of all writepage data buffers
+ * still to be written before this transaction can be committed.
+ * Protected by journal_datalist_lock.
+ */
+ struct journal_head * t_async_datalist;
+
+ /* Doubly-linked circular list of all forget buffers (superceded
+ buffers which we can un-checkpoint once this transaction
+ commits) */
+ struct journal_head * t_forget;
+
+ /*
+ * Doubly-linked circular list of all buffers still to be
+ * flushed before this transaction can be checkpointed.
+ */
+ /* Protected by journal_datalist_lock */
+ struct journal_head * t_checkpoint_list;
+
+ /* Doubly-linked circular list of temporary buffers currently
+ undergoing IO in the log */
+ struct journal_head * t_iobuf_list;
+
+ /* Doubly-linked circular list of metadata buffers being
+ shadowed by log IO. The IO buffers on the iobuf list and the
+ shadow buffers on this list match each other one for one at
+ all times. */
+ struct journal_head * t_shadow_list;
+
+ /* Doubly-linked circular list of control buffers being written
+ to the log. */
+ struct journal_head * t_log_list;
+
+ /* Number of outstanding updates running on this transaction */
+ int t_updates;
+
+ /* Number of buffers reserved for use by all handles in this
+ * transaction handle but not yet modified. */
+ int t_outstanding_credits;
+
+ /*
+ * Forward and backward links for the circular list of all
+ * transactions awaiting checkpoint.
+ */
+ /* Protected by journal_datalist_lock */
+ transaction_t *t_cpnext, *t_cpprev;
+
+ /* When will the transaction expire (become due for commit), in
+ * jiffies ? */
+ unsigned long t_expires;
+
+ /* How many handles used this transaction? */
+ int t_handle_count;
+};
+
+
+/* The journal_t maintains all of the journaling state information for a
+ * single filesystem. It is linked to from the fs superblock structure.
+ *
+ * We use the journal_t to keep track of all outstanding transaction
+ * activity on the filesystem, and to manage the state of the log
+ * writing process. */
+
+struct journal_s
+{
+ /* General journaling state flags */
+ unsigned long j_flags;
+
+ /* Is there an outstanding uncleared error on the journal (from
+ * a prior abort)? */
+ int j_errno;
+
+ /* The superblock buffer */
+ struct buffer_head * j_sb_buffer;
+ journal_superblock_t * j_superblock;
+
+ /* Version of the superblock format */
+ int j_format_version;
+
+ /* Number of processes waiting to create a barrier lock */
+ int j_barrier_count;
+
+ /* The barrier lock itself */
+ struct semaphore j_barrier;
+
+ /* Transactions: The current running transaction... */
+ transaction_t * j_running_transaction;
+
+ /* ... the transaction we are pushing to disk ... */
+ transaction_t * j_committing_transaction;
+
+ /* ... and a linked circular list of all transactions waiting
+ * for checkpointing. */
+ /* Protected by journal_datalist_lock */
+ transaction_t * j_checkpoint_transactions;
+
+ /* Wait queue for waiting for a locked transaction to start
+ committing, or for a barrier lock to be released */
+ wait_queue_head_t j_wait_transaction_locked;
+
+ /* Wait queue for waiting for checkpointing to complete */
+ wait_queue_head_t j_wait_logspace;
+
+ /* Wait queue for waiting for commit to complete */
+ wait_queue_head_t j_wait_done_commit;
+
+ /* Wait queue to trigger checkpointing */
+ wait_queue_head_t j_wait_checkpoint;
+
+ /* Wait queue to trigger commit */
+ wait_queue_head_t j_wait_commit;
+
+ /* Wait queue to wait for updates to complete */
+ wait_queue_head_t j_wait_updates;
+
+ /* Semaphore for locking against concurrent checkpoints */
+ struct semaphore j_checkpoint_sem;
+
+ /* The main journal lock, used by lock_journal() */
+ struct semaphore j_sem;
+
+ /* Journal head: identifies the first unused block in the journal. */
+ unsigned long j_head;
+
+ /* Journal tail: identifies the oldest still-used block in the
+ * journal. */
+ unsigned long j_tail;
+
+ /* Journal free: how many free blocks are there in the journal? */
+ unsigned long j_free;
+
+ /* Journal start and end: the block numbers of the first usable
+ * block and one beyond the last usable block in the journal. */
+ unsigned long j_first, j_last;
+
+ /* Device, blocksize and starting block offset for the location
+ * where we store the journal. */
+ kdev_t j_dev;
+ int j_blocksize;
+ unsigned int j_blk_offset;
+
+ /* Device which holds the client fs. For internal journal this
+ * will be equal to j_dev. */
+ kdev_t j_fs_dev;
+
+ /* Total maximum capacity of the journal region on disk. */
+ unsigned int j_maxlen;
+
+ /* Optional inode where we store the journal. If present, all
+ * journal block numbers are mapped into this inode via
+ * bmap(). */
+ struct inode * j_inode;
+
+ /* Sequence number of the oldest transaction in the log */
+ tid_t j_tail_sequence;
+ /* Sequence number of the next transaction to grant */
+ tid_t j_transaction_sequence;
+ /* Sequence number of the most recently committed transaction */
+ tid_t j_commit_sequence;
+ /* Sequence number of the most recent transaction wanting commit */
+ tid_t j_commit_request;
+
+ /* Journal uuid: identifies the object (filesystem, LVM volume
+ * etc) backed by this journal. This will eventually be
+ * replaced by an array of uuids, allowing us to index multiple
+ * devices within a single journal and to perform atomic updates
+ * across them. */
+
+ __u8 j_uuid[16];
+
+ /* Pointer to the current commit thread for this journal */
+ struct task_struct * j_task;
+
+ /* Maximum number of metadata buffers to allow in a single
+ * compound commit transaction */
+ int j_max_transaction_buffers;
+
+ /* What is the maximum transaction lifetime before we begin a
+ * commit? */
+ unsigned long j_commit_interval;
+
+ /* The timer used to wakeup the commit thread: */
+ struct timer_list * j_commit_timer;
+ int j_commit_timer_active;
+
+ /* Link all journals together - system-wide */
+ struct list_head j_all_journals;
+
+ /* The revoke table: maintains the list of revoked blocks in the
+ current transaction. */
+ struct jbd_revoke_table_s *j_revoke;
+};
+
+/*
+ * Journal flag definitions
+ */
+#define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */
+#define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */
+#define JFS_ACK_ERR 0x004 /* The errno in the sb has been acked */
+#define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */
+#define JFS_LOADED 0x010 /* The journal superblock has been loaded */
+
+/*
+ * Function declarations for the journaling transaction and buffer
+ * management
+ */
+
+/* Filing buffers */
+extern void __journal_unfile_buffer(struct journal_head *);
+extern void journal_unfile_buffer(struct journal_head *);
+extern void __journal_refile_buffer(struct journal_head *);
+extern void journal_refile_buffer(struct journal_head *);
+extern void __journal_file_buffer(struct journal_head *, transaction_t *, int);
+extern void __journal_free_buffer(struct journal_head *bh);
+extern void journal_file_buffer(struct journal_head *, transaction_t *, int);
+extern void __journal_clean_data_list(transaction_t *transaction);
+
+/* Log buffer allocation */
+extern struct journal_head * journal_get_descriptor_buffer(journal_t *);
+extern unsigned long journal_next_log_block(journal_t *);
+
+/* Commit management */
+extern void journal_commit_transaction(journal_t *);
+
+/* Checkpoint list management */
+int __journal_clean_checkpoint_list(journal_t *journal);
+extern void journal_remove_checkpoint(struct journal_head *);
+extern void __journal_remove_checkpoint(struct journal_head *);
+extern void journal_insert_checkpoint(struct journal_head *, transaction_t *);
+extern void __journal_insert_checkpoint(struct journal_head *,transaction_t *);
+
+/* Buffer IO */
+extern int
+journal_write_metadata_buffer(transaction_t *transaction,
+ struct journal_head *jh_in,
+ struct journal_head **jh_out,
+ int blocknr);
+
+/* Transaction locking */
+extern void __wait_on_journal (journal_t *);
+
+/*
+ * Journal locking.
+ *
+ * We need to lock the journal during transaction state changes so that
+ * nobody ever tries to take a handle on the running transaction while
+ * we are in the middle of moving it to the commit phase.
+ *
+ * Note that the locking is completely interrupt unsafe. We never touch
+ * journal structures from interrupts.
+ *
+ * In 2.2, the BKL was required for lock_journal. This is no longer
+ * the case.
+ */
+
+static inline void lock_journal(journal_t *journal)
+{
+ down(&journal->j_sem);
+}
+
+/* This returns zero if we acquired the semaphore */
+static inline int try_lock_journal(journal_t * journal)
+{
+ return down_trylock(&journal->j_sem);
+}
+
+static inline void unlock_journal(journal_t * journal)
+{
+ up(&journal->j_sem);
+}
+
+
+static inline handle_t *journal_current_handle(void)
+{
+ return current->journal_info;
+}
+
+/* The journaling code user interface:
+ *
+ * Create and destroy handles
+ * Register buffer modifications against the current transaction.
+ */
+
+extern handle_t *journal_start(journal_t *, int nblocks);
+extern handle_t *journal_try_start(journal_t *, int nblocks);
+extern int journal_restart (handle_t *, int nblocks);
+extern int journal_extend (handle_t *, int nblocks);
+extern int journal_get_write_access (handle_t *, struct buffer_head *);
+extern int journal_get_create_access (handle_t *, struct buffer_head *);
+extern int journal_get_undo_access (handle_t *, struct buffer_head *);
+extern int journal_dirty_data (handle_t *,
+ struct buffer_head *, int async);
+extern int journal_dirty_metadata (handle_t *, struct buffer_head *);
+extern void journal_release_buffer (handle_t *, struct buffer_head *);
+extern void journal_forget (handle_t *, struct buffer_head *);
+extern void journal_sync_buffer (struct buffer_head *);
+extern int journal_flushpage(journal_t *, struct page *, unsigned long);
+extern int journal_try_to_free_buffers(journal_t *, struct page *, int);
+extern int journal_stop(handle_t *);
+extern int journal_flush (journal_t *);
+
+extern void journal_lock_updates (journal_t *);
+extern void journal_unlock_updates (journal_t *);
+
+extern journal_t * journal_init_dev(kdev_t dev, kdev_t fs_dev,
+ int start, int len, int bsize);
+extern journal_t * journal_init_inode (struct inode *);
+extern int journal_update_format (journal_t *);
+extern int journal_check_used_features
+ (journal_t *, unsigned long, unsigned long, unsigned long);
+extern int journal_check_available_features
+ (journal_t *, unsigned long, unsigned long, unsigned long);
+extern int journal_set_features
+ (journal_t *, unsigned long, unsigned long, unsigned long);
+extern int journal_create (journal_t *);
+extern int journal_load (journal_t *journal);
+extern void journal_destroy (journal_t *);
+extern int journal_recover (journal_t *journal);
+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 (journal_t *);
+extern void journal_abort (journal_t *, int);
+extern int journal_errno (journal_t *);
+extern void journal_ack_err (journal_t *);
+extern int journal_clear_err (journal_t *);
+extern unsigned long journal_bmap(journal_t *journal, unsigned long blocknr);
+extern int journal_force_commit(journal_t *journal);
+
+/*
+ * journal_head management
+ */
+extern struct journal_head
+ *journal_add_journal_head(struct buffer_head *bh);
+extern void journal_remove_journal_head(struct buffer_head *bh);
+extern void __journal_remove_journal_head(struct buffer_head *bh);
+extern void journal_unlock_journal_head(struct journal_head *jh);
+
+/* Primary revoke support */
+#define JOURNAL_REVOKE_DEFAULT_HASH 256
+extern int journal_init_revoke(journal_t *, int);
+extern void journal_destroy_revoke_caches(void);
+extern int journal_init_revoke_caches(void);
+
+extern void journal_destroy_revoke(journal_t *);
+extern int journal_revoke (handle_t *,
+ unsigned long, struct buffer_head *);
+extern int journal_cancel_revoke(handle_t *, struct journal_head *);
+extern void journal_write_revoke_records(journal_t *, transaction_t *);
+
+/* Recovery revoke support */
+extern int journal_set_revoke(journal_t *, unsigned long, tid_t);
+extern int journal_test_revoke(journal_t *, unsigned long, tid_t);
+extern void journal_clear_revoke(journal_t *);
+extern void journal_brelse_array(struct buffer_head *b[], int n);
+
+/* The log thread user interface:
+ *
+ * Request space in the current transaction, and force transaction commit
+ * transitions on demand.
+ */
+
+extern int log_space_left (journal_t *); /* Called with journal locked */
+extern tid_t log_start_commit (journal_t *, transaction_t *);
+extern void log_wait_commit (journal_t *, tid_t);
+extern int log_do_checkpoint (journal_t *, int);
+
+extern void log_wait_for_space(journal_t *, int nblocks);
+extern void __journal_drop_transaction(journal_t *, transaction_t *);
+extern int cleanup_journal_tail(journal_t *);
+
+/* Reduce journal memory usage by flushing */
+extern void shrink_journal_memory(void);
+
+/* Debugging code only: */
+
+#define jbd_ENOSYS() \
+do { \
+ printk (KERN_ERR "JBD unimplemented function " __FUNCTION__); \
+ current->state = TASK_UNINTERRUPTIBLE; \
+ schedule(); \
+} while (1)
+
+/*
+ * is_journal_abort
+ *
+ * Simple test wrapper function to test the JFS_ABORT state flag. This
+ * bit, when set, indicates that we have had a fatal error somewhere,
+ * either inside the journaling layer or indicated to us by the client
+ * (eg. ext3), and that we and should not commit any further
+ * transactions.
+ */
+
+static inline int is_journal_aborted(journal_t *journal)
+{
+ return journal->j_flags & JFS_ABORT;
+}
+
+static inline int is_handle_aborted(handle_t *handle)
+{
+ if (handle->h_aborted)
+ return 1;
+ return is_journal_aborted(handle->h_transaction->t_journal);
+}
+
+static inline void journal_abort_handle(handle_t *handle)
+{
+ handle->h_aborted = 1;
+}
+
+/* Not all architectures define BUG() */
+#ifndef BUG
+ #define BUG() do { \
+ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+ * ((char *) 0) = 0; \
+ } while (0)
+#endif /* BUG */
+
+#endif /* __KERNEL__ */
+
+/* Comparison functions for transaction IDs: perform comparisons using
+ * modulo arithmetic so that they work over sequence number wraps. */
+
+static inline int tid_gt(tid_t x, tid_t y)
+{
+ int difference = (x - y);
+ return (difference > 0);
+}
+
+static inline int tid_geq(tid_t x, tid_t y)
+{
+ int difference = (x - y);
+ return (difference >= 0);
+}
+
+extern int journal_blocks_per_page(struct inode *inode);
+
+/*
+ * Definitions which augment the buffer_head layer
+ */
+
+/* journaling buffer types */
+#define BJ_None 0 /* Not journaled */
+#define BJ_SyncData 1 /* Normal data: flush before commit */
+#define BJ_AsyncData 2 /* writepage data: wait on it before commit */
+#define BJ_Metadata 3 /* Normal journaled metadata */
+#define BJ_Forget 4 /* Buffer superceded by this transaction */
+#define BJ_IO 5 /* Buffer is for temporary IO use */
+#define BJ_Shadow 6 /* Buffer contents being shadowed to the log */
+#define BJ_LogCtl 7 /* Buffer contains log descriptors */
+#define BJ_Reserved 8 /* Buffer is reserved for access by journal */
+#define BJ_Types 9
+
+extern int jbd_blocks_per_page(struct inode *inode);
+
+#ifdef __KERNEL__
+
+extern spinlock_t jh_splice_lock;
+/*
+ * Once `expr1' has been found true, take jh_splice_lock
+ * and then reevaluate everything.
+ */
+#define SPLICE_LOCK(expr1, expr2) \
+ ({ \
+ int ret = (expr1); \
+ if (ret) { \
+ spin_lock(&jh_splice_lock); \
+ ret = (expr1) && (expr2); \
+ spin_unlock(&jh_splice_lock); \
+ } \
+ ret; \
+ })
+
+/*
+ * A number of buffer state predicates. They test for
+ * buffer_jbd() because they are used in core kernel code.
+ *
+ * These will be racy on SMP unless we're *sure* that the
+ * buffer won't be detached from the journalling system
+ * in parallel.
+ */
+
+/* Return true if the buffer is on journal list `list' */
+static inline int buffer_jlist_eq(struct buffer_head *bh, int list)
+{
+ return SPLICE_LOCK(buffer_jbd(bh), bh2jh(bh)->b_jlist == list);
+}
+
+/* Return true if this bufer is dirty wrt the journal */
+static inline int buffer_jdirty(struct buffer_head *bh)
+{
+ return buffer_jbd(bh) && __buffer_state(bh, JBDDirty);
+}
+
+/* Return true if it's a data buffer which journalling is managing */
+static inline int buffer_jbd_data(struct buffer_head *bh)
+{
+ return SPLICE_LOCK(buffer_jbd(bh),
+ bh2jh(bh)->b_jlist == BJ_SyncData ||
+ bh2jh(bh)->b_jlist == BJ_AsyncData);
+}
+
+#ifdef CONFIG_SMP
+#define assert_spin_locked(lock) J_ASSERT(spin_is_locked(lock))
+#else
+#define assert_spin_locked(lock) do {} while(0)
+#endif
+
+#define buffer_trace_init(bh) do {} while (0)
+#define print_buffer_fields(bh) do {} while (0)
+#define print_buffer_trace(bh) do {} while (0)
+#define BUFFER_TRACE(bh, info) do {} while (0)
+#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
+#define JBUFFER_TRACE(jh, info) do {} while (0)
+
+#endif /* __KERNEL__ */
+
+#endif /* CONFIG_JBD || CONFIG_JBD_MODULE || !__KERNEL__ */
+
+/*
+ * Compatibility no-ops which allow the kernel to compile without CONFIG_JBD
+ * go here.
+ */
+
+#if defined(__KERNEL__) && !(defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE))
+
+#define J_ASSERT(expr) do {} while (0)
+#define J_ASSERT_BH(bh, expr) do {} while (0)
+#define buffer_jbd(bh) 0
+#define buffer_jlist_eq(bh, val) 0
+#define journal_buffer_journal_lru(bh) 0
+
+#endif /* defined(__KERNEL__) && !defined(CONFIG_JBD) */
+#endif /* _LINUX_JBD_H */
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h
new file mode 100644
index 000000000000..cd77e2fca55a
--- /dev/null
+++ b/include/linux/journal-head.h
@@ -0,0 +1,70 @@
+/*
+ * include/linux/journal-head.h
+ *
+ * buffer_head fields for JBD
+ *
+ * 27 May 2001 ANdrew Morton <andrewm@uow.edu.au>
+ * Created - pulled out of fs.h
+ */
+
+#ifndef JOURNAL_HEAD_H_INCLUDED
+#define JOURNAL_HEAD_H_INCLUDED
+
+typedef unsigned int tid_t; /* Unique transaction ID */
+typedef struct transaction_s transaction_t; /* Compound transaction type */
+struct buffer_head;
+
+struct journal_head {
+#ifndef CONFIG_JBD_UNIFIED_BUFFERS
+ /* Points back to our buffer_head. */
+ struct buffer_head *b_bh;
+#endif
+
+ /* Reference count - see description in journal.c */
+ int b_jcount;
+
+ /* Journaling list for this buffer */
+ unsigned b_jlist;
+
+ /* Copy of the buffer data frozen for writing to the log. */
+ char * b_frozen_data;
+
+ /* Pointer to a saved copy of the buffer containing no
+ uncommitted deallocation references, so that allocations can
+ avoid overwriting uncommitted deletes. */
+ char * b_committed_data;
+
+ /* Pointer to the compound transaction which owns this buffer's
+ metadata: either the running transaction or the committing
+ transaction (if there is one). Only applies to buffers on a
+ transaction's data or metadata journaling list. */
+ /* Protected by journal_datalist_lock */
+ transaction_t * b_transaction;
+
+ /* Pointer to the running compound transaction which is
+ currently modifying the buffer's metadata, if there was
+ already a transaction committing it when the new transaction
+ touched it. */
+ transaction_t * b_next_transaction;
+
+ /* Doubly-linked list of buffers on a transaction's data,
+ metadata or forget queue. */
+ /* Protected by journal_datalist_lock */
+ struct journal_head *b_tnext, *b_tprev;
+
+ /*
+ * Pointer to the compound transaction against which this buffer
+ * is checkpointed. Only dirty buffers can be checkpointed.
+ */
+ /* Protected by journal_datalist_lock */
+ transaction_t * b_cp_transaction;
+
+ /*
+ * Doubly-linked list of buffers still remaining to be flushed
+ * before an old transaction can be checkpointed.
+ */
+ /* Protected by journal_datalist_lock */
+ struct journal_head *b_cpnext, *b_cpprev;
+};
+
+#endif /* JOURNAL_HEAD_H_INCLUDED */
diff --git a/include/linux/malloc.h b/include/linux/malloc.h
index f3ebf1857c77..fc5e144f30a4 100644
--- a/include/linux/malloc.h
+++ b/include/linux/malloc.h
@@ -1,5 +1,7 @@
#ifndef _LINUX_MALLOC_H
#define _LINUX_MALLOC_H
+#warning linux/malloc.h is deprecated, use linux/slab.h instead.
+
#include <linux/slab.h>
#endif /* _LINUX_MALLOC_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 9efd6da5d3ff..e554242553a6 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -257,8 +257,6 @@ static const unsigned long __module_##gtype##_size \
__attribute__ ((unused)) = sizeof(struct gtype##_id); \
static const struct gtype##_id * __module_##gtype##_table \
__attribute__ ((unused)) = name
-#define MODULE_DEVICE_TABLE(type,name) \
- MODULE_GENERIC_TABLE(type##_device,name)
/*
* The following license idents are currently accepted as indicating free
@@ -312,8 +310,15 @@ static const char __module_using_checksums[] __attribute__((section(".modinfo"))
#define MODULE_SUPPORTED_DEVICE(name)
#define MODULE_PARM(var,type)
#define MODULE_PARM_DESC(var,desc)
-#define MODULE_GENERIC_TABLE(gtype,name)
-#define MODULE_DEVICE_TABLE(type,name)
+
+/* Create a dummy reference to the table to suppress gcc unused warnings. Put
+ * the reference in the .data.exit section which is discarded when code is built
+ * in, so the reference does not bloat the running kernel. Note: cannot be
+ * const, other exit data may be writable.
+ */
+#define MODULE_GENERIC_TABLE(gtype,name) \
+static struct gtype##_id * __module_##gtype##_table \
+ __attribute__ ((unused, __section__(".data.exit"))) = name
#ifndef __GENKSYMS__
@@ -328,6 +333,9 @@ extern struct module *module_list;
#endif /* MODULE */
+#define MODULE_DEVICE_TABLE(type,name) \
+ MODULE_GENERIC_TABLE(type##_device,name)
+
/* Export a symbol either from the kernel or a module.
In the kernel, the symbol is added to the kernel's global symbol table.
diff --git a/include/linux/mtd/jedec.h b/include/linux/mtd/jedec.h
index 9d55006c7b20..75271b8a70ba 100644
--- a/include/linux/mtd/jedec.h
+++ b/include/linux/mtd/jedec.h
@@ -7,7 +7,7 @@
*
* See the AMD flash databook for information on how to operate the interface.
*
- * $Id: jedec.h,v 1.1 2000/07/04 07:21:51 jgg Exp $
+ * $Id: jedec.h,v 1.2 2001/11/06 14:37:36 dwmw2 Exp $
*/
#ifndef __LINUX_MTD_JEDEC_H__
@@ -64,6 +64,4 @@ struct jedec_private
struct jedec_flash_chip chips[MAX_JEDEC_CHIPS];
};
-extern const struct JEDECTable *jedec_idtoinf(__u8 mfr,__u8 id);
-
#endif
diff --git a/include/linux/mtio.h b/include/linux/mtio.h
index 8b0f4aa64f85..692088c6361d 100644
--- a/include/linux/mtio.h
+++ b/include/linux/mtio.h
@@ -325,7 +325,8 @@ struct mtftcmd {
#define GMT_DR_OPEN(x) ((x) & 0x00040000) /* door open (no tape) */
/* #define GMT_ ? ((x) & 0x00020000) */
#define GMT_IM_REP_EN(x) ((x) & 0x00010000) /* immediate report mode */
-/* 16 generic status bits unused */
+#define GMT_CLN(x) ((x) & 0x00008000) /* cleaning requested */
+/* 15 generic status bits unused */
/* SCSI-tape specific definitions */
@@ -349,6 +350,7 @@ struct mtftcmd {
#define MT_ST_TIMEOUTS 0x70000000
#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
+#define MT_ST_SET_CLN 0x80000000
#define MT_ST_BUFFER_WRITES 0x1
#define MT_ST_ASYNC_WRITES 0x2
@@ -363,6 +365,7 @@ struct mtftcmd {
#define MT_ST_CAN_PARTITIONS 0x400
#define MT_ST_SCSI2LOGICAL 0x800
#define MT_ST_SYSV 0x1000
+#define MT_ST_NOWAIT 0x2000
/* The mode parameters to be controlled. Parameter chosen with bits 20-28 */
#define MT_ST_CLEAR_DEFAULT 0xfffff
diff --git a/include/linux/nfs_flushd.h b/include/linux/nfs_flushd.h
index ff235df973ea..c8347cc6828e 100644
--- a/include/linux/nfs_flushd.h
+++ b/include/linux/nfs_flushd.h
@@ -9,11 +9,9 @@
/*
* Counters of total number and pending number of requests.
- * When the total number of requests exceeds the soft limit, we start
- * flushing out requests. If it exceeds the hard limit, we stall until
- * it drops again.
+ * When the total number of requests exceeds the hard limit, we stall
+ * until it drops again.
*/
-#define MAX_REQUEST_SOFT 192
#define MAX_REQUEST_HARD 256
/*
@@ -36,8 +34,6 @@ extern int nfs_reqlist_alloc(struct nfs_server *);
extern void nfs_reqlist_free(struct nfs_server *);
extern int nfs_reqlist_init(struct nfs_server *);
extern void nfs_reqlist_exit(struct nfs_server *);
-extern void inode_schedule_scan(struct inode *, unsigned long);
-extern void inode_remove_flushd(struct inode *);
extern void nfs_wake_flushd(void);
/*
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 64d9850695a9..efbbdba3a1bc 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -207,10 +207,14 @@ extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned
*/
extern int nfs_sync_file(struct inode *, struct file *, unsigned long, unsigned int, int);
extern int nfs_flush_file(struct inode *, struct file *, unsigned long, unsigned int, int);
-extern int nfs_flush_timeout(struct inode *, int);
+extern int nfs_flush_list(struct list_head *, int, int);
+extern int nfs_scan_lru_dirty(struct nfs_server *, struct list_head *);
+extern int nfs_scan_lru_dirty_timeout(struct nfs_server *, struct list_head *);
#ifdef CONFIG_NFS_V3
extern int nfs_commit_file(struct inode *, struct file *, unsigned long, unsigned int, int);
-extern int nfs_commit_timeout(struct inode *, int);
+extern int nfs_commit_list(struct list_head *, int);
+extern int nfs_scan_lru_commit(struct nfs_server *, struct list_head *);
+extern int nfs_scan_lru_commit_timeout(struct nfs_server *, struct list_head *);
#endif
static inline int
@@ -257,7 +261,9 @@ nfs_wb_file(struct inode *inode, struct file *file)
*/
extern int nfs_readpage(struct file *, struct page *);
extern int nfs_pagein_inode(struct inode *, unsigned long, unsigned int);
-extern int nfs_pagein_timeout(struct inode *);
+extern int nfs_pagein_list(struct list_head *, int);
+extern int nfs_scan_lru_read(struct nfs_server *, struct list_head *);
+extern int nfs_scan_lru_read_timeout(struct nfs_server *, struct list_head *);
/*
* linux/fs/mount_clnt.c
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index c1e835d3a907..c5fc3aa01a7a 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -1,6 +1,8 @@
#ifndef _NFS_FS_SB
#define _NFS_FS_SB
+#include <linux/list.h>
+
/*
* NFS client parameters stored in the superblock.
*/
@@ -21,6 +23,10 @@ struct nfs_server {
unsigned int namelen;
char * hostname; /* remote hostname */
struct nfs_reqlist * rw_requests; /* async read/write requests */
+ struct list_head lru_read,
+ lru_dirty,
+ lru_commit,
+ lru_busy;
};
/*
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 833242aa7099..59150c0a76f2 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -23,6 +23,7 @@
struct nfs_page {
struct list_head wb_hash, /* Inode */
+ wb_lru, /* superblock lru list */
wb_list, /* Defines state of page: */
*wb_list_head; /* read/write/commit */
struct file *wb_file;
@@ -40,33 +41,39 @@ struct nfs_page {
#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
-extern struct nfs_page *nfs_create_request(struct file *file,
- struct inode *inode,
- struct page *page,
- unsigned int offset,
- unsigned int count);
+extern struct nfs_page *nfs_create_request(struct file *, struct inode *,
+ struct page *,
+ unsigned int, unsigned int);
extern void nfs_release_request(struct nfs_page *req);
-extern void nfs_list_add_request(struct nfs_page *req,
- struct list_head *head);
-extern void nfs_list_remove_request(struct nfs_page *req);
+extern void nfs_list_add_request(struct nfs_page *, struct list_head *);
-extern int nfs_scan_list_timeout(struct list_head *head,
- struct list_head *dst,
- struct inode *inode);
-extern int nfs_scan_list(struct list_head *src, struct list_head *dst,
- struct file *file, unsigned long idx_start,
- unsigned int npages);
-extern int nfs_coalesce_requests(struct list_head *src, struct list_head *dst,
- unsigned int maxpages);
+extern int nfs_scan_lru(struct list_head *, struct list_head *, int);
+extern int nfs_scan_lru_timeout(struct list_head *, struct list_head *, int);
+extern int nfs_scan_list(struct list_head *, struct list_head *,
+ struct file *, unsigned long, unsigned int);
+extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
+ unsigned int);
+extern int nfs_wait_on_request(struct nfs_page *);
extern spinlock_t nfs_wreq_lock;
/*
+ * Lock the page of an asynchronous request without incrementing the wb_count
+ */
+static inline int
+nfs_lock_request_dontget(struct nfs_page *req)
+{
+ if (test_and_set_bit(PG_BUSY, &req->wb_flags))
+ return 0;
+ return 1;
+}
+
+/*
* Lock the page of an asynchronous request
*/
-static __inline__ int
+static inline int
nfs_lock_request(struct nfs_page *req)
{
if (test_and_set_bit(PG_BUSY, &req->wb_flags))
@@ -75,7 +82,7 @@ nfs_lock_request(struct nfs_page *req)
return 1;
}
-static __inline__ void
+static inline void
nfs_unlock_request(struct nfs_page *req)
{
if (!NFS_WBACK_BUSY(req)) {
@@ -86,20 +93,57 @@ nfs_unlock_request(struct nfs_page *req)
clear_bit(PG_BUSY, &req->wb_flags);
smp_mb__after_clear_bit();
if (waitqueue_active(&req->wb_wait))
- wake_up(&req->wb_wait);
+ wake_up_all(&req->wb_wait);
nfs_release_request(req);
}
-static __inline__ struct nfs_page *
+/**
+ * nfs_list_remove_request - Remove a request from its wb_list
+ * @req: request
+ */
+static inline void
+nfs_list_remove_request(struct nfs_page *req)
+{
+ if (list_empty(&req->wb_list))
+ return;
+ if (!NFS_WBACK_BUSY(req)) {
+ printk(KERN_ERR "NFS: unlocked request attempted removed from list!\n");
+ BUG();
+ }
+ list_del_init(&req->wb_list);
+ req->wb_list_head = NULL;
+}
+
+static inline struct nfs_page *
nfs_list_entry(struct list_head *head)
{
return list_entry(head, struct nfs_page, wb_list);
}
-static __inline__ struct nfs_page *
+static inline struct nfs_page *
nfs_inode_wb_entry(struct list_head *head)
{
return list_entry(head, struct nfs_page, wb_hash);
}
+static inline void
+__nfs_add_lru(struct list_head *head, struct nfs_page *req)
+{
+ list_add_tail(&req->wb_lru, head);
+}
+
+static inline void
+__nfs_del_lru(struct nfs_page *req)
+{
+ if (list_empty(&req->wb_lru))
+ return;
+ list_del_init(&req->wb_lru);
+}
+
+static inline struct nfs_page *
+nfs_lru_entry(struct list_head *head)
+{
+ return list_entry(head, struct nfs_page, wb_lru);
+}
+
#endif /* _LINUX_NFS_PAGE_H */
diff --git a/include/linux/parport.h b/include/linux/parport.h
index 07a9ac6ae9a3..bee974807bd8 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -11,8 +11,8 @@
/* Start off with user-visible constants */
-/* Maximum of 8 ports per machine */
-#define PARPORT_MAX 8
+/* Maximum of 16 ports per machine */
+#define PARPORT_MAX 16
/* Magic numbers */
#define PARPORT_IRQ_NONE -1
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 08e720a8904f..d5ab6ab27264 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -383,6 +383,11 @@
#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411
#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413
#define PCI_DEVICE_ID_AMD_VIPER_7414 0x7414
+#define PCI_DEVICE_ID_AMD_VIPER_7440 0x7440
+#define PCI_DEVICE_ID_AMD_VIPER_7441 0x7441
+#define PCI_DEVICE_ID_AMD_VIPER_7443 0x7443
+#define PCI_DEVICE_ID_AMD_VIPER_7448 0x7448
+#define PCI_DEVICE_ID_AMD_VIPER_7449 0x7449
#define PCI_VENDOR_ID_TRIDENT 0x1023
#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
@@ -420,6 +425,7 @@
#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
#define PCI_DEVICE_ID_MATROX_G400 0x0525
+#define PCI_DEVICE_ID_MATROX_G550 0x2527
#define PCI_DEVICE_ID_MATROX_VIA 0x4536
#define PCI_VENDOR_ID_CT 0x102c
@@ -452,6 +458,7 @@
#define PCI_DEVICE_ID_SI_300 0x0300
#define PCI_DEVICE_ID_SI_315H 0x0310
#define PCI_DEVICE_ID_SI_315 0x0315
+#define PCI_DEVICE_ID_SI_315PRO 0x0325
#define PCI_DEVICE_ID_SI_530 0x0530
#define PCI_DEVICE_ID_SI_540 0x0540
#define PCI_DEVICE_ID_SI_550 0x0550
@@ -465,12 +472,12 @@
#define PCI_DEVICE_ID_SI_645 0x0645
#define PCI_DEVICE_ID_SI_650 0x0650
#define PCI_DEVICE_ID_SI_730 0x0730
+#define PCI_DEVICE_ID_SI_630_VGA 0x6300
+#define PCI_DEVICE_ID_SI_730_VGA 0x7300
#define PCI_DEVICE_ID_SI_735 0x0735
#define PCI_DEVICE_ID_SI_740 0x0740
#define PCI_DEVICE_ID_SI_745 0x0745
#define PCI_DEVICE_ID_SI_750 0x0750
-#define PCI_DEVICE_ID_SI_630_VGA 0x6300
-#define PCI_DEVICE_ID_SI_730_VGA 0x7300
#define PCI_DEVICE_ID_SI_900 0x0900
#define PCI_DEVICE_ID_SI_5107 0x5107
#define PCI_DEVICE_ID_SI_5300 0x5300
@@ -595,7 +602,9 @@
#define PCI_DEVICE_ID_PROMISE_20246 0x4d33
#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
#define PCI_DEVICE_ID_PROMISE_20268 0x4d68
-#define PCI_DEVICE_ID_PROMISE_20268R 0x6268
+#define PCI_DEVICE_ID_PROMISE_20268R 0x6268
+#define PCI_DEVICE_ID_PROMISE_20269 0x4d69
+#define PCI_DEVICE_ID_PROMISE_20275 0x1275
#define PCI_DEVICE_ID_PROMISE_5300 0x5300
#define PCI_VENDOR_ID_N9 0x105d
@@ -710,6 +719,7 @@
#define PCI_DEVICE_ID_CMD_648 0x0648
#define PCI_DEVICE_ID_CMD_649 0x0649
#define PCI_DEVICE_ID_CMD_670 0x0670
+#define PCI_DEVICE_ID_CMD_680 0x0680
#define PCI_VENDOR_ID_VISION 0x1098
#define PCI_DEVICE_ID_VISION_QD8500 0x0001
@@ -1600,6 +1610,16 @@
#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443
#define PCI_DEVICE_ID_INTEL_82801BA_3 0x2444
#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445
+#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
+#define PCI_DEVICE_ID_INTEL_82801CA_2 0x2482
+#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
+#define PCI_DEVICE_ID_INTEL_82801CA_4 0x2484
+#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485
+#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486
+#define PCI_DEVICE_ID_INTEL_82801CA_7 0x2487
+#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
+#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
+#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
#define PCI_DEVICE_ID_INTEL_82801BA_5 0x2446
#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448
#define PCI_DEVICE_ID_INTEL_82801BA_7 0x2449
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index ffc468f00ae5..9a1be8145a7d 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -19,6 +19,7 @@
#include <asm/unaligned.h>
#include <linux/bitops.h>
#include <asm/hardirq.h>
+#include <linux/proc_fs.h>
#endif
/*
@@ -1908,6 +1909,67 @@ int read_old_super_block (struct super_block * s, int size);*/
struct super_block * reiserfs_read_super (struct super_block * s, void * data, int silent);
int reiserfs_statfs (struct super_block * s, struct statfs * buf);
+/* procfs.c */
+
+#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
+#define REISERFS_PROC_INFO
+#else
+#undef REISERFS_PROC_INFO
+#endif
+
+int reiserfs_proc_info_init( struct super_block *sb );
+int reiserfs_proc_info_done( struct super_block *sb );
+struct proc_dir_entry *reiserfs_proc_register( struct super_block *sb,
+ char *name, read_proc_t *func );
+void reiserfs_proc_unregister( struct super_block *sb, const char *name );
+struct proc_dir_entry *reiserfs_proc_register_global( char *name,
+ read_proc_t *func );
+void reiserfs_proc_unregister_global( const char *name );
+int reiserfs_proc_info_global_init( void );
+int reiserfs_proc_info_global_done( void );
+int reiserfs_proc_tail( int len, char *buffer, char **start,
+ off_t offset, int count, int *eof );
+int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_version_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_super_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_per_level_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_bitmap_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_on_disk_super_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_oidmap_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+int reiserfs_journal_in_proc( char *buffer, char **start, off_t offset,
+ int count, int *eof, void *data );
+
+#if defined( REISERFS_PROC_INFO )
+
+#define PROC_EXP( e ) e
+
+#define MAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
+#define __PINFO( sb ) ( sb ) -> u.reiserfs_sb.s_proc_info_data
+#define PROC_INFO_MAX( sb, field, value ) \
+ __PINFO( sb ).field = \
+ MAX( ( sb ) -> u.reiserfs_sb.s_proc_info_data.field, value )
+#define PROC_INFO_INC( sb, field ) ( ++ ( __PINFO( sb ).field ) )
+#define PROC_INFO_ADD( sb, field, val ) ( __PINFO( sb ).field += ( val ) )
+#define PROC_INFO_BH_STAT( sb, bh, level ) \
+ PROC_INFO_INC( sb, sbk_read_at[ ( level ) ] ); \
+ PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \
+ PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) )
+#else
+#define PROC_EXP( e )
+#define VOID_V ( ( void ) 0 )
+#define PROC_INFO_MAX( sb, field, value ) VOID_V
+#define PROC_INFO_INC( sb, field ) VOID_V
+#define PROC_INFO_ADD( sb, field, val ) VOID_V
+#define PROC_INFO_BH_STAT( p_s_sb, p_s_bh, n_node_level ) VOID_V
+#endif
+
/* dir.c */
extern struct inode_operations reiserfs_dir_inode_operations;
extern struct file_operations reiserfs_dir_operations;
@@ -1929,8 +1991,8 @@ int get_new_buffer (struct reiserfs_transaction_handle *th, struct buffer_head *
/* buffer2.c */
struct buffer_head * reiserfs_getblk (kdev_t n_dev, int n_block, int n_size);
void wait_buffer_until_released (const struct buffer_head * bh);
-struct buffer_head * reiserfs_bread (kdev_t n_dev, int n_block, int n_size);
-
+struct buffer_head * reiserfs_bread (struct super_block *super, int n_block,
+ int n_size);
/* fix_nodes.c */
void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s);
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index ffd16a92c8f0..1eee601a12de 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -314,6 +314,74 @@ struct reiserfs_journal {
typedef __u32 (*hashf_t) (const signed char *, int);
+struct proc_dir_entry;
+
+#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
+typedef unsigned long int stat_cnt_t;
+typedef struct reiserfs_proc_info_data
+{
+ spinlock_t lock;
+ int exiting;
+ int max_hash_collisions;
+
+ stat_cnt_t breads;
+ stat_cnt_t bread_miss;
+ stat_cnt_t search_by_key;
+ stat_cnt_t search_by_key_fs_changed;
+ stat_cnt_t search_by_key_restarted;
+
+ stat_cnt_t leaked_oid;
+ stat_cnt_t leaves_removable;
+
+ /* balances per level. Use explicit 5 as MAX_HEIGHT is not visible yet. */
+ stat_cnt_t balance_at[ 5 ]; /* XXX */
+ /* sbk == search_by_key */
+ stat_cnt_t sbk_read_at[ 5 ]; /* XXX */
+ stat_cnt_t sbk_fs_changed[ 5 ];
+ stat_cnt_t sbk_restarted[ 5 ];
+ stat_cnt_t items_at[ 5 ]; /* XXX */
+ stat_cnt_t free_at[ 5 ]; /* XXX */
+ stat_cnt_t can_node_be_removed[ 5 ]; /* XXX */
+ long int lnum[ 5 ]; /* XXX */
+ long int rnum[ 5 ]; /* XXX */
+ long int lbytes[ 5 ]; /* XXX */
+ long int rbytes[ 5 ]; /* XXX */
+ stat_cnt_t get_neighbors[ 5 ];
+ stat_cnt_t get_neighbors_restart[ 5 ];
+ stat_cnt_t need_l_neighbor[ 5 ];
+ stat_cnt_t need_r_neighbor[ 5 ];
+
+ stat_cnt_t free_block;
+ struct __find_forward_stats {
+ stat_cnt_t call;
+ stat_cnt_t wait;
+ stat_cnt_t bmap;
+ stat_cnt_t retry;
+ stat_cnt_t in_journal_hint;
+ stat_cnt_t in_journal_out;
+ } find_forward;
+ struct __journal_stats {
+ stat_cnt_t in_journal;
+ stat_cnt_t in_journal_bitmap;
+ stat_cnt_t in_journal_reusable;
+ stat_cnt_t lock_journal;
+ stat_cnt_t lock_journal_wait;
+ stat_cnt_t journal_being;
+ stat_cnt_t journal_relock_writers;
+ stat_cnt_t journal_relock_wcount;
+ stat_cnt_t mark_dirty;
+ stat_cnt_t mark_dirty_already;
+ stat_cnt_t mark_dirty_notjournal;
+ stat_cnt_t restore_prepared;
+ stat_cnt_t prepare;
+ stat_cnt_t prepare_retry;
+ } journal;
+} reiserfs_proc_info_data_t;
+#else
+typedef struct reiserfs_proc_info_data
+{} reiserfs_proc_info_data_t;
+#endif
+
/* reiserfs union of in-core super block data */
struct reiserfs_sb_info
{
@@ -352,6 +420,8 @@ struct reiserfs_sb_info
int s_bmaps_without_search;
int s_direct2indirect;
int s_indirect2direct;
+ reiserfs_proc_info_data_t s_proc_info_data;
+ struct proc_dir_entry *procdir;
};
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 836b3b86e41b..1501cd0e9f8d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -88,6 +88,7 @@ extern int last_pid;
#define TASK_UNINTERRUPTIBLE 2
#define TASK_ZOMBIE 4
#define TASK_STOPPED 8
+#define TASK_DEAD 16
#define __set_task_state(tsk, state_value) \
do { (tsk)->state = (state_value); } while (0)
@@ -399,6 +400,9 @@ struct task_struct {
u32 self_exec_id;
/* Protection of (de-)allocation: mm, files, fs, tty */
spinlock_t alloc_lock;
+
+/* journalling filesystem info */
+ void *journal_info;
};
/*
@@ -486,7 +490,8 @@ extern struct exec_domain default_exec_domain;
sig: &init_signals, \
pending: { NULL, &tsk.pending.head, {{0}}}, \
blocked: {{0}}, \
- alloc_lock: SPIN_LOCK_UNLOCKED \
+ alloc_lock: SPIN_LOCK_UNLOCKED, \
+ journal_info: NULL, \
}
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 28da97697470..13f23c7ef376 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -182,5 +182,11 @@ extern void unregister_serial(int line);
/* Allow complicated architectures to specify rs_table[] at run time */
extern int early_serial_setup(struct serial_struct *req);
+#ifdef CONFIG_ACPI
+/* tty ports reserved for the ACPI serial console port and debug port */
+#define ACPI_SERIAL_CONSOLE_PORT 4
+#define ACPI_SERIAL_DEBUG_PORT 5
+#endif
+
#endif /* __KERNEL__ */
#endif /* _LINUX_SERIAL_H */
diff --git a/include/linux/sisfb.h b/include/linux/sisfb.h
index 2f5be64743ac..4d12567013ba 100644
--- a/include/linux/sisfb.h
+++ b/include/linux/sisfb.h
@@ -1,12 +1,6 @@
#ifndef _LINUX_SISFB
#define _LINUX_SISFB
-/* CRT2 connection */
-#define MASK_DISPTYPE_CRT2 0x04 /* Connect CRT2 */
-#define MASK_DISPTYPE_LCD 0x02 /* Connect LCD */
-#define MASK_DISPTYPE_TV 0x01 /* Connect TV */
-#define MASK_DISPTYPE_DISP2 (MASK_DISPTYPE_LCD | MASK_DISPTYPE_TV | MASK_DISPTYPE_CRT2)
-
#define DISPTYPE_CRT1 0x00000008L
#define DISPTYPE_CRT2 0x00000004L
#define DISPTYPE_LCD 0x00000002L
@@ -17,96 +11,102 @@
#define DISPMODE_MIRROR 0x00000010L
#define DISPMODE_DUALVIEW 0x00000040L
-#define HASVB_NONE 0
-#define HASVB_301 1
-#define HASVB_LVDS 2
-#define HASVB_TRUMPION 3
-#define HASVB_LVDS_CHRONTEL 4
-#define HASVB_LVDS_ALL (HASVB_LVDS | HASVB_TRUMPION | HASVB_LVDS_CHRONTEL)
+#define HASVB_NONE 0x00
+#define HASVB_301 0x01
+#define HASVB_LVDS 0x02
+#define HASVB_TRUMPION 0x04
+#define HASVB_LVDS_CHRONTEL 0x10
+#define HASVB_302 0x20
+#define HASVB_303 0x40
+#define HASVB_CHRONTEL 0x80
+
+typedef enum _SIS_CHIP_TYPE {
+ SIS_VGALegacy = 0,
+ SIS_300,
+ SIS_630,
+ SIS_540,
+ SIS_730,
+ SIS_315H,
+ SIS_315,
+ SIS_550,
+ SIS_315PRO,
+ SIS_640,
+ SIS_740,
+ SIS_330,
+ MAX_SIS_CHIP
+} SIS_CHIP_TYPE;
-enum _TVMODE
-{
+typedef enum _TVTYPE {
TVMODE_NTSC = 0,
TVMODE_PAL,
TVMODE_HIVISION,
TVMODE_TOTAL
-};
+} SIS_TV_TYPE;
-enum _TVPLUGTYPE
-{
- TVPLUG_UNKNOWN = 0,
+typedef enum _TVPLUGTYPE {
+ TVPLUG_Legacy = 0,
TVPLUG_COMPOSITE,
TVPLUG_SVIDEO,
TVPLUG_SCART,
TVPLUG_TOTAL
-};
+} SIS_TV_PLUG;
-enum CHIPTYPE
-{
- SiS_UNKNOWN = 0,
- SiS_300,
- SiS_540,
- SiS_630,
- SiS_630S,
- SiS_730
+struct sis_memreq {
+ unsigned long offset;
+ unsigned long size;
};
-struct sis_memreq
-{
- unsigned long offset;
- unsigned long size;
+struct mode_info {
+ int bpp;
+ int xres;
+ int yres;
+ int v_xres;
+ int v_yres;
+ int org_x;
+ int org_y;
+ unsigned int vrate;
};
-/* Data for AP */
-struct mode_info
-{
- int bpp;
- int xres;
- int yres;
- int v_xres;
- int v_yres;
- int org_x;
- int org_y;
- unsigned int vrate;
+struct ap_data {
+ struct mode_info minfo;
+ unsigned long iobase;
+ unsigned int mem_size;
+ unsigned long disp_state;
+ SIS_CHIP_TYPE chip;
+ unsigned char hasVB;
+ SIS_TV_TYPE TV_type;
+ SIS_TV_PLUG TV_plug;
+ unsigned long version;
+ char reserved[256];
};
-struct ap_data
-{
- struct mode_info minfo;
- unsigned long iobase;
- unsigned int mem_size;
- unsigned long disp_state;
- enum CHIPTYPE chip;
-};
+struct video_info {
+ int chip_id;
+ unsigned int video_size;
+ unsigned long video_base;
+ char *video_vbase;
+ unsigned long mmio_base;
+ char *mmio_vbase;
+ unsigned long vga_base;
+ int video_bpp;
+ int video_width;
+ int video_height;
+ int video_vwidth;
+ int video_vheight;
+ int org_x;
+ int org_y;
+ unsigned int refresh_rate;
-/* Data for kernel */
-struct video_info
-{
- /* card parameters */
- int chip_id;
- unsigned int video_size;
- unsigned long video_base;
- char *video_vbase;
- unsigned long mmio_base;
- char *mmio_vbase;
- unsigned long vga_base;
+ unsigned long disp_state;
+ unsigned char hasVB;
+ unsigned char TV_type;
+ unsigned char TV_plug;
- /* mode */
- int video_bpp;
- int video_width;
- int video_height;
- int video_vwidth;
- int video_vheight;
- int org_x;
- int org_y;
- unsigned int refresh_rate;
+ SIS_CHIP_TYPE chip;
+ unsigned char revision_id;
- /* VB functions */
- unsigned long disp_state;
- unsigned char hasVB;
- unsigned char TV_type;
- unsigned char TV_plug;
+ char reserved[256];
};
#ifdef __KERNEL__
@@ -114,5 +114,6 @@ extern struct video_info ivideo;
extern void sis_malloc(struct sis_memreq *req);
extern void sis_free(unsigned long base);
+extern void sis_dispinfo(struct ap_data *rec);
#endif
#endif
diff --git a/include/linux/soundcard.h b/include/linux/soundcard.h
index e39d96543fa3..28d2d1881978 100644
--- a/include/linux/soundcard.h
+++ b/include/linux/soundcard.h
@@ -179,7 +179,7 @@ typedef struct seq_event_rec {
* Some big endian/little endian handling macros
*/
-#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC)
+#if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__sparc__) || defined(HPPA) || defined(PPC) || defined(__mc68000__)
/* Big endian machines */
# define _PATCHKEY(id) (0xfd00|id)
# define AFMT_S16_NE AFMT_S16_BE
diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h
index 60a38abf536c..104de0a08e19 100644
--- a/include/linux/sysv_fs.h
+++ b/include/linux/sysv_fs.h
@@ -241,53 +241,6 @@ struct sysv_inode {
u32 i_ctime; /* time of creation */
};
-/* The admissible values for i_mode are listed in <linux/stat.h> :
- * #define S_IFMT 00170000 mask for type
- * #define S_IFREG 0100000 type = regular file
- * #define S_IFBLK 0060000 type = block device
- * #define S_IFDIR 0040000 type = directory
- * #define S_IFCHR 0020000 type = character device
- * #define S_IFIFO 0010000 type = named pipe
- * #define S_ISUID 0004000 set user id
- * #define S_ISGID 0002000 set group id
- * #define S_ISVTX 0001000 save swapped text even after use
- * Additionally for SystemV:
- * #define S_IFLNK 0120000 type = symbolic link
- * #define S_IFNAM 0050000 type = XENIX special named file ??
- * Additionally for Coherent:
- * #define S_IFMPB 0070000 type = multiplexed block device ??
- * #define S_IFMPC 0030000 type = multiplexed character device ??
- *
- * Since Coherent doesn't know about symbolic links, we use a kludgey
- * implementation of symbolic links: i_mode = COH_KLUDGE_SYMLINK_MODE
- * denotes a symbolic link. When a regular file should get this mode by
- * accident, it is automatically converted to COH_KLUDGE_NOT_SYMLINK.
- * We use S_IFREG because only regular files (and Coherent pipes...) can have
- * data blocks with arbitrary contents associated with them, and S_ISVTX
- * ("save swapped text after use") because it is unused on both Linux and
- * Coherent: Linux does much more intelligent paging, and Coherent hasn't
- * virtual memory at all.
- * Same trick for Xenix.
- */
-#define COH_KLUDGE_SYMLINK_MODE (S_IFREG | S_ISVTX)
-#define COH_KLUDGE_NOT_SYMLINK (S_IFREG | S_ISVTX | S_IRUSR) /* force read access */
-static inline mode_t from_coh_imode(unsigned short mode)
-{
- if (mode == COH_KLUDGE_SYMLINK_MODE)
- return (S_IFLNK | 0777);
- else
- return mode;
-}
-static inline unsigned short to_coh_imode(mode_t mode)
-{
- if (S_ISLNK(mode))
- return COH_KLUDGE_SYMLINK_MODE;
- else if (mode == COH_KLUDGE_SYMLINK_MODE)
- return COH_KLUDGE_NOT_SYMLINK;
- else
- return mode;
-}
-
/* Admissible values for i_nlink: 0.._LINK_MAX */
enum {
XENIX_LINK_MAX = 126, /* ?? */
@@ -360,7 +313,6 @@ extern void sysv_truncate(struct inode *);
extern void sysv_write_inode(struct inode *, int);
extern int sysv_sync_inode(struct inode *);
extern int sysv_sync_file(struct file *, struct dentry *, int);
-extern int sysv_notify_change(struct dentry *, struct iattr *);
extern void sysv_set_inode(struct inode *, dev_t);
extern struct sysv_dir_entry *sysv_find_entry(struct dentry*, struct page**);
diff --git a/include/linux/sysv_fs_i.h b/include/linux/sysv_fs_i.h
index 08eff4449aff..084173ad891b 100644
--- a/include/linux/sysv_fs_i.h
+++ b/include/linux/sysv_fs_i.h
@@ -10,6 +10,7 @@ struct sysv_inode_info {
* then 1 double indirection block,
* then 1 triple indirection block.
*/
+ u32 i_dir_start_lookup;
};
#endif
diff --git a/include/linux/sysv_fs_sb.h b/include/linux/sysv_fs_sb.h
index fe324c96df84..b7f0d3238b23 100644
--- a/include/linux/sysv_fs_sb.h
+++ b/include/linux/sysv_fs_sb.h
@@ -13,7 +13,6 @@
struct sysv_sb_info {
int s_type; /* file system type: FSTYPE_{XENIX|SYSV|COH} */
char s_bytesex; /* bytesex (le/be/pdp) */
- char s_kludge_symlinks; /* flag whether symlinks have a kludgey mode */
char s_truncate; /* if 1: names > SYSV_NAMELEN chars are truncated */
/* if 0: they are disallowed (ENAMETOOLONG) */
nlink_t s_link_max; /* max number of hard links to a file */
@@ -56,7 +55,6 @@ struct sysv_sb_info {
/* sv_ == u.sysv_sb.s_ */
#define sv_type u.sysv_sb.s_type
#define sv_bytesex u.sysv_sb.s_bytesex
-#define sv_kludge_symlinks u.sysv_sb.s_kludge_symlinks
#define sv_truncate u.sysv_sb.s_truncate
#define sv_link_max u.sysv_sb.s_link_max
#define sv_inodes_per_block u.sysv_sb.s_inodes_per_block
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 9ae491f509d5..0055d5810dae 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -91,7 +91,7 @@ struct video_tuner
{
int tuner;
char name[32];
- ulong rangelow, rangehigh; /* Tuner range */
+ unsigned long rangelow, rangehigh; /* Tuner range */
__u32 flags;
#define VIDEO_TUNER_PAL 1
#define VIDEO_TUNER_NTSC 2
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 8d7a7764d87e..46ee52f3e6a1 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -25,6 +25,7 @@ struct watchdog_info {
#define WDIOC_GETTEMP _IOR(WATCHDOG_IOCTL_BASE, 3, int)
#define WDIOC_SETOPTIONS _IOR(WATCHDOG_IOCTL_BASE, 4, int)
#define WDIOC_KEEPALIVE _IOR(WATCHDOG_IOCTL_BASE, 5, int)
+#define WDIOC_SETTIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 6, int)
#define WDIOF_UNKNOWN -1 /* Unknown flag error */
#define WDIOS_UNKNOWN -1 /* Unknown status error */
diff --git a/include/net/dn.h b/include/net/dn.h
index 88a0bab3e072..a88b6f5e9324 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -217,5 +217,6 @@ extern int decnet_time_wait;
extern int decnet_dn_count;
extern int decnet_di_count;
extern int decnet_dr_count;
+extern int decnet_no_fc_max_cwnd;
#endif /* _NET_DN_H */
diff --git a/include/net/irda/irda-usb.h b/include/net/irda/irda-usb.h
index 0be3f916e2b4..497d15f82440 100644
--- a/include/net/irda/irda-usb.h
+++ b/include/net/irda/irda-usb.h
@@ -120,6 +120,11 @@ struct irda_class_desc {
__u8 bMaxUnicastList;
} __attribute__ ((packed));
+/* class specific interface request to get the IrDA-USB class descriptor
+ * (6.2.5, USB-IrDA class spec 1.0) */
+
+#define IU_REQ_GET_CLASS_DESC 0x06
+
struct irda_usb_cb {
struct irda_class_desc *irda_desc;
struct usb_device *usbdev; /* init: probe_irda */
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 77c9d5765715..c3896b397492 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -10,6 +10,7 @@
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-2000 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -44,6 +45,11 @@ typedef __u32 magic_t;
#define FALSE 0
#endif
+/* Hack to do small backoff when setting media busy in IrLAP */
+#ifndef SMALL
+#define SMALL 5
+#endif
+
#ifndef IRDA_MIN /* Lets not mix this MIN with other header files */
#define IRDA_MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index 54f5349fafa2..42ea7f81c115 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -12,6 +12,7 @@
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -103,6 +104,7 @@ typedef enum {
DISCOVERY_TIMER_EXPIRED,
WD_TIMER_EXPIRED,
BACKOFF_TIMER_EXPIRED,
+ MEDIA_BUSY_TIMER_EXPIRED,
} IRLAP_EVENT;
/*
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 9c86abb774f9..aebf005ac066 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -11,6 +11,7 @@
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -131,7 +132,6 @@ struct lap_cb {
struct irlap_cb *irlap; /* Instance of IrLAP layer */
hashbin_t *lsaps; /* LSAP associated with this link */
- int refcount;
__u8 caddr; /* Connection address */
__u32 saddr; /* Source device address */
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h
index 1c960e6a00bd..e8af8d3dc676 100644
--- a/include/net/irda/irlmp_event.h
+++ b/include/net/irda/irlmp_event.h
@@ -11,6 +11,7 @@
*
* Copyright (c) 1997, 1999 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -103,10 +104,6 @@ void irlmp_watchdog_timer_expired(void *data);
void irlmp_discovery_timer_expired(void *data);
void irlmp_idle_timer_expired(void *data);
-void irlmp_next_station_state(IRLMP_STATE state);
-void irlmp_next_lsap_state(struct lsap_cb *self, LSAP_STATE state);
-void irlmp_next_lap_state(struct lap_cb *self, IRLMP_STATE state);
-
void irlmp_do_lap_event(struct lap_cb *self, IRLMP_EVENT event,
struct sk_buff *skb);
int irlmp_do_lsap_event(struct lsap_cb *self, IRLMP_EVENT event,
diff --git a/include/net/irda/irmod.h b/include/net/irda/irmod.h
index f2ccb854c816..d54720925460 100644
--- a/include/net/irda/irmod.h
+++ b/include/net/irda/irmod.h
@@ -10,6 +10,7 @@
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-2000 Dag Brattli, All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -25,109 +26,20 @@
#ifndef IRMOD_H
#define IRMOD_H
-#include <linux/skbuff.h>
-#include <linux/miscdevice.h>
+#include <net/irda/irda.h> /* Notify stuff */
-#include <net/irda/irqueue.h>
+/* Nothing much here anymore - Maybe this header should be merged in
+ * another header like net/irda/irda.h... - Jean II */
-#define IRMGR_IOC_MAGIC 'm'
-#define IRMGR_IOCTNPC _IO(IRMGR_IOC_MAGIC, 1)
-#define IRMGR_IOC_MAXNR 1
-
-/*
- * Events that we pass to the user space manager
- */
-typedef enum {
- EVENT_DEVICE_DISCOVERED = 0,
- EVENT_REQUEST_MODULE,
- EVENT_IRLAN_START,
- EVENT_IRLAN_STOP,
- EVENT_IRLPT_START, /* Obsolete */
- EVENT_IRLPT_STOP, /* Obsolete */
- EVENT_IROBEX_START, /* Obsolete */
- EVENT_IROBEX_STOP, /* Obsolete */
- EVENT_IRDA_STOP,
- EVENT_NEED_PROCESS_CONTEXT,
-} IRMGR_EVENT;
-
-/*
- * Event information passed to the IrManager daemon process
- */
-struct irmanager_event {
- IRMGR_EVENT event;
- char devname[10];
- char info[32];
- int service;
- __u32 saddr;
- __u32 daddr;
-};
-
-typedef void (*TODO_CALLBACK)( void *self, __u32 param);
-
-/*
- * Same as irmanager_event but this one can be queued and inclueds some
- * addtional information
- */
-struct irda_event {
- irda_queue_t q; /* Must be first */
-
- struct irmanager_event event;
-};
-
-/*
- * Funtions with needs to be called with a process context
- */
-struct irda_todo {
- irda_queue_t q; /* Must be first */
-
- void *self;
- TODO_CALLBACK callback;
- __u32 param;
-};
-
-/*
- * Main structure for the IrDA device (not much here :-)
- */
-struct irda_cb {
- struct miscdevice dev;
- wait_queue_head_t wait_queue;
-
- int in_use;
-
- irda_queue_t *event_queue; /* Events queued for the irmanager */
- irda_queue_t *todo_queue; /* Todo list */
-};
-
-int irmod_init_module(void);
-void irmod_cleanup_module(void);
-
-/*
- * Function irda_lock (lock)
- *
- * Lock variable. Returns false if the lock is already set.
- *
- */
-static inline int irda_lock(int *lock)
-{
- if (test_and_set_bit( 0, (void *) lock)) {
- IRDA_DEBUG(3, __FUNCTION__
- "(), Trying to lock, already locked variable!\n");
- return FALSE;
- }
- return TRUE;
-}
-
-inline int irda_unlock(int *lock);
+/* Locking wrapper - Note the inverted logic on irda_lock().
+ * Those function basically return false if the lock is already in the
+ * position you want to set it. - Jean II */
+#define irda_lock(lock) (! test_and_set_bit(0, (void *) (lock)))
+#define irda_unlock(lock) (test_and_clear_bit(0, (void *) (lock)))
+/* Zero the notify structure */
void irda_notify_init(notify_t *notify);
-void irda_execute_as_process(void *self, TODO_CALLBACK callback, __u32 param);
-void irmanager_notify(struct irmanager_event *event);
-
-extern void irda_proc_modcount(struct inode *, int);
-void irda_mod_inc_use_count(void);
-void irda_mod_dec_use_count(void);
-
#endif /* IRMOD_H */
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index 20f8a23c1f54..3938975c0764 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -25,6 +25,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
+ *
+ * Michel Dänzer <daenzer@debian.org>, 10/2001
+ * - simplify irda_pv_t to avoid endianness issues
*
********************************************************************/
@@ -55,11 +58,7 @@ typedef enum {
typedef union {
char *c;
- __u8 b;
- __u16 s;
__u32 i;
- __u8 *bp;
- __u16 *sp;
__u32 *ip;
} irda_pv_t;
diff --git a/include/net/irda/timer.h b/include/net/irda/timer.h
index f2cc642ece73..ba648b9b9443 100644
--- a/include/net/irda/timer.h
+++ b/include/net/irda/timer.h
@@ -11,6 +11,7 @@
*
* Copyright (c) 1997, 1998-1999 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
+ * Copyright (c) 2000-2001 Jean Tourrilhes <jt@hpl.hp.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -47,7 +48,9 @@
* duration of the P-timer.
*/
#define WD_TIMEOUT (POLL_TIMEOUT*2)
+
#define MEDIABUSY_TIMEOUT (500*HZ/1000) /* 500 msec */
+#define SMALLBUSY_TIMEOUT (100*HZ/1000) /* 100 msec - IrLAP 6.13.4 */
/*
* Slot timer must never exceed 85 ms, and must always be at least 25 ms,
@@ -75,7 +78,7 @@ inline void irlap_start_final_timer(struct irlap_cb *self, int timeout);
inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout);
inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout);
-void irlap_start_mbusy_timer(struct irlap_cb *);
+void irlap_start_mbusy_timer(struct irlap_cb *self, int timeout);
void irlap_stop_mbusy_timer(struct irlap_cb *);
struct lsap_cb;