diff options
| author | David S. Miller <davem@kernel.bkbits.net> | 2003-05-14 06:50:40 -0700 |
|---|---|---|
| committer | David S. Miller <davem@kernel.bkbits.net> | 2003-05-14 06:50:40 -0700 |
| commit | 917ba3a61d3c4dd052c50bc216e8f22cf53308d7 (patch) | |
| tree | 5f54fc7881b82019280d10000bd29d23f2a0cd43 /include | |
| parent | 1b1b7dc23b4149e673a06b276f6b812374dd41b9 (diff) | |
| parent | dd4a39287ab6a7529e694fedd358201040e3ef27 (diff) | |
Merge davem@nuts.ninka.net:/home/davem/src/BK/net-2.5
into kernel.bkbits.net:/home/davem/net-2.5
Diffstat (limited to 'include')
24 files changed, 208 insertions, 56 deletions
diff --git a/include/asm-arm/arch-anakin/time.h b/include/asm-arm/arch-anakin/time.h index a00557a7210c..bbee11b55fd8 100644 --- a/include/asm-arm/arch-anakin/time.h +++ b/include/asm-arm/arch-anakin/time.h @@ -14,10 +14,11 @@ #ifndef __ASM_ARCH_TIME_H #define __ASM_ARCH_TIME_H -static void +static irqreturn_t anakin_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); + return IRQ_HANDLED; } void __init time_init(void) diff --git a/include/asm-arm/arch-arc/time.h b/include/asm-arm/arch-arc/time.h index 6d980227fc6c..d382dad68ece 100644 --- a/include/asm-arm/arch-arc/time.h +++ b/include/asm-arm/arch-arc/time.h @@ -14,11 +14,13 @@ */ extern void ioctime_init(void); -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); do_set_rtc(); do_profile(regs); + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-cl7500/time.h b/include/asm-arm/arch-cl7500/time.h index adf3096e85da..e5e5be510265 100644 --- a/include/asm-arm/arch-cl7500/time.h +++ b/include/asm-arm/arch-cl7500/time.h @@ -11,7 +11,8 @@ extern void ioctime_init(void); -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); do_set_rtc(); @@ -26,6 +27,7 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) *((volatile unsigned int *)LED_ADDRESS) = state; } } + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-clps711x/time.h b/include/asm-arm/arch-clps711x/time.h index 635356dd62b0..10d1038f3cfd 100644 --- a/include/asm-arm/arch-clps711x/time.h +++ b/include/asm-arm/arch-clps711x/time.h @@ -25,11 +25,13 @@ extern void clps711x_setup_timer(void); /* * IRQ handler for the timer */ -static void p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +p720t_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_leds(); do_timer(regs); do_profile(regs); + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-ebsa110/time.h b/include/asm-arm/arch-ebsa110/time.h index 30c90e607546..c482e372b012 100644 --- a/include/asm-arm/arch-ebsa110/time.h +++ b/include/asm-arm/arch-ebsa110/time.h @@ -74,7 +74,8 @@ static unsigned long ebsa110_gettimeoffset(void) return offset; } -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 count; @@ -91,6 +92,8 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_leds(); do_timer(regs); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-ebsa285/time.h b/include/asm-arm/arch-ebsa285/time.h index feb175ee806b..5aedeb859b35 100644 --- a/include/asm-arm/arch-ebsa285/time.h +++ b/include/asm-arm/arch-ebsa285/time.h @@ -69,7 +69,8 @@ static unsigned long isa_gettimeoffset(void) return count; } -static void isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { if (machine_is_netwinder()) do_leds(); @@ -77,6 +78,8 @@ static void isa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer(regs); do_set_rtc(); do_profile(regs); + + return IRQ_HANDLED; } static unsigned long __init get_isa_cmos_time(void) @@ -186,7 +189,8 @@ static unsigned long timer1_gettimeoffset (void) return ((tick_nsec / 1000) * value) / LATCH; } -static void timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { *CSR_TIMER1_CLR = 0; @@ -195,6 +199,8 @@ static void timer1_interrupt(int irq, void *dev_id, struct pt_regs *regs) do_timer(regs); do_set_rtc(); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-epxa10db/time.h b/include/asm-arm/arch-epxa10db/time.h index a025bbe65626..749770b83e9a 100644 --- a/include/asm-arm/arch-epxa10db/time.h +++ b/include/asm-arm/arch-epxa10db/time.h @@ -27,7 +27,8 @@ /* * IRQ handler for the timer */ -static void excalibur_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +excalibur_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { // ...clear the interrupt @@ -36,6 +37,8 @@ static void excalibur_timer_interrupt(int irq, void *dev_id, struct pt_regs *reg do_leds(); do_timer(regs); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-integrator/time.h b/include/asm-arm/arch-integrator/time.h index cb6f749f2db8..40f4e40fec25 100644 --- a/include/asm-arm/arch-integrator/time.h +++ b/include/asm-arm/arch-integrator/time.h @@ -98,7 +98,8 @@ static unsigned long integrator_gettimeoffset(void) /* * IRQ handler for the timer */ -static void integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { volatile TimerStruct_t *timer1 = (volatile TimerStruct_t *)TIMER1_VA_BASE; @@ -108,6 +109,8 @@ static void integrator_timer_interrupt(int irq, void *dev_id, struct pt_regs *re do_leds(); do_timer(regs); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-l7200/time.h b/include/asm-arm/arch-l7200/time.h index 727c32a96a89..31d791ac1d8c 100644 --- a/include/asm-arm/arch-l7200/time.h +++ b/include/asm-arm/arch-l7200/time.h @@ -42,11 +42,14 @@ /* * Handler for RTC timer interrupt */ -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); do_profile(regs); RTC_RTCC = 0; /* Clear interrupt */ + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-nexuspci/time.h b/include/asm-arm/arch-nexuspci/time.h index ba09e7bb3ee9..c0fd0cdc9cb0 100644 --- a/include/asm-arm/arch-nexuspci/time.h +++ b/include/asm-arm/arch-nexuspci/time.h @@ -14,7 +14,8 @@ * 2 of the License, or (at your option) any later version. */ -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { static int count = 25; unsigned char stat = __raw_readb(DUART_BASE + 0x14); @@ -40,7 +41,9 @@ static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) __raw_readb(DUART_BASE + 0x14); __raw_readb(DUART_BASE + 0x14); - do_timer(regs); + do_timer(regs); + + return IRQ_HANDLED; } void __init time_init(void) diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h index 54d78076afd4..6d452434eabc 100644 --- a/include/asm-arm/arch-pxa/irqs.h +++ b/include/asm-arm/arch-pxa/irqs.h @@ -10,9 +10,10 @@ * published by the Free Software Foundation. */ -#define PXA_IRQ_SKIP 8 /* The first 8 IRQs are reserved */ +#define PXA_IRQ_SKIP 7 /* The first 7 IRQs are not yet used */ #define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP) +#define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error */ #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ #define IRQ_GPIO1 PXA_IRQ(9) /* GPIO1 Edge Detect */ #define IRQ_GPIO_2_80 PXA_IRQ(10) /* GPIO[2-80] Edge Detect */ @@ -20,6 +21,8 @@ #define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ #define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt */ #define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ +#define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request */ +#define IRQ_NSSP PXA_IRQ(16) /* Network SSP Service Request */ #define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ #define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ #define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ diff --git a/include/asm-arm/arch-pxa/time.h b/include/asm-arm/arch-pxa/time.h index 303d30dc8116..91865bd8fce8 100644 --- a/include/asm-arm/arch-pxa/time.h +++ b/include/asm-arm/arch-pxa/time.h @@ -47,7 +47,8 @@ static unsigned long pxa_gettimeoffset (void) return usec; } -static void pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int next_match; @@ -66,6 +67,8 @@ static void pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) OSSR = OSSR_M0; /* Clear match on timer 0 */ next_match = (OSMR0 += LATCH); } while( (signed long)(next_match - OSCR) <= 0 ); + + return IRQ_HANDLED; } void __init time_init(void) diff --git a/include/asm-arm/arch-rpc/time.h b/include/asm-arm/arch-rpc/time.h index 189595c68fce..1df6a12cd0e3 100644 --- a/include/asm-arm/arch-rpc/time.h +++ b/include/asm-arm/arch-rpc/time.h @@ -14,11 +14,14 @@ */ extern void ioctime_init(void); -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_timer(regs); do_set_rtc(); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-sa1100/time.h b/include/asm-arm/arch-sa1100/time.h index 31fd3647c791..a7c984968819 100644 --- a/include/asm-arm/arch-sa1100/time.h +++ b/include/asm-arm/arch-sa1100/time.h @@ -72,7 +72,8 @@ static unsigned long sa1100_gettimeoffset (void) * lost_ticks (updated in do_timer()) and the match reg value, so we * can use do_gettimeofday() from interrupt handlers. */ -static void sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned int next_match; @@ -85,6 +86,8 @@ static void sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) } while ((signed long)(next_match - OSCR) <= 0); do_profile(regs); + + return IRQ_HANDLED; } void __init time_init(void) diff --git a/include/asm-arm/arch-shark/time.h b/include/asm-arm/arch-shark/time.h index bea20835697a..86a9bdebae23 100644 --- a/include/asm-arm/arch-shark/time.h +++ b/include/asm-arm/arch-shark/time.h @@ -13,11 +13,14 @@ #define IRQ_TIMER 0 #define HZ_TIME ((1193180 + HZ/2) / HZ) -static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { do_leds(); do_timer(regs); do_profile(regs); + + return IRQ_HANDLED; } /* diff --git a/include/asm-arm/arch-tbox/time.h b/include/asm-arm/arch-tbox/time.h index e50e1bdb9af8..461787189e1e 100644 --- a/include/asm-arm/arch-tbox/time.h +++ b/include/asm-arm/arch-tbox/time.h @@ -20,13 +20,16 @@ #define update_rtc() -static void timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t +timer_interrupt (int irq, void *dev_id, struct pt_regs *regs) { /* Clear irq */ __raw_writel(1, FPGA1CONT + 0xc); __raw_writel(0, FPGA1CONT + 0xc); do_timer(regs); + + return IRQ_HANDLED; } void __init time_init(void) diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index 819c89592d62..917adde845ba 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h @@ -173,7 +173,7 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *p) */ static inline int __test_bit(int nr, const unsigned long * p) { - return p[nr >> 5] & (1UL << (nr & 31)); + return (p[nr >> 5] >> (nr & 31)) & 1UL; } /* @@ -277,6 +277,8 @@ extern int _find_next_zero_bit_be(void * p, int size, int offset); #endif +#if __LINUX_ARM_ARCH__ < 5 + /* * ffz = Find First Zero in word. Undefined if no zero exists, * so code should check against ~0UL first.. @@ -326,6 +328,23 @@ static inline unsigned long __ffs(unsigned long word) #define ffs(x) generic_ffs(x) +#else + +/* + * On ARMv5 and above those functions can be implemented around + * the clz instruction for much better code efficiency. + */ + +extern __inline__ int generic_fls(int x); +#define fls(x) \ + ( __builtin_constant_p(x) ? generic_fls(x) : \ + ({ int __r; asm("clz%?\t%0, %1" : "=r"(__r) : "r"(x)); 32-__r; }) ) +#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); }) +#define __ffs(x) (ffs(x) - 1) +#define ffz(x) __ffs( ~(x) ) + +#endif + /* * Find first bit set in a 168-bit bitmap, where the first * 128 bits are unlikely to be set. diff --git a/include/asm-arm/bugs.h b/include/asm-arm/bugs.h index 14a4e05eee8c..adae0482000d 100644 --- a/include/asm-arm/bugs.h +++ b/include/asm-arm/bugs.h @@ -10,8 +10,6 @@ #ifndef __ASM_BUGS_H #define __ASM_BUGS_H -#include <asm/proc-fns.h> - #define check_bugs() do { } while (0) #endif diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h index 4b62abb9a1ef..5ddc14f683c2 100644 --- a/include/asm-arm/mach/arch.h +++ b/include/asm-arm/mach/arch.h @@ -54,39 +54,37 @@ struct machine_desc { #define MACHINE_START(_type,_name) \ const struct machine_desc __mach_desc_##_type \ __attribute__((__section__(".arch.info"))) = { \ - nr: MACH_TYPE_##_type, \ - name: _name, + .nr = MACH_TYPE_##_type, \ + .name = _name, #define MAINTAINER(n) #define BOOT_MEM(_pram,_pio,_vio) \ - phys_ram: _pram, \ - phys_io: _pio, \ - io_pg_offst: ((_vio)>>18)&0xfffc, + .phys_ram = _pram, \ + .phys_io = _pio, \ + .io_pg_offst = ((_vio)>>18)&0xfffc, #define BOOT_PARAMS(_params) \ - param_offset: _params, + .param_offset = _params, #define VIDEO(_start,_end) \ - video_start: _start, \ - video_end: _end, + .video_start = _start, \ + .video_end = _end, #define DISABLE_PARPORT(_n) \ - reserve_lp##_n: 1, - -#define BROKEN_HLT /* unused */ + .reserve_lp##_n = 1, #define SOFT_REBOOT \ - soft_reboot: 1, + .soft_reboot = 1, #define FIXUP(_func) \ - fixup: _func, + .fixup = _func, #define MAPIO(_func) \ - map_io: _func, + .map_io = _func, #define INITIRQ(_func) \ - init_irq: _func, + .init_irq = _func, #define MACHINE_END \ }; diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h index 7fa77f0c4248..181223a7329b 100644 --- a/include/asm-arm/processor.h +++ b/include/asm-arm/processor.h @@ -74,6 +74,29 @@ unsigned long get_wchan(struct task_struct *p); */ extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); +/* + * Prefetching support - only ARMv5. + */ +#if __LINUX_ARM_ARCH__ >= 5 + +#define ARCH_HAS_PREFETCH +#define prefetch(ptr) \ + ({ \ + __asm__ __volatile__( \ + "pld\t%0" \ + : \ + : "o" (*(char *)(ptr)) \ + : "cc"); \ + }) + +#define ARCH_HAS_PREFETCHW +#define prefetchw(ptr) prefetch(ptr) + +#define ARCH_HAS_SPINLOCK_PREFETCH +#define spin_lock_prefetch(x) do { } while (0) + +#endif + #endif #endif /* __ASM_ARM_PROCESSOR_H */ diff --git a/include/asm-arm/traps.h b/include/asm-arm/traps.h new file mode 100644 index 000000000000..d4f34dc83eb0 --- /dev/null +++ b/include/asm-arm/traps.h @@ -0,0 +1,18 @@ +#ifndef _ASMARM_TRAP_H +#define _ASMARM_TRAP_H + +#include <linux/list.h> + +struct undef_hook { + struct list_head node; + u32 instr_mask; + u32 instr_val; + u32 cpsr_mask; + u32 cpsr_val; + int (*fn)(struct pt_regs *regs, unsigned int instr); +}; + +void register_undef_hook(struct undef_hook *hook); +void unregister_undef_hook(struct undef_hook *hook); + +#endif diff --git a/include/linux/bio.h b/include/linux/bio.h index 19451364a58e..bbc69dd67b28 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -131,6 +131,7 @@ struct bio { #define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx) #define bio_page(bio) bio_iovec((bio))->bv_page #define bio_offset(bio) bio_iovec((bio))->bv_offset +#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) #define bio_sectors(bio) ((bio)->bi_size >> 9) #define bio_cur_sectors(bio) (bio_iovec(bio)->bv_len >> 9) #define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio))) @@ -226,12 +227,12 @@ extern void bio_check_pages_dirty(struct bio *bio); #ifdef CONFIG_HIGHMEM /* * remember to add offset! and never ever reenable interrupts between a - * bio_kmap_irq and bio_kunmap_irq!! + * bvec_kmap_irq and bvec_kunmap_irq!! * * This function MUST be inlined - it plays with the CPU interrupt flags. * Hence the `extern inline'. */ -extern inline char *bio_kmap_irq(struct bio *bio, unsigned long *flags) +extern inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) { unsigned long addr; @@ -240,15 +241,15 @@ extern inline char *bio_kmap_irq(struct bio *bio, unsigned long *flags) * balancing is a lot nicer this way */ local_irq_save(*flags); - addr = (unsigned long) kmap_atomic(bio_page(bio), KM_BIO_SRC_IRQ); + addr = (unsigned long) kmap_atomic(bvec->bv_page, KM_BIO_SRC_IRQ); if (addr & ~PAGE_MASK) BUG(); - return (char *) addr + bio_offset(bio); + return (char *) addr + bvec->bv_offset; } -extern inline void bio_kunmap_irq(char *buffer, unsigned long *flags) +extern inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) { unsigned long ptr = (unsigned long) buffer & PAGE_MASK; @@ -257,8 +258,19 @@ extern inline void bio_kunmap_irq(char *buffer, unsigned long *flags) } #else -#define bio_kmap_irq(bio, flags) (bio_data(bio)) -#define bio_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0) +#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset) +#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0) #endif +extern inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, + unsigned long *flags) +{ + return bvec_kmap_irq(bio_iovec_idx(bio, idx), flags); +} +#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags) + +#define bio_kmap_irq(bio, flags) \ + __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) +#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) + #endif /* __LINUX_BIO_H */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 6e0fc430b428..aa38c5f33c21 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -11,6 +11,7 @@ #include <linux/backing-dev.h> #include <linux/wait.h> #include <linux/mempool.h> +#include <linux/bio.h> #include <asm/scatterlist.h> @@ -36,25 +37,35 @@ struct request { * blkdev_dequeue_request! */ unsigned long flags; /* see REQ_ bits below */ - sector_t sector; - unsigned long nr_sectors; + /* Maintain bio traversal state for part by part I/O submission. + * hard_* are block layer internals, no driver should touch them! + */ + + sector_t sector; /* next sector to submit */ + unsigned long nr_sectors; /* no. of sectors left to submit */ + /* no. of sectors left to submit in the current segment */ unsigned int current_nr_sectors; + sector_t hard_sector; /* next sector to complete */ + unsigned long hard_nr_sectors; /* no. of sectors left to complete */ + /* no. of sectors left to complete in the current segment */ + unsigned int hard_cur_sectors; + + /* no. of segments left to submit in the current bio */ + unsigned short nr_cbio_segments; + /* no. of sectors left to submit in the current bio */ + unsigned long nr_cbio_sectors; + + struct bio *cbio; /* next bio to submit */ + struct bio *bio; /* next unfinished bio to complete */ + struct bio *biotail; + void *elevator_private; int rq_status; /* should split this into a few status bits */ struct gendisk *rq_disk; int errors; unsigned long start_time; - sector_t hard_sector; /* the hard_* are block layer - * internals, no driver should - * touch them - */ - unsigned long hard_nr_sectors; - unsigned int hard_cur_sectors; - - struct bio *bio; - struct bio *biotail; /* Number of scatter-gather DMA addr+len pairs after * physical address coalescing is performed. @@ -284,6 +295,32 @@ struct request_queue */ #define blk_queue_headactive(q, head_active) +/* current index into bio being processed for submission */ +#define blk_rq_idx(rq) ((rq)->cbio->bi_vcnt - (rq)->nr_cbio_segments) + +/* current bio vector being processed */ +#define blk_rq_vec(rq) (bio_iovec_idx((rq)->cbio, blk_rq_idx(rq))) + +/* current offset with respect to start of the segment being submitted */ +#define blk_rq_offset(rq) \ + (((rq)->hard_cur_sectors - (rq)->current_nr_sectors) << 9) + +/* + * temporarily mapping a (possible) highmem bio (typically for PIO transfer) + */ + +/* Assumes rq->cbio != NULL */ +static inline char * rq_map_buffer(struct request *rq, unsigned long *flags) +{ + return (__bio_kmap_irq(rq->cbio, blk_rq_idx(rq), flags) + + blk_rq_offset(rq)); +} + +static inline void rq_unmap_buffer(char *buffer, unsigned long *flags) +{ + __bio_kunmap_irq(buffer, flags); +} + /* * q->prep_rq_fn return values */ @@ -362,6 +399,7 @@ static inline request_queue_t *bdev_get_queue(struct block_device *bdev) extern int end_that_request_first(struct request *, int, int); extern int end_that_request_chunk(struct request *, int, int); extern void end_that_request_last(struct request *); +extern int process_that_request_first(struct request *, unsigned int); extern void end_request(struct request *req, int uptodate); static inline void blkdev_dequeue_request(struct request *req) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 8db7ca4df8f2..2a80a0c3fe2f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -146,6 +146,7 @@ struct zone { #define ZONE_NORMAL 1 #define ZONE_HIGHMEM 2 #define MAX_NR_ZONES 3 +#define GFP_ZONEMASK 0x03 /* * One allocation request operates on a zonelist. A zonelist @@ -162,7 +163,6 @@ struct zonelist { struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited }; -#define GFP_ZONEMASK 0x0f /* * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM @@ -178,7 +178,7 @@ struct zonelist { struct bootmem_data; typedef struct pglist_data { struct zone node_zones[MAX_NR_ZONES]; - struct zonelist node_zonelists[GFP_ZONEMASK+1]; + struct zonelist node_zonelists[MAX_NR_ZONES]; int nr_zones; struct page *node_mem_map; unsigned long *valid_addr_bitmap; |
