Commit 835a906c authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6:
  sh64: Add .gitignore entry for syscalltab.
  sh64: generic quicklist support.
  sh64: Update cayman defconfig.
  sh64: Fixup sh-sci build.
  sh64: ppoll/pselect6() and restartable syscalls.
  sh64: dma-mapping updates.
  sh64: Fixups for the irq_regs changes.
  sh64: Wire up many new syscalls.
  spelling fixes: arch/sh64/
  sh64: ROUND_UP macro cleanup in arch/sh64/kernel/pci_sh5.c
parents e089d43f 51a41e7d
...@@ -17,6 +17,9 @@ config MMU ...@@ -17,6 +17,9 @@ config MMU
bool bool
default y default y
config QUICKLIST
def_bool y
config RWSEM_GENERIC_SPINLOCK config RWSEM_GENERIC_SPINLOCK
bool bool
default y default y
......
This diff is collapsed.
...@@ -947,14 +947,14 @@ ret_with_reschedule: ...@@ -947,14 +947,14 @@ ret_with_reschedule:
! FIXME:!!! ! FIXME:!!!
! no handling of TIF_SYSCALL_TRACE yet!! ! no handling of TIF_SYSCALL_TRACE yet!!
movi (1 << TIF_NEED_RESCHED), r8 movi _TIF_NEED_RESCHED, r8
and r8, r7, r8 and r8, r7, r8
pta work_resched, tr0 pta work_resched, tr0
bne r8, ZERO, tr0 bne r8, ZERO, tr0
pta restore_all, tr1 pta restore_all, tr1
movi (1 << TIF_SIGPENDING), r8 movi (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), r8
and r8, r7, r8 and r8, r7, r8
pta work_notifysig, tr0 pta work_notifysig, tr0
bne r8, ZERO, tr0 bne r8, ZERO, tr0
......
...@@ -94,6 +94,7 @@ asmlinkage void do_NMI(unsigned long vector_num, struct pt_regs * regs) ...@@ -94,6 +94,7 @@ asmlinkage void do_NMI(unsigned long vector_num, struct pt_regs * regs)
*/ */
asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs)
{ {
struct pt_regs *old_regs = set_irq_regs(regs);
int irq; int irq;
irq_enter(); irq_enter();
...@@ -101,13 +102,14 @@ asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) ...@@ -101,13 +102,14 @@ asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs)
irq = irq_demux(vector_num); irq = irq_demux(vector_num);
if (irq >= 0) { if (irq >= 0) {
__do_IRQ(irq, regs); __do_IRQ(irq);
} else { } else {
printk("unexpected IRQ trap at vector %03lx\n", vector_num); printk("unexpected IRQ trap at vector %03lx\n", vector_num);
} }
irq_exit(); irq_exit();
set_irq_regs(old_regs);
return 1; return 1;
} }
...@@ -340,8 +340,9 @@ static int __init map_cayman_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -340,8 +340,9 @@ static int __init map_cayman_irq(struct pci_dev *dev, u8 slot, u8 pin)
return result; return result;
} }
irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t pcish5_err_irq(int irq, void *dev_id)
{ {
struct pt_regs *regs = get_irq_regs();
unsigned pci_int, pci_air, pci_cir, pci_aint; unsigned pci_int, pci_air, pci_cir, pci_aint;
pci_int = SH5PCI_READ(INT); pci_int = SH5PCI_READ(INT);
...@@ -368,15 +369,13 @@ irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs) ...@@ -368,15 +369,13 @@ irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t pcish5_serr_irq(int irq, void *dev_id)
{ {
printk("SERR IRQ\n"); printk("SERR IRQ\n");
return IRQ_NONE; return IRQ_NONE;
} }
#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1))
static void __init static void __init
pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
struct resource *memr) struct resource *memr)
...@@ -433,8 +432,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, ...@@ -433,8 +432,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
mem_res.end -= mem_res.start; mem_res.end -= mem_res.start;
/* Align the sizes up by bridge rules */ /* Align the sizes up by bridge rules */
io_res.end = ROUND_UP(io_res.end, 4*1024) - 1; io_res.end = ALIGN(io_res.end, 4*1024) - 1;
mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1; mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1;
/* Adjust the bridge's allocation requirements */ /* Adjust the bridge's allocation requirements */
bridge->resource[0].end = bridge->resource[0].start + io_res.end; bridge->resource[0].end = bridge->resource[0].start + io_res.end;
...@@ -447,18 +446,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, ...@@ -447,18 +446,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior,
/* adjust parent's resource requirements */ /* adjust parent's resource requirements */
if (ior) { if (ior) {
ior->end = ROUND_UP(ior->end, 4*1024); ior->end = ALIGN(ior->end, 4*1024);
ior->end += io_res.end; ior->end += io_res.end;
} }
if (memr) { if (memr) {
memr->end = ROUND_UP(memr->end, 1*1024*1024); memr->end = ALIGN(memr->end, 1*1024*1024);
memr->end += mem_res.end; memr->end += mem_res.end;
} }
} }
#undef ROUND_UP
static void __init pcibios_size_bridges(void) static void __init pcibios_size_bridges(void)
{ {
struct resource io_res, mem_res; struct resource io_res, mem_res;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* May be copied or modified under the terms of the GNU General Public * May be copied or modified under the terms of the GNU General Public
* License. See linux/COPYING for more information. * License. See linux/COPYING for more information.
* *
* Defintions for the SH5 PCI hardware. * Definitions for the SH5 PCI hardware.
*/ */
/* Product ID */ /* Product ID */
......
...@@ -387,7 +387,7 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *)) ...@@ -387,7 +387,7 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
* NOTE! Only a kernel-only process(ie the swapper or direct descendants * NOTE! Only a kernel-only process(ie the swapper or direct descendants
* who haven't done an "execve()") should use this: it will work within * who haven't done an "execve()") should use this: it will work within
* a system call from a "real" process, but the process memory space will * a system call from a "real" process, but the process memory space will
* not be free'd until both the parent and the child have exited. * not be freed until both the parent and the child have exited.
*/ */
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{ {
......
...@@ -698,7 +698,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -698,7 +698,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (try_to_freeze()) if (try_to_freeze())
goto no_signal; goto no_signal;
if (!oldset) if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, &ka, regs, 0); signr = get_signal_to_deliver(&info, &ka, regs, 0);
...@@ -706,6 +708,15 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -706,6 +708,15 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (signr > 0) { if (signr > 0) {
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, &ka, oldset, regs); handle_signal(signr, &info, &ka, oldset, regs);
/*
* If a signal was successfully delivered, the saved sigmask
* is in its frame, and we can clear the TIF_RESTORE_SIGMASK
* flag.
*/
if (test_thread_flag(TIF_RESTORE_SIGMASK))
clear_thread_flag(TIF_RESTORE_SIGMASK);
return 1; return 1;
} }
...@@ -713,13 +724,27 @@ no_signal: ...@@ -713,13 +724,27 @@ no_signal:
/* Did we come from a system call? */ /* Did we come from a system call? */
if (regs->syscall_nr >= 0) { if (regs->syscall_nr >= 0) {
/* Restart the system call - no handlers present */ /* Restart the system call - no handlers present */
if (regs->regs[REG_RET] == -ERESTARTNOHAND || switch (regs->regs[REG_RET]) {
regs->regs[REG_RET] == -ERESTARTSYS || case -ERESTARTNOHAND:
regs->regs[REG_RET] == -ERESTARTNOINTR) { case -ERESTARTSYS:
case -ERESTARTNOINTR:
/* Decode Syscall # */ /* Decode Syscall # */
regs->regs[REG_RET] = regs->syscall_nr; regs->regs[REG_RET] = regs->syscall_nr;
regs->pc -= 4; regs->pc -= 4;
break;
case -ERESTART_RESTARTBLOCK:
regs->regs[REG_RET] = __NR_restart_syscall;
regs->pc -= 4;
break;
} }
} }
/* No signal to deliver -- put the saved sigmask back */
if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
clear_thread_flag(TIF_RESTORE_SIGMASK);
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
}
return 0; return 0;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* arch/sh64/kernel/syscalls.S * arch/sh64/kernel/syscalls.S
* *
* Copyright (C) 2000, 2001 Paolo Alberelli * Copyright (C) 2000, 2001 Paolo Alberelli
* Copyright (C) 2004 Paul Mundt * Copyright (C) 2004 - 2007 Paul Mundt
* Copyright (C) 2003, 2004 Richard Curnow * Copyright (C) 2003, 2004 Richard Curnow
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*/ */
.globl sys_call_table .globl sys_call_table
sys_call_table: sys_call_table:
.long sys_ni_syscall /* 0 - old "setup()" system call */ .long sys_restart_syscall /* 0 - old "setup()" system call */
.long sys_exit .long sys_exit
.long sys_fork .long sys_fork
.long sys_read .long sys_read
...@@ -347,4 +347,34 @@ sys_call_table: ...@@ -347,4 +347,34 @@ sys_call_table:
.long sys_inotify_init .long sys_inotify_init
.long sys_inotify_add_watch .long sys_inotify_add_watch
.long sys_inotify_rm_watch /* 320 */ .long sys_inotify_rm_watch /* 320 */
.long sys_ni_syscall
.long sys_migrate_pages
.long sys_openat
.long sys_mkdirat
.long sys_mknodat /* 325 */
.long sys_fchownat
.long sys_futimesat
.long sys_fstatat64
.long sys_unlinkat
.long sys_renameat /* 330 */
.long sys_linkat
.long sys_symlinkat
.long sys_readlinkat
.long sys_fchmodat
.long sys_faccessat /* 335 */
.long sys_pselect6
.long sys_ppoll
.long sys_unshare
.long sys_set_robust_list
.long sys_get_robust_list /* 340 */
.long sys_splice
.long sys_sync_file_range
.long sys_tee
.long sys_vmsplice
.long sys_move_pages /* 345 */
.long sys_getcpu
.long sys_epoll_pwait
.long sys_utimensat
.long sys_signalfd
.long sys_timerfd /* 350 */
.long sys_eventfd
...@@ -123,7 +123,7 @@ static unsigned long long usecs_per_jiffy = 1000000/HZ; /* Approximation */ ...@@ -123,7 +123,7 @@ static unsigned long long usecs_per_jiffy = 1000000/HZ; /* Approximation */
static unsigned long long scaled_recip_ctc_ticks_per_jiffy; static unsigned long long scaled_recip_ctc_ticks_per_jiffy;
/* Estimate number of microseconds that have elapsed since the last timer tick, /* Estimate number of microseconds that have elapsed since the last timer tick,
by scaling the delta that has occured in the CTC register. by scaling the delta that has occurred in the CTC register.
WARNING WARNING WARNING : This algorithm relies on the CTC decrementing at WARNING WARNING WARNING : This algorithm relies on the CTC decrementing at
the CPU clock rate. If the CPU sleeps, the CTC stops counting. Bear this the CPU clock rate. If the CPU sleeps, the CTC stops counting. Bear this
...@@ -282,7 +282,7 @@ static long last_rtc_update = 0; ...@@ -282,7 +282,7 @@ static long last_rtc_update = 0;
* timer_interrupt() needs to keep up the real-time clock, * timer_interrupt() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick * as well as call the "do_timer()" routine every clocktick
*/ */
static inline void do_timer_interrupt(int irq, struct pt_regs *regs) static inline void do_timer_interrupt(void)
{ {
unsigned long long current_ctc; unsigned long long current_ctc;
asm ("getcon cr62, %0" : "=r" (current_ctc)); asm ("getcon cr62, %0" : "=r" (current_ctc));
...@@ -290,9 +290,10 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs) ...@@ -290,9 +290,10 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs)
do_timer(1); do_timer(1);
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
update_process_times(user_mode(regs)); update_process_times(user_mode(get_irq_regs()));
#endif #endif
profile_tick(CPU_PROFILING, regs); if (current->pid)
profile_tick(CPU_PROFILING);
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
{ {
...@@ -323,7 +324,7 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs) ...@@ -323,7 +324,7 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs)
* Time Stamp Counter value at the time of the timer interrupt, so that * Time Stamp Counter value at the time of the timer interrupt, so that
* we later on can estimate the time of day more exactly. * we later on can estimate the time of day more exactly.
*/ */
static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t timer_interrupt(int irq, void *dev_id)
{ {
unsigned long timer_status; unsigned long timer_status;
...@@ -340,7 +341,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -340,7 +341,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* locally disabled. -arca * locally disabled. -arca
*/ */
write_lock(&xtime_lock); write_lock(&xtime_lock);
do_timer_interrupt(irq, regs); do_timer_interrupt();
write_unlock(&xtime_lock); write_unlock(&xtime_lock);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -465,9 +466,10 @@ static __init unsigned int get_cpu_hz(void) ...@@ -465,9 +466,10 @@ static __init unsigned int get_cpu_hz(void)
#endif #endif
} }
static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id, static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id)
struct pt_regs *regs)
{ {
struct pt_regs *regs = get_irq_regs();
ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ ctrl_outb(0, RCR1); /* Disable Carry Interrupts */
regs->regs[3] = 1; /* Using r3 */ regs->regs[3] = 1; /* Using r3 */
......
...@@ -29,13 +29,13 @@ unsigned long epld_virt; ...@@ -29,13 +29,13 @@ unsigned long epld_virt;
/* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto /* Note the SMSC SuperIO chip and SMSC LAN chip interrupts are all muxed onto
the same SH-5 interrupt */ the same SH-5 interrupt */
static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t cayman_interrupt_smsc(int irq, void *dev_id)
{ {
printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n"); printk(KERN_INFO "CAYMAN: spurious SMSC interrupt\n");
return IRQ_NONE; return IRQ_NONE;
} }
static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
{ {
printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq); printk(KERN_INFO "CAYMAN: spurious PCI interrupt, IRQ %d\n", irq);
return IRQ_NONE; return IRQ_NONE;
......
...@@ -213,7 +213,7 @@ static int __init smsc_superio_setup(void) ...@@ -213,7 +213,7 @@ static int __init smsc_superio_setup(void)
SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */ SMSC_SUPERIO_WRITE_INDEXED(0x00, 0xc7); /* GP47 = nIOWOP */
#endif #endif
/* Exit the configuraton state */ /* Exit the configuration state */
outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR); outb(SMSC_EXIT_CONFIG_KEY, SMSC_CONFIG_PORT_ADDR);
return 0; return 0;
......
...@@ -135,7 +135,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, ...@@ -135,7 +135,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
/* SIM /* SIM
* Note this is now called with interrupts still disabled * Note this is now called with interrupts still disabled
* This is to cope with being called for a missing IO port * This is to cope with being called for a missing IO port
* address with interupts disabled. This should be fixed as * address with interrupts disabled. This should be fixed as
* soon as we have a better 'fast path' miss handler. * soon as we have a better 'fast path' miss handler.
* *
* Plus take care how you try and debug this stuff. * Plus take care how you try and debug this stuff.
......
...@@ -84,7 +84,7 @@ void show_mem(void) ...@@ -84,7 +84,7 @@ void show_mem(void)
printk("%d reserved pages\n",reserved); printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared); printk("%d pages shared\n",shared);
printk("%d pages swap cached\n",cached); printk("%d pages swap cached\n",cached);
printk("%ld pages in page table cache\n",pgtable_cache_size); printk("%ld pages in page table cache\n", quicklist_total_size());
} }
/* /*
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* IMPORTANT NOTES : * IMPORTANT NOTES :
* The do_fast_page_fault function is called from a context in entry.S where very few registers * The do_fast_page_fault function is called from a context in entry.S where very few registers
* have been saved. In particular, the code in this file must be compiled not to use ANY * have been saved. In particular, the code in this file must be compiled not to use ANY
* caller-save regiseters that are not part of the restricted save set. Also, it means that * caller-save registers that are not part of the restricted save set. Also, it means that
* code in this file must not make calls to functions elsewhere in the kernel, or else the * code in this file must not make calls to functions elsewhere in the kernel, or else the
* excepting context will see corruption in its caller-save registers. Plus, the entry.S save * excepting context will see corruption in its caller-save registers. Plus, the entry.S save
* area is non-reentrant, so this code has to run with SR.BL==1, i.e. no interrupts taken inside * area is non-reentrant, so this code has to run with SR.BL==1, i.e. no interrupts taken inside
...@@ -249,7 +249,7 @@ asmlinkage int do_fast_page_fault(unsigned long long ssr_md, unsigned long long ...@@ -249,7 +249,7 @@ asmlinkage int do_fast_page_fault(unsigned long long ssr_md, unsigned long long
/* SIM /* SIM
* Note this is now called with interrupts still disabled * Note this is now called with interrupts still disabled
* This is to cope with being called for a missing IO port * This is to cope with being called for a missing IO port
* address with interupts disabled. This should be fixed as * address with interrupts disabled. This should be fixed as
* soon as we have a better 'fast path' miss handler. * soon as we have a better 'fast path' miss handler.
* *
* Plus take care how you try and debug this stuff. * Plus take care how you try and debug this stuff.
......
...@@ -35,6 +35,10 @@ static inline void dma_free_coherent(struct device *dev, size_t size, ...@@ -35,6 +35,10 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
consistent_free(NULL, size, vaddr, dma_handle); consistent_free(NULL, size, vaddr, dma_handle);
} }
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
#define dma_is_consistent(d, h) (1)
static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction dir) enum dma_data_direction dir)
{ {
...@@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev, ...@@ -49,7 +53,7 @@ static inline dma_addr_t dma_map_single(struct device *dev,
if (dev->bus == &pci_bus_type) if (dev->bus == &pci_bus_type)
return virt_to_bus(ptr); return virt_to_bus(ptr);
#endif #endif
dma_cache_sync(ptr, size, dir); dma_cache_sync(dev, ptr, size, dir);
return virt_to_bus(ptr); return virt_to_bus(ptr);
} }
...@@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, ...@@ -63,7 +67,7 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
for (i = 0; i < nents; i++) { for (i = 0; i < nents; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(page_address(sg[i].page) + sg[i].offset, dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir); sg[i].length, dir);
#endif #endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
...@@ -94,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, ...@@ -94,7 +98,7 @@ static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle,
if (dev->bus == &pci_bus_type) if (dev->bus == &pci_bus_type)
return; return;
#endif #endif
dma_cache_sync(bus_to_virt(dma_handle), size, dir); dma_cache_sync(dev, bus_to_virt(dma_handle), size, dir);
} }
static inline void dma_sync_single_range(struct device *dev, static inline void dma_sync_single_range(struct device *dev,
...@@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev, ...@@ -106,7 +110,7 @@ static inline void dma_sync_single_range(struct device *dev,
if (dev->bus == &pci_bus_type) if (dev->bus == &pci_bus_type)
return; return;
#endif #endif
dma_cache_sync(bus_to_virt(dma_handle) + offset, size, dir); dma_cache_sync(dev, bus_to_virt(dma_handle) + offset, size, dir);
} }
static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
...@@ -116,7 +120,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, ...@@ -116,7 +120,7 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg,
for (i = 0; i < nelems; i++) { for (i = 0; i < nelems; i++) {
#if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT)
dma_cache_sync(page_address(sg[i].page) + sg[i].offset, dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset,
sg[i].length, dir); sg[i].length, dir);
#endif #endif
sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
......
#include <asm-generic/irq_regs.h>
...@@ -14,13 +14,9 @@ ...@@ -14,13 +14,9 @@
* *
*/ */
#include <linux/threads.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/quicklist.h>
#define pgd_quicklist (current_cpu_data.pgd_quick) #include <asm/page.h>
#define pmd_quicklist (current_cpu_data.pmd_quick)
#define pte_quicklist (current_cpu_data.pte_quick)
#define pgtable_cache_size (current_cpu_data.pgtable_cache_sz)
static inline void pgd_init(unsigned long page) static inline void pgd_init(unsigned long page)
{ {
...@@ -45,84 +41,37 @@ static inline pgd_t *get_pgd_slow(void) ...@@ -45,84 +41,37 @@ static inline pgd_t *get_pgd_slow(void)
return ret; return ret;
} }
static inline pgd_t *get_pgd_fast(void) static inline pgd_t *pgd_alloc(struct mm_struct *mm)
{
unsigned long *ret;
if ((ret = pgd_quicklist) != NULL) {
pgd_quicklist = (unsigned long *)(*ret);
ret[0] = 0;
pgtable_cache_size--;
} else
ret = (unsigned long *)get_pgd_slow();
if (ret) {
memset(ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
}
return (pgd_t *)ret;
}
static inline void free_pgd_fast(pgd_t *pgd)
{
*(unsigned long *)pgd = (unsigned long) pgd_quicklist;
pgd_quicklist = (unsigned long *) pgd;
pgtable_cache_size++;
}
static inline void free_pgd_slow(pgd_t *pgd)
{ {
kfree((void *)pgd); return quicklist_alloc(0, GFP_KERNEL, NULL);
} }
extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted); static inline void pgd_free(pgd_t *pgd)
extern pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long address_preadjusted);
static inline pte_t *get_pte_fast(void)
{ {
unsigned long *ret; quicklist_free(0, NULL, pgd);
if((ret = (unsigned long *)pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
}
return (pte_t *)ret;
} }
static inline void free_pte_fast(pte_t *pte) static inline struct page *pte_alloc_one(struct mm_struct *mm,
unsigned long address)
{ {
*(unsigned long *)pte = (unsigned long) pte_quicklist; void *pg = quicklist_alloc(0, GFP_KERNEL, NULL);
pte_quicklist = (unsigned long *) pte; return pg ? virt_to_page(pg) : NULL;
pgtable_cache_size++;
} }
static inline void pte_free_kernel(pte_t *pte) static inline void pte_free_kernel(pte_t *pte)
{ {
free_page((unsigned long)pte); quicklist_free(0, NULL, pte);
} }
static inline void pte_free(struct page *pte) static inline void pte_free(struct page *pte)
{ {
__free_page(pte); quicklist_free_page(0, NULL, pte);
} }
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long address) unsigned long address)
{ {
pte_t *pte; return quicklist_alloc(0, GFP_KERNEL, NULL);
pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_REPEAT|__GFP_ZERO);
return pte;
}
static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
{
struct page *pte;
pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
return pte;
} }
#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
...@@ -142,31 +91,23 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add ...@@ -142,31 +91,23 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
#elif defined(CONFIG_SH64_PGTABLE_3_LEVEL) #elif defined(CONFIG_SH64_PGTABLE_3_LEVEL)
static __inline__ pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{ {
pmd_t *pmd; return quicklist_alloc(0, GFP_KERNEL, NULL);
pmd = (pmd_t *) __get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
return pmd;
} }
static __inline__ void pmd_free(pmd_t *pmd) static inline void pmd_free(pmd_t *pmd)
{ {
free_page((unsigned long) pmd); quicklist_free(0, NULL, pmd);
} }
#define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd) #define pgd_populate(mm, pgd, pmd) pgd_set(pgd, pmd)
#define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) #define __pmd_free_tlb(tlb,pmd) pmd_free(pmd)
#else #else
#error "No defined page table size" #error "No defined page table size"
#endif #endif
#define check_pgt_cache() do { } while (0)
#define pgd_free(pgd) free_pgd_slow(pgd)
#define pgd_alloc(mm) get_pgd_fast()
extern int do_check_pgt_cache(int, int);
#define pmd_populate_kernel(mm, pmd, pte) \ #define pmd_populate_kernel(mm, pmd, pte) \
set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte))) set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) (pte)))
...@@ -176,4 +117,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, ...@@ -176,4 +117,9 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte))); set_pmd(pmd, __pmd(_PAGE_TABLE + (unsigned long) page_address (pte)));
} }
static inline void check_pgt_cache(void)
{
quicklist_trim(0, NULL, 25, 16);
}
#endif /* __ASM_SH64_PGALLOC_H */ #endif /* __ASM_SH64_PGALLOC_H */
#include <asm-sh/sci.h>
...@@ -78,7 +78,13 @@ static inline struct thread_info *current_thread_info(void) ...@@ -78,7 +78,13 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_SIGPENDING 2 /* signal pending */ #define TIF_SIGPENDING 2 /* signal pending */
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
#define TIF_MEMDIE 4 #define TIF_MEMDIE 4
#define TIF_RESTORE_SIGMASK 5 /* Restore signal mask in do_signal */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
* include/asm-sh64/unistd.h * include/asm-sh64/unistd.h
* *
* Copyright (C) 2000, 2001 Paolo Alberelli * Copyright (C) 2000, 2001 Paolo Alberelli
* Copyright (C) 2003 Paul Mundt * Copyright (C) 2003 - 2007 Paul Mundt
* Copyright (C) 2004 Sean McGoogan * Copyright (C) 2004 Sean McGoogan
* *
* This file contains the system call numbers. * This file contains the system call numbers.
* *
*/ */
#define __NR_setup 0 /* used only by init, to get system going */ #define __NR_restart_syscall 0
#define __NR_exit 1 #define __NR_exit 1
#define __NR_fork 2 #define __NR_fork 2
#define __NR_read 3 #define __NR_read 3
...@@ -196,8 +196,8 @@ ...@@ -196,8 +196,8 @@
#define __NR_rt_sigtimedwait 177 #define __NR_rt_sigtimedwait 177
#define __NR_rt_sigqueueinfo 178 #define __NR_rt_sigqueueinfo 178
#define __NR_rt_sigsuspend 179 #define __NR_rt_sigsuspend 179
#define __NR_pread 180 #define __NR_pread64 180
#define __NR_pwrite 181 #define __NR_pwrite64 181
#define __NR_chown 182 #define __NR_chown 182
#define __NR_getcwd 183 #define __NR_getcwd 183
#define __NR_capget 184 #define __NR_capget 184
...@@ -343,10 +343,41 @@ ...@@ -343,10 +343,41 @@
#define __NR_inotify_init 318 #define __NR_inotify_init 318
#define __NR_inotify_add_watch 319 #define __NR_inotify_add_watch 319
#define __NR_inotify_rm_watch 320 #define __NR_inotify_rm_watch 320
/* 321 is unused */
#define __NR_migrate_pages 322
#define __NR_openat 323
#define __NR_mkdirat 324
#define __NR_mknodat 325
#define __NR_fchownat 326
#define __NR_futimesat 327
#define __NR_fstatat64 328
#define __NR_unlinkat 329
#define __NR_renameat 330
#define __NR_linkat 331
#define __NR_symlinkat 332
#define __NR_readlinkat 333
#define __NR_fchmodat 334
#define __NR_faccessat 335
#define __NR_pselect6 336
#define __NR_ppoll 337
#define __NR_unshare 338
#define __NR_set_robust_list 339
#define __NR_get_robust_list 340
#define __NR_splice 341
#define __NR_sync_file_range 342
#define __NR_tee 343
#define __NR_vmsplice 344
#define __NR_move_pages 345
#define __NR_getcpu 346
#define __NR_epoll_pwait 347
#define __NR_utimensat 348
#define __NR_signalfd 349
#define __NR_timerfd 350
#define __NR_eventfd 351
#ifdef __KERNEL__ #ifdef __KERNEL__
#define NR_syscalls 321 #define NR_syscalls 352
#define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
......
...@@ -166,5 +166,5 @@ config ZONE_DMA_FLAG ...@@ -166,5 +166,5 @@ config ZONE_DMA_FLAG
config NR_QUICK config NR_QUICK
int int
depends on QUICKLIST depends on QUICKLIST
default "2" if SUPERH default "2" if (SUPERH && !SUPERH64)
default "1" default "1"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment