summaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/config.in2
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/ia32/ia32_signal.c22
-rw-r--r--arch/ia64/ia32/sys_ia32.c57
-rw-r--r--arch/ia64/kernel/efi.c3
-rw-r--r--arch/ia64/kernel/entry.S33
-rw-r--r--arch/ia64/kernel/gate.S1
-rw-r--r--arch/ia64/kernel/head.S5
-rw-r--r--arch/ia64/kernel/irq.c18
-rw-r--r--arch/ia64/kernel/irq_lock.c2
-rw-r--r--arch/ia64/kernel/pci-dma.c15
-rw-r--r--arch/ia64/kernel/pci.c11
-rw-r--r--arch/ia64/kernel/smp.c8
-rw-r--r--arch/ia64/kernel/sys_ia64.c4
-rw-r--r--arch/ia64/lib/Makefile2
-rw-r--r--arch/ia64/tools/print_offsets.c1
16 files changed, 118 insertions, 68 deletions
diff --git a/arch/ia64/config.in b/arch/ia64/config.in
index d006c1d05..2d2388590 100644
--- a/arch/ia64/config.in
+++ b/arch/ia64/config.in
@@ -3,6 +3,8 @@ mainmenu_name "Kernel configuration of Linux for IA-64 machines"
mainmenu_option next_comment
comment 'General setup'
+define_bool CONFIG_IA64 y
+
choice 'IA-64 system type' \
"Generic CONFIG_IA64_GENERIC \
HP-simulator CONFIG_IA64_HP_SIM \
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 1342e64f0..82ba58129 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -144,7 +144,7 @@ ia32_syscall_table:
data8 sys32_settimeofday
data8 sys_getgroups /* 80 */
data8 sys_setgroups
- data8 sys_ni_syscall
+ data8 old_select
data8 sys_symlink
data8 sys_ni_syscall
data8 sys_readlink /* 85 */
diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index ed443ee66..2c2c53741 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -342,7 +342,16 @@ ia32_setup_frame1 (int sig, struct k_sigaction *ka, siginfo_t *info,
}
asmlinkage int
-sys32_sigreturn(int arg1, int arg2, int arg3, int arg4, int arg5, unsigned long stack)
+sys32_sigreturn(
+int arg0,
+int arg1,
+int arg2,
+int arg3,
+int arg4,
+int arg5,
+int arg6,
+int arg7,
+unsigned long stack)
{
struct pt_regs *regs = (struct pt_regs *) &stack;
struct sigframe_ia32 *frame = (struct sigframe_ia32 *)(regs->r12- 8);
@@ -375,7 +384,16 @@ badframe:
}
asmlinkage int
-sys32_rt_sigreturn(int arg1, int arg2, int arg3, int arg4, int arg5, unsigned long stack)
+sys32_rt_sigreturn(
+int arg0,
+int arg1,
+int arg2,
+int arg3,
+int arg4,
+int arg5,
+int arg6,
+int arg7,
+unsigned long stack)
{
struct pt_regs *regs = (struct pt_regs *) &stack;
struct rt_sigframe_ia32 *frame = (struct rt_sigframe_ia32 *)(regs->r12 - 4);
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 7b4c4995e..d61f1cfe5 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -240,18 +240,29 @@ do_mmap_fake(struct file *file, unsigned long addr, unsigned long len,
return -EINVAL;
if (prot & PROT_WRITE)
prot |= PROT_EXEC;
+#ifdef DDD
+#else // DDD
+ prot |= PROT_WRITE;
+#endif // DDD
front = NULL;
back = NULL;
if ((baddr = (addr & PAGE_MASK)) != addr && get_user(c, (char *)baddr) == 0) {
front = kmalloc(addr - baddr, GFP_KERNEL);
memcpy(front, (void *)baddr, addr - baddr);
}
- if ((addr + len) & ~PAGE_MASK && get_user(c, (char *)(addr + len)) == 0) {
+#ifndef DDD
+ if (addr)
+#endif
+ if (((addr + len) & ~PAGE_MASK) && get_user(c, (char *)(addr + len)) == 0) {
back = kmalloc(PAGE_SIZE - ((addr + len) & ~PAGE_MASK), GFP_KERNEL);
memcpy(back, addr + len, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
}
if ((r = do_mmap(0, baddr, len + (addr - baddr), prot, flags | MAP_ANONYMOUS, 0)) < 0)
return(r);
+#ifndef DDD
+ if (addr == 0)
+ addr = r;
+#endif // DDD
if (back) {
memcpy(addr + len, back, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
kfree(back);
@@ -315,7 +326,11 @@ sys32_mmap(struct mmap_arg_struct *arg)
}
a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+#ifdef DDD
if ((a.flags & MAP_FIXED) && ((a.addr & ~PAGE_MASK) || (a.offset & ~PAGE_MASK))) {
+#else // DDD
+ if (1) {
+#endif // DDD
unlock_kernel();
up(&current->mm->mmap_sem);
error = do_mmap_fake(file, a.addr, a.len, a.prot, a.flags, a.offset);
@@ -665,7 +680,7 @@ struct dirent32 {
};
static void
-xlate_dirent(void *dirent, long n)
+xlate_dirent(void *dirent64, void *dirent32, long n)
{
long off;
struct dirent *dirp;
@@ -673,9 +688,9 @@ xlate_dirent(void *dirent, long n)
off = 0;
while (off < n) {
- dirp = (struct dirent *)(dirent + off);
+ dirp = (struct dirent *)(dirent64 + off);
+ dirp32 = (struct dirent32 *)(dirent32 + off);
off += dirp->d_reclen;
- dirp32 = (struct dirent32 *)dirp;
dirp32->d_ino = dirp->d_ino;
dirp32->d_off = (unsigned int)dirp->d_off;
dirp32->d_reclen = dirp->d_reclen;
@@ -685,26 +700,27 @@ xlate_dirent(void *dirent, long n)
}
asmlinkage long
-sys32_getdents(unsigned int fd, void * dirent, unsigned int count)
+sys32_getdents(unsigned int fd, void * dirent32, unsigned int count)
{
long n;
+ void *dirent64;
- if ((n = sys_getdents(fd, dirent, count)) < 0)
+ dirent64 = (unsigned long)(dirent32 + (sizeof(long) - 1)) & ~(sizeof(long) - 1);
+ if ((n = sys_getdents(fd, dirent64, count - (dirent64 - dirent32))) < 0)
return(n);
- xlate_dirent(dirent, n);
+ xlate_dirent(dirent64, dirent32, n);
return(n);
}
asmlinkage int
-sys32_readdir(unsigned int fd, void * dirent, unsigned int count)
+sys32_readdir(unsigned int fd, void * dirent32, unsigned int count)
{
int n;
- struct dirent *dirp;
+ struct dirent dirent64;
- if ((n = old_readdir(fd, dirent, count)) < 0)
+ if ((n = old_readdir(fd, &dirent64, count)) < 0)
return(n);
- dirp = (struct dirent *)dirent;
- xlate_dirent(dirent, dirp->d_reclen);
+ xlate_dirent(&dirent64, dirent32, dirent64.d_reclen);
return(n);
}
@@ -809,6 +825,23 @@ out_nofds:
return ret;
}
+struct sel_arg_struct {
+ unsigned int n;
+ unsigned int inp;
+ unsigned int outp;
+ unsigned int exp;
+ unsigned int tvp;
+};
+
+asmlinkage int old_select(struct sel_arg_struct *arg)
+{
+ struct sel_arg_struct a;
+
+ if (copy_from_user(&a, arg, sizeof(a)))
+ return -EFAULT;
+ return sys32_select(a.n, a.inp, a.outp, a.exp, a.tvp);
+}
+
struct rusage32 {
struct timeval32 ru_utime;
struct timeval32 ru_stime;
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index dd7de2ab0..6e0d09ea7 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -15,7 +15,6 @@
*
* Implemented EFI runtime services and virtual mode calls. --davidm
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
@@ -166,14 +165,12 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
case EFI_BOOT_SERVICES_CODE:
case EFI_BOOT_SERVICES_DATA:
case EFI_CONVENTIONAL_MEMORY:
-#ifndef CONFIG_IA64_VIRTUAL_MEM_MAP
if (md->phys_addr > 1024*1024*1024UL) {
printk("Warning: ignoring %luMB of memory above 1GB!\n",
md->num_pages >> 8);
md->type = EFI_UNUSABLE_MEMORY;
continue;
}
-#endif
curr.start = PAGE_OFFSET + md->phys_addr;
curr.end = curr.start + (md->num_pages << 12);
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 87e77c677..47b972cb4 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -496,18 +496,27 @@ ia64_ret_from_syscall:
(p7) br.cond.spnt.few handle_syscall_error // handle potential syscall failure
ia64_leave_kernel:
- // check & deliver software interrupts (bottom half handlers):
+ // check & deliver software interrupts:
- movl r2=bh_active // sheesh, why aren't these two in
- movl r3=bh_mask // a struct??
+#ifdef CONFIG_SMP
+ adds r2=IA64_TASK_PROCESSOR_OFFSET,r13
+ movl r3=softirq_state
;;
- ld8 r2=[r2]
- ld8 r3=[r3]
+ ld4 r2=[r2]
+ ;;
+ shladd r3=r2,3,r3
+#else
+ movl r3=softirq_state
+#endif
+ ;;
+ ld8 r2=[r3] // r3 is guaranteed to be 8-byte aligned!
+ ;;
+ shr r3=r2,32
;;
and r2=r2,r3
;;
- cmp.ne p6,p7=r2,r0 // any soft interrupts ready for delivery?
-(p6) br.call.dpnt.few rp=invoke_do_bottom_half
+ cmp4.ne p6,p7=r2,r0
+(p6) br.call.spnt.many rp=invoke_do_softirq
1:
(pKern) br.cond.dpnt.many restore_all // yup -> skip check for rescheduling & signal delivery
@@ -751,20 +760,20 @@ invoke_schedule_tail:
#endif /* CONFIG_SMP */
/*
- * Invoke do_bottom_half() while preserving in0-in7, which may be needed
+ * Invoke do_softirq() while preserving in0-in7, which may be needed
* in case a system call gets restarted.
*/
- .proc invoke_do_bottom_half
-invoke_do_bottom_half:
+ .proc invoke_do_softirq
+invoke_do_softirq:
alloc loc0=ar.pfs,8,2,0,0
mov loc1=rp
;;
- br.call.sptk.few rp=do_bottom_half
+ br.call.sptk.few rp=do_softirq
.ret9:
mov ar.pfs=loc0
mov rp=loc1
br.ret.sptk.many rp
- .endp invoke_do_bottom_half
+ .endp invoke_do_softirq
/*
* Invoke schedule() while preserving in0-in7, which may be needed
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index 24dc10ee4..65de8e589 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -132,6 +132,7 @@ back_from_setup_rbs:
ld8 r8=[base0] // restore (perhaps modified) CFM0, EC0, and CPL0
cmp.ne p8,p0=r14,r15 // do we need to restore the rbs?
(p8) br.cond.spnt.few restore_rbs // yup -> (clobbers r14 and r16)
+ ;;
back_from_restore_rbs:
{
and r9=0x7f,r8 // r9 <- CFM0.sof
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S
index 50d965e02..35a52628a 100644
--- a/arch/ia64/kernel/head.S
+++ b/arch/ia64/kernel/head.S
@@ -133,6 +133,7 @@ alive_msg:
#endif /* CONFIG_IA64_EARLY_PRINTK */
alloc r2=ar.pfs,8,0,2,0
+ ;;
#ifdef CONFIG_SMP
(isAP) br.call.sptk.few rp=smp_callin
.ret1:
@@ -174,7 +175,7 @@ ia64_save_debug_regs:
st8.nta [in0]=r16,8
st8.nta [r19]=r17,8
br.cloop.sptk.few 1b
-
+ ;;
mov ar.lc=r20 // restore ar.lc
br.ret.sptk.few b0
.endp ia64_save_debug_regs
@@ -197,7 +198,7 @@ ia64_load_debug_regs:
mov dbr[r18]=r16
mov ibr[r18]=r17
br.cloop.sptk.few 1b
-
+ ;;
mov ar.lc=r20 // restore ar.lc
br.ret.sptk.few b0
.endp ia64_load_debug_regs
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 01c201137..5efe50164 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -128,6 +128,18 @@ get_irq_list (char *buf)
return p - buf;
}
+int usbfix;
+
+static int __init
+usbfix_option (char *str)
+{
+ printk("irq: enabling USB workaround\n");
+ usbfix = 1;
+ return 1;
+}
+
+__setup("usbfix", usbfix_option);
+
/*
* That's where the IVT branches when we get an external
* interrupt. This branches to the correct hardware IRQ handler via
@@ -146,7 +158,8 @@ ia64_handle_irq (unsigned long irq, struct pt_regs *regs)
unsigned long eoi_ptr;
# ifdef CONFIG_USB
- disable_usb();
+ if (usbfix)
+ disable_usb();
# endif
/*
* Stop IPIs by getting the ivr_read_lock
@@ -170,7 +183,8 @@ ia64_handle_irq (unsigned long irq, struct pt_regs *regs)
spin_unlock(&ivr_read_lock);
# ifdef CONFIG_USB
- reenable_usb();
+ if (usbfix)
+ reenable_usb();
# endif
# ifndef CONFIG_SMP
diff --git a/arch/ia64/kernel/irq_lock.c b/arch/ia64/kernel/irq_lock.c
index 9c512dd4e..4a2ead673 100644
--- a/arch/ia64/kernel/irq_lock.c
+++ b/arch/ia64/kernel/irq_lock.c
@@ -26,7 +26,7 @@ int global_irq_holder = NO_PROC_ID;
spinlock_t global_irq_lock;
atomic_t global_irq_count;
atomic_t global_bh_count;
-atomic_t global_bh_lock;
+spinlock_t global_bh_lock;
#define INIT_STUCK (1<<26)
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index f86f45537..0bc110510 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -17,21 +17,6 @@
#include <asm/io.h>
-/* Pure 2^n version of get_order */
-extern __inline__ unsigned long
-get_order (unsigned long size)
-{
- unsigned long order = ia64_fls(size);
-
- printk ("get_order: size=%lu, order=%lu\n", size, order);
-
- if (order > PAGE_SHIFT)
- order -= PAGE_SHIFT;
- else
- order = 0;
- return order;
-}
-
void *
pci_alloc_consistent (struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle)
{
diff --git a/arch/ia64/kernel/pci.c b/arch/ia64/kernel/pci.c
index 3bceeed8e..4acc7f041 100644
--- a/arch/ia64/kernel/pci.c
+++ b/arch/ia64/kernel/pci.c
@@ -226,14 +226,3 @@ void
pcibios_align_resource (void *data, struct resource *res, unsigned long size)
{
}
-
-#if 0 /*def CONFIG_PROC_FS*/
-/*
- * This is an ugly hack to get a (weak) unresolved reference to something that is
- * in drivers/pci/proc.c. Without this, the file does not get linked in at all
- * (I suspect the reason this isn't needed on Linux/x86 is that most people compile
- * with module support, in which case the EXPORT_SYMBOL() stuff will ensure the
- * code gets linked in. Sigh... --davidm 99/12/20.
- */
-asm ("data8 proc_bus_pci_add");
-#endif
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 48a3d68b4..ed5d594a6 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -57,7 +57,7 @@ spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
unsigned long cpu_online_map = 1;
#endif
-volatile int cpu_number_map[NR_CPUS] = { -1, }; /* SAPIC ID -> Logical ID */
+volatile int __cpu_number_map[NR_CPUS] = { -1, }; /* SAPIC ID -> Logical ID */
volatile int __cpu_logical_map[NR_CPUS] = { -1, }; /* logical ID -> SAPIC ID */
int smp_num_cpus = 1;
int bootstrap_processor = -1; /* SAPIC ID of BSP */
@@ -586,7 +586,7 @@ smp_boot_one_cpu(int cpuid, int cpunum)
alive:
/* Remember the AP data */
- cpu_number_map[cpuid] = cpunum;
+ __cpu_number_map[cpuid] = cpunum;
#ifdef CONFIG_KDB
cpu_online_map |= (1<<cpunum);
printk ("DEBUGGER: cpu_online_map = 0x%08x\n", cpu_online_map);
@@ -612,12 +612,12 @@ smp_boot_cpus(void)
extern int acpi_apic_map[32];
/* Take care of some initial bookkeeping. */
- memset(&cpu_number_map, -1, sizeof(cpu_number_map));
+ memset(&__cpu_number_map, -1, sizeof(__cpu_number_map));
memset(&__cpu_logical_map, -1, sizeof(__cpu_logical_map));
memset(&ipi_op, 0, sizeof(ipi_op));
/* Setup BSP mappings */
- cpu_number_map[bootstrap_processor] = 0;
+ __cpu_number_map[bootstrap_processor] = 0;
__cpu_logical_map[0] = bootstrap_processor;
current->processor = bootstrap_processor;
diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
index 18a498a09..f06d3bea8 100644
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -2,8 +2,8 @@
* This file contains various system calls that have different calling
* conventions on different platforms.
*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999-2000 Hewlett-Packard Co
+ * Copyright (C) 1999-2000 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/config.h>
#include <linux/errno.h>
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
index 8a9581747..88a4aadd4 100644
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -3,7 +3,7 @@
#
.S.o:
- $(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $@
+ $(CC) -D__ASSEMBLY__ $(AFLAGS) -c $< -o $@
OBJS = __divdi3.o __divsi3.o __udivdi3.o __udivsi3.o \
__moddi3.o __modsi3.o __umoddi3.o __umodsi3.o \
diff --git a/arch/ia64/tools/print_offsets.c b/arch/ia64/tools/print_offsets.c
index 85b15aae1..f1b298e21 100644
--- a/arch/ia64/tools/print_offsets.c
+++ b/arch/ia64/tools/print_offsets.c
@@ -47,6 +47,7 @@ tab[] =
{ "IA64_TASK_FLAGS_OFFSET", offsetof (struct task_struct, flags) },
{ "IA64_TASK_SIGPENDING_OFFSET", offsetof (struct task_struct, sigpending) },
{ "IA64_TASK_NEED_RESCHED_OFFSET", offsetof (struct task_struct, need_resched) },
+ { "IA64_TASK_PROCESSOR_OFFSET", offsetof (struct task_struct, processor) },
{ "IA64_TASK_THREAD_OFFSET", offsetof (struct task_struct, thread) },
{ "IA64_TASK_THREAD_KSP_OFFSET", offsetof (struct task_struct, thread.ksp) },
{ "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) },