Commit d7f1917a authored by Richard Russon's avatar Richard Russon

Merge flatcap.org:/home/flatcap/backup/bk/ntfs-2.6

into flatcap.org:/home/flatcap/backup/bk/ntfs-2.6-devel
parents bad71405 8ff96da6
...@@ -91,8 +91,8 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len, ...@@ -91,8 +91,8 @@ osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
* braindamage (it can't really handle filesystems where the directory * braindamage (it can't really handle filesystems where the directory
* offset differences aren't the same as "d_reclen"). * offset differences aren't the same as "d_reclen").
*/ */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) #define NAME_OFFSET offsetof (struct osf_dirent, d_name)
#define ROUND_UP(x) (((x)+3) & ~3) #define ROUND_UP(x) (((x)+3) & ~3)
struct osf_dirent { struct osf_dirent {
unsigned int d_ino; unsigned int d_ino;
...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, ...@@ -114,7 +114,7 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
{ {
struct osf_dirent __user *dirent; struct osf_dirent __user *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); unsigned int reclen = ROUND_UP(NAME_OFFSET + namlen + 1);
buf->error = -EINVAL; /* only used if we fail */ buf->error = -EINVAL; /* only used if we fail */
if (reclen > buf->count) if (reclen > buf->count)
...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, ...@@ -989,7 +989,7 @@ osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
fd_set_bits fds; fd_set_bits fds;
char *bits; char *bits;
size_t size; size_t size;
unsigned long timeout; long timeout;
int ret; int ret;
timeout = MAX_SCHEDULE_TIMEOUT; timeout = MAX_SCHEDULE_TIMEOUT;
......
...@@ -91,15 +91,15 @@ static int regoff[] = { ...@@ -91,15 +91,15 @@ static int regoff[] = {
PT_REG( pc) PT_REG( pc)
}; };
static long zero; static unsigned long zero;
/* /*
* Get address of register REGNO in task TASK. * Get address of register REGNO in task TASK.
*/ */
static long * static unsigned long *
get_reg_addr(struct task_struct * task, unsigned long regno) get_reg_addr(struct task_struct * task, unsigned long regno)
{ {
long *addr; unsigned long *addr;
if (regno == 30) { if (regno == 30) {
addr = &task->thread_info->pcb.usp; addr = &task->thread_info->pcb.usp;
...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -109,7 +109,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
zero = 0; zero = 0;
addr = &zero; addr = &zero;
} else { } else {
addr = (long *)((long)task->thread_info + regoff[regno]); addr = (void *)task->thread_info + regoff[regno];
} }
return addr; return addr;
} }
...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -117,7 +117,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
/* /*
* Get contents of register REGNO in task TASK. * Get contents of register REGNO in task TASK.
*/ */
static long static unsigned long
get_reg(struct task_struct * task, unsigned long regno) get_reg(struct task_struct * task, unsigned long regno)
{ {
/* Special hack for fpcr -- combine hardware and software bits. */ /* Special hack for fpcr -- combine hardware and software bits. */
...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno) ...@@ -135,7 +135,7 @@ get_reg(struct task_struct * task, unsigned long regno)
* Write contents of register REGNO in task TASK. * Write contents of register REGNO in task TASK.
*/ */
static int static int
put_reg(struct task_struct *task, unsigned long regno, long data) put_reg(struct task_struct *task, unsigned long regno, unsigned long data)
{ {
if (regno == 63) { if (regno == 63) {
task->thread_info->ieee_state task->thread_info->ieee_state
...@@ -168,11 +168,11 @@ int ...@@ -168,11 +168,11 @@ int
ptrace_set_bpt(struct task_struct * child) ptrace_set_bpt(struct task_struct * child)
{ {
int displ, i, res, reg_b, nsaved = 0; int displ, i, res, reg_b, nsaved = 0;
u32 insn, op_code; unsigned int insn, op_code;
unsigned long pc; unsigned long pc;
pc = get_reg(child, REG_PC); pc = get_reg(child, REG_PC);
res = read_int(child, pc, &insn); res = read_int(child, pc, (int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child) ...@@ -203,7 +203,8 @@ ptrace_set_bpt(struct task_struct * child)
/* install breakpoints: */ /* install breakpoints: */
for (i = 0; i < nsaved; ++i) { for (i = 0; i < nsaved; ++i) {
res = read_int(child, child->thread_info->bpt_addr[i], &insn); res = read_int(child, child->thread_info->bpt_addr[i],
(int *) &insn);
if (res < 0) if (res < 0)
return res; return res;
child->thread_info->bpt_insn[i] = insn; child->thread_info->bpt_insn[i] = insn;
......
...@@ -228,6 +228,12 @@ struct rt_sigframe ...@@ -228,6 +228,12 @@ struct rt_sigframe
unsigned int retcode[3]; unsigned int retcode[3];
}; };
/* If this changes, userland unwinders that Know Things about our signal
frame will break. Do not undertake lightly. It also implies an ABI
change wrt the size of siginfo_t, which may cause some pain. */
extern char compile_time_assert
[offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
#define INSN_MOV_R30_R16 0x47fe0410 #define INSN_MOV_R30_R16 0x47fe0410
#define INSN_LDI_R0 0x201f0000 #define INSN_LDI_R0 0x201f0000
#define INSN_CALLSYS 0x00000083 #define INSN_CALLSYS 0x00000083
......
...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data) ...@@ -91,15 +91,15 @@ srmcons_receive_chars(unsigned long data)
/* called with callback_lock held */ /* called with callback_lock held */
static int static int
srmcons_do_write(struct tty_struct *tty, const unsigned char *buf, int count) srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
{ {
unsigned char *str_cr = "\r"; static char str_cr[1] = "\r";
long c, remaining = count; long c, remaining = count;
srmcons_result result; srmcons_result result;
unsigned char *cur; char *cur;
int need_cr; int need_cr;
for (cur = (unsigned char *)buf; remaining > 0; ) { for (cur = (char *)buf; remaining > 0; ) {
need_cr = 0; need_cr = 0;
/* /*
* Break it up into reasonable size chunks to allow a chance * Break it up into reasonable size chunks to allow a chance
...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -138,7 +138,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
unsigned long flags; unsigned long flags;
if (from_user) { if (from_user) {
unsigned char tmp[512]; char tmp[512];
int ret = 0; int ret = 0;
size_t c; size_t c;
...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user, ...@@ -167,7 +167,7 @@ srmcons_write(struct tty_struct *tty, int from_user,
} }
spin_lock_irqsave(&srmcons_callback_lock, flags); spin_lock_irqsave(&srmcons_callback_lock, flags);
srmcons_do_write(tty, buf, count); srmcons_do_write(tty, (const char *) buf, count);
spin_unlock_irqrestore(&srmcons_callback_lock, flags); spin_unlock_irqrestore(&srmcons_callback_lock, flags);
return count; return count;
......
...@@ -176,7 +176,6 @@ CONFIG_IP_MULTIPLE_TABLES=y ...@@ -176,7 +176,6 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_FWMARK=y
CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_NAT=y
# CONFIG_IP_ROUTE_MULTIPATH is not set # CONFIG_IP_ROUTE_MULTIPATH is not set
# CONFIG_IP_ROUTE_TOS is not set
CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set # CONFIG_IP_PNP_DHCP is not set
......
...@@ -308,7 +308,6 @@ CONFIG_IP_MULTIPLE_TABLES=y ...@@ -308,7 +308,6 @@ CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_FWMARK=y
CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_DHCP=y
......
...@@ -202,7 +202,7 @@ static void apm_suspend(void) ...@@ -202,7 +202,7 @@ static void apm_suspend(void)
} }
up_read(&user_list_lock); up_read(&user_list_lock);
wake_up_interruptible(&apm_suspend_waitqueue); wake_up(&apm_suspend_waitqueue);
} }
static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos) static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
...@@ -306,7 +306,15 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg) ...@@ -306,7 +306,15 @@ apm_ioctl(struct inode * inode, struct file *filp, u_int cmd, u_long arg)
flags = current->flags; flags = current->flags;
current->flags |= PF_NOFREEZE; current->flags |= PF_NOFREEZE;
wait_event_interruptible(apm_suspend_waitqueue, /*
* Note: do not allow a thread which is acking the suspend
* to escape until the resume is complete.
*/
if (as->suspend_state == SUSPEND_ACKED)
wait_event(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE);
else
wait_event_interruptible(apm_suspend_waitqueue,
as->suspend_state == SUSPEND_DONE); as->suspend_state == SUSPEND_DONE);
current->flags = flags; current->flags = flags;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <asm/arch/udc.h> #include <asm/arch/udc.h>
#include <asm/arch/pxafb.h> #include <asm/arch/pxafb.h>
#include <asm/arch/mmc.h>
#include "generic.h" #include "generic.h"
...@@ -128,6 +129,12 @@ static struct platform_device pxamci_device = { ...@@ -128,6 +129,12 @@ static struct platform_device pxamci_device = {
.resource = pxamci_resources, .resource = pxamci_resources,
}; };
void __init pxa_set_mci_info(struct pxamci_platform_data *info)
{
pxamci_device.dev.platform_data = info;
}
EXPORT_SYMBOL(pxa_set_mci_info);
static struct pxa2xx_udc_mach_info pxa_udc_info; static struct pxa2xx_udc_mach_info pxa_udc_info;
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.9-rc1 # Linux kernel version: 2.6.9-rc2
# Fri Aug 27 22:00:00 2004 # Fri Sep 17 13:58:32 2004
# #
# #
...@@ -13,6 +13,7 @@ CONFIG_CLEAN_COMPILE=y ...@@ -13,6 +13,7 @@ CONFIG_CLEAN_COMPILE=y
# #
# General setup # General setup
# #
CONFIG_LOCALVERSION=""
CONFIG_SWAP=y CONFIG_SWAP=y
CONFIG_SYSVIPC=y CONFIG_SYSVIPC=y
CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE=y
...@@ -33,6 +34,8 @@ CONFIG_IOSCHED_AS=y ...@@ -33,6 +34,8 @@ CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SHMEM=y
# CONFIG_TINY_SHMEM is not set
# #
# Loadable module support # Loadable module support
...@@ -54,6 +57,7 @@ CONFIG_MMU=y ...@@ -54,6 +57,7 @@ CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_TIME_INTERPOLATION=y CONFIG_TIME_INTERPOLATION=y
CONFIG_EFI=y CONFIG_EFI=y
CONFIG_GENERIC_IOMAP=y
# CONFIG_IA64_GENERIC is not set # CONFIG_IA64_GENERIC is not set
# CONFIG_IA64_DIG is not set # CONFIG_IA64_DIG is not set
# CONFIG_IA64_HP_ZX1 is not set # CONFIG_IA64_HP_ZX1 is not set
...@@ -210,7 +214,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y ...@@ -210,7 +214,6 @@ CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_AMD74XX is not set
...@@ -277,7 +280,8 @@ CONFIG_SCSI_FC_ATTRS=y ...@@ -277,7 +280,8 @@ CONFIG_SCSI_FC_ATTRS=y
# CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_MEGARAID is not set # CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA=y
# CONFIG_SCSI_SATA_SVW is not set # CONFIG_SCSI_SATA_SVW is not set
# CONFIG_SCSI_ATA_PIIX is not set # CONFIG_SCSI_ATA_PIIX is not set
...@@ -334,8 +338,7 @@ CONFIG_DM_ZERO=m ...@@ -334,8 +338,7 @@ CONFIG_DM_ZERO=m
# Fusion MPT device support # Fusion MPT device support
# #
CONFIG_FUSION=y CONFIG_FUSION=y
CONFIG_FUSION_MAX_SGE=40 CONFIG_FUSION_MAX_SGE=128
CONFIG_FUSION_ISENSE=m
CONFIG_FUSION_CTL=m CONFIG_FUSION_CTL=m
# #
...@@ -550,7 +553,6 @@ CONFIG_SERIAL_SGI_L1_CONSOLE=y ...@@ -550,7 +553,6 @@ CONFIG_SERIAL_SGI_L1_CONSOLE=y
CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_QIC02_TAPE is not set
# #
# IPMI # IPMI
...@@ -575,6 +577,7 @@ CONFIG_EFI_RTC=y ...@@ -575,6 +577,7 @@ CONFIG_EFI_RTC=y
CONFIG_RAW_DRIVER=m CONFIG_RAW_DRIVER=m
# CONFIG_HPET is not set # CONFIG_HPET is not set
CONFIG_MAX_RAW_DEVS=256 CONFIG_MAX_RAW_DEVS=256
CONFIG_MMTIMER=y
# #
# I2C support # I2C support
......
...@@ -48,6 +48,7 @@ static void elf32_set_personality (void); ...@@ -48,6 +48,7 @@ static void elf32_set_personality (void);
extern struct page *ia32_shared_page[]; extern struct page *ia32_shared_page[];
extern unsigned long *ia32_gdt; extern unsigned long *ia32_gdt;
extern struct page *ia32_gate_page;
struct page * struct page *
ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int *type) ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int *type)
...@@ -59,10 +60,25 @@ ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int ...@@ -59,10 +60,25 @@ ia32_install_shared_page (struct vm_area_struct *vma, unsigned long address, int
return pg; return pg;
} }
struct page *
ia32_install_gate_page (struct vm_area_struct *vma, unsigned long address, int *type)
{
struct page *pg = ia32_gate_page;
get_page(pg);
if (type)
*type = VM_FAULT_MINOR;
return pg;
}
static struct vm_operations_struct ia32_shared_page_vm_ops = { static struct vm_operations_struct ia32_shared_page_vm_ops = {
.nopage = ia32_install_shared_page .nopage = ia32_install_shared_page
}; };
static struct vm_operations_struct ia32_gate_page_vm_ops = {
.nopage = ia32_install_gate_page
};
void void
ia64_elf32_init (struct pt_regs *regs) ia64_elf32_init (struct pt_regs *regs)
{ {
...@@ -89,6 +105,29 @@ ia64_elf32_init (struct pt_regs *regs) ...@@ -89,6 +105,29 @@ ia64_elf32_init (struct pt_regs *regs)
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);
} }
/*
* When user stack is not executable, push sigreturn code to stack makes
* segmentation fault raised when returning to kernel. So now sigreturn
* code is locked in specific gate page, which is pointed by pretcode
* when setup_frame_ia32
*/
vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
if (vma) {
memset(vma, 0, sizeof(*vma));
vma->vm_mm = current->mm;
vma->vm_start = IA32_GATE_OFFSET;
vma->vm_end = vma->vm_start + PAGE_SIZE;
vma->vm_page_prot = PAGE_COPY_EXEC;
vma->vm_flags = VM_READ | VM_MAYREAD | VM_EXEC
| VM_MAYEXEC | VM_RESERVED;
vma->vm_ops = &ia32_gate_page_vm_ops;
down_write(&current->mm->mmap_sem);
{
insert_vm_struct(current->mm, vma);
}
up_write(&current->mm->mmap_sem);
}
/* /*
* Install LDT as anonymous memory. This gives us all-zero segment descriptors * Install LDT as anonymous memory. This gives us all-zero segment descriptors
* until a task modifies them via modify_ldt(). * until a task modifies them via modify_ldt().
......
...@@ -311,7 +311,7 @@ ia32_syscall_table: ...@@ -311,7 +311,7 @@ ia32_syscall_table:
data8 sys_ni_syscall /* old profil syscall holder */ data8 sys_ni_syscall /* old profil syscall holder */
data8 compat_sys_statfs data8 compat_sys_statfs
data8 compat_sys_fstatfs /* 100 */ data8 compat_sys_fstatfs /* 100 */
data8 sys32_ioperm data8 sys_ni_syscall /* ioperm */
data8 compat_sys_socketcall data8 compat_sys_socketcall
data8 sys_syslog data8 sys_syslog
data8 compat_sys_setitimer data8 compat_sys_setitimer
...@@ -320,7 +320,7 @@ ia32_syscall_table: ...@@ -320,7 +320,7 @@ ia32_syscall_table:
data8 compat_sys_newlstat data8 compat_sys_newlstat
data8 compat_sys_newfstat data8 compat_sys_newfstat
data8 sys_ni_syscall data8 sys_ni_syscall
data8 sys32_iopl /* 110 */ data8 sys_ni_syscall /* iopl */ /* 110 */
data8 sys_vhangup data8 sys_vhangup
data8 sys_ni_syscall /* used to be sys_idle */ data8 sys_ni_syscall /* used to be sys_idle */
data8 sys_ni_syscall data8 sys_ni_syscall
......
...@@ -853,14 +853,19 @@ setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs ...@@ -853,14 +853,19 @@ setup_frame_ia32 (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs
unsigned int restorer = IA32_SA_RESTORER(ka); unsigned int restorer = IA32_SA_RESTORER(ka);
err |= __put_user(restorer, &frame->pretcode); err |= __put_user(restorer, &frame->pretcode);
} else { } else {
err |= __put_user((long)frame->retcode, &frame->pretcode); /* Pointing to restorer in ia32 gate page */
/* This is popl %eax ; movl $,%eax ; int $0x80 */ err |= __put_user(IA32_GATE_OFFSET, &frame->pretcode);
err |= __put_user(0xb858, (short *)(frame->retcode+0));
err |= __put_user(__IA32_NR_sigreturn & 0xffff, (short *)(frame->retcode+2));
err |= __put_user(__IA32_NR_sigreturn >> 16, (short *)(frame->retcode+4));
err |= __put_user(0x80cd, (short *)(frame->retcode+6));
} }
/* This is popl %eax ; movl $,%eax ; int $0x80
* and there for historical reasons only.
* See arch/i386/kernel/signal.c
*/
err |= __put_user(0xb858, (short *)(frame->retcode+0));
err |= __put_user(__IA32_NR_sigreturn, (int *)(frame->retcode+2));
err |= __put_user(0x80cd, (short *)(frame->retcode+6));
if (err) if (err)
goto give_sigsegv; goto give_sigsegv;
...@@ -922,13 +927,19 @@ setup_rt_frame_ia32 (int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -922,13 +927,19 @@ setup_rt_frame_ia32 (int sig, struct k_sigaction *ka, siginfo_t *info,
unsigned int restorer = IA32_SA_RESTORER(ka); unsigned int restorer = IA32_SA_RESTORER(ka);
err |= __put_user(restorer, &frame->pretcode); err |= __put_user(restorer, &frame->pretcode);
} else { } else {
err |= __put_user((long)frame->retcode, &frame->pretcode); /* Pointing to rt_restorer in ia32 gate page */
/* This is movl $,%eax ; int $0x80 */ err |= __put_user(IA32_GATE_OFFSET + 8, &frame->pretcode);
err |= __put_user(0xb8, (char *)(frame->retcode+0));
err |= __put_user(__IA32_NR_rt_sigreturn, (int *)(frame->retcode+1));
err |= __put_user(0x80cd, (short *)(frame->retcode+5));
} }
/* This is movl $,%eax ; int $0x80
* and there for historical reasons only.
* See arch/i386/kernel/signal.c
*/
err |= __put_user(0xb8, (char *)(frame->retcode+0));
err |= __put_user(__IA32_NR_rt_sigreturn, (int *)(frame->retcode+1));
err |= __put_user(0x80cd, (short *)(frame->retcode+5));
if (err) if (err)
goto give_sigsegv; goto give_sigsegv;
......
...@@ -33,6 +33,7 @@ struct exec_domain ia32_exec_domain; ...@@ -33,6 +33,7 @@ struct exec_domain ia32_exec_domain;
struct page *ia32_shared_page[NR_CPUS]; struct page *ia32_shared_page[NR_CPUS];
unsigned long *ia32_boot_gdt; unsigned long *ia32_boot_gdt;
unsigned long *cpu_gdt_table[NR_CPUS]; unsigned long *cpu_gdt_table[NR_CPUS];
struct page *ia32_gate_page;
static unsigned long static unsigned long
load_desc (u16 selector) load_desc (u16 selector)
...@@ -158,7 +159,7 @@ ia32_gdt_init (void) ...@@ -158,7 +159,7 @@ ia32_gdt_init (void)
/* /*
* Setup IA32 GDT and TSS * Setup IA32 GDT and TSS
*/ */
void static void
ia32_boot_gdt_init (void) ia32_boot_gdt_init (void)
{ {
unsigned long ldt_size; unsigned long ldt_size;
...@@ -172,12 +173,12 @@ ia32_boot_gdt_init (void) ...@@ -172,12 +173,12 @@ ia32_boot_gdt_init (void)
/* CS descriptor in IA-32 (scrambled) format */ /* CS descriptor in IA-32 (scrambled) format */
ia32_boot_gdt[__USER_CS >> 3] ia32_boot_gdt[__USER_CS >> 3]
= IA32_SEG_DESCRIPTOR(0, (IA32_PAGE_OFFSET-1) >> IA32_PAGE_SHIFT, = IA32_SEG_DESCRIPTOR(0, (IA32_GATE_END-1) >> IA32_PAGE_SHIFT,
0xb, 1, 3, 1, 1, 1, 1); 0xb, 1, 3, 1, 1, 1, 1);
/* DS descriptor in IA-32 (scrambled) format */ /* DS descriptor in IA-32 (scrambled) format */
ia32_boot_gdt[__USER_DS >> 3] ia32_boot_gdt[__USER_DS >> 3]
= IA32_SEG_DESCRIPTOR(0, (IA32_PAGE_OFFSET-1) >> IA32_PAGE_SHIFT, = IA32_SEG_DESCRIPTOR(0, (IA32_GATE_END-1) >> IA32_PAGE_SHIFT,
0x3, 1, 3, 1, 1, 1, 1); 0x3, 1, 3, 1, 1, 1, 1);
ldt_size = PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE); ldt_size = PAGE_ALIGN(IA32_LDT_ENTRIES*IA32_LDT_ENTRY_SIZE);
...@@ -187,6 +188,27 @@ ia32_boot_gdt_init (void) ...@@ -187,6 +188,27 @@ ia32_boot_gdt_init (void)
0x2, 0, 3, 1, 1, 1, 0); 0x2, 0, 3, 1, 1, 1, 0);
} }
static void
ia32_gate_page_init(void)
{
unsigned long *sr;
ia32_gate_page = alloc_page(GFP_KERNEL);
sr = page_address(ia32_gate_page);
/* This is popl %eax ; movl $,%eax ; int $0x80 */
*sr++ = 0xb858 | (__IA32_NR_sigreturn << 16) | (0x80cdUL << 48);
/* This is movl $,%eax ; int $0x80 */
*sr = 0xb8 | (__IA32_NR_rt_sigreturn << 8) | (0x80cdUL << 40);
}
void
ia32_mem_init(void)
{
ia32_boot_gdt_init();
ia32_gate_page_init();
}
/* /*
* Handle bad IA32 interrupt via syscall * Handle bad IA32 interrupt via syscall
*/ */
......
...@@ -168,6 +168,9 @@ struct ia32_user_fxsr_struct { ...@@ -168,6 +168,9 @@ struct ia32_user_fxsr_struct {
#define IA32_SA_HANDLER(ka) ((unsigned long) (ka)->sa.sa_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) #define IA32_SA_RESTORER(ka) ((unsigned long) (ka)->sa.sa_handler >> 32)
#define __IA32_NR_sigreturn 119
#define __IA32_NR_rt_sigreturn 173
struct sigaction32 { 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_flags;
...@@ -324,14 +327,16 @@ struct old_linux32_dirent { ...@@ -324,14 +327,16 @@ struct old_linux32_dirent {
#define IA32_PAGE_OFFSET 0xc0000000 #define IA32_PAGE_OFFSET 0xc0000000
#define IA32_STACK_TOP IA32_PAGE_OFFSET #define IA32_STACK_TOP IA32_PAGE_OFFSET
#define IA32_GATE_OFFSET IA32_PAGE_OFFSET
#define IA32_GATE_END IA32_PAGE_OFFSET + PAGE_SIZE
/* /*
* The system segments (GDT, TSS, LDT) have to be mapped below 4GB so the IA-32 engine can * The system segments (GDT, TSS, LDT) have to be mapped below 4GB so the IA-32 engine can
* access them. * access them.
*/ */
#define IA32_GDT_OFFSET (IA32_PAGE_OFFSET) #define IA32_GDT_OFFSET (IA32_PAGE_OFFSET + PAGE_SIZE)
#define IA32_TSS_OFFSET (IA32_PAGE_OFFSET + PAGE_SIZE) #define IA32_TSS_OFFSET (IA32_PAGE_OFFSET + 2*PAGE_SIZE)
#define IA32_LDT_OFFSET (IA32_PAGE_OFFSET + 2*PAGE_SIZE) #define IA32_LDT_OFFSET (IA32_PAGE_OFFSET + 3*PAGE_SIZE)
#define ELF_EXEC_PAGESIZE IA32_PAGE_SIZE #define ELF_EXEC_PAGESIZE IA32_PAGE_SIZE
......
...@@ -1913,73 +1913,6 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, ...@@ -1913,73 +1913,6 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
return ret; return ret;
} }
/*
* The IA64 maps 4 I/O ports for each 4K page
*/
#define IOLEN ((65536 / 4) * 4096)
asmlinkage long
sys32_iopl (int level)
{
extern unsigned long ia64_iobase;
int fd;
struct file * file;
unsigned int old;
unsigned long addr;
mm_segment_t old_fs = get_fs ();
if (level != 3)
return(-EINVAL);
/* Trying to gain more privileges? */
old = ia64_getreg(_IA64_REG_AR_EFLAG);
if ((unsigned int) level > ((old >> 12) & 3)) {
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
}
set_fs(KERNEL_DS);
fd = sys_open("/dev/mem", O_SYNC | O_RDWR, 0);
set_fs(old_fs);
if (fd < 0)
return fd;
file = fget(fd);
if (file == NULL) {
sys_close(fd);
return(-EFAULT);
}
down_write(&current->mm->mmap_sem);
addr = do_mmap_pgoff(file, IA32_IOBASE,
IOLEN, PROT_READ|PROT_WRITE, MAP_SHARED,
(ia64_iobase & ~PAGE_OFFSET) >> PAGE_SHIFT);
up_write(&current->mm->mmap_sem);
if (addr >= 0) {
old = (old & ~0x3000) | (level << 12);
ia64_setreg(_IA64_REG_AR_EFLAG, old);
}
fput(file);
sys_close(fd);
return 0;
}
asmlinkage long
sys32_ioperm (unsigned int from, unsigned int num, int on)
{
/*
* Since IA64 doesn't have permission bits we'd have to go to
* a lot of trouble to simulate them in software. There's
* no point, only trusted programs can make this call so we'll
* just turn it into an iopl call and let the process have
* access to all I/O ports.
*
* XXX proper ioperm() support should be emulated by
* manipulating the page protections...
*/
return sys32_iopl(3);
}
typedef struct { typedef struct {
unsigned int ss_sp; unsigned int ss_sp;
unsigned int ss_flags; unsigned int ss_flags;
......
...@@ -587,6 +587,6 @@ mem_init (void) ...@@ -587,6 +587,6 @@ mem_init (void)
setup_gate(); setup_gate();
#ifdef CONFIG_IA32_SUPPORT #ifdef CONFIG_IA32_SUPPORT
ia32_boot_gdt_init(); ia32_mem_init();
#endif #endif
} }
...@@ -272,7 +272,6 @@ CONFIG_IP_ADVANCED_ROUTER=y ...@@ -272,7 +272,6 @@ CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set # CONFIG_IP_PNP_DHCP is not set
......
...@@ -229,7 +229,6 @@ CONFIG_IP_ADVANCED_ROUTER=y ...@@ -229,7 +229,6 @@ CONFIG_IP_ADVANCED_ROUTER=y
CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_MULTIPLE_TABLES=y
CONFIG_IP_ROUTE_NAT=y CONFIG_IP_ROUTE_NAT=y
CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_MULTIPATH=y
CONFIG_IP_ROUTE_TOS=y
CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_ROUTE_VERBOSE=y
CONFIG_IP_PNP=y CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set # CONFIG_IP_PNP_DHCP is not set
......
...@@ -1737,21 +1737,30 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32, ...@@ -1737,21 +1737,30 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32,
} }
asmlinkage long compat_sys_waitid(u32 which, u32 pid, asmlinkage long compat_sys_waitid(u32 which, u32 pid,
struct siginfo32 __user *uinfo, u32 options) struct siginfo32 __user *uinfo, u32 options,
struct compat_rusage __user *uru)
{ {
siginfo_t info; siginfo_t info;
struct rusage ru;
long ret; long ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
ret = sys_waitid((int)which, (compat_pid_t) pid, ret = sys_waitid(which, pid, (siginfo_t __user *) &info,
(siginfo_t __user *) &info, (int) options); options, uru ? &ru : NULL);
set_fs (old_fs); set_fs (old_fs);
if (ret < 0 || info.si_signo == 0) if (ret < 0 || info.si_signo == 0)
return ret; return ret;
if (uru) {
ret = put_compat_rusage(&ru, uru);
if (ret)
return ret;
}
BUG_ON(info.si_code & __SI_MASK); BUG_ON(info.si_code & __SI_MASK);
info.si_code |= __SI_CHLD; info.si_code |= __SI_CHLD;
return copy_siginfo_to_user32(uinfo, &info); return copy_siginfo_to_user32(uinfo, &info);
......
...@@ -1152,19 +1152,26 @@ asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp, ...@@ -1152,19 +1152,26 @@ asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
} }
asmlinkage long sys32_waitid(int which, compat_pid_t pid, asmlinkage long sys32_waitid(int which, compat_pid_t pid,
siginfo_t32 __user *uinfo, int options) siginfo_t32 __user *uinfo, int options,
struct compat_rusage __user *uru)
{ {
siginfo_t info; siginfo_t info;
struct rusage ru;
long ret; long ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
info.si_signo = 0; info.si_signo = 0;
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options); ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
uru ? &ru : NULL);
set_fs (old_fs); set_fs (old_fs);
if (ret < 0 || info.si_signo == 0) if (ret < 0 || info.si_signo == 0)
return ret; return ret;
if (uru && (ret = put_compat_rusage(&ru, uru)))
return ret;
BUG_ON(info.si_code & __SI_MASK); BUG_ON(info.si_code & __SI_MASK);
info.si_code |= __SI_CHLD; info.si_code |= __SI_CHLD;
return ia32_copy_siginfo_to_user(uinfo, &info); return ia32_copy_siginfo_to_user(uinfo, &info);
......
...@@ -1667,7 +1667,7 @@ static int __devinit fs_init (struct fs_dev *dev) ...@@ -1667,7 +1667,7 @@ static int __devinit fs_init (struct fs_dev *dev)
dev->hw_base = pci_resource_start(pci_dev, 0); dev->hw_base = pci_resource_start(pci_dev, 0);
dev->base = (ulong) ioremap(dev->hw_base, 0x1000); dev->base = ioremap(dev->hw_base, 0x1000);
reset_chip (dev); reset_chip (dev);
...@@ -1704,8 +1704,7 @@ static int __devinit fs_init (struct fs_dev *dev) ...@@ -1704,8 +1704,7 @@ static int __devinit fs_init (struct fs_dev *dev)
} }
/* Try again after 10ms. */ /* Try again after 10ms. */
set_current_state(TASK_UNINTERRUPTIBLE); msleep(10);
schedule_timeout ((HZ+99)/100);
} }
if (!to) { if (!to) {
......
...@@ -477,7 +477,7 @@ struct fs_dev { ...@@ -477,7 +477,7 @@ struct fs_dev {
struct timer_list timer; struct timer_list timer;
unsigned long hw_base; /* mem base address */ unsigned long hw_base; /* mem base address */
unsigned long base; /* Mapping of base address */ void __iomem *base; /* Mapping of base address */
int channo; int channo;
unsigned long channel_mask; unsigned long channel_mask;
......
...@@ -1007,6 +1007,7 @@ he_start(struct atm_dev *dev) ...@@ -1007,6 +1007,7 @@ he_start(struct atm_dev *dev)
{ {
struct he_dev *he_dev; struct he_dev *he_dev;
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
unsigned long membase;
u16 command; u16 command;
u32 gen_cntl_0, host_cntl, lb_swap; u32 gen_cntl_0, host_cntl, lb_swap;
...@@ -1019,8 +1020,8 @@ he_start(struct atm_dev *dev) ...@@ -1019,8 +1020,8 @@ he_start(struct atm_dev *dev)
he_dev = HE_DEV(dev); he_dev = HE_DEV(dev);
pci_dev = he_dev->pci_dev; pci_dev = he_dev->pci_dev;
he_dev->membase = pci_dev->resource[0].start; membase = pci_resource_start(pci_dev, 0);
HPRINTK("membase = 0x%lx irq = %d.\n", he_dev->membase, pci_dev->irq); HPRINTK("membase = 0x%lx irq = %d.\n", membase, pci_dev->irq);
/* /*
* pci bus controller initialization * pci bus controller initialization
...@@ -1080,7 +1081,7 @@ he_start(struct atm_dev *dev) ...@@ -1080,7 +1081,7 @@ he_start(struct atm_dev *dev)
hprintk("can't set latency timer to %d\n", timer); hprintk("can't set latency timer to %d\n", timer);
} }
if (!(he_dev->membase = (unsigned long) ioremap(he_dev->membase, HE_REGMAP_SIZE))) { if (!(he_dev->membase = ioremap(membase, HE_REGMAP_SIZE))) {
hprintk("can't set up page mapping\n"); hprintk("can't set up page mapping\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1962,7 +1963,7 @@ he_service_tbrq(struct he_dev *he_dev, int group) ...@@ -1962,7 +1963,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
struct he_tpd *tpd; struct he_tpd *tpd;
int slot, updated = 0; int slot, updated = 0;
#ifdef USE_TPD_POOL #ifdef USE_TPD_POOL
struct list_head *p; struct he_tpd *__tpd;
#endif #endif
/* 2.1.6 transmit buffer return queue */ /* 2.1.6 transmit buffer return queue */
...@@ -1977,8 +1978,7 @@ he_service_tbrq(struct he_dev *he_dev, int group) ...@@ -1977,8 +1978,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : ""); TBRQ_MULTIPLE(he_dev->tbrq_head) ? " MULTIPLE" : "");
#ifdef USE_TPD_POOL #ifdef USE_TPD_POOL
tpd = NULL; tpd = NULL;
list_for_each(p, &he_dev->outstanding_tpds) { list_for_each_entry(__tpd, &he_dev->outstanding_tpds, entry) {
struct he_tpd *__tpd = list_entry(p, struct he_tpd, entry);
if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) { if (TPD_ADDR(__tpd->status) == TBRQ_TPD(he_dev->tbrq_head)) {
tpd = __tpd; tpd = __tpd;
list_del(&__tpd->entry); list_del(&__tpd->entry);
...@@ -2595,9 +2595,8 @@ he_close(struct atm_vcc *vcc) ...@@ -2595,9 +2595,8 @@ he_close(struct atm_vcc *vcc)
while (((tx_inuse = atomic_read(&vcc->sk->sk_wmem_alloc)) > 0) && while (((tx_inuse = atomic_read(&vcc->sk->sk_wmem_alloc)) > 0) &&
(retry < MAX_RETRY)) { (retry < MAX_RETRY)) {
set_current_state(TASK_UNINTERRUPTIBLE); msleep(sleep);
(void) schedule_timeout(sleep); if (sleep < 250)
if (sleep < HZ)
sleep = sleep * 2; sleep = sleep * 2;
++retry; ++retry;
......
...@@ -265,7 +265,7 @@ struct he_cs_stper ...@@ -265,7 +265,7 @@ struct he_cs_stper
struct he_dev { struct he_dev {
unsigned int number; unsigned int number;
unsigned int irq; unsigned int irq;
unsigned long membase; void __iomem *membase;
char prod_id[30]; char prod_id[30];
char mac_addr[6]; char mac_addr[6];
......
...@@ -2516,7 +2516,7 @@ idt77252_close(struct atm_vcc *vcc) ...@@ -2516,7 +2516,7 @@ idt77252_close(struct atm_vcc *vcc)
struct vc_map *vc = vcc->dev_data; struct vc_map *vc = vcc->dev_data;
unsigned long flags; unsigned long flags;
unsigned long addr; unsigned long addr;
int timeout; unsigned long timeout;
down(&card->mutex); down(&card->mutex);
...@@ -2566,9 +2566,9 @@ idt77252_close(struct atm_vcc *vcc) ...@@ -2566,9 +2566,9 @@ idt77252_close(struct atm_vcc *vcc)
} }
spin_unlock_irqrestore(&vc->lock, flags); spin_unlock_irqrestore(&vc->lock, flags);
timeout = 5 * HZ; timeout = 5 * 1000;
while (atomic_read(&vc->scq->used) > 0) { while (atomic_read(&vc->scq->used) > 0) {
timeout = schedule_timeout(timeout); timeout = msleep_interruptible(timeout);
if (!timeout) if (!timeout)
break; break;
} }
...@@ -3164,7 +3164,7 @@ deinit_card(struct idt77252_dev *card) ...@@ -3164,7 +3164,7 @@ deinit_card(struct idt77252_dev *card)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (card->fbq[i]) if (card->fbq[i])
iounmap((void *) card->fbq[i]); iounmap(card->fbq[i]);
} }
if (card->membase) if (card->membase)
...@@ -3722,7 +3722,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) ...@@ -3722,7 +3722,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
card->tst_timer.function = tst_timer; card->tst_timer.function = tst_timer;
/* Do the I/O remapping... */ /* Do the I/O remapping... */
card->membase = (unsigned long) ioremap(membase, 1024); card->membase = ioremap(membase, 1024);
if (!card->membase) { if (!card->membase) {
printk("%s: can't ioremap() membase\n", card->name); printk("%s: can't ioremap() membase\n", card->name);
err = -EIO; err = -EIO;
...@@ -3756,8 +3756,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) ...@@ -3756,8 +3756,7 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
card->sramsize = probe_sram(card); card->sramsize = probe_sram(card);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
card->fbq[i] = (unsigned long) card->fbq[i] = ioremap(srambase | 0x200000 | (i << 18), 4);
ioremap(srambase | 0x200000 | (i << 18), 4);
if (!card->fbq[i]) { if (!card->fbq[i]) {
printk("%s: can't ioremap() FBQ%d\n", card->name, i); printk("%s: can't ioremap() FBQ%d\n", card->name, i);
err = -EIO; err = -EIO;
......
...@@ -355,9 +355,9 @@ struct idt77252_dev ...@@ -355,9 +355,9 @@ struct idt77252_dev
struct pci_dev *pcidev; /* PCI handle (desriptor) */ struct pci_dev *pcidev; /* PCI handle (desriptor) */
struct atm_dev *atmdev; /* ATM device desriptor */ struct atm_dev *atmdev; /* ATM device desriptor */
unsigned long membase; /* SAR's memory base address */ void __iomem *membase; /* SAR's memory base address */
unsigned long srambase; /* SAR's sram base address */ unsigned long srambase; /* SAR's sram base address */
unsigned long fbq[4]; /* FBQ fill addresses */ void __iomem *fbq[4]; /* FBQ fill addresses */
struct semaphore mutex; struct semaphore mutex;
spinlock_t cmd_lock; /* for r/w utility/sram */ spinlock_t cmd_lock; /* for r/w utility/sram */
......
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
#define LANAI_EEPROM_SIZE (128) #define LANAI_EEPROM_SIZE (128)
typedef int vci_t; typedef int vci_t;
typedef unsigned long bus_addr_t; typedef void __iomem *bus_addr_t;
/* DMA buffer in host memory for TX, RX, or service list. */ /* DMA buffer in host memory for TX, RX, or service list. */
struct lanai_buffer { struct lanai_buffer {
...@@ -471,7 +471,7 @@ enum lanai_register { ...@@ -471,7 +471,7 @@ enum lanai_register {
static inline bus_addr_t reg_addr(const struct lanai_dev *lanai, static inline bus_addr_t reg_addr(const struct lanai_dev *lanai,
enum lanai_register reg) enum lanai_register reg)
{ {
return lanai->base + (bus_addr_t) reg; return lanai->base + reg;
} }
static inline u32 reg_read(const struct lanai_dev *lanai, static inline u32 reg_read(const struct lanai_dev *lanai,
...@@ -651,7 +651,7 @@ static inline u32 cardvcc_read(const struct lanai_vcc *lvcc, ...@@ -651,7 +651,7 @@ static inline u32 cardvcc_read(const struct lanai_vcc *lvcc,
{ {
u32 val; u32 val;
APRINTK(lvcc->vbase != 0, "cardvcc_read: unbound vcc!\n"); APRINTK(lvcc->vbase != 0, "cardvcc_read: unbound vcc!\n");
val= readl(lvcc->vbase + (bus_addr_t) offset); val= readl(lvcc->vbase + offset);
RWDEBUG("VR vci=%04d 0x%02X = 0x%08X\n", RWDEBUG("VR vci=%04d 0x%02X = 0x%08X\n",
lvcc->vci, (int) offset, val); lvcc->vci, (int) offset, val);
return val; return val;
...@@ -666,7 +666,7 @@ static inline void cardvcc_write(const struct lanai_vcc *lvcc, ...@@ -666,7 +666,7 @@ static inline void cardvcc_write(const struct lanai_vcc *lvcc,
(unsigned int) val, lvcc->vci, (unsigned int) offset); (unsigned int) val, lvcc->vci, (unsigned int) offset);
RWDEBUG("VW vci=%04d 0x%02X > 0x%08X\n", RWDEBUG("VW vci=%04d 0x%02X > 0x%08X\n",
lvcc->vci, (unsigned int) offset, (unsigned int) val); lvcc->vci, (unsigned int) offset, (unsigned int) val);
writel(val, lvcc->vbase + (bus_addr_t) offset); writel(val, lvcc->vbase + offset);
} }
/* -------------------- COMPUTE SIZE OF AN AAL5 PDU: */ /* -------------------- COMPUTE SIZE OF AN AAL5 PDU: */
...@@ -813,7 +813,7 @@ static void lanai_shutdown_tx_vci(struct lanai_dev *lanai, ...@@ -813,7 +813,7 @@ static void lanai_shutdown_tx_vci(struct lanai_dev *lanai,
DPRINTK("read, write = %d, %d\n", read, write); DPRINTK("read, write = %d, %d\n", read, write);
break; break;
} }
schedule_timeout(HZ / 25); msleep(4);
} }
/* 15.2.2 - clear out all tx registers */ /* 15.2.2 - clear out all tx registers */
cardvcc_write(lvcc, 0, vcc_txreadptr); cardvcc_write(lvcc, 0, vcc_txreadptr);
...@@ -2177,7 +2177,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev) ...@@ -2177,7 +2177,7 @@ static int __init lanai_dev_open(struct atm_dev *atmdev)
/* 3.2: PCI initialization */ /* 3.2: PCI initialization */
if ((result = lanai_pci_start(lanai)) != 0) if ((result = lanai_pci_start(lanai)) != 0)
goto error; goto error;
raw_base = (bus_addr_t) lanai->pci->resource[0].start; raw_base = lanai->pci->resource[0].start;
lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE); lanai->base = (bus_addr_t) ioremap(raw_base, LANAI_MAPPING_SIZE);
if (lanai->base == 0) { if (lanai->base == 0) {
printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n"); printk(KERN_ERR DEV_LABEL ": couldn't remap I/O space\n");
......
...@@ -467,6 +467,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) ...@@ -467,6 +467,7 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
u32 u32d[4]; u32 u32d[4];
u32 ns_cfg_rctsize; u32 ns_cfg_rctsize;
int bcount; int bcount;
unsigned long membase;
error = 0; error = 0;
...@@ -494,8 +495,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) ...@@ -494,8 +495,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
card->index = i; card->index = i;
card->atmdev = NULL; card->atmdev = NULL;
card->pcidev = pcidev; card->pcidev = pcidev;
card->membase = pci_resource_start(pcidev, 1); membase = pci_resource_start(pcidev, 1);
card->membase = (unsigned long) ioremap(card->membase, NS_IOREMAP_SIZE); card->membase = ioremap(membase, NS_IOREMAP_SIZE);
if (card->membase == 0) if (card->membase == 0)
{ {
printk("nicstar%d: can't ioremap() membase.\n",i); printk("nicstar%d: can't ioremap() membase.\n",i);
......
...@@ -763,7 +763,7 @@ typedef struct ns_dev ...@@ -763,7 +763,7 @@ typedef struct ns_dev
{ {
int index; /* Card ID to the device driver */ int index; /* Card ID to the device driver */
int sram_size; /* In k x 32bit words. 32 or 128 */ int sram_size; /* In k x 32bit words. 32 or 128 */
unsigned long membase; /* Card's memory base address */ void __iomem *membase; /* Card's memory base address */
unsigned long max_pcr; unsigned long max_pcr;
int rct_size; /* Number of entries */ int rct_size; /* Number of entries */
int vpibits; int vpibits;
......
...@@ -162,7 +162,7 @@ nicstar_read_eprom_status( virt_addr_t base ) ...@@ -162,7 +162,7 @@ nicstar_read_eprom_status( virt_addr_t base )
*/ */
static u_int8_t static u_int8_t
read_eprom_byte(u_int32_t base, u_int8_t offset) read_eprom_byte(virt_addr_t base, u_int8_t offset)
{ {
u_int32_t val = 0; u_int32_t val = 0;
int i,j=0; int i,j=0;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
******************************************************************************/ ******************************************************************************/
typedef unsigned int virt_addr_t; typedef void __iomem *virt_addr_t;
u_int32_t nicstar_read_eprom_status( virt_addr_t base ); u_int32_t nicstar_read_eprom_status( virt_addr_t base );
void nicstar_init_eprom( virt_addr_t base ); void nicstar_init_eprom( virt_addr_t base );
......
...@@ -52,10 +52,6 @@ ...@@ -52,10 +52,6 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
*/ */
#ifndef __HAVE_COUNTERS
#define __HAVE_COUNTERS 0
#endif
#ifndef DRIVER_IOCTLS #ifndef DRIVER_IOCTLS
#define DRIVER_IOCTLS #define DRIVER_IOCTLS
#endif #endif
...@@ -195,41 +191,6 @@ static int DRM(setup)( drm_device_t *dev ) ...@@ -195,41 +191,6 @@ static int DRM(setup)( drm_device_t *dev )
return i; return i;
} }
dev->counters = 6 + __HAVE_COUNTERS;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
#ifdef __HAVE_COUNTER6
dev->types[6] = __HAVE_COUNTER6;
#endif
#ifdef __HAVE_COUNTER7
dev->types[7] = __HAVE_COUNTER7;
#endif
#ifdef __HAVE_COUNTER8
dev->types[8] = __HAVE_COUNTER8;
#endif
#ifdef __HAVE_COUNTER9
dev->types[9] = __HAVE_COUNTER9;
#endif
#ifdef __HAVE_COUNTER10
dev->types[10] = __HAVE_COUNTER10;
#endif
#ifdef __HAVE_COUNTER11
dev->types[11] = __HAVE_COUNTER11;
#endif
#ifdef __HAVE_COUNTER12
dev->types[12] = __HAVE_COUNTER12;
#endif
#ifdef __HAVE_COUNTER13
dev->types[13] = __HAVE_COUNTER13;
#endif
#ifdef __HAVE_COUNTER14
dev->types[14] = __HAVE_COUNTER14;
#endif
for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ ) for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
atomic_set( &dev->counts[i], 0 ); atomic_set( &dev->counts[i], 0 );
...@@ -510,7 +471,16 @@ static int DRM(probe)(struct pci_dev *pdev) ...@@ -510,7 +471,16 @@ static int DRM(probe)(struct pci_dev *pdev)
/* dev_priv_size can be changed by a driver in driver_register_fns */ /* dev_priv_size can be changed by a driver in driver_register_fns */
dev->dev_priv_size = sizeof(u32); dev->dev_priv_size = sizeof(u32);
/* the DRM has 6 basic counters - drivers add theirs in register_fns */
dev->counters = 6;
dev->types[0] = _DRM_STAT_LOCK;
dev->types[1] = _DRM_STAT_OPENS;
dev->types[2] = _DRM_STAT_CLOSES;
dev->types[3] = _DRM_STAT_IOCTLS;
dev->types[4] = _DRM_STAT_LOCKS;
dev->types[5] = _DRM_STAT_UNLOCKS;
DRM(init_fn_table)(dev); DRM(init_fn_table)(dev);
DRM(driver_register_fns)(dev); DRM(driver_register_fns)(dev);
......
...@@ -74,10 +74,4 @@ ...@@ -74,10 +74,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I810_RSTATUS)] = { i810_rstatus, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I810_FLIP)] = { i810_flip_bufs, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
#endif #endif
...@@ -1412,5 +1412,11 @@ void i810_driver_register_fns(drm_device_t *dev) ...@@ -1412,5 +1412,11 @@ void i810_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.release = i810_driver_release; dev->fn_tbl.release = i810_driver_release;
dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent; dev->fn_tbl.dma_quiescent = i810_driver_dma_quiescent;
dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers; dev->fn_tbl.reclaim_buffers = i810_reclaim_buffers;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -73,12 +73,6 @@ ...@@ -73,12 +73,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I830_GETPARAM)] = { i830_getparam, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I830_SETPARAM)] = { i830_setparam, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* Driver will work either way: IRQ's save cpu time when waiting for /* Driver will work either way: IRQ's save cpu time when waiting for
* the card, but are subject to subtle interactions between bios, * the card, but are subject to subtle interactions between bios,
* hardware and the driver. * hardware and the driver.
......
...@@ -1615,5 +1615,10 @@ void i830_driver_register_fns(drm_device_t *dev) ...@@ -1615,5 +1615,10 @@ void i830_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = i830_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i830_driver_irq_handler; dev->fn_tbl.irq_handler = i830_driver_irq_handler;
#endif #endif
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -45,12 +45,6 @@ ...@@ -45,12 +45,6 @@
[DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \ [DRM_IOCTL_NR(DRM_IOCTL_I915_INIT_HEAP)] = { i915_mem_init_heap, 1, 1 }, \
[DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 } [DRM_IOCTL_NR(DRM_IOCTL_I915_CMDBUFFER)] = { i915_cmdbuffer, 1, 0 }
#define __HAVE_COUNTERS 4
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#define __HAVE_COUNTER9 _DRM_STAT_DMA
/* We use our own dma mechanisms, not the drm template code. However, /* We use our own dma mechanisms, not the drm template code. However,
* the shared IRQ code is useful to us: * the shared IRQ code is useful to us:
*/ */
......
...@@ -746,4 +746,10 @@ void i915_driver_register_fns(drm_device_t *dev) ...@@ -746,4 +746,10 @@ void i915_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall; dev->fn_tbl.irq_postinstall = i915_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = i915_driver_irq_uninstall;
dev->fn_tbl.irq_handler = i915_driver_irq_handler; dev->fn_tbl.irq_handler = i915_driver_irq_handler;
dev->counters += 4;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
dev->types[9] = _DRM_STAT_DMA;
} }
...@@ -60,9 +60,4 @@ ...@@ -60,9 +60,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_MGA_BLIT)] = { mga_dma_blit, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_MGA_GETPARAM)]= { mga_getparam, 1, 0 },
#define __HAVE_COUNTERS 3
#define __HAVE_COUNTER6 _DRM_STAT_IRQ
#define __HAVE_COUNTER7 _DRM_STAT_PRIMARY
#define __HAVE_COUNTER8 _DRM_STAT_SECONDARY
#endif #endif
...@@ -819,4 +819,9 @@ void mga_driver_register_fns(drm_device_t *dev) ...@@ -819,4 +819,9 @@ void mga_driver_register_fns(drm_device_t *dev)
dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall; dev->fn_tbl.irq_postinstall = mga_driver_irq_postinstall;
dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall; dev->fn_tbl.irq_uninstall = mga_driver_irq_uninstall;
dev->fn_tbl.irq_handler = mga_driver_irq_handler; dev->fn_tbl.irq_handler = mga_driver_irq_handler;
dev->counters += 3;
dev->types[6] = _DRM_STAT_IRQ;
dev->types[7] = _DRM_STAT_PRIMARY;
dev->types[8] = _DRM_STAT_SECONDARY;
} }
...@@ -58,6 +58,4 @@ ...@@ -58,6 +58,4 @@
[DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \ [DRM_IOCTL_NR(DRM_IOCTL_SIS_AGP_FREE)] = { sis_ioctl_agp_free, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 } [DRM_IOCTL_NR(DRM_IOCTL_SIS_FB_INIT)] = { sis_fb_init, 1, 1 }
#define __HAVE_COUNTERS 5
#endif #endif
...@@ -428,11 +428,7 @@ static int mmc_blk_suspend(struct mmc_card *card, u32 state) ...@@ -428,11 +428,7 @@ static int mmc_blk_suspend(struct mmc_card *card, u32 state)
struct mmc_blk_data *md = mmc_get_drvdata(card); struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) { if (md) {
unsigned long flags; mmc_queue_suspend(&md->queue);
spin_lock_irqsave(&md->lock, flags);
blk_stop_queue(md->queue.queue);
spin_unlock_irqrestore(&md->lock, flags);
} }
return 0; return 0;
} }
...@@ -442,12 +438,8 @@ static int mmc_blk_resume(struct mmc_card *card) ...@@ -442,12 +438,8 @@ static int mmc_blk_resume(struct mmc_card *card)
struct mmc_blk_data *md = mmc_get_drvdata(card); struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) { if (md) {
unsigned long flags;
mmc_blk_set_blksize(md, card); mmc_blk_set_blksize(md, card);
spin_lock_irqsave(&md->lock, flags); mmc_queue_resume(&md->queue);
blk_start_queue(md->queue.queue);
spin_unlock_irqrestore(&md->lock, flags);
} }
return 0; return 0;
} }
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include "mmc_queue.h" #include "mmc_queue.h"
#define MMC_QUEUE_EXIT (1 << 0)
#define MMC_QUEUE_SUSPENDED (1 << 1)
/* /*
* Prepare a MMC request. Essentially, this means passing the * Prepare a MMC request. Essentially, this means passing the
* preparation off to the media driver. The media driver will * preparation off to the media driver. The media driver will
...@@ -66,14 +69,9 @@ static int mmc_queue_thread(void *d) ...@@ -66,14 +69,9 @@ static int mmc_queue_thread(void *d)
daemonize("mmcqd"); daemonize("mmcqd");
spin_lock_irq(&current->sighand->siglock);
sigfillset(&current->blocked);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
mq->thread = current;
complete(&mq->thread_complete); complete(&mq->thread_complete);
down(&mq->thread_sem);
add_wait_queue(&mq->thread_wq, &wait); add_wait_queue(&mq->thread_wq, &wait);
do { do {
struct request *req = NULL; struct request *req = NULL;
...@@ -85,9 +83,11 @@ static int mmc_queue_thread(void *d) ...@@ -85,9 +83,11 @@ static int mmc_queue_thread(void *d)
spin_unlock(q->queue_lock); spin_unlock(q->queue_lock);
if (!req) { if (!req) {
if (!mq->thread) if (mq->flags & MMC_QUEUE_EXIT)
break; break;
up(&mq->thread_sem);
schedule(); schedule();
down(&mq->thread_sem);
continue; continue;
} }
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
...@@ -95,6 +95,7 @@ static int mmc_queue_thread(void *d) ...@@ -95,6 +95,7 @@ static int mmc_queue_thread(void *d)
mq->issue_fn(mq, req); mq->issue_fn(mq, req);
} while (1); } while (1);
remove_wait_queue(&mq->thread_wq, &wait); remove_wait_queue(&mq->thread_wq, &wait);
up(&mq->thread_sem);
complete_and_exit(&mq->thread_complete, 0); complete_and_exit(&mq->thread_complete, 0);
return 0; return 0;
...@@ -148,6 +149,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock ...@@ -148,6 +149,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
init_completion(&mq->thread_complete); init_completion(&mq->thread_complete);
init_waitqueue_head(&mq->thread_wq); init_waitqueue_head(&mq->thread_wq);
init_MUTEX(&mq->thread_sem);
ret = kernel_thread(mmc_queue_thread, mq, CLONE_KERNEL); ret = kernel_thread(mmc_queue_thread, mq, CLONE_KERNEL);
if (ret < 0) { if (ret < 0) {
...@@ -160,17 +162,61 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock ...@@ -160,17 +162,61 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
return ret; return ret;
} }
EXPORT_SYMBOL(mmc_init_queue); EXPORT_SYMBOL(mmc_init_queue);
void mmc_cleanup_queue(struct mmc_queue *mq) void mmc_cleanup_queue(struct mmc_queue *mq)
{ {
mq->thread = NULL; mq->flags |= MMC_QUEUE_EXIT;
wake_up(&mq->thread_wq); wake_up(&mq->thread_wq);
wait_for_completion(&mq->thread_complete); wait_for_completion(&mq->thread_complete);
blk_cleanup_queue(mq->queue); blk_cleanup_queue(mq->queue);
mq->card = NULL; mq->card = NULL;
} }
EXPORT_SYMBOL(mmc_cleanup_queue); EXPORT_SYMBOL(mmc_cleanup_queue);
/**
* mmc_queue_suspend - suspend a MMC request queue
* @mq: MMC queue to suspend
*
* Stop the block request queue, and wait for our thread to
* complete any outstanding requests. This ensures that we
* won't suspend while a request is being processed.
*/
void mmc_queue_suspend(struct mmc_queue *mq)
{
request_queue_t *q = mq->queue;
unsigned long flags;
if (!(mq->flags & MMC_QUEUE_SUSPENDED)) {
mq->flags |= MMC_QUEUE_SUSPENDED;
spin_lock_irqsave(q->queue_lock, flags);
blk_stop_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
down(&mq->thread_sem);
}
}
EXPORT_SYMBOL(mmc_queue_suspend);
/**
* mmc_queue_resume - resume a previously suspended MMC request queue
* @mq: MMC queue to resume
*/
void mmc_queue_resume(struct mmc_queue *mq)
{
request_queue_t *q = mq->queue;
unsigned long flags;
if (mq->flags & MMC_QUEUE_SUSPENDED) {
mq->flags &= ~MMC_QUEUE_SUSPENDED;
up(&mq->thread_sem);
spin_lock_irqsave(q->queue_lock, flags);
blk_start_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
}
}
EXPORT_SYMBOL(mmc_queue_resume);
...@@ -8,7 +8,8 @@ struct mmc_queue { ...@@ -8,7 +8,8 @@ struct mmc_queue {
struct mmc_card *card; struct mmc_card *card;
struct completion thread_complete; struct completion thread_complete;
wait_queue_head_t thread_wq; wait_queue_head_t thread_wq;
struct task_struct *thread; struct semaphore thread_sem;
unsigned int flags;
struct request *req; struct request *req;
int (*prep_fn)(struct mmc_queue *, struct request *); int (*prep_fn)(struct mmc_queue *, struct request *);
int (*issue_fn)(struct mmc_queue *, struct request *); int (*issue_fn)(struct mmc_queue *, struct request *);
...@@ -25,5 +26,7 @@ struct mmc_io_request { ...@@ -25,5 +26,7 @@ struct mmc_io_request {
extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *); extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
extern void mmc_cleanup_queue(struct mmc_queue *); extern void mmc_cleanup_queue(struct mmc_queue *);
extern void mmc_queue_suspend(struct mmc_queue *);
extern void mmc_queue_resume(struct mmc_queue *);
#endif #endif
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/arch/mmc.h>
#include "pxamci.h" #include "pxamci.h"
#ifdef CONFIG_MMC_DEBUG #ifdef CONFIG_MMC_DEBUG
...@@ -52,6 +54,7 @@ struct pxamci_host { ...@@ -52,6 +54,7 @@ struct pxamci_host {
unsigned int cmdat; unsigned int cmdat;
unsigned int imask; unsigned int imask;
unsigned int power_mode; unsigned int power_mode;
struct pxamci_platform_data *pdata;
struct mmc_request *mrq; struct mmc_request *mrq;
struct mmc_command *cmd; struct mmc_command *cmd;
...@@ -384,9 +387,8 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -384,9 +387,8 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (host->power_mode != ios->power_mode) { if (host->power_mode != ios->power_mode) {
host->power_mode = ios->power_mode; host->power_mode = ios->power_mode;
/* if (host->pdata && host->pdata->setpower)
* power control? none on the lubbock. host->pdata->setpower(mmc->dev, ios->vdd);
*/
if (ios->power_mode == MMC_POWER_ON) if (ios->power_mode == MMC_POWER_ON)
host->cmdat |= CMDAT_INIT; host->cmdat |= CMDAT_INIT;
...@@ -407,6 +409,12 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs) ...@@ -407,6 +409,12 @@ static void pxamci_dma_irq(int dma, void *devid, struct pt_regs *regs)
DCSR(dma) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR; DCSR(dma) = DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
} }
static irqreturn_t pxamci_detect_irq(int irq, void *devid, struct pt_regs *regs)
{
mmc_detect_change(devid);
return IRQ_HANDLED;
}
static int pxamci_probe(struct device *dev) static int pxamci_probe(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
...@@ -433,11 +441,14 @@ static int pxamci_probe(struct device *dev) ...@@ -433,11 +441,14 @@ static int pxamci_probe(struct device *dev)
mmc->ops = &pxamci_ops; mmc->ops = &pxamci_ops;
mmc->f_min = 312500; mmc->f_min = 312500;
mmc->f_max = 20000000; mmc->f_max = 20000000;
mmc->ocr_avail = MMC_VDD_32_33;
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->mmc = mmc; host->mmc = mmc;
host->dma = -1; host->dma = -1;
host->pdata = pdev->dev.platform_data;
mmc->ocr_avail = host->pdata ?
host->pdata->ocr_mask :
MMC_VDD_32_33|MMC_VDD_33_34;
host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); host->sg_cpu = dma_alloc_coherent(dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
if (!host->sg_cpu) { if (!host->sg_cpu) {
...@@ -464,6 +475,7 @@ static int pxamci_probe(struct device *dev) ...@@ -464,6 +475,7 @@ static int pxamci_probe(struct device *dev)
pxamci_stop_clock(host); pxamci_stop_clock(host);
writel(0, host->base + MMC_SPI); writel(0, host->base + MMC_SPI);
writel(64, host->base + MMC_RESTO); writel(64, host->base + MMC_RESTO);
writel(host->imask, host->base + MMC_I_MASK);
pxa_gpio_mode(GPIO6_MMCCLK_MD); pxa_gpio_mode(GPIO6_MMCCLK_MD);
pxa_gpio_mode(GPIO8_MMCCS0_MD); pxa_gpio_mode(GPIO8_MMCCS0_MD);
...@@ -481,6 +493,9 @@ static int pxamci_probe(struct device *dev) ...@@ -481,6 +493,9 @@ static int pxamci_probe(struct device *dev)
dev_set_drvdata(dev, mmc); dev_set_drvdata(dev, mmc);
if (host->pdata && host->pdata->init)
host->pdata->init(dev, pxamci_detect_irq, mmc);
mmc_add_host(mmc); mmc_add_host(mmc);
return 0; return 0;
...@@ -509,6 +524,9 @@ static int pxamci_remove(struct device *dev) ...@@ -509,6 +524,9 @@ static int pxamci_remove(struct device *dev)
if (mmc) { if (mmc) {
struct pxamci_host *host = mmc_priv(mmc); struct pxamci_host *host = mmc_priv(mmc);
if (host->pdata && host->pdata->exit)
host->pdata->exit(dev, mmc);
mmc_remove_host(mmc); mmc_remove_host(mmc);
pxamci_stop_clock(host); pxamci_stop_clock(host);
...@@ -516,6 +534,8 @@ static int pxamci_remove(struct device *dev) ...@@ -516,6 +534,8 @@ static int pxamci_remove(struct device *dev)
END_CMD_RES|PRG_DONE|DATA_TRAN_DONE, END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
host->base + MMC_I_MASK); host->base + MMC_I_MASK);
pxa_set_cken(CKEN12_MMC, 0);
free_irq(host->irq, host); free_irq(host->irq, host);
pxa_free_dma(host->dma); pxa_free_dma(host->dma);
iounmap(host->base); iounmap(host->base);
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <net/sock.h> #include <net/sock.h>
#include <net/checksum.h> #include <net/checksum.h>
#include <linux/if_ether.h> /* For the statistics structure. */ #include <linux/if_ether.h> /* For the statistics structure. */
...@@ -183,6 +184,17 @@ static struct net_device_stats *get_stats(struct net_device *dev) ...@@ -183,6 +184,17 @@ static struct net_device_stats *get_stats(struct net_device *dev)
return stats; return stats;
} }
u32 loopback_get_link(struct net_device *dev)
{
return 1;
}
static struct ethtool_ops loopback_ethtool_ops = {
.get_link = loopback_get_link,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
};
struct net_device loopback_dev = { struct net_device loopback_dev = {
.name = "lo", .name = "lo",
.mtu = (16 * 1024) + 20 + 20 + 12, .mtu = (16 * 1024) + 20 + 20 + 12,
...@@ -199,6 +211,7 @@ struct net_device loopback_dev = { ...@@ -199,6 +211,7 @@ struct net_device loopback_dev = {
.features = NETIF_F_SG|NETIF_F_FRAGLIST .features = NETIF_F_SG|NETIF_F_FRAGLIST
|NETIF_F_NO_CSUM|NETIF_F_HIGHDMA |NETIF_F_NO_CSUM|NETIF_F_HIGHDMA
|NETIF_F_LLTX, |NETIF_F_LLTX,
.ethtool_ops = &loopback_ethtool_ops,
}; };
/* Setup and register the of the LOOPBACK device. */ /* Setup and register the of the LOOPBACK device. */
......
...@@ -40,9 +40,7 @@ config TULIP ...@@ -40,9 +40,7 @@ config TULIP
(smc9332dst), you can also try the driver for "Generic DECchip" (smc9332dst), you can also try the driver for "Generic DECchip"
cards, above. However, most people with a network card of this type cards, above. However, most people with a network card of this type
will say Y here.) Do read the Ethernet-HOWTO, available from will say Y here.) Do read the Ethernet-HOWTO, available from
<http://www.tldp.org/docs.html#howto>. More specific <http://www.tldp.org/docs.html#howto>.
information is contained in
<file:Documentation/networking/tulip.txt>.
To compile this driver as a module, choose M here and read To compile this driver as a module, choose M here and read
<file:Documentation/networking/net-modules.txt>. The module will <file:Documentation/networking/net-modules.txt>. The module will
......
...@@ -126,26 +126,28 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, ...@@ -126,26 +126,28 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset,
i = 0; i = 0;
read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock);
list_for_each(tmp, &GlobalTreeConnectionList) { list_for_each(tmp, &GlobalTreeConnectionList) {
__u32 dev_type;
i++; i++;
tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList);
dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
length = length =
sprintf(buf, sprintf(buf,
"\n%d) %s Uses: %d Type: %s Characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d", "\n%d) %s Uses: %d Type: %s Characteristics: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d",
i, tcon->treeName, i, tcon->treeName,
atomic_read(&tcon->useCount), atomic_read(&tcon->useCount),
tcon->nativeFileSystem, tcon->nativeFileSystem,
tcon->fsDevInfo.DeviceCharacteristics, le32_to_cpu(tcon->fsDevInfo.DeviceCharacteristics),
tcon->fsAttrInfo.Attributes, le32_to_cpu(tcon->fsAttrInfo.Attributes),
tcon->fsAttrInfo.MaxPathNameComponentLength,tcon->tidStatus); le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength),
tcon->tidStatus);
buf += length; buf += length;
if (tcon->fsDevInfo.DeviceType == FILE_DEVICE_DISK) if (dev_type == FILE_DEVICE_DISK)
length = sprintf(buf, " type: DISK "); length = sprintf(buf, " type: DISK ");
else if (tcon->fsDevInfo.DeviceType == FILE_DEVICE_CD_ROM) else if (dev_type == FILE_DEVICE_CD_ROM)
length = sprintf(buf, " type: CDROM "); length = sprintf(buf, " type: CDROM ");
else else
length = length =
sprintf(buf, " type: %d ", sprintf(buf, " type: %d ", dev_type);
tcon->fsDevInfo.DeviceType);
buf += length; buf += length;
if(tcon->tidStatus == CifsNeedReconnect) { if(tcon->tidStatus == CifsNeedReconnect) {
buf += sprintf(buf, "\tDISCONNECTED "); buf += sprintf(buf, "\tDISCONNECTED ");
......
...@@ -61,7 +61,7 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct cifsSesInfo * ses, ...@@ -61,7 +61,7 @@ int cifs_sign_smb(struct smb_hdr * cifs_pdu, struct cifsSesInfo * ses,
if((cifs_pdu == NULL) || (ses == NULL)) if((cifs_pdu == NULL) || (ses == NULL))
return -EINVAL; return -EINVAL;
if((le32_to_cpu(cifs_pdu->Flags2) & SMBFLG2_SECURITY_SIGNATURE) == 0) if((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0)
return rc; return rc;
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
...@@ -107,13 +107,11 @@ int cifs_verify_signature(struct smb_hdr * cifs_pdu, const char * mac_key, ...@@ -107,13 +107,11 @@ int cifs_verify_signature(struct smb_hdr * cifs_pdu, const char * mac_key,
if(memcmp(cifs_pdu->Signature.SecuritySignature,"BSRSPYL ",8)==0) if(memcmp(cifs_pdu->Signature.SecuritySignature,"BSRSPYL ",8)==0)
cFYI(1,("dummy signature received for smb command 0x%x",cifs_pdu->Command)); cFYI(1,("dummy signature received for smb command 0x%x",cifs_pdu->Command));
expected_sequence_number = cpu_to_le32(expected_sequence_number);
/* save off the origiginal signature so we can modify the smb and check /* save off the origiginal signature so we can modify the smb and check
its signature against what the server sent */ its signature against what the server sent */
memcpy(server_response_sig,cifs_pdu->Signature.SecuritySignature,8); memcpy(server_response_sig,cifs_pdu->Signature.SecuritySignature,8);
cifs_pdu->Signature.Sequence.SequenceNumber = expected_sequence_number; cifs_pdu->Signature.Sequence.SequenceNumber = cpu_to_le32(expected_sequence_number);
cifs_pdu->Signature.Sequence.Reserved = 0; cifs_pdu->Signature.Sequence.Reserved = 0;
rc = cifs_calculate_signature(cifs_pdu, mac_key, rc = cifs_calculate_signature(cifs_pdu, mac_key,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -189,7 +189,6 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , ...@@ -189,7 +189,6 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
) )
{ {
int i; int i;
__u32 tmp;
struct list_head* temp_item; struct list_head* temp_item;
struct cifsSesInfo * ses; struct cifsSesInfo * ses;
char *temp = (char *) buffer; char *temp = (char *) buffer;
...@@ -211,10 +210,8 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , ...@@ -211,10 +210,8 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ ,
buffer->Command = smb_command; buffer->Command = smb_command;
buffer->Flags = 0x00; /* case sensitive */ buffer->Flags = 0x00; /* case sensitive */
buffer->Flags2 = SMBFLG2_KNOWS_LONG_NAMES; buffer->Flags2 = SMBFLG2_KNOWS_LONG_NAMES;
tmp = cpu_to_le32(current->tgid); buffer->Pid = cpu_to_le16((__u16)current->tgid);
buffer->Pid = tmp & 0xFFFF; buffer->PidHigh = cpu_to_le16((__u16)(current->tgid >> 16));
tmp >>= 16;
buffer->PidHigh = tmp & 0xFFFF;
spin_lock(&GlobalMid_Lock); spin_lock(&GlobalMid_Lock);
GlobalMid++; GlobalMid++;
buffer->Mid = GlobalMid; buffer->Mid = GlobalMid;
...@@ -292,7 +289,7 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid) ...@@ -292,7 +289,7 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
{ {
/* Make sure that this really is an SMB, that it is a response, /* Make sure that this really is an SMB, that it is a response,
and that the message ids match */ and that the message ids match */
if ((*(unsigned int *) smb->Protocol == cpu_to_le32(0x424d53ff)) && if ((*(__le32 *) smb->Protocol == cpu_to_le32(0x424d53ff)) &&
(mid == smb->Mid)) { (mid == smb->Mid)) {
if(smb->Flags & SMBFLG_RESPONSE) if(smb->Flags & SMBFLG_RESPONSE)
return 0; return 0;
...@@ -304,7 +301,7 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid) ...@@ -304,7 +301,7 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
cERROR(1, ("Rcvd Request not response ")); cERROR(1, ("Rcvd Request not response "));
} }
} else { /* bad signature or mid */ } else { /* bad signature or mid */
if (*(unsigned int *) smb->Protocol != cpu_to_le32(0x424d53ff)) if (*(__le32 *) smb->Protocol != cpu_to_le32(0x424d53ff))
cERROR(1, cERROR(1,
("Bad protocol string signature header %x ", ("Bad protocol string signature header %x ",
*(unsigned int *) smb->Protocol)); *(unsigned int *) smb->Protocol));
...@@ -318,12 +315,12 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid) ...@@ -318,12 +315,12 @@ checkSMBhdr(struct smb_hdr *smb, __u16 mid)
int int
checkSMB(struct smb_hdr *smb, __u16 mid, int length) checkSMB(struct smb_hdr *smb, __u16 mid, int length)
{ {
__u32 len = be32_to_cpu(smb->smb_buf_length);
cFYI(0, cFYI(0,
("Entering checkSMB with Length: %x, smb_buf_length: %x ", ("Entering checkSMB with Length: %x, smb_buf_length: %x ",
length, ntohl(smb->smb_buf_length))); length, len));
if (((unsigned int)length < 2 + sizeof (struct smb_hdr)) if (((unsigned int)length < 2 + sizeof (struct smb_hdr)) ||
|| (ntohl(smb->smb_buf_length) > (len > CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE - 4)) {
CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE - 4)) {
if ((unsigned int)length < 2 + sizeof (struct smb_hdr)) { if ((unsigned int)length < 2 + sizeof (struct smb_hdr)) {
cERROR(1, ("Length less than 2 + sizeof smb_hdr ")); cERROR(1, ("Length less than 2 + sizeof smb_hdr "));
if (((unsigned int)length >= sizeof (struct smb_hdr) - 1) if (((unsigned int)length >= sizeof (struct smb_hdr) - 1)
...@@ -331,8 +328,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length) ...@@ -331,8 +328,7 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
return 0; /* some error cases do not return wct and bcc */ return 0; /* some error cases do not return wct and bcc */
} }
if (ntohl(smb->smb_buf_length) > if (len > CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE - 4)
CIFS_MAX_MSGSIZE + MAX_CIFS_HDR_SIZE - 4)
cERROR(1, cERROR(1,
("smb_buf_length greater than CIFS_MAX_MSGSIZE ... ")); ("smb_buf_length greater than CIFS_MAX_MSGSIZE ... "));
cERROR(1, cERROR(1,
...@@ -344,8 +340,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length) ...@@ -344,8 +340,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, int length)
if (checkSMBhdr(smb, mid)) if (checkSMBhdr(smb, mid))
return 1; return 1;
if ((4 + ntohl(smb->smb_buf_length) != smbCalcSize(smb)) if ((4 + len != smbCalcSize(smb))
|| (4 + ntohl(smb->smb_buf_length) != (unsigned int)length)) { || (4 + len != (unsigned int)length)) {
return 0; return 0;
} else { } else {
cERROR(1, ("smbCalcSize %x ", smbCalcSize(smb))); cERROR(1, ("smbCalcSize %x ", smbCalcSize(smb)));
......
...@@ -187,8 +187,8 @@ cifs_inet_pton(int address_family, char *cp,void *dst) ...@@ -187,8 +187,8 @@ cifs_inet_pton(int address_family, char *cp,void *dst)
if (value > addr_class_max[end - bytes]) if (value > addr_class_max[end - bytes])
return 0; return 0;
address.s_addr = *((int *) bytes) | htonl(value); address.s_addr = *((__be32 *) bytes) | htonl(value);
*((int *)dst) = address.s_addr; *((__be32 *)dst) = address.s_addr;
return 1; /* success */ return 1; /* success */
} }
...@@ -810,16 +810,13 @@ map_smb_to_linux_error(struct smb_hdr *smb) ...@@ -810,16 +810,13 @@ map_smb_to_linux_error(struct smb_hdr *smb)
if (smb->Flags2 & SMBFLG2_ERR_STATUS) { if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
/* translate the newer STATUS codes to old style errors and then to POSIX errors */ /* translate the newer STATUS codes to old style errors and then to POSIX errors */
smb->Status.CifsError = le32_to_cpu(smb->Status.CifsError); __u32 err = le32_to_cpu(smb->Status.CifsError);
if(cifsFYI) if(cifsFYI)
cifs_print_status(smb->Status.CifsError); cifs_print_status(err);
ntstatus_to_dos(smb->Status.CifsError, &smberrclass, ntstatus_to_dos(err, &smberrclass, &smberrcode);
&smberrcode);
} else { } else {
smberrclass = smb->Status.DosError.ErrorClass; smberrclass = smb->Status.DosError.ErrorClass;
smb->Status.DosError.Error = smberrcode = le16_to_cpu(smb->Status.DosError.Error);
le16_to_cpu(smb->Status.DosError.Error);
smberrcode = smb->Status.DosError.Error;
} }
/* old style errors */ /* old style errors */
......
This diff is collapsed.
This diff is collapsed.
...@@ -86,7 +86,7 @@ flush_tlb(void) ...@@ -86,7 +86,7 @@ flush_tlb(void)
static inline void static inline void
flush_tlb_other(struct mm_struct *mm) flush_tlb_other(struct mm_struct *mm)
{ {
long *mmc = &mm->context[smp_processor_id()]; unsigned long *mmc = &mm->context[smp_processor_id()];
/* Check it's not zero first to avoid cacheline ping pong /* Check it's not zero first to avoid cacheline ping pong
when possible. */ when possible. */
if (*mmc) *mmc = 0; if (*mmc) *mmc = 0;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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