Commit ae4f429f authored by Linus Torvalds's avatar Linus Torvalds

Import 2.4.0-test5pre2

parent d7b5134e
......@@ -197,7 +197,7 @@ final kernel executable:
> c017e7a7 <do_con_write+e3> movzbl %dl,%esi
The whole user memory access is reduced to 10 x86 machine instructions.
The instructions bracketed in the .section directives are not longer
The instructions bracketed in the .section directives are no longer
in the normal execution path. They are located in a different section
of the executable file:
......
......@@ -76,8 +76,6 @@ CONFIG_HOTPLUG=y
#
CONFIG_PCMCIA=y
CONFIG_CARDBUS=y
# CONFIG_I82365 is not set
CONFIG_TCIC=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
......
......@@ -11,6 +11,8 @@
NM := $(CROSS_COMPILE)nm -B
AWK := awk
export AWK
LINKFLAGS = -static -T arch/$(ARCH)/vmlinux.lds
AFLAGS += -Wa,-x
EXTRA =
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
#
mainmenu_name "Kernel configuration of Linux for IA-64 machines"
mainmenu_option next_comment
......@@ -71,6 +68,8 @@ bool 'Sysctl support' CONFIG_SYSCTL
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
bool 'PCI support' CONFIG_PCI
source drivers/pci/Config.in
......@@ -83,17 +82,21 @@ fi
source drivers/parport/Config.in
fi # !HP_SIM
endmenu
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
fi
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
source drivers/mtd/Config.in
source drivers/pnp/Config.in
source drivers/block/Config.in
source drivers/i2o/Config.in
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
fi
mainmenu_option next_comment
comment 'ATA/IDE/MFM/RLL support'
......@@ -107,6 +110,8 @@ else
fi
endmenu
fi # !HP_SIM
mainmenu_option next_comment
comment 'SCSI support'
......@@ -114,10 +119,11 @@ tristate 'SCSI support' CONFIG_SCSI
if [ "$CONFIG_SCSI" != "n" ]; then
source drivers/scsi/Config.in
bool 'Simulated SCSI disk' CONFIG_SCSI_SIM
fi
endmenu
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment
comment 'Network device support'
......@@ -149,7 +155,10 @@ if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
fi
endmenu
fi # !HP_SIM
source drivers/char/Config.in
#source drivers/misc/Config.in
source fs/Config.in
......@@ -167,6 +176,8 @@ if [ "$CONFIG_VT" = "y" ]; then
endmenu
fi
if [ "$CONFIG_IA64_HP_SIM" = "n" ]; then
mainmenu_option next_comment
comment 'Sound'
......@@ -178,6 +189,21 @@ endmenu
source drivers/usb/Config.in
fi # !HP_SIM
if [ "$CONFIG_IA64_HP_SIM" != "n" -o "$CONFIG_IA64_GENERIC" != "n" ]; then
mainmenu_option next_comment
comment 'Simulated drivers'
tristate 'Simulated Ethernet ' CONFIG_SIMETH
bool 'Simulated serial driver support' CONFIG_SIM_SERIAL
if [ "$CONFIG_SCSI" != "n" ]; then
bool 'Simulated SCSI disk' CONFIG_SCSI_SIM
fi
endmenu
fi
mainmenu_option next_comment
comment 'Kernel hacking'
......
......@@ -19,7 +19,6 @@
#include <linux/console.h>
#include <linux/timex.h>
#include <linux/sched.h>
#include <linux/mc146818rtc.h>
#include <asm/io.h>
#include <asm/machvec.h>
......
......@@ -62,6 +62,12 @@ ia64_ctl_trace (long on)
ia64_ssc(on, 0, 0, 0, SSC_CTL_TRACE);
}
void __init
hpsim_pci_fixup (void)
{
}
void __init
hpsim_setup (char **cmdline_p)
{
......
......@@ -10,7 +10,7 @@
all: ia32.o
O_TARGET := ia32.o
O_OBJS := ia32_entry.o sys_ia32.o ia32_signal.o ia32_support.o ia32_traps.o binfmt_elf32.o
O_OBJS := ia32_entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o ia32_support.o ia32_traps.o binfmt_elf32.o
clean::
......
......@@ -6,7 +6,8 @@
* 06/16/00 A. Mallick initialize csd/ssd/tssd/cflg for ia32_load_state
*/
#include <linux/config.h>
#include <linux/posix_types.h>
#include <linux/types.h>
#include <asm/signal.h>
#include <asm/ia32.h>
......@@ -16,7 +17,9 @@
/* Override some function names */
#undef start_thread
#define start_thread ia32_start_thread
#define elf_format elf32_format
#define init_elf_binfmt init_elf32_binfmt
#define exit_elf_binfmt exit_elf32_binfmt
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
......@@ -28,10 +31,12 @@
# define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
void ia64_elf32_init(struct pt_regs *regs);
#define ELF_PLAT_INIT(_r) ia64_elf32_init(_r)
extern void ia64_elf32_init(struct pt_regs *regs);
extern void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address);
#define ELF_PLAT_INIT(_r) ia64_elf32_init(_r)
#define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm)
#define elf_map elf_map32
/* Ugly but avoids duplication */
#include "../../../fs/binfmt_elf.c"
......@@ -201,3 +206,53 @@ int ia32_setup_arg_pages(struct linux_binprm *bprm)
return 0;
}
static unsigned long
ia32_mm_addr(unsigned long addr)
{
struct vm_area_struct *vma;
if ((vma = find_vma(current->mm, addr)) == NULL)
return(ELF_PAGESTART(addr));
if (vma->vm_start > addr)
return(ELF_PAGESTART(addr));
return(ELF_PAGEALIGN(addr));
}
/*
* Normally we would do an `mmap' to map in the process's text section.
* This doesn't work with IA32 processes as the ELF file might specify
* a non page size aligned address. Instead we will just allocate
* memory and read the data in from the file. Slightly less efficient
* but it works.
*/
extern long ia32_do_mmap (struct file *filep, unsigned int len, unsigned int prot,
unsigned int flags, unsigned int fd, unsigned int offset);
static unsigned long
elf_map32 (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
{
unsigned long retval;
if (eppnt->p_memsz >= (1UL<<32) || addr > (1UL<<32) - eppnt->p_memsz)
return -EINVAL;
#if 1
set_brk(ia32_mm_addr(addr), addr + eppnt->p_memsz);
memset((char *) addr + eppnt->p_filesz, 0, eppnt->p_memsz - eppnt->p_filesz);
kernel_read(filep, eppnt->p_offset, (char *) addr, eppnt->p_filesz);
retval = (unsigned long) addr;
#else
/* doesn't work yet... */
# define IA32_PAGESTART(_v) ((_v) & ~(unsigned long)(ELF_EXEC_PAGESIZE-1))
# define IA32_PAGEOFFSET(_v) ((_v) & (ELF_EXEC_PAGESIZE-1))
# define IA32_PAGEALIGN(_v) (((_v) + ELF_EXEC_PAGESIZE - 1) & ~(ELF_EXEC_PAGESIZE - 1))
down(&current->mm->mmap_sem);
retval = ia32_do_mmap(filep, IA32_PAGESTART(addr),
eppnt->p_filesz + IA32_PAGEOFFSET(eppnt->p_vaddr), prot, type,
eppnt->p_offset - IA32_PAGEOFFSET(eppnt->p_vaddr));
up(&current->mm->mmap_sem);
#endif
return retval;
}
......@@ -63,13 +63,13 @@ END(ia32_ret_from_syscall)
GLOBAL_ENTRY(ia32_trace_syscall)
PT_REGS_UNWIND_INFO(0)
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
.Lret4: br.call.sptk.few rp=b6 // do the syscall
.Lret5: cmp.lt p6,p0=r8,r0 // syscall failed?
.ret0: br.call.sptk.few rp=b6 // do the syscall
.ret1: cmp.lt p6,p0=r8,r0 // syscall failed?
adds r2=IA64_PT_REGS_R8_OFFSET+16,sp // r2 = &pt_regs.r8
;;
st8.spill [r2]=r8 // store return value in slot for r8
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch return value
.Lret6: br.cond.sptk.many ia64_leave_kernel // rp MUST be != ia64_leave_kernel!
.ret2: br.cond.sptk.many ia64_leave_kernel // rp MUST be != ia64_leave_kernel!
END(ia32_trace_syscall)
GLOBAL_ENTRY(sys32_vfork)
......@@ -80,7 +80,7 @@ END(sys32_vfork)
GLOBAL_ENTRY(sys32_fork)
UNW(.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2))
alloc r16=ar.pfs,2,2,3,0
alloc r16=ar.pfs,2,2,4,0
mov out0=SIGCHLD // out0 = clone_flags
;;
.fork1:
......@@ -90,13 +90,11 @@ GLOBAL_ENTRY(sys32_fork)
UNW(.body)
adds out2=IA64_SWITCH_STACK_SIZE+16,sp
adds r2=IA64_SWITCH_STACK_SIZE+IA64_PT_REGS_R12_OFFSET+16,sp
;;
ld8 out1=[r2] // fetch usp from pt_regs.r12
mov out1=0
mov out2=0
adds out3=IA64_SWITCH_STACK_SIZE+16,sp
br.call.sptk.few rp=do_fork
.ret1:
mov ar.pfs=loc1
.ret3: mov ar.pfs=loc1
UNW(.restore sp)
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
mov rp=loc0
......@@ -137,7 +135,7 @@ ia32_syscall_table:
data8 sys32_alarm
data8 sys_ni_syscall
data8 sys_ni_syscall
data8 sys_ni_syscall /* 30 */
data8 ia32_utime /* 30 */
data8 sys_ni_syscall /* old stty syscall holder */
data8 sys_ni_syscall /* old gtty syscall holder */
data8 sys_access
......@@ -161,7 +159,7 @@ ia32_syscall_table:
data8 sys_acct
data8 sys_umount /* recycled never used phys( */
data8 sys_ni_syscall /* old lock syscall holder */
data8 sys_ioctl
data8 ia32_ioctl
data8 sys_fcntl /* 55 */
data8 sys_ni_syscall /* old mpx syscall holder */
data8 sys_setpgid
......
/*
* IA32 Architecture-specific ioctl shim code
*
* Copyright (C) 2000 VA Linux Co
* Copyright (C) 2000 Don Dugger <n0ano@valinux.com>
*/
#include <linux/types.h>
#include <linux/dirent.h>
#include <linux/msdos_fs.h>
#include <linux/mtio.h>
#include <linux/ncp_fs.h>
#include <linux/capi.h>
#include <linux/videodev.h>
#include <linux/synclink.h>
#include <linux/atmdev.h>
#include <linux/atm_eni.h>
#include <linux/atm_nicstar.h>
#include <linux/atm_zatm.h>
#include <linux/atm_idt77105.h>
#include <linux/ppp_defs.h>
#include <linux/if_ppp.h>
#include <linux/ixjuser.h>
#include <linux/i2o-dev.h>
asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long ia32_ioctl(unsigned int fd, unsigned int cmd, unsigned int arg)
{
switch (cmd) {
case VFAT_IOCTL_READDIR_BOTH:
case VFAT_IOCTL_READDIR_SHORT:
case MTIOCGET:
case MTIOCPOS:
case MTIOCGETCONFIG:
case MTIOCSETCONFIG:
case PPPIOCSCOMPRESS:
case PPPIOCGIDLE:
case NCP_IOC_GET_FS_INFO_V2:
case NCP_IOC_GETOBJECTNAME:
case NCP_IOC_SETOBJECTNAME:
case NCP_IOC_GETPRIVATEDATA:
case NCP_IOC_SETPRIVATEDATA:
case NCP_IOC_GETMOUNTUID2:
case CAPI_MANUFACTURER_CMD:
case VIDIOCGTUNER:
case VIDIOCSTUNER:
case VIDIOCGWIN:
case VIDIOCSWIN:
case VIDIOCGFBUF:
case VIDIOCSFBUF:
case MGSL_IOCSPARAMS:
case MGSL_IOCGPARAMS:
case ATM_GETNAMES:
case ATM_GETLINKRATE:
case ATM_GETTYPE:
case ATM_GETESI:
case ATM_GETADDR:
case ATM_RSTADDR:
case ATM_ADDADDR:
case ATM_DELADDR:
case ATM_GETCIRANGE:
case ATM_SETCIRANGE:
case ATM_SETESI:
case ATM_SETESIF:
case ATM_GETSTAT:
case ATM_GETSTATZ:
case ATM_GETLOOP:
case ATM_SETLOOP:
case ATM_QUERYLOOP:
case ENI_SETMULT:
case NS_GETPSTAT:
/* case NS_SETBUFLEV: This is a duplicate case with ZATM_GETPOOLZ */
case ZATM_GETPOOLZ:
case ZATM_GETPOOL:
case ZATM_SETPOOL:
case ZATM_GETTHIST:
case IDT77105_GETSTAT:
case IDT77105_GETSTATZ:
case IXJCTL_TONE_CADENCE:
case IXJCTL_FRAMES_READ:
case IXJCTL_FRAMES_WRITTEN:
case IXJCTL_READ_WAIT:
case IXJCTL_WRITE_WAIT:
case IXJCTL_DRYBUFFER_READ:
case I2OHRTGET:
case I2OLCTGET:
case I2OPARMSET:
case I2OPARMGET:
case I2OSWDL:
case I2OSWUL:
case I2OSWDEL:
case I2OHTML:
printk("%x:unimplemented IA32 ioctl system call\n", cmd);
return(-EINVAL);
default:
return(sys_ioctl(fd, cmd, (unsigned long)arg));
}
}
......@@ -29,6 +29,7 @@
#include <linux/smp_lock.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/mm.h>
#include <linux/shm.h>
#include <linux/malloc.h>
#include <linux/uio.h>
......@@ -207,7 +208,7 @@ sys32_newfstat(unsigned int fd, struct stat32 *statbuf)
unsigned long
do_mmap_fake(struct file *file, unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long off)
unsigned long prot, unsigned long flags, loff_t off)
{
struct inode *inode;
void *front, *back;
......@@ -224,11 +225,11 @@ do_mmap_fake(struct file *file, unsigned long addr, unsigned long len,
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);
__copy_user(front, (void *)baddr, addr - baddr);
}
if (addr && ((addr + len) & ~PAGE_MASK) && get_user(c, (char *)(addr + len)) == 0) {
back = kmalloc(PAGE_SIZE - ((addr + len) & ~PAGE_MASK), GFP_KERNEL);
memcpy(back, (char *)addr + len, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
__copy_user(back, (char *)addr + len, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
}
down(&current->mm->mmap_sem);
r = do_mmap(0, baddr, len + (addr - baddr), prot, flags | MAP_ANONYMOUS, 0);
......@@ -238,15 +239,15 @@ do_mmap_fake(struct file *file, unsigned long addr, unsigned long len,
if (addr == 0)
addr = r;
if (back) {
memcpy((char *)addr + len, back, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
__copy_user((char *)addr + len, back, PAGE_SIZE - ((addr + len) & ~PAGE_MASK));
kfree(back);
}
if (front) {
memcpy((void *)baddr, front, addr - baddr);
__copy_user((void *)baddr, front, addr - baddr);
kfree(front);
}
if (flags & MAP_ANONYMOUS) {
memset((char *)addr, 0, len);
clear_user((char *)addr, len);
return(addr);
}
if (!file)
......@@ -256,19 +257,39 @@ do_mmap_fake(struct file *file, unsigned long addr, unsigned long len,
return -EINVAL;
if (!file->f_op->read)
return -EINVAL;
lock_kernel();
if (file->f_op->llseek) {
if (file->f_op->llseek(file,off,0) != off) {
unlock_kernel();
return -EINVAL;
}
} else
file->f_pos = off;
unlock_kernel();
r = file->f_op->read(file, (char *)addr, len, &file->f_pos);
r = file->f_op->read(file, (char *)addr, len, &off);
return (r < 0) ? -EINVAL : addr;
}
long
ia32_do_mmap (struct file *file, unsigned int addr, unsigned int len, unsigned int prot,
unsigned int flags, unsigned int fd, unsigned int offset)
{
long error = -EFAULT;
unsigned int poff;
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if ((flags & MAP_FIXED) && ((addr & ~PAGE_MASK) || (offset & ~PAGE_MASK)))
error = do_mmap_fake(file, addr, len, prot, flags, (loff_t)offset);
else if (!addr && (offset & ~PAGE_MASK)) {
poff = offset & PAGE_MASK;
len += offset - poff;
down(&current->mm->mmap_sem);
error = do_mmap(file, addr, len, prot, flags, poff);
up(&current->mm->mmap_sem);
if (!IS_ERR(error))
error += offset - poff;
} else {
down(&current->mm->mmap_sem);
error = do_mmap(file, addr, len, prot, flags, offset);
up(&current->mm->mmap_sem);
}
return error;
}
/*
* Linux/i386 didn't use to be able to handle more than
* 4 system call parameters, so these system calls used a memory
......@@ -287,32 +308,22 @@ struct mmap_arg_struct {
asmlinkage long
sys32_mmap(struct mmap_arg_struct *arg)
{
int error = -EFAULT;
struct file * file = NULL;
struct mmap_arg_struct a;
struct file *file = NULL;
long retval;
if (copy_from_user(&a, arg, sizeof(a)))
return -EFAULT;
if (!(a.flags & MAP_ANONYMOUS)) {
error = -EBADF;
file = fget(a.fd);
if (!file)
goto out;
}
a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if ((a.flags & MAP_FIXED) && ((a.addr & ~PAGE_MASK) || (a.offset & ~PAGE_MASK))) {
error = do_mmap_fake(file, a.addr, a.len, a.prot, a.flags, a.offset);
} else {
down(&current->mm->mmap_sem);
error = do_mmap(file, a.addr, a.len, a.prot, a.flags, a.offset);
up(&current->mm->mmap_sem);
return -EBADF;
}
retval = ia32_do_mmap(file, a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
if (file)
fput(file);
out:
return error;
return retval;
}
asmlinkage long
......@@ -602,6 +613,40 @@ sys32_alarm(unsigned int seconds)
/* Translations due to time_t size differences. Which affects all
sorts of things, like timeval and itimerval. */
struct utimbuf_32 {
int atime;
int mtime;
};
extern asmlinkage long sys_utimes(char * filename, struct timeval * utimes);
extern asmlinkage long sys_gettimeofday (struct timeval *tv, struct timezone *tz);
asmlinkage long
ia32_utime(char * filename, struct utimbuf_32 *times32)
{
mm_segment_t old_fs = get_fs();
struct timeval tv[2];
long ret;
if (times32) {
get_user(tv[0].tv_sec, &times32->atime);
tv[0].tv_usec = 0;
get_user(tv[1].tv_sec, &times32->mtime);
tv[1].tv_usec = 0;
set_fs (KERNEL_DS);
} else {
set_fs (KERNEL_DS);
ret = sys_gettimeofday(&tv[0], 0);
if (ret < 0)
goto out;
tv[1] = tv[0];
}
ret = sys_utimes(filename, tv);
out:
set_fs (old_fs);
return ret;
}
extern struct timezone sys_tz;
extern int do_sys_settimeofday(struct timeval *tv, struct timezone *tz);
......@@ -2359,7 +2404,7 @@ sys32_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
goto out;
}
ret = -ESRCH;
if (!(child->flags & PF_PTRACED))
if (!(child->ptrace & PT_PTRACED))
goto out;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
......
......@@ -9,35 +9,20 @@
all: kernel.o head.o init_task.o
O_TARGET := kernel.o
O_OBJS := acpi.o entry.o gate.o efi.o efi_stub.o irq.o irq_ia64.o irq_sapic.o ivt.o \
pal.o pci-dma.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \
signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
OX_OBJS := ia64_ksyms.o
ifdef CONFIG_IA64_GENERIC
O_OBJS += machvec.o
endif
ifdef CONFIG_IA64_PALINFO
O_OBJS += palinfo.o
endif
obj-y := acpi.o entry.o gate.o efi.o efi_stub.o irq.o irq_ia64.o irq_sapic.o ivt.o \
pal.o pci-dma.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \
signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
ifdef CONFIG_PCI
O_OBJS += pci.o
endif
obj-$(CONFIG_IA64_GENERIC) += machvec.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o
obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
ifdef CONFIG_SMP
O_OBJS += smp.o
endif
ifdef CONFIG_IA64_MCA
O_OBJS += mca.o mca_asm.o
endif
ifdef CONFIG_IA64_BRL_EMU
O_OBJS += brl_emu.o
endif
O_TARGET := kernel.o
O_OBJS := $(obj-y)
OX_OBJS := ia64_ksyms.o
clean::
......
......@@ -76,17 +76,14 @@ GLOBAL_ENTRY(efi_call_phys)
andcm r16=loc3,r16 // get psr with IT, DT, and RT bits cleared
mov out3=in4
br.call.sptk.few rp=ia64_switch_mode
.ret0:
mov out4=in5
.ret0: mov out4=in5
mov out5=in6
mov out6=in7
br.call.sptk.few rp=b6 // call the EFI function
.ret1:
mov ar.rsc=r0 // put RSE in enforced lazy, LE mode
.ret1: mov ar.rsc=r0 // put RSE in enforced lazy, LE mode
mov r16=loc3
br.call.sptk.few rp=ia64_switch_mode // return to virtual mode
.ret2:
mov ar.rsc=loc4 // restore RSE configuration
.ret2: mov ar.rsc=loc4 // restore RSE configuration
mov ar.pfs=loc1
mov rp=loc0
mov gp=loc2
......
......@@ -17,8 +17,6 @@
* pSys: See entry.h.
* pNonSys: !pSys
* p2: (Alias of pKern!) True if any signals are pending.
* p16/p17: Used by stubs calling ia64_do_signal to indicate if current task
* has PF_PTRACED flag bit set. p16 is true if so, p17 is the complement.
*/
#include <linux/config.h>
......@@ -62,27 +60,41 @@ ENTRY(ia64_execve)
br.ret.sptk.few rp
END(ia64_execve)
GLOBAL_ENTRY(sys_clone)
GLOBAL_ENTRY(sys_clone2)
UNW(.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2))
alloc r16=ar.pfs,2,2,3,0;;
mov loc0=rp
alloc r16=ar.pfs,3,2,4,0
DO_SAVE_SWITCH_STACK
mov loc0=rp
mov loc1=r16 // save ar.pfs across do_fork
UNW(.body)
adds out2=IA64_SWITCH_STACK_SIZE+16,sp
adds r2=IA64_SWITCH_STACK_SIZE+IA64_PT_REGS_R12_OFFSET+16,sp
cmp.eq p8,p9=in1,r0 // usp == 0?
mov out1=in1
mov out2=in2
adds out3=IA64_SWITCH_STACK_SIZE+16,sp // out3 = &regs
mov out0=in0 // out0 = clone_flags
;;
(p8) ld8 out1=[r2] // fetch usp from pt_regs.r12
(p9) mov out1=in1
br.call.sptk.few rp=do_fork
.ret1:
.ret1: UNW(.restore sp)
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
mov ar.pfs=loc1
UNW(.restore sp)
mov rp=loc0
br.ret.sptk.many rp
END(sys_clone2)
GLOBAL_ENTRY(sys_clone)
UNW(.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2))
alloc r16=ar.pfs,2,2,4,0
DO_SAVE_SWITCH_STACK
mov loc0=rp
mov loc1=r16 // save ar.pfs across do_fork
UNW(.body)
mov out1=in1
mov out2=0
adds out3=IA64_SWITCH_STACK_SIZE+16,sp // out3 = &regs
mov out0=in0 // out0 = clone_flags
br.call.sptk.few rp=do_fork
.ret2: UNW(.restore sp)
adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack
mov ar.pfs=loc1
mov rp=loc0
;;
br.ret.sptk.many rp
END(sys_clone)
......@@ -387,9 +399,9 @@ GLOBAL_ENTRY(invoke_syscall_trace)
;; // WAW on CFM at the br.call
mov loc0=rp
br.call.sptk.many rp=save_switch_stack_with_current_frame // must preserve b6!!
.ret2: mov loc2=b6
.ret4: mov loc2=b6
br.call.sptk.few rp=syscall_trace
.ret3: adds sp=IA64_SWITCH_STACK_SIZE,sp // drop switch_stack frame
.ret5: adds sp=IA64_SWITCH_STACK_SIZE,sp // drop switch_stack frame
mov rp=loc0
mov ar.pfs=loc1
mov b6=loc2
......@@ -408,26 +420,14 @@ END(invoke_syscall_trace)
// r15 = syscall number
// b6 = syscall entry point
//
.global ia64_trace_syscall
.global ia64_strace_leave_kernel
GLOBAL_ENTRY(ia64_strace_clear_r8)
// this is where we return after cloning when PF_TRACESYS is on
PT_REGS_UNWIND_INFO(0)
# ifdef CONFIG_SMP
br.call.sptk.few rp=invoke_schedule_tail
# endif
mov r8=0
br strace_check_retval
END(ia64_strace_clear_r8)
ENTRY(ia64_trace_syscall)
GLOBAL_ENTRY(ia64_trace_syscall)
PT_REGS_UNWIND_INFO(0)
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
.ret4: br.call.sptk.few rp=b6 // do the syscall
.ret6: br.call.sptk.few rp=b6 // do the syscall
strace_check_retval:
.ret5: cmp.lt p6,p0=r8,r0 // syscall failed?
;;
cmp.lt p6,p0=r8,r0 // syscall failed?
adds r2=IA64_PT_REGS_R8_OFFSET+16,sp // r2 = &pt_regs.r8
adds r3=IA64_PT_REGS_R8_OFFSET+32,sp // r3 = &pt_regs.r10
mov r10=0
......@@ -438,7 +438,7 @@ strace_save_retval:
.mem.offset 8,0; st8.spill [r3]=r10 // clear error indication in slot for r10
ia64_strace_leave_kernel:
br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch return value
.ret6: br.cond.sptk.many ia64_leave_kernel
.rety: br.cond.sptk.many ia64_leave_kernel
strace_error:
ld8 r3=[r2] // load pt_regs.r8
......@@ -468,18 +468,24 @@ END(ia64_trace_syscall)
#define rKRBS r22
#define rB6 r21
GLOBAL_ENTRY(ia64_ret_from_syscall_clear_r8)
GLOBAL_ENTRY(ia64_ret_from_clone)
PT_REGS_UNWIND_INFO(0)
#ifdef CONFIG_SMP
// In SMP mode, we need to call schedule_tail to complete the scheduling process.
// Called by ia64_switch_to after do_fork()->copy_thread(). r8 contains the
// address of the previously executing task.
br.call.sptk.few rp=invoke_schedule_tail
.ret7:
#endif
.ret8:
#endif
adds r2=IA64_TASK_PTRACE_OFFSET,r13
;;
ld8 r2=[r2]
;;
mov r8=0
tbit.nz p6,p0=r2,PT_TRACESYS_BIT
(p6) br strace_check_retval
;; // added stop bits to prevent r8 dependency
END(ia64_ret_from_syscall_clear_r8)
END(ia64_ret_from_clone)
// fall through
GLOBAL_ENTRY(ia64_ret_from_syscall)
PT_REGS_UNWIND_INFO(0)
......@@ -542,6 +548,7 @@ back_from_resched:
2:
// check & deliver pending signals:
(p2) br.call.spnt.few rp=handle_signal_delivery
.ret9:
#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC) || defined(CONFIG_IA64_SOFTSDV_HACKS)
// Check for lost ticks
rsm psr.i
......@@ -555,6 +562,7 @@ back_from_resched:
;;
cmp.ge p6,p7 = r2, r0
(p6) br.call.spnt.few rp=invoke_ia64_reset_itm
.ret10:
;;
ssm psr.i
#endif
......@@ -749,8 +757,7 @@ ENTRY(invoke_schedule_tail)
mov out0=r8 // Address of previous task
;;
br.call.sptk.few rp=schedule_tail
.ret8:
mov ar.pfs=loc1
.ret11: mov ar.pfs=loc1
mov rp=loc0
br.ret.sptk.many rp
END(invoke_schedule_tail)
......@@ -766,7 +773,7 @@ ENTRY(invoke_ia64_reset_itm)
;;
UNW(.body)
br.call.sptk.many rp=ia64_reset_itm
;;
.ret12: ;;
mov ar.pfs=loc1
mov rp=loc0
br.ret.sptk.many rp
......@@ -785,8 +792,7 @@ ENTRY(invoke_do_softirq)
;;
UNW(.body)
br.call.sptk.few rp=do_softirq
.ret9:
mov ar.pfs=loc1
.ret13: mov ar.pfs=loc1
mov rp=loc0
br.ret.sptk.many rp
END(invoke_do_softirq)
......@@ -802,8 +808,7 @@ ENTRY(invoke_schedule)
;;
UNW(.body)
br.call.sptk.few rp=schedule
.ret10:
mov ar.pfs=loc1
.ret14: mov ar.pfs=loc1
mov rp=loc0
br.ret.sptk.many rp
END(invoke_schedule)
......@@ -829,8 +834,7 @@ ENTRY(handle_signal_delivery)
st8 [sp]=r9,-16 // allocate space for ar.unat and save it
.body
br.call.sptk.few rp=ia64_do_signal
.ret11:
.restore sp
.ret15: .restore sp
adds sp=16,sp // pop scratch stack space
;;
ld8 r9=[sp] // load new unat from sw->caller_unat
......@@ -851,8 +855,7 @@ ENTRY(handle_signal_delivery)
(pSys) mov out2=1 // out2==1 => we're in a syscall
(pNonSys) mov out2=0 // out2==0 => not a syscall
br.call.sptk.few rp=ia64_do_signal
.ret11:
// restore the switch stack (ptrace may have modified it)
.ret16: // restore the switch stack (ptrace may have modified it)
DO_LOAD_SWITCH_STACK( )
br.ret.sptk.many rp
#endif /* !CONFIG_IA64_NEW_UNWIND */
......@@ -873,8 +876,7 @@ GLOBAL_ENTRY(sys_rt_sigsuspend)
st8 [sp]=r9,-16 // allocate space for ar.unat and save it
.body
br.call.sptk.few rp=ia64_rt_sigsuspend
.ret12:
.restore sp
.ret17: .restore sp
adds sp=16,sp // pop scratch stack space
;;
ld8 r9=[sp] // load new unat from sw->caller_unat
......@@ -893,8 +895,7 @@ GLOBAL_ENTRY(sys_rt_sigsuspend)
mov out1=in1 // sigsetsize
adds out2=16,sp // out1=&sigscratch
br.call.sptk.many rp=ia64_rt_sigsuspend
.ret12:
// restore the switch stack (ptrace may have modified it)
.ret18: // restore the switch stack (ptrace may have modified it)
DO_LOAD_SWITCH_STACK( )
br.ret.sptk.many rp
#endif /* !CONFIG_IA64_NEW_UNWIND */
......@@ -912,8 +913,7 @@ ENTRY(sys_rt_sigreturn)
;;
adds out0=16,sp // out0 = &sigscratch
br.call.sptk.few rp=ia64_rt_sigreturn
.ret13:
adds sp=16,sp // doesn't drop pt_regs, so don't mark it as restoring sp!
.ret19: adds sp=16,sp // doesn't drop pt_regs, so don't mark it as restoring sp!
PT_REGS_UNWIND_INFO(0) // instead, create a new body section with the smaller frame
;;
ld8 r9=[sp] // load new ar.unat
......@@ -937,8 +937,7 @@ ENTRY(sys_rt_sigreturn)
adds out0=16,sp // out0 = &sigscratch
br.call.sptk.few rp=ia64_rt_sigreturn
.ret13:
adds r3=IA64_SWITCH_STACK_CALLER_UNAT_OFFSET+16,sp
.ret20: adds r3=IA64_SWITCH_STACK_CALLER_UNAT_OFFSET+16,sp
;;
ld8 r9=[r3] // load new ar.unat
mov b7=r8
......@@ -957,9 +956,10 @@ GLOBAL_ENTRY(ia64_prepare_handle_unaligned)
//
PT_REGS_UNWIND_INFO(0)
mov r16=r0
UNW(.prologue)
DO_SAVE_SWITCH_STACK
br.call.sptk.few rp=ia64_handle_unaligned // stack frame setup in ivt
.ret14:
.ret21: .body
DO_LOAD_SWITCH_STACK(PT_REGS_UNWIND_INFO(0))
br.cond.sptk.many rp // goes to ia64_leave_kernel
END(ia64_prepare_handle_unaligned)
......@@ -1206,7 +1206,7 @@ sys_call_table:
data8 sys_newstat // 1210
data8 sys_newlstat
data8 sys_newfstat
data8 ia64_ni_syscall
data8 sys_clone2
data8 ia64_ni_syscall
data8 ia64_ni_syscall // 1215
data8 ia64_ni_syscall
......
......@@ -240,7 +240,7 @@ sal_emulator (long index, unsigned long in1, unsigned long in2,
if (index == SAL_FREQ_BASE) {
switch (in1) {
case SAL_FREQ_BASE_PLATFORM:
r9 = 100000000;
r9 = 200000000;
break;
case SAL_FREQ_BASE_INTERVAL_TIMER:
......
......@@ -120,8 +120,7 @@ back_from_setup_rbs:
stf.spill [base0]=f14,32
stf.spill [base1]=f15,32
br.call.sptk.few rp=b6 // call the signal handler
.ret2:
adds base0=(BSP_OFF+SIGCONTEXT_OFF),sp
.ret0: adds base0=(BSP_OFF+SIGCONTEXT_OFF),sp
;;
ld8 r15=[base0],(CFM_OFF-BSP_OFF) // fetch sc_ar_bsp and advance to CFM_OFF
mov r14=ar.bsp
......
......@@ -139,7 +139,7 @@ alive_msg:
;;
#ifdef CONFIG_SMP
(isAP) br.call.sptk.few rp=smp_callin
.ret1:
.ret0:
(isAP) br.cond.sptk.few self
#endif
......@@ -150,11 +150,10 @@ alive_msg:
#ifdef CONFIG_IA64_FW_EMU
// initialize PAL & SAL emulator:
br.call.sptk.few rp=sys_fw_init
;;
.ret1:
#endif
br.call.sptk.few rp=start_kernel
.ret2:
addl r2=@ltoff(halt_msg),gp
.ret2: addl r2=@ltoff(halt_msg),gp
;;
ld8 out0=[r2]
br.call.sptk.few b0=console_print
......
......@@ -170,10 +170,11 @@ ia64_ivt:
* The ITLB basically does the same as the VHPT handler except
* that we always insert exactly one instruction TLB entry.
*/
#if 0
#if 1
/*
* This code works, but I don't want to enable it until I have numbers
* that prove this to be a win.
* Attempt to lookup PTE through virtual linear page table.
* The speculative access will fail if there is no TLB entry
* for the L3 page table page we're trying to access.
*/
mov r31=pr // save predicates
;;
......@@ -244,10 +245,11 @@ ia64_ivt:
* that we always insert exactly one data TLB entry.
*/
mov r16=cr.ifa // get address that caused the TLB miss
#if 0
#if 1
/*
* This code works, but I don't want to enable it until I have numbers
* that prove this to be a win.
* Attempt to lookup PTE through virtual linear page table.
* The speculative access will fail if there is no TLB entry
* for the L3 page table page we're trying to access.
*/
mov r31=pr // save predicates
;;
......@@ -568,7 +570,7 @@ page_fault:
mov r3=255
adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024
adds r2=IA64_TASK_FLAGS_OFFSET,r13 // r2 = &current->flags
adds r2=IA64_TASK_PTRACE_OFFSET,r13 // r2 = &current->ptrace
;;
cmp.geu.unc p6,p7=r3,r15 // (syscall > 0 && syscall <= 1024+255) ?
......@@ -581,7 +583,7 @@ page_fault:
ld8 r16=[r16] // load address of syscall entry point
mov rp=r15 // set the real return addr
;;
ld8 r2=[r2] // r2 = current->flags
ld8 r2=[r2] // r2 = current->ptrace
mov b6=r16
// arrange things so we skip over break instruction when returning:
......@@ -590,7 +592,7 @@ page_fault:
adds r17=24,sp // get pointer to cr_iip
;;
ld8 r18=[r16] // fetch cr_ipsr
tbit.z p8,p0=r2,5 // (current->flags & PF_TRACESYS) == 0?
tbit.z p8,p0=r2,PT_TRACESYS_BIT // (current->ptrace & PF_TRACESYS) == 0?
;;
ld8 r19=[r17] // fetch cr_iip
extr.u r20=r18,41,2 // extract ei field
......@@ -686,7 +688,7 @@ dispatch_illegal_op_fault:
SAVE_REST
;;
br.call.sptk.few rp=ia64_illegal_op_fault
;;
.ret0: ;;
alloc r14=ar.pfs,0,0,3,0 // must be first in insn group
mov out0=r9
mov out1=r10
......@@ -755,16 +757,16 @@ dispatch_to_ia32_handler:
ld4 out5=[r14],8 // r13 == ebp
;;
ld4 out3=[r14],8 // r14 == esi
adds r2=IA64_TASK_FLAGS_OFFSET,r13 // r2 = &current->flags
adds r2=IA64_TASK_PTRACE_OFFSET,r13 // r2 = &current->ptrace
;;
ld4 out4=[r14] // R15 == edi
movl r16=ia32_syscall_table
;;
(p6) shladd r16=r8,3,r16 // Force ni_syscall if not valid syscall number
ld8 r2=[r2] // r2 = current->flags
ld8 r2=[r2] // r2 = current->ptrace
;;
ld8 r16=[r16]
tbit.z p8,p0=r2,5 // (current->flags & PF_TRACESYS) == 0?
tbit.z p8,p0=r2,PT_TRACESYS_BIT // (current->ptrace & PT_TRACESYS) == 0?
;;
mov b6=r16
movl r15=ia32_ret_from_syscall
......@@ -780,8 +782,7 @@ non_ia32_syscall:
add out1=16,sp // pointer to pt_regs
;; // avoid WAW on CFM
br.call.sptk.few rp=ia32_bad_interrupt
;;
movl r15=ia64_leave_kernel
.ret1: movl r15=ia64_leave_kernel
;;
mov rp=r15
br.ret.sptk.many rp
......
......@@ -9,8 +9,7 @@
* Copyright (C) 1999 Silicon Graphics, Inc.
* Copyright (C) Vijay Chander(vijay@engr.sgi.com)
*
* 00/03/29 C. Fleckenstein Fixed PAL/SAL update issues, began MCA bug fixes,
* logging issues,
* 00/03/29 C. Fleckenstein Fixed PAL/SAL update issues, began MCA bug fixes, logging issues,
* added min save state dump, added INIT handler.
*/
#include <linux/config.h>
......
......@@ -136,8 +136,7 @@ ia64_os_mca_virtual_begin:
movl r2=ia64_mca_ucmc_handler;;
mov b6=r2;;
br.call.sptk.few b0=b6
;;
.ret0:
// Revert back to physical mode before going back to SAL
PHYSICAL_MODE_ENTER(r2, r3, ia64_os_mca_virtual_end, r4)
ia64_os_mca_virtual_end:
......@@ -766,7 +765,7 @@ IVirtual_Switch:
;;
br.call.sptk.few rp=ia64_init_handler
;;
.ret1:
return_from_init:
br.sptk return_from_init
......
......@@ -74,14 +74,14 @@ GLOBAL_ENTRY(ia64_pal_call_static)
mov loc3 = psr
mov loc0 = rp
UNW(.body)
adds r8 = .ret0-1b,r8
adds r8 = 1f-1b,r8
;;
rsm psr.i
mov b7 = loc2
mov rp = r8
;;
br.cond.sptk.few b7
.ret0: mov psr.l = loc3
1: mov psr.l = loc3
mov ar.pfs = loc1
mov rp = loc0
;;
......@@ -116,8 +116,7 @@ GLOBAL_ENTRY(ia64_pal_call_stacked)
mov b7 = loc2
;;
br.call.sptk.many rp=b7 // now make the call
.ret2:
mov psr.l = loc3
.ret0: mov psr.l = loc3
mov ar.pfs = loc1
mov rp = loc0
;;
......@@ -161,7 +160,7 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
mov r31 = in3 // copy arg3
;;
mov loc3 = psr // save psr
adds r8 = .ret4-1b,r8 // calculate return address for call
adds r8 = 1f-1b,r8 // calculate return address for call
;;
mov loc4=ar.rsc // save RSE configuration
dep.z loc2=loc2,0,61 // convert pal entry point to physical
......@@ -176,15 +175,14 @@ GLOBAL_ENTRY(ia64_pal_call_phys_static)
;;
andcm r16=loc3,r16 // removes bits to clear from psr
br.call.sptk.few rp=ia64_switch_mode
.ret3:
mov rp = r8 // install return address (physical)
.ret1: mov rp = r8 // install return address (physical)
br.cond.sptk.few b7
.ret4:
1:
mov ar.rsc=r0 // put RSE in enforced lazy, LE mode
mov r16=loc3 // r16= original psr
br.call.sptk.few rp=ia64_switch_mode // return to virtual mode
.ret5: mov psr.l = loc3 // restore init PSR
.ret2:
mov psr.l = loc3 // restore init PSR
mov ar.pfs = loc1
mov rp = loc0
......
/*
* Architecture-specific setup.
*
* Copyright (C) 1998, 1999 Hewlett-Packard Co
* Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998-2000 Hewlett-Packard Co
* Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */
#include <linux/config.h>
......@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
......@@ -204,24 +205,22 @@ ia64_load_extra (struct task_struct *task)
* be copied as well.
*
* Observe that we copy the unat values that are in pt_regs and
* switch_stack. Since the interpretation of unat is dependent upon
* the address to which the registers got spilled, doing this is valid
* only as long as we preserve the alignment of the stack. Since the
* stack is always page aligned, we know this is the case.
*
* XXX Actually, the above isn't true when we create kernel_threads().
* If we ever needs to create kernel_threads() that preserve the unat
* values we'll need to fix this. Perhaps an easy workaround would be
* to always clear the unat bits in the child thread.
* switch_stack. Spilling an integer to address X causes bit N in
* ar.unat to be set to the NaT bit of the register, with N=(X &
* 0x1ff)/8. Thus, copying the unat value preserves the NaT bits ONLY
* if the pt_regs structure in the parent is congruent to that of the
* child, modulo 512. Since the stack is page aligned and the page
* size is at least 4KB, this is always the case, so there is nothing
* to worry about.
*/
int
copy_thread (int nr, unsigned long clone_flags, unsigned long usp,
copy_thread (int nr, unsigned long clone_flags,
unsigned long user_stack_base, unsigned long user_stack_size,
struct task_struct *p, struct pt_regs *regs)
{
unsigned long rbs, child_rbs, rbs_size, stack_offset, stack_top, stack_used;
struct switch_stack *child_stack, *stack;
extern char ia64_ret_from_syscall_clear_r8;
extern char ia64_strace_clear_r8;
extern char ia64_ret_from_clone;
struct pt_regs *child_ptregs;
#ifdef CONFIG_SMP
......@@ -251,10 +250,14 @@ copy_thread (int nr, unsigned long clone_flags, unsigned long usp,
/* copy the parent's register backing store to the child: */
memcpy((void *) child_rbs, (void *) rbs, rbs_size);
child_ptregs->r8 = 0; /* child gets a zero return value */
if (user_mode(child_ptregs))
child_ptregs->r12 = usp; /* user stack pointer */
else {
if (user_mode(child_ptregs)) {
if (user_stack_base) {
child_ptregs->r12 = user_stack_base + user_stack_size;
child_ptregs->ar_bspstore = user_stack_base;
child_ptregs->ar_rnat = 0;
child_ptregs->loadrs = 0;
}
} else {
/*
* Note: we simply preserve the relative position of
* the stack pointer here. There is no need to
......@@ -265,13 +268,10 @@ copy_thread (int nr, unsigned long clone_flags, unsigned long usp,
child_ptregs->r12 = (unsigned long) (child_ptregs + 1); /* kernel sp */
child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */
}
if (p->flags & PF_TRACESYS)
child_stack->b0 = (unsigned long) &ia64_strace_clear_r8;
else
child_stack->b0 = (unsigned long) &ia64_ret_from_syscall_clear_r8;
child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
child_stack->ar_bspstore = child_rbs + rbs_size;
/* copy the thread_struct: */
/* copy parts of thread_struct: */
p->thread.ksp = (unsigned long) child_stack - 16;
/*
* NOTE: The calling convention considers all floating point
......@@ -288,18 +288,11 @@ copy_thread (int nr, unsigned long clone_flags, unsigned long usp,
* would be a slight deviation from the normal Linux system
* call behavior where scratch registers are preserved across
* system calls (unless used by the system call itself).
*
* If we wanted to inherit the fph state from the parent to the
* child, we would have to do something along the lines of:
*
* if (ia64_get_fpu_owner() == current && ia64_psr(regs)->mfh) {
* p->thread.flags |= IA64_THREAD_FPH_VALID;
* ia64_save_fpu(&p->thread.fph);
* } else if (current->thread.flags & IA64_THREAD_FPH_VALID) {
* memcpy(p->thread.fph, current->thread.fph, sizeof(p->thread.fph));
* }
*/
p->thread.flags = (current->thread.flags & ~IA64_THREAD_FPH_VALID);
# define THREAD_FLAGS_TO_CLEAR (IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID)
# define THREAD_FLAGS_TO_SET 0
p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR)
| THREAD_FLAGS_TO_SET);
return 0;
}
......
......@@ -942,9 +942,9 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
if (current->flags & PF_PTRACED)
if (current->ptrace & PT_PTRACED)
goto out;
current->flags |= PF_PTRACED;
current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
......@@ -976,9 +976,9 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
(current->gid != child->gid)) && !capable(CAP_SYS_PTRACE))
goto out_tsk;
/* the same process cannot be attached many times */
if (child->flags & PF_PTRACED)
if (child->ptrace & PT_PTRACED)
goto out_tsk;
child->flags |= PF_PTRACED;
child->ptrace |= PT_PTRACED;
if (child->p_pptr != current) {
unsigned long flags;
......@@ -993,7 +993,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
goto out_tsk;
}
ret = -ESRCH;
if (!(child->flags & PF_PTRACED))
if (!(child->ptrace & PT_PTRACED))
goto out_tsk;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
......@@ -1083,9 +1083,9 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
if (data > _NSIG)
goto out_tsk;
if (request == PTRACE_SYSCALL)
child->flags |= PF_TRACESYS;
child->ptrace |= PT_TRACESYS;
else
child->flags &= ~PF_TRACESYS;
child->ptrace &= ~PT_TRACESYS;
child->exit_code = data;
/* make sure the single step/take-branch tra bits are not set: */
......@@ -1126,7 +1126,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
if (data > _NSIG)
goto out_tsk;
child->flags &= ~PF_TRACESYS;
child->ptrace &= ~PT_TRACESYS;
if (request == PTRACE_SINGLESTEP) {
ia64_psr(ia64_task_regs(child))->ss = 1;
} else {
......@@ -1147,7 +1147,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
if (data > _NSIG)
goto out_tsk;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->ptrace &= ~(PT_PTRACED|PT_TRACESYS);
child->exit_code = data;
write_lock_irqsave(&tasklist_lock, flags);
REMOVE_LINKS(child);
......@@ -1180,7 +1180,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
void
syscall_trace (void)
{
if ((current->flags & (PF_PTRACED|PF_TRACESYS)) != (PF_PTRACED|PF_TRACESYS))
if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) != (PT_PTRACED|PT_TRACESYS))
return;
current->exit_code = SIGTRAP;
set_current_state(TASK_STOPPED);
......
......@@ -241,18 +241,18 @@ get_cpuinfo (char *buffer)
sprintf(cp, " 0x%lx", mask);
p += sprintf(p,
"CPU# %lu\n"
"\tvendor : %s\n"
"\tfamily : %s\n"
"\tmodel : %s\n"
"\trevision : %u\n"
"\tarchrev : %u\n"
"\tfeatures :%s\n" /* don't change this---it _is_ right! */
"\tcpu number : %lu\n"
"\tcpu regs : %u\n"
"\tcpu MHz : %lu.%06lu\n"
"\titc MHz : %lu.%06lu\n"
"\tBogoMIPS : %lu.%02lu\n\n",
"processor : %lu\n"
"vendor : %s\n"
"family : %s\n"
"model : %s\n"
"revision : %u\n"
"archrev : %u\n"
"features :%s\n" /* don't change this---it _is_ right! */
"cpu number : %lu\n"
"cpu regs : %u\n"
"cpu MHz : %lu.%06lu\n"
"itc MHz : %lu.%06lu\n"
"BogoMIPS : %lu.%02lu\n\n",
c - cpu_data, c->vendor, family, model, c->revision, c->archrev,
features,
c->ppn, c->number, c->proc_freq / 1000000, c->proc_freq % 1000000,
......
......@@ -218,7 +218,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
* be corrupted.
*/
retval = (long) &ia64_leave_kernel;
if (current->flags & PF_TRACESYS)
if (current->ptrace & PT_TRACESYS)
/*
* strace expects to be notified after sigreturn
* returns even though the context to which we return
......@@ -492,7 +492,7 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
if (!signr)
break;
if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
/* Let the debugger run. */
current->exit_code = signr;
current->thread.siginfo = &info;
......@@ -570,7 +570,6 @@ ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall)
/* FALLTHRU */
default:
lock_kernel();
sigaddset(&current->signal, signr);
recalc_sigpending(current);
current->flags |= PF_SIGNALED;
......
......@@ -183,7 +183,7 @@ handle_IPI(int irq, void *dev_id, struct pt_regs *regs)
int wait;
/* release the 'pointer lock' */
data = smp_call_function_data;
data = (struct smp_call_struct *) smp_call_function_data;
func = data->func;
info = data->info;
wait = data->wait;
......@@ -536,7 +536,7 @@ fork_by_hand(void)
* Don't care about the usp and regs settings since we'll never
* reschedule the forked task.
*/
return do_fork(CLONE_VM|CLONE_PID, 0, 0);
return do_fork(CLONE_VM|CLONE_PID, 0, 0, 0);
}
/*
......
......@@ -95,7 +95,6 @@ sys_pipe (long arg0, long arg1, long arg2, long arg3,
static inline unsigned long
do_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, unsigned long pgoff)
{
long start_low, end_low, starting_region, ending_region;
unsigned long loff, hoff;
struct file *file = 0;
/* the virtual address space that is mappable in each region: */
......@@ -109,17 +108,15 @@ do_mmap2 (unsigned long addr, unsigned long len, int prot, int flags, int fd, un
return addr;
/* Don't permit mappings into or across the address hole in a region: */
loff = REGION_OFFSET(addr);
hoff = loff - (REGION_SIZE - OCTANT_SIZE/2);
loff = rgn_offset(addr);
hoff = loff - (RGN_SIZE - OCTANT_SIZE/2);
if ((len | loff | (loff + len)) >= OCTANT_SIZE/2
&& (len | hoff | (hoff + len)) >= OCTANT_SIZE/2)
return -EINVAL;
/* Don't permit mappings that would cross a region boundary: */
starting_region = REGION_NUMBER(addr);
ending_region = REGION_NUMBER(addr + len);
if (starting_region != ending_region)
if (rgn_index(addr) != rgn_index(addr + len))
return -EINVAL;
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
......
......@@ -24,7 +24,7 @@
#include <asm/system.h>
extern rwlock_t xtime_lock;
extern volatile unsigned long lost_ticks;
extern unsigned long wall_jiffies;
#ifdef CONFIG_IA64_DEBUG_IRQ
......@@ -80,7 +80,7 @@ gettimeoffset (void)
return 0;
#else
unsigned long now = ia64_get_itc(), last_tick;
unsigned long elapsed_cycles, lost = lost_ticks;
unsigned long elapsed_cycles, lost = jiffies - wall_jiffies;
last_tick = (itm.next[smp_processor_id()].count - (lost+1)*itm.delta);
# if 1
......@@ -101,13 +101,15 @@ do_settimeofday (struct timeval *tv)
write_lock_irq(&xtime_lock);
{
/*
* This is revolting. We need to set the xtime.tv_usec
* This is revolting. We need to set "xtime"
* correctly. However, the value in this location is
* is value at the last tick. Discover what
* correction gettimeofday would have done, and then
* undo it!
* the value at the most recent update of wall time.
* Discover what correction gettimeofday would have
* done, and then undo it!
*/
tv->tv_usec -= gettimeoffset();
tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
while (tv->tv_usec < 0) {
tv->tv_usec += 1000000;
tv->tv_sec--;
......
......@@ -1428,9 +1428,15 @@ ia64_handle_unaligned(unsigned long ifa, struct pt_regs *regs)
if (unalign_count > 5 && jiffies - last_time > 5*HZ)
unalign_count = 0;
if (++unalign_count < 5) {
char buf[200]; /* comm[] is at most 16 bytes... */
size_t len;
last_time = jiffies;
printk("%s(%d): unaligned trap accessing %016lx (ip=%016lx)\n",
current->comm, current->pid, ifa, regs->cr_iip + ipsr->ri);
len = sprintf(buf, "%s(%d): unaligned access to 0x%016lx, ip=0x%016lx\n\r",
current->comm, current->pid, ifa, regs->cr_iip + ipsr->ri);
tty_write_message(current->tty, buf);
buf[len-1] = '\0'; /* drop '\r' */
printk("%s", buf); /* guard against command names containing %s!! */
}
}
......
......@@ -66,9 +66,12 @@
#define UNW_STATS 0 /* WARNING: this disabled interrupts for long time-spans!! */
#if UNW_DEBUG
static long unw_debug_level = 1;
# define debug(level,format...) if (unw_debug_level > level) printk(format)
# define dprintk(format...) printk(format)
# define inline
#else
# define debug(level,format...)
# define dprintk(format...)
#endif
......@@ -1600,11 +1603,10 @@ find_save_locs (struct unw_frame_info *info)
int have_write_lock = 0;
struct unw_script *scr;
if ((info->ip & (my_cpu_data.unimpl_va_mask | 0xf))
|| REGION_NUMBER(info->ip) != REGION_KERNEL)
if ((info->ip & (my_cpu_data.unimpl_va_mask | 0xf)) || rgn_index(info->ip) != RGN_KERNEL)
{
/* don't let obviously bad addresses pollute the cache */
dprintk("unwind: rejecting bad ip=0x%lx\n", info->ip);
debug(1, "unwind: rejecting bad ip=0x%lx\n", info->ip);
info->rp = 0;
return -1;
}
......@@ -1647,7 +1649,7 @@ unw_unwind (struct unw_frame_info *info)
/* restore the ip */
if (!info->rp) {
dprintk("unwind: failed to locate return link (ip=0x%lx)!\n", info->ip);
debug(1, "unwind: failed to locate return link (ip=0x%lx)!\n", info->ip);
STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
return -1;
}
......@@ -1657,7 +1659,7 @@ unw_unwind (struct unw_frame_info *info)
* We don't have unwind info for the gate page, so we consider that part
* of user-space for the purpose of unwinding.
*/
dprintk("unwind: reached user-space (ip=0x%lx)\n", ip);
debug(1, "unwind: reached user-space (ip=0x%lx)\n", ip);
STAT(unw.stat.api.unwind_time += ia64_get_itc() - start; local_irq_restore(flags));
return -1;
}
......
......@@ -7,40 +7,26 @@
L_TARGET = lib.a
L_OBJS = __divdi3.o __divsi3.o __udivdi3.o __udivsi3.o \
__moddi3.o __modsi3.o __umoddi3.o __umodsi3.o \
checksum.o clear_page.o csum_partial_copy.o copy_page.o \
copy_user.o clear_user.o memset.o strncpy_from_user.o \
strlen.o strlen_user.o strnlen_user.o \
L_OBJS = __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o \
checksum.o clear_page.o csum_partial_copy.o copy_page.o \
copy_user.o clear_user.o memcpy.o memset.o strncpy_from_user.o \
strlen.o strlen_user.o strnlen_user.o \
flush.o do_csum.o
LX_OBJS = io.o
IGNORE_FLAGS_OBJS = __divdi3.o __divsi3.o __udivdi3.o __udivsi3.o \
__moddi3.o __modsi3.o __umoddi3.o __umodsi3.o
IGNORE_FLAGS_OBJS = __divdi3.o __udivdi3.o __moddi3.o __umoddi3.o
include $(TOPDIR)/Rules.make
__divdi3.o: idiv.S
$(CC) $(AFLAGS) -c -o $@ $<
__divsi3.o: idiv.S
$(CC) $(AFLAGS) -c -DSINGLE -c -o $@ $<
__udivdi3.o: idiv.S
$(CC) $(AFLAGS) -c -DUNSIGNED -c -o $@ $<
__udivsi3.o: idiv.S
$(CC) $(AFLAGS) -c -DUNSIGNED -DSINGLE -c -o $@ $<
__moddi3.o: idiv.S
$(CC) $(AFLAGS) -c -DMODULO -c -o $@ $<
__modsi3.o: idiv.S
$(CC) $(AFLAGS) -c -DMODULO -DSINGLE -c -o $@ $<
__umoddi3.o: idiv.S
$(CC) $(AFLAGS) -c -DMODULO -DUNSIGNED -c -o $@ $<
__umodsi3.o: idiv.S
$(CC) $(AFLAGS) -c -DMODULO -DUNSIGNED -DSINGLE -c -o $@ $<
......@@ -116,7 +116,7 @@ GLOBAL_ENTRY(__copy_user)
cmp.lt p10,p7=COPY_BREAK,len // if len > COPY_BREAK then long copy
xor tmp=src,dst // same alignment test prepare
(p10) br.cond.dptk.few long_memcpy
(p10) br.cond.dptk.few long_copy_user
;; // RAW pr.rot/p16 ?
//
// Now we do the byte by byte loop with software pipeline
......@@ -136,7 +136,7 @@ GLOBAL_ENTRY(__copy_user)
//
// Beginning of long mempcy (i.e. > 16 bytes)
//
long_memcpy:
long_copy_user:
tbit.nz p6,p7=src1,0 // odd alignement
and tmp=7,tmp
;;
......
/*
* Integer division routine.
*
* 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>
*/
/* Simple integer division. It uses the straight forward division
algorithm. This may not be the absolutely fastest way to do it,
but it's not horrible either. According to ski, the worst case
scenario of dividing 0xffffffffffffffff by 1 takes 133 cycles.
An alternative would be to use an algorithm similar to the
floating point division algorithm (Newton-Raphson iteration),
but that approach is rather tricky (one has to be very careful
to get the last bit right...).
While this algorithm is straight-forward, it does use a couple
of neat ia-64 specific tricks:
- it uses the floating point unit to determine the initial
shift amount (shift = floor(ld(x)) - floor(ld(y)))
- it uses predication to avoid a branch in the case where
x < y (this is what p8 is used for)
- it uses rotating registers and the br.ctop branch to
implement a software-pipelined loop that's unrolled
twice (without any code expansion!)
- the code is relatively well scheduled to avoid unnecessary
nops while maximizing parallelism
*/
#include <asm/asmmacro.h>
#include <asm/break.h>
.text
.psr abi64
#ifdef __BIG_ENDIAN__
.psr msb
.msb
#else
.psr lsb
.lsb
#endif
/*
* Compute a 64-bit unsigned integer quotient.
*
* Use reciprocal approximation and Newton-Raphson iteration to compute the
* quotient. frcpa gives 8.6 significant bits, so we need 3 iterations
* to get more than the 64 bits of precision that we need for DImode.
*
* Must use max precision for the reciprocal computations to get 64 bits of
* precision.
*
* r32 holds the dividend. r33 holds the divisor.
*/
#ifdef MODULO
# define OP mod
# define Q r9
# define R r8
#else
# define OP div
# define Q r8
# define R r9
#endif
#ifdef SINGLE
# define PREC si
#else
# define PREC di
# define OP div
#endif
#ifdef UNSIGNED
# define SGN u
# define INT_TO_FP(a,b) fma.s0 a=b,f1,f0
# define FP_TO_INT(a,b) fcvt.fxu.trunc.s0 a=b
# define SGN u
# define INT_TO_FP(a,b) fcvt.xuf.s1 a=b
# define FP_TO_INT(a,b) fcvt.fxu.trunc.s1 a=b
#else
# define SGN
# define INT_TO_FP(a,b) fcvt.xf a=b
# define FP_TO_INT(a,b) fcvt.fx.trunc.s0 a=b
# define FP_TO_INT(a,b) fcvt.fx.trunc.s1 a=b
#endif
#define PASTE1(a,b) a##b
#define PASTE(a,b) PASTE1(a,b)
#define NAME PASTE(PASTE(__,SGN),PASTE(OP,PASTE(PREC,3)))
#define NAME PASTE(PASTE(__,SGN),PASTE(OP,di3))
GLOBAL_ENTRY(NAME)
UNW(.prologue)
alloc r2=ar.pfs,2,6,0,8
UNW(.save pr, r18)
mov r18=pr
#ifdef SINGLE
# ifdef UNSIGNED
zxt4 in0=in0
zxt4 in1=in1
# else
sxt4 in0=in0
sxt4 in1=in1
# endif
;;
#endif
#ifndef UNSIGNED
cmp.lt p6,p0=in0,r0 // x negative?
cmp.lt p7,p0=in1,r0 // y negative?
.regstk 2,0,0,0
// Transfer inputs to FP registers.
setf.sig f8 = in0
setf.sig f9 = in1
UNW(.fframe 16)
UNW(.save.f 0x20)
stf.spill [sp] = f17,-16
// Convert the inputs to FP, to avoid FP software-assist faults.
INT_TO_FP(f8, f8)
;;
(p6) sub in0=r0,in0 // make x positive
(p7) sub in1=r0,in1 // ditto for y
;;
#endif
setf.sig f8=in0
UNW(.save ar.lc, r3)
UNW(.save.f 0x10)
stf.spill [sp] = f16
UNW(.body)
mov r3=ar.lc // save ar.lc
setf.sig f9=in1
INT_TO_FP(f9, f9)
;;
mov Q=0 // initialize q
mov R=in0 // stash away x in a static register
mov r16=1 // r16 = 1
INT_TO_FP(f8,f8)
cmp.eq p8,p0=0,in0 // x==0?
cmp.eq p9,p0=0,in1 // y==0?
frcpa.s1 f17, p6 = f8, f9 // y = frcpa(b)
;;
INT_TO_FP(f9,f9)
(p8) br.dpnt.few .L3
(p9) break __IA64_BREAK_KDB // attempted division by zero (should never happen)
mov ar.ec=r0 // epilogue count = 0
/*
* This is the magic algorithm described in Section 8.6.2 of "IA-64
* and Elementary Functions" by Peter Markstein; HP Professional Books
* (http://www.hp.com/go/retailbooks/)
*/
(p6) fmpy.s1 f7 = f8, f17 // q = a*y
(p6) fnma.s1 f6 = f9, f17, f1 // e = -b*y + 1
;;
getf.exp r14=f8 // r14 = exponent of x
getf.exp r15=f9 // r15 = exponent of y
mov ar.lc=r0 // loop count = 0
(p6) fma.s1 f16 = f7, f6, f7 // q1 = q*e + q
(p6) fmpy.s1 f7 = f6, f6 // e1 = e*e
;;
sub r17=r14,r15 // r17 = (exp of x - exp y) = shift amount
cmp.ge p8,p0=r14,r15
(p6) fma.s1 f16 = f16, f7, f16 // q2 = q1*e1 + q1
(p6) fma.s1 f6 = f17, f6, f17 // y1 = y*e + y
;;
.rotr y[2], mask[2] // in0 and in1 may no longer be valid after
// the first write to a rotating register!
(p8) shl y[1]=in1,r17 // y[1] = y<<shift
(p8) shl mask[1]=r16,r17 // mask[1] = 1<<shift
(p8) mov ar.lc=r17 // loop count = r17
(p6) fma.s1 f6 = f6, f7, f6 // y2 = y1*e1 + y1
(p6) fnma.s1 f7 = f9, f16, f8 // r = -b*q2 + a
;;
.L1:
(p8) cmp.geu.unc p9,p0=R,y[1]// p9 = (x >= y[1])
(p8) shr.u mask[0]=mask[1],1 // prepare mask[0] and y[0] for next
(p8) shr.u y[0]=y[1],1 // iteration
(p6) fma.s1 f17 = f7, f6, f16 // q3 = r*y2 + q2
;;
(p9) sub R=R,y[1] // if (x >= y[1]), subtract y[1] from x
(p9) add Q=Q,mask[1] // and set corresponding bit in q (Q)
br.ctop.dptk.few .L1 // repeated unless ar.lc-- == 0
#ifdef MODULO
FP_TO_INT(f17, f17) // round quotient to an unsigned integer
;;
INT_TO_FP(f17, f17) // renormalize
;;
.L2:
#ifndef UNSIGNED
# ifdef MODULO
(p6) sub R=r0,R // set sign of remainder according to x
# else
(p6) sub Q=r0,Q // set sign of quotient
fnma.s1 f17 = f17, f9, f8 // compute remainder
;;
(p7) sub Q=r0,Q
# endif
#endif
.L3:
mov ar.pfs=r2 // restore ar.pfs
mov ar.lc=r3 // restore ar.lc
mov pr=r18,0xffffffffffff0000 // restore p16-p63
br.ret.sptk.few rp
UNW(.restore sp)
ldf.fill f16 = [sp], 16
FP_TO_INT(f8, f17) // round result to an (unsigned) integer
;;
ldf.fill f17 = [sp]
getf.sig r8 = f8 // transfer result to result register
br.ret.sptk rp
END(NAME)
#include <asm/asmmacro.h>
GLOBAL_ENTRY(bcopy)
.regstk 3,0,0,0
mov r8=in0
mov in0=in1
;;
mov in1=r8
END(bcopy)
// FALL THROUGH
GLOBAL_ENTRY(memcpy)
# define MEM_LAT 4
# define N MEM_LAT-1
# define Nrot ((MEM_LAT + 7) & ~7)
# define dst r2
# define src r3
# define len r9
# define saved_pfs r10
# define saved_lc r11
# define saved_pr r16
# define t0 r17
# define cnt r18
UNW(.prologue)
UNW(.save ar.pfs, saved_pfs)
alloc saved_pfs=ar.pfs,3,Nrot,0,Nrot
lfetch [in1]
.rotr val[MEM_LAT]
.rotp p[MEM_LAT]
UNW(.save ar.lc, saved_lc)
mov saved_lc=ar.lc
or t0=in0,in1
UNW(.save pr, saved_pr)
mov saved_pr=pr
UNW(.body)
mov ar.ec=MEM_LAT
mov r8=in0 // return dst
shr cnt=in2,3 // number of 8-byte words to copy
mov pr.rot=1<<16
;;
cmp.eq p6,p0=in2,r0 // zero length?
or t0=t0,in2
(p6) br.ret.spnt.many rp // yes, return immediately
mov dst=in0 // copy because of rotation
mov src=in1 // copy because of rotation
adds cnt=-1,cnt // br.ctop is repeat/until
;;
and t0=0x7,t0
mov ar.lc=cnt
;;
cmp.ne p6,p0=t0,r0
(p6) br.cond.spnt.few slow_memcpy
1:
(p[0]) ld8 val[0]=[src],8
(p[N]) st8 [dst]=val[N],8
br.ctop.sptk.few 1b
;;
.exit:
mov ar.lc=saved_lc
mov pr=saved_pr,0xffffffffffff0000
mov ar.pfs=saved_pfs
br.ret.sptk.many rp
slow_memcpy:
adds cnt=-1,in2
;;
mov ar.lc=cnt
;;
1:
(p[0]) ld1 val[0]=[src],1
(p[N]) st1 [dst]=val[N],1
br.ctop.sptk.few 1b
br.sptk.few .exit
END(memcpy)
......@@ -182,7 +182,7 @@ flush_tlb_range (struct mm_struct *mm, unsigned long start, unsigned long end)
unsigned long nbits;
if (mm != current->active_mm) {
/* this doesn't happen often, if at all, so it's not worth optimizing for... */
/* this does happen, but perhaps it's not worth optimizing for? */
mm->context = 0;
return;
}
......
......@@ -11,10 +11,10 @@ clean:
fastdep: offsets.h
@if ! cmp -s offsets.h ${TARGET}; then \
echo "Updating ${TARGET}..."; \
echo -e "*** Updating ${TARGET}..."; \
cp offsets.h ${TARGET}; \
else \
echo "${TARGET} is up to date"; \
echo "*** ${TARGET} is up to date"; \
fi
#
......@@ -31,9 +31,11 @@ ifeq ($(CROSS_COMPILE),)
offsets.h: print_offsets
./print_offsets > offsets.h
print_offsets: print_offsets.c
print_offsets: print_offsets.c FORCE_RECOMPILE
$(CC) $(CFLAGS) print_offsets.c -o $@
FORCE_RECOMPILE:
else
offsets.h: print_offsets.s
......
......@@ -9,9 +9,10 @@ BEGIN {
print " */"
#
# This is a cheesy hack. Make sure that
# PF_PTRACED == 1<<PF_PTRACED_BIT.
# PT_PTRACED == 1<<PT_PTRACED_BIT.
#
print "#define PF_PTRACED_BIT 4"
print "#define PT_PTRACED_BIT 0"
print "#define PT_TRACESYS_BIT 1"
}
# look for .tab:
......
......@@ -49,7 +49,7 @@ tab[] =
{ "UNW_FRAME_INFO_SIZE", sizeof (struct unw_frame_info) },
#endif
{ "", 0 }, /* spacer */
{ "IA64_TASK_FLAGS_OFFSET", offsetof (struct task_struct, flags) },
{ "IA64_TASK_PTRACE_OFFSET", offsetof (struct task_struct, ptrace) },
{ "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) },
......@@ -175,10 +175,12 @@ main (int argc, char **argv)
"arch/ia64/tools/print_offsets.\n *\n */\n\n");
/* This is stretching things a bit, but entry.S needs the bit number
for PF_PTRACED and it can't include <linux/sched.h> so this seems
like a reasonably solution. At least the code won't break shoudl
PF_PTRACED ever change. */
printf ("#define PF_PTRACED_BIT\t\t\t%u\n\n", ffs (PF_PTRACED) - 1);
for PT_PTRACED and it can't include <linux/sched.h> so this seems
like a reasonably solution. At least the code won't break in
subtle ways should PT_PTRACED ever change. Ditto for
PT_TRACESYS_BIT. */
printf ("#define PT_PTRACED_BIT\t\t\t%u\n", ffs (PT_PTRACED) - 1);
printf ("#define PT_TRACESYS_BIT\t\t\t%u\n\n", ffs (PT_TRACESYS) - 1);
for (i = 0; i < sizeof (tab) / sizeof (tab[0]); ++i)
{
......
......@@ -125,6 +125,7 @@ SECTIONS
/DISCARD/ : {
*(.text.exit)
*(.data.exit)
*(.exitcall.exit)
}
/* Stabs debugging sections. */
......
......@@ -3422,6 +3422,9 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long param)
{
#define IOCTL_MODE_BIT 8
#define OPEN_WRITE_BIT 16
#define IOCTL_ALLOWED (filp && (filp->f_mode & IOCTL_MODE_BIT))
#define OUT(c,x) case c: outparam = (const char *) (x); break
#define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0
......@@ -3489,7 +3492,8 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return -EINVAL;
/* permission checks */
if ((cmd & 0x80) && !suser())
if (((cmd & 0x40) && !IOCTL_ALLOWED) ||
((cmd & 0x80) && !suser()))
return -EPERM;
/* copyin */
......@@ -3609,6 +3613,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return fd_copyout((void *)param, outparam, size);
else
return 0;
#undef IOCTL_ALLOWED
#undef OUT
#undef IN
}
......@@ -3761,6 +3766,12 @@ static int floppy_open(struct inode * inode, struct file * filp)
invalidate_buffers(MKDEV(FLOPPY_MAJOR,old_dev));
}
/* Allow ioctls if we have write-permissions even if read-only open */
if ((filp->f_mode & 2) || (permission(inode,2) == 0))
filp->f_mode |= IOCTL_MODE_BIT;
if (filp->f_mode & 2)
filp->f_mode |= OPEN_WRITE_BIT;
if (UFDCS->rawcmd == 1)
UFDCS->rawcmd = 2;
......
......@@ -31,6 +31,7 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/rtc.h>
#include <linux/proc_fs.h>
......
......@@ -91,6 +91,11 @@ static int __init wdt_setup(char *str)
__setup("wdt=", wdt_setup);
#endif /* !MODULE */
MODULE_PARM(io, "i");
MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
MODULE_PARM(irq, "i");
MODULE_PARM_DESC(irq, "WDT irq (default=11)");
/*
* Programming support
......
......@@ -286,7 +286,7 @@ int __init init_mtdblock(void)
if (register_blkdev(MAJOR_NR,DEVICE_NAME,&mtd_fops)) {
printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
MTD_BLOCK_MAJOR);
return EAGAIN;
return -EAGAIN;
}
/* We fill it in at open() time. */
......
......@@ -379,7 +379,7 @@ mod_init_t init_mtdchar(void)
if (register_chrdev(MTD_CHAR_MAJOR,"mtd",&mtd_fops)) {
printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
MTD_CHAR_MAJOR);
return EAGAIN;
return -EAGAIN;
}
return 0;
......
This diff is collapsed.
......@@ -185,6 +185,11 @@ static int eth_change_mtu(struct net_device *dev, int new_mtu)
#ifdef CONFIG_FDDI
struct net_device *init_fddidev(struct net_device *dev, int sizeof_priv)
{
return init_netdev(dev, sizeof_priv, "fddi%d", fddi_setup);
}
static int fddi_change_mtu(struct net_device *dev, int new_mtu)
{
if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN))
......
......@@ -130,7 +130,7 @@ int __init stnic_probe(void)
printk (" unable to get IRQ %d.\n", dev->irq);
kfree(dev->priv);
dev->priv = NULL;
return EAGAIN;
return -EAGAIN;
}
ei_status.name = "eth0";
......
#
# PCMCIA bus subsystem configuration
#
# Right now the non-CardBus choices are not supported
# by the integrated kernel driver.
#
mainmenu_option next_comment
comment 'PCMCIA/CardBus support'
tristate 'PCMCIA/CardBus support' CONFIG_PCMCIA
if [ "$CONFIG_PCMCIA" != "n" ]; then
if [ "$CONFIG_PCI" != "n" ]; then
bool ' CardBus support' CONFIG_CARDBUS
fi
bool ' i82365 compatible bridge support' CONFIG_I82365
bool ' Databook TCIC host bridge support' CONFIG_TCIC
dep_tristate 'CardBus support' CONFIG_PCMCIA $CONFIG_PCI
if [ "$CONFIG_CARDBUS" != "n" ]; then
define_bool CONFIG_CARDBUS y
fi
#tristate 'PCMCIA/CardBus support' CONFIG_PCMCIA
#if [ "$CONFIG_PCMCIA" != "n" ]; then
# if [ "$CONFIG_PCI" != "n" ]; then
# bool ' CardBus support' CONFIG_CARDBUS
# fi
# bool ' i82365 compatible bridge support' CONFIG_I82365
# bool ' Databook TCIC host bridge support' CONFIG_TCIC
#fi
endmenu
......@@ -106,10 +106,10 @@ MODULE_DESCRIPTION("Linux PCMCIA Card Services " CS_RELEASE
INT_MODULE_PARM(setup_delay, HZ/20); /* ticks */
INT_MODULE_PARM(resume_delay, HZ/5); /* ticks */
INT_MODULE_PARM(shutdown_delay, HZ/40); /* ticks */
INT_MODULE_PARM(vcc_settle, HZ*4/10); /* ticks */
INT_MODULE_PARM(vcc_settle, 400); /* msecs */
INT_MODULE_PARM(reset_time, 10); /* usecs */
INT_MODULE_PARM(unreset_delay, HZ/10); /* ticks */
INT_MODULE_PARM(unreset_check, HZ/10); /* ticks */
INT_MODULE_PARM(unreset_delay, 100); /* msecs */
INT_MODULE_PARM(unreset_check, 100); /* msecs */
INT_MODULE_PARM(unreset_limit, 30); /* unreset_check's */
/* Access speed for attribute memory windows */
......@@ -303,10 +303,10 @@ static int proc_read_clients(char *buf, char **start, off_t pos,
======================================================================*/
static void setup_socket(u_long i);
static void shutdown_socket(u_long i);
static void reset_socket(u_long i);
static void unreset_socket(u_long i);
static void setup_socket(socket_info_t *);
static void shutdown_socket(socket_info_t *);
static void reset_socket(socket_info_t *);
static void unreset_socket(socket_info_t *);
static void parse_events(void *info, u_int events);
socket_info_t *pcmcia_register_socket (int slot,
......@@ -323,10 +323,7 @@ socket_info_t *pcmcia_register_socket (int slot,
s->ss_entry = ss_entry;
s->sock = slot;
s->setup.data = sockets;
s->setup.function = &setup_socket;
s->shutdown.data = sockets;
s->shutdown.function = &shutdown_socket;
/* base address = 0, map = 0 */
s->cis_mem.flags = 0;
s->cis_mem.speed = cis_speed;
......@@ -397,7 +394,7 @@ void pcmcia_unregister_socket(socket_info_t *s)
}
#endif
shutdown_socket(socket);
shutdown_socket(s);
release_cis_mem(s);
while (s->clients) {
client = s->clients;
......@@ -449,12 +446,17 @@ static void free_regions(memory_handle_t *list)
static int send_event(socket_info_t *s, event_t event, int priority);
static void shutdown_socket(u_long i)
static void msleep(unsigned int msec)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout( (msec * HZ + 999) / 1000);
}
static void shutdown_socket(socket_info_t *s)
{
socket_info_t *s = socket_table[i];
client_t **c;
DEBUG(1, "cs: shutdown_socket(%ld)\n", i);
DEBUG(1, "cs: shutdown_socket(%p)\n", s);
/* Blank out the socket state */
s->state &= SOCKET_PRESENT|SOCKET_SETUP_PENDING;
......@@ -488,47 +490,49 @@ static void shutdown_socket(u_long i)
free_regions(&s->c_region);
} /* shutdown_socket */
static void setup_socket(u_long i)
static void setup_socket(socket_info_t *s)
{
int val;
socket_info_t *s = socket_table[i];
get_socket_status(s, &val);
if (val & SS_PENDING) {
/* Does the socket need more time? */
DEBUG(2, "cs: setup_socket(%ld): status pending\n", i);
if (++s->setup_timeout > 100) {
printk(KERN_NOTICE "cs: socket %ld voltage interrogation"
" timed out\n", i);
} else {
s->setup.expires = jiffies + HZ/10;
add_timer(&s->setup);
}
} else if (val & SS_DETECT) {
DEBUG(1, "cs: setup_socket(%ld): applying power\n", i);
s->state |= SOCKET_PRESENT;
s->socket.flags = 0;
if (val & SS_3VCARD)
s->socket.Vcc = s->socket.Vpp = 33;
else if (!(val & SS_XVCARD))
s->socket.Vcc = s->socket.Vpp = 50;
else {
printk(KERN_NOTICE "cs: socket %ld: unsupported "
"voltage key\n", i);
s->socket.Vcc = 0;
int val;
int setup_timeout = 100;
/* Wait for "not pending" */
for (;;) {
get_socket_status(s, &val);
if (!(val & SS_PENDING))
break;
if (--setup_timeout) {
msleep(100);
continue;
}
printk(KERN_NOTICE "cs: socket %p voltage interrogation"
" timed out\n", s);
return;
}
if (val & SS_CARDBUS) {
s->state |= SOCKET_CARDBUS;
if (val & SS_DETECT) {
DEBUG(1, "cs: setup_socket(%p): applying power\n", s);
s->state |= SOCKET_PRESENT;
s->socket.flags = 0;
if (val & SS_3VCARD)
s->socket.Vcc = s->socket.Vpp = 33;
else if (!(val & SS_XVCARD))
s->socket.Vcc = s->socket.Vpp = 50;
else {
printk(KERN_NOTICE "cs: socket %p: unsupported "
"voltage key\n", s);
s->socket.Vcc = 0;
}
if (val & SS_CARDBUS) {
s->state |= SOCKET_CARDBUS;
#ifndef CONFIG_CARDBUS
printk(KERN_NOTICE "cs: unsupported card type detected!\n");
printk(KERN_NOTICE "cs: unsupported card type detected!\n");
#endif
}
set_socket(s, &s->socket);
s->setup.function = &reset_socket;
s->setup.expires = jiffies + vcc_settle;
add_timer(&s->setup);
} else
DEBUG(0, "cs: setup_socket(%ld): no card!\n", i);
}
set_socket(s, &s->socket);
msleep(vcc_settle);
reset_socket(s);
} else
DEBUG(0, "cs: setup_socket(%p): no card!\n", s);
} /* setup_socket */
/*======================================================================
......@@ -540,33 +544,43 @@ static void setup_socket(u_long i)
======================================================================*/
static void reset_socket(u_long i)
static void reset_socket(socket_info_t *s)
{
socket_info_t *s = socket_table[i];
DEBUG(1, "cs: resetting socket %ld\n", i);
DEBUG(1, "cs: resetting socket %p\n", s);
s->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
set_socket(s, &s->socket);
udelay((long)reset_time);
s->socket.flags &= ~SS_RESET;
set_socket(s, &s->socket);
s->setup_timeout = 0;
s->setup.expires = jiffies + unreset_delay;
s->setup.function = &unreset_socket;
add_timer(&s->setup);
msleep(unreset_delay);
unreset_socket(s);
} /* reset_socket */
#define EVENT_MASK \
(SOCKET_SETUP_PENDING|SOCKET_SUSPEND|SOCKET_RESET_PENDING)
static void unreset_socket(u_long i)
static void unreset_socket(socket_info_t *s)
{
socket_info_t *s = socket_table[i];
int val;
int setup_timeout = unreset_limit;
int val;
/* Wait for "ready" */
for (;;) {
get_socket_status(s, &val);
if (val & SS_READY)
break;
DEBUG(2, "cs: socket %ld not ready yet\n", i);
if (--setup_timeout) {
msleep(unreset_check);
continue;
}
printk(KERN_NOTICE "cs: socket %p timed out during"
" reset\n", s);
s->state &= ~EVENT_MASK;
return;
}
get_socket_status(s, &val);
if (val & SS_READY) {
DEBUG(1, "cs: reset done on socket %ld\n", i);
DEBUG(1, "cs: reset done on socket %p\n", s);
if (s->state & SOCKET_SUSPEND) {
s->state &= ~EVENT_MASK;
if (verify_cis_cache(s) != 0)
......@@ -587,17 +601,6 @@ static void unreset_socket(u_long i)
CS_EVENT_PRI_LOW);
s->state &= ~EVENT_MASK;
}
} else {
DEBUG(2, "cs: socket %ld not ready yet\n", i);
if (++s->setup_timeout > unreset_limit) {
printk(KERN_NOTICE "cs: socket %ld timed out during"
" reset\n", i);
s->state &= ~EVENT_MASK;
} else {
s->setup.expires = jiffies + unreset_check;
add_timer(&s->setup);
}
}
} /* unreset_socket */
/*======================================================================
......@@ -640,12 +643,11 @@ static void do_shutdown(socket_info_t *s)
client->state |= CLIENT_STALE;
if (s->state & (SOCKET_SETUP_PENDING|SOCKET_RESET_PENDING)) {
DEBUG(0, "cs: flushing pending setup\n");
del_timer(&s->setup);
s->state &= ~EVENT_MASK;
}
s->shutdown.expires = jiffies + shutdown_delay;
add_timer(&s->shutdown);
msleep(shutdown_delay);
s->state &= ~SOCKET_PRESENT;
shutdown_socket(s);
}
static void parse_events(void *info, u_int events)
......@@ -653,8 +655,7 @@ static void parse_events(void *info, u_int events)
socket_info_t *s = info;
if (events & SS_DETECT) {
int status;
u_long flags;
spin_lock_irqsave(&s->lock, flags);
get_socket_status(s, &status);
if ((s->state & SOCKET_PRESENT) &&
(!(s->state & SOCKET_SUSPEND) ||
......@@ -662,19 +663,16 @@ static void parse_events(void *info, u_int events)
do_shutdown(s);
if (status & SS_DETECT) {
if (s->state & SOCKET_SETUP_PENDING) {
del_timer(&s->setup);
DEBUG(1, "cs: delaying pending setup\n");
return;
}
s->state |= SOCKET_SETUP_PENDING;
s->setup.function = &setup_socket;
s->setup_timeout = 0;
if (s->state & SOCKET_SUSPEND)
s->setup.expires = jiffies + resume_delay;
msleep(resume_delay);
else
s->setup.expires = jiffies + setup_delay;
add_timer(&s->setup);
msleep(setup_delay);
setup_socket(s);
}
spin_unlock_irqrestore(&s->lock, flags);
}
if (events & SS_BATDEAD)
send_event(s, CS_EVENT_BATTERY_DEAD, CS_EVENT_PRI_LOW);
......@@ -1406,7 +1404,7 @@ int pcmcia_register_client(client_handle_t *handle, client_reg_t *req)
if ((status & SS_DETECT) &&
!(s->state & SOCKET_SETUP_PENDING)) {
s->state |= SOCKET_SETUP_PENDING;
setup_socket(ns);
setup_socket(s);
}
}
......@@ -1991,7 +1989,7 @@ int pcmcia_reset_card(client_handle_t handle, client_req_t *req)
DEBUG(1, "cs: resetting socket %d\n", i);
send_event(s, CS_EVENT_RESET_PHYSICAL, CS_EVENT_PRI_LOW);
s->reset_handle = handle;
reset_socket(i);
reset_socket(s);
}
return CS_SUCCESS;
} /* reset_card */
......@@ -2038,7 +2036,7 @@ int pcmcia_resume_card(client_handle_t handle, client_req_t *req)
return CS_IN_USE;
DEBUG(1, "cs: waking up socket %d\n", i);
setup_socket(i);
setup_socket(s);
return CS_SUCCESS;
} /* resume_card */
......@@ -2095,7 +2093,7 @@ int pcmcia_insert_card(client_handle_t handle, client_req_t *req)
spin_unlock_irqrestore(&s->lock, flags);
get_socket_status(s, &status);
if (status & SS_DETECT)
setup_socket(i);
setup_socket(s);
else {
s->state &= ~SOCKET_SETUP_PENDING;
return CS_NO_CARD;
......
......@@ -130,8 +130,6 @@ typedef struct socket_info_t {
client_handle_t clients;
u_int real_clients;
client_handle_t reset_handle;
struct timer_list setup, shutdown;
u_long setup_timeout;
pccard_mem_map cis_mem;
u_char *cis_virt;
config_t *config;
......
......@@ -196,7 +196,7 @@ cardbus_probe (struct pci_dev *dev, const struct pci_device_id *id)
return 0;
}
}
return -1;
return -ENODEV;
}
static void __devexit cardbus_remove (struct pci_dev *dev)
......@@ -222,7 +222,7 @@ static void cardbus_resume (struct pci_dev *dev)
}
static struct pci_device_id cardbus_table [] = { {
static struct pci_device_id cardbus_table [] __devinitdata = { {
class: PCI_CLASS_BRIDGE_CARDBUS << 8,
class_mask: ~0,
......@@ -232,6 +232,7 @@ static struct pci_device_id cardbus_table [] = { {
subdevice: PCI_ANY_ID,
}, { /* all zeroes */ }
};
MODULE_DEVICE_TABLE(pci, cardbus_table);
static struct pci_driver pci_cardbus_driver = {
name: "cardbus",
......@@ -242,12 +243,12 @@ static struct pci_driver pci_cardbus_driver = {
resume: cardbus_resume,
};
static int __devinit pci_socket_init(void)
static int __init pci_socket_init(void)
{
return pci_module_init (&pci_cardbus_driver);
}
static void __devexit pci_socket_exit (void)
static void __exit pci_socket_exit (void)
{
pci_unregister_driver (&pci_cardbus_driver);
}
......
......@@ -815,10 +815,8 @@ static int imm_completion(Scsi_Cmnd * cmd)
* Make sure that we transfer even number of bytes
* otherwise it makes imm_byte_out() messy.
*/
if (cmd->SCp.this_residual & 0x01) {
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
printk("IMM: adjusted buffer for 16 bit transfer\n");
}
}
}
/* Now check to see if the drive is ready to comunicate */
......@@ -994,10 +992,8 @@ static int imm_engine(imm_struct * tmp, Scsi_Cmnd * cmd)
}
cmd->SCp.buffers_residual = cmd->use_sg;
cmd->SCp.phase++;
if (cmd->SCp.this_residual & 0x01) {
if (cmd->SCp.this_residual & 0x01)
cmd->SCp.this_residual++;
printk("IMM: adjusted buffer for 16 bit transfer\n");
}
/* Phase 5 - Pre-Data transfer stage */
case 5:
/* Spin lock for BUSY */
......
......@@ -298,12 +298,11 @@ static unsigned char ppa_wait(int host_no)
unsigned char r;
k = PPA_SPIN_TMO;
do {
r = r_str(ppb);
k--;
udelay(1);
/* Wait for bit 6 and 7 - PJC */
for (r = r_str (ppb); ((r & 0xc0)!=0xc0) && (k); k--) {
udelay (1);
r = r_str (ppb);
}
while (!(r & 0x80) && (k));
/*
* return some status information.
......@@ -637,7 +636,6 @@ static int ppa_completion(Scsi_Cmnd * cmd)
* 1 Finished data transfer
*/
int host_no = cmd->host->unique_id;
unsigned short ppb = PPA_BASE(host_no);
unsigned long start_jiffies = jiffies;
unsigned char r, v;
......@@ -649,11 +647,7 @@ static int ppa_completion(Scsi_Cmnd * cmd)
(v == WRITE_6) ||
(v == WRITE_10));
/*
* We only get here if the drive is ready to comunicate,
* hence no need for a full ppa_wait.
*/
r = (r_str(ppb) & 0xf0);
r = ppa_wait(host_no); /* Need a ppa_wait() - PJC */
while (r != (unsigned char) 0xf0) {
/*
......@@ -691,7 +685,7 @@ static int ppa_completion(Scsi_Cmnd * cmd)
}
}
/* Now check to see if the drive is ready to comunicate */
r = (r_str(ppb) & 0xf0);
r = ppa_wait(host_no); /* need ppa_wait() - PJC */
/* If not, drop back down to the scheduler and wait a timer tick */
if (!(r & 0x80))
return 0;
......
......@@ -10,7 +10,7 @@
#ifndef _PPA_H
#define _PPA_H
#define PPA_VERSION "2.03 (for Linux 2.2.x)"
#define PPA_VERSION "2.04 (for Linux 2.2.x)"
/*
* this driver has been hacked by Matteo Frigo (athena@theory.lcs.mit.edu)
......@@ -51,6 +51,12 @@
* CONFIG_SCSI_PPA_HAVE_PEDANTIC => CONFIG_SCSI_IZIP_EPP16
* added CONFIG_SCSI_IZIP_SLOW_CTR option
* [2.03]
*
* Use ppa_wait() to check for ready AND connected status bits
* Add ppa_wait() calls to ppa_completion()
* by Peter Cherriman <pjc@ecs.soton.ac.uk> and
* Tim Waugh <twaugh@redhat.com>
* [2.04]
*/
/* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
......
......@@ -241,7 +241,7 @@ typedef struct siginfo32 {
#define IA32_PAGE_OFFSET 0xc0000000
#define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE PAGE_SIZE
#define ELF_EXEC_PAGESIZE IA32_PAGE_SIZE
/*
* This is the location that an ET_DYN program is loaded if exec'ed.
......
......@@ -15,6 +15,7 @@ extern ia64_mv_map_nr_t map_nr_dense;
#define platform_name "hpsim"
#define platform_setup hpsim_setup
#define platform_irq_init hpsim_irq_init
#define platform_pci_fixup hpsim_pci_fixup
#define platform_map_nr map_nr_dense
#endif /* _ASM_IA64_MACHVEC_HPSIM_h */
......@@ -8,20 +8,22 @@
*
*/
#define PF_PTRACED_BIT 4
#define PT_PTRACED_BIT 0
#define PT_TRACESYS_BIT 1
#define IA64_TASK_SIZE 2816 /* 0xb00 */
#define IA64_TASK_SIZE 2768 /* 0xad0 */
#define IA64_PT_REGS_SIZE 400 /* 0x190 */
#define IA64_SWITCH_STACK_SIZE 560 /* 0x230 */
#define IA64_SIGINFO_SIZE 136 /* 0x88 */
#define UNW_FRAME_INFO_SIZE 448 /* 0x1c0 */
#define IA64_TASK_FLAGS_OFFSET 8 /* 0x8 */
#define IA64_TASK_PTRACE_OFFSET 48 /* 0x30 */
#define IA64_TASK_SIGPENDING_OFFSET 16 /* 0x10 */
#define IA64_TASK_NEED_RESCHED_OFFSET 40 /* 0x28 */
#define IA64_TASK_PROCESSOR_OFFSET 108 /* 0x6c */
#define IA64_TASK_THREAD_OFFSET 928 /* 0x3a0 */
#define IA64_TASK_THREAD_KSP_OFFSET 928 /* 0x3a0 */
#define IA64_TASK_THREAD_SIGMASK_OFFSET 2656 /* 0xa60 */
#define IA64_TASK_PROCESSOR_OFFSET 100 /* 0x64 */
#define IA64_TASK_THREAD_OFFSET 896 /* 0x380 */
#define IA64_TASK_THREAD_KSP_OFFSET 896 /* 0x380 */
#define IA64_TASK_THREAD_SIGMASK_OFFSET 2648 /* 0xa58 */
#define IA64_TASK_PID_OFFSET 188 /* 0xbc */
#define IA64_TASK_MM_OFFSET 88 /* 0x58 */
#define IA64_PT_REGS_CR_IPSR_OFFSET 0 /* 0x0 */
......
......@@ -111,6 +111,7 @@
#include <asm/bitops.h>
#include <asm/mmu_context.h>
#include <asm/processor.h>
#include <asm/system.h>
/*
......@@ -305,6 +306,21 @@ rgn_index (unsigned long address)
return a.f.reg;
}
/*
* Return the region offset for virtual address ADDRESS.
*/
extern __inline__ unsigned long
rgn_offset (unsigned long address)
{
ia64_va a;
a.l = address;
return a.f.off;
}
#define RGN_SIZE (1UL << 61)
#define RGN_KERNEL 7
extern __inline__ unsigned long
pgd_index (unsigned long address)
{
......
......@@ -5,14 +5,17 @@
* Here is where we want to put optimized versions of the string
* routines.
*
* Copyright (C) 1998, 1999 Hewlett-Packard Co
* Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998-2000 Hewlett-Packard Co
* Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#define __HAVE_ARCH_STRLEN 1 /* see arch/ia64/lib/strlen.S */
#define __HAVE_ARCH_MEMSET 1 /* see arch/ia64/lib/memset.S */
#define __HAVE_ARCH_MEMCPY 1 /* see arch/ia64/lib/memcpy.S */
#define __HAVE_ARCH_BCOPY 1 /* see arch/ia64/lib/memcpy.S */
extern __kernel_size_t strlen (const char *);
extern void *memset (void *,int,__kernel_size_t);
extern void *memset (void *, int, __kernel_size_t);
extern void *memcpy (void *, const void *, __kernel_size_t);
#endif /* _ASM_IA64_STRING_H */
......@@ -4,8 +4,8 @@
/*
* IA-64 Linux syscall numbers and inline-functions.
*
* Copyright (C) 1998, 1999 Hewlett-Packard Co
* Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998-2000 Hewlett-Packard Co
* Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <asm/break.h>
......@@ -202,6 +202,7 @@
#define __NR_stat 1210
#define __NR_lstat 1211
#define __NR_fstat 1212
#define __NR_clone2 1213
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
......
......@@ -34,6 +34,7 @@ extern int fddi_header(struct sk_buff *skb,
extern int fddi_rebuild_header(struct sk_buff *skb);
extern unsigned short fddi_type_trans(struct sk_buff *skb,
struct net_device *dev);
extern struct net_device * init_fddidev(struct net_device *, int);
#endif
#endif /* _LINUX_FDDIDEVICE_H */
......@@ -52,8 +52,8 @@ struct vm_area_struct {
struct vm_area_struct * vm_avl_left;
struct vm_area_struct * vm_avl_right;
/* For areas with inode, the list inode->i_mmap, for shm areas,
* the list of attaches, otherwise unused.
/* For areas with inode, the list inode->i_mapping->i_mmap,
* for shm areas, the list of attaches, otherwise unused.
*/
struct vm_area_struct *vm_next_share;
struct vm_area_struct **vm_pprev_share;
......
......@@ -666,13 +666,6 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
copy_flags(clone_flags, p);
p->pid = get_pid(clone_flags);
/*
* This is a "shadow run" state. The process
* is marked runnable, but isn't actually on
* any run queue yet.. (that happens at the
* very end).
*/
p->state = TASK_RUNNING;
p->run_list.next = NULL;
p->run_list.prev = NULL;
......
......@@ -209,8 +209,11 @@ static inline int preemption_goodness(struct task_struct * prev, struct task_str
* We enter with the runqueue spinlock held, but we might end
* up unlocking it early, so the caller must not unlock the
* runqueue, it's always done by reschedule_idle().
*
* This function must be inline as anything that saves and restores
* flags has to do so within the same register window on sparc (Anton)
*/
static void reschedule_idle(struct task_struct * p, unsigned long flags)
static inline void reschedule_idle(struct task_struct * p, unsigned long flags)
{
#ifdef CONFIG_SMP
int this_cpu = smp_processor_id();
......
......@@ -69,7 +69,7 @@ int vm_enough_memory(long pages)
return free > pages;
}
/* Remove one vm structure from the inode's i_mmap ring. */
/* Remove one vm structure from the inode's i_mapping address space. */
static inline void remove_shared_vm_struct(struct vm_area_struct *vma)
{
struct file * file = vma->vm_file;
......
......@@ -464,6 +464,7 @@ EXPORT_SYMBOL(eth_type_trans);
#ifdef CONFIG_FDDI
EXPORT_SYMBOL(fddi_type_trans);
EXPORT_SYMBOL(fddi_setup);
EXPORT_SYMBOL(init_fddidev);
#endif /* CONFIG_FDDI */
#if 0
EXPORT_SYMBOL(eth_copy_and_sum);
......
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