Commit bdbd1323 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-acpi.bkbits.net/linux-acpi

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 28d35e95 32f06e37
...@@ -444,6 +444,13 @@ M: dz@debian.org ...@@ -444,6 +444,13 @@ M: dz@debian.org
W: http://www.debian.org/~dz/i8k/ W: http://www.debian.org/~dz/i8k/
S: Maintained S: Maintained
DEVICE-MAPPER
P: Joe Thornber
M: dm@uk.sistina.com
L: linux-lvm@sistina.com
W: http://www.sistina.com/lvm
S: Maintained
DEVICE NUMBER REGISTRY DEVICE NUMBER REGISTRY
P: H. Peter Anvin P: H. Peter Anvin
M: hpa@zytor.com M: hpa@zytor.com
...@@ -457,23 +464,24 @@ L: linux-kernel@vger.kernel.org ...@@ -457,23 +464,24 @@ L: linux-kernel@vger.kernel.org
S: Maintained S: Maintained
DIGI INTL. EPCA DRIVER DIGI INTL. EPCA DRIVER
P: Chad Schwartz P: Digi International, Inc
M: support@dgii.com M: Eng.Linux@digi.com
L: digilnux@dgii.com L: Eng.Linux@digi.com
W: http://www.digi.com
S: Maintained S: Maintained
DIGI RIGHTSWITCH NETWORK DRIVER DIGI RIGHTSWITCH NETWORK DRIVER
P: Rick Richardson P: Rick Richardson
L: linux-net@vger.kernel.org L: linux-net@vger.kernel.org
W: http://www.dgii.com/linux/ W: http://www.digi.com
S: Maintained S: Orphaned
DIGIBOARD PC/XE AND PC/XI DRIVER DIGIBOARD PC/XE AND PC/XI DRIVER
P: Christoph Lameter P: Christoph Lameter
M: christoph@lameter.com M: christoph@lameter.com
W: http://www.dgii.com/linux,http://lameter.com/digi W: http://www.digi.com
L: digilnux@dgii.com L: digilnux@dgii.com
S: Maintained S: Orphaned
DIRECTORY NOTIFICATION DIRECTORY NOTIFICATION
P: Stephen Rothwell P: Stephen Rothwell
...@@ -852,9 +860,8 @@ L: linux-net@vger.kernel.org ...@@ -852,9 +860,8 @@ L: linux-net@vger.kernel.org
S: Maintained S: Maintained
IRDA SUBSYSTEM IRDA SUBSYSTEM
P: Dag Brattli P: Jean Tourrilhes
M: Dag Brattli <dag@brattli.net> L: irda-users@lists.sourceforge.net
L: linux-irda@pasta.cs.uit.no
W: http://irda.sourceforge.net/ W: http://irda.sourceforge.net/
S: Maintained S: Maintained
...@@ -958,6 +965,12 @@ M: paulus@au.ibm.com ...@@ -958,6 +965,12 @@ M: paulus@au.ibm.com
W: http://www.ibm.com/linux/ltc/projects/ppc W: http://www.ibm.com/linux/ltc/projects/ppc
S: Supported S: Supported
LINUX FOR NCR VOYAGER
P: James Bottomley
M: James.Bottomley@HansenPartnership.com
W: http://www.hansenpartnership.com/voyager
S: Maintained
LINUX FOR POWERPC LINUX FOR POWERPC
P: Paul Mackerras P: Paul Mackerras
M: paulus@samba.org M: paulus@samba.org
...@@ -1896,6 +1909,24 @@ P: Jeff Garzik ...@@ -1896,6 +1909,24 @@ P: Jeff Garzik
L: linux-via@gtf.org L: linux-via@gtf.org
S: Odd fixes S: Odd fixes
UCLINUX
P: Greg Ungerer
M: gerg@snapgear.com
P: David McCullough
M: davidm@snapgear.com
P: D. Jeff Dionne (created first uClinux port)
M: jeff@uclinux.org
W: http://www.uclinux.org/
L: uclinux-dev@uclinux.org
S: Maintained
UCLINUX FOR NEC V850
P: Miles Bader
M: uclinux-v850@lsi.nec.co.jp
W: http://www.ic.nec.co.jp/micro/uclinux/eng/
W: http://www.ee.nec.de/uclinux/
S: Supported
USB DIAMOND RIO500 DRIVER USB DIAMOND RIO500 DRIVER
P: Cesar Miquel P: Cesar Miquel
M: miquel@df.uba.ar M: miquel@df.uba.ar
......
...@@ -22,6 +22,7 @@ void foo(void) ...@@ -22,6 +22,7 @@ void foo(void)
BLANK(); BLANK();
DEFINE(PT_PTRACED, PT_PTRACED); DEFINE(PT_PTRACED, PT_PTRACED);
DEFINE(CLONE_VM, CLONE_VM); DEFINE(CLONE_VM, CLONE_VM);
DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
DEFINE(SIGCHLD, SIGCHLD); DEFINE(SIGCHLD, SIGCHLD);
BLANK(); BLANK();
DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache)); DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
......
...@@ -212,7 +212,7 @@ kernel_thread: ...@@ -212,7 +212,7 @@ kernel_thread:
stq $2, 152($30) /* HAE */ stq $2, 152($30) /* HAE */
/* Shuffle FLAGS to the front; add CLONE_VM. */ /* Shuffle FLAGS to the front; add CLONE_VM. */
ldi $1, CLONE_VM ldi $1, CLONE_VM|CLONE_UNTRACED
or $18, $1, $16 or $18, $1, $16
bsr $26, sys_clone bsr $26, sys_clone
......
...@@ -383,7 +383,7 @@ sys_ptrace(long request, long pid, long addr, long data, ...@@ -383,7 +383,7 @@ sys_ptrace(long request, long pid, long addr, long data,
goto out; goto out;
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
goto out; goto out;
} }
out: out:
...@@ -400,7 +400,8 @@ syscall_trace(void) ...@@ -400,7 +400,8 @@ syscall_trace(void)
return; return;
if (!(current->ptrace & PT_PTRACED)) if (!(current->ptrace & PT_PTRACED))
return; return;
current->exit_code = SIGTRAP; current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0);
current->state = TASK_STOPPED; current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD); notify_parent(current, SIGCHLD);
schedule(); schedule();
......
...@@ -306,10 +306,7 @@ privateer_map_irq(struct pci_dev *dev, u8 slot, u8 pin) ...@@ -306,10 +306,7 @@ privateer_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{ {
u8 irq; u8 irq;
pcibios_read_config_byte(dev->bus->number, pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
dev->devfn,
PCI_INTERRUPT_LINE,
&irq);
/* is it routed through ISA? */ /* is it routed through ISA? */
if ((irq & 0xF0) == 0xE0) if ((irq & 0xF0) == 0xE0)
......
...@@ -31,18 +31,27 @@ SECTIONS ...@@ -31,18 +31,27 @@ SECTIONS
*(__ksymtab) *(__ksymtab)
__stop___ksymtab = .; __stop___ksymtab = .;
} }
/* All kernel symbols */
__kallsyms ALIGN(8) : {
__start___kallsyms = .;
*(__kallsyms)
__stop___kallsyms = .;
}
.kstrtab : { *(.kstrtab) } .kstrtab : { *(.kstrtab) }
.rodata : { *(.rodata) *(.rodata.*) }
/* Startup code */ /* Startup code */
.text.init ALIGN(8192) : { .init.text ALIGN(8192) : {
__init_begin = .; __init_begin = .;
*(.text.init) *(.init.text)
} }
.data.init : { *(.data.init) } .init.data : { *(.init.data) }
.setup.init ALIGN(16): { .init.setup ALIGN(16): {
__setup_start = .; __setup_start = .;
*(.setup.init) *(.init.setup)
__setup_end = .; __setup_end = .;
} }
...@@ -71,11 +80,11 @@ SECTIONS ...@@ -71,11 +80,11 @@ SECTIONS
} }
/* Global data */ /* Global data */
.data.cacheline_aligned : { .data.page_aligned ALIGN(8192) : {
_data = .; _data = .;
*(.data.cacheline_aligned) *(.data.page_aligned)
} }
.rodata : { *(.rodata) *(.rodata.*) } .data.cacheline_aligned : { *(.data.cacheline_aligned) }
.data : { *(.data) CONSTRUCTORS } .data : { *(.data) CONSTRUCTORS }
.got : { *(.got) } .got : { *(.got) }
.sdata : { .sdata : {
...@@ -120,5 +129,5 @@ SECTIONS ...@@ -120,5 +129,5 @@ SECTIONS
.debug_typenames 0 : { *(.debug_typenames) } .debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) } .debug_varnames 0 : { *(.debug_varnames) }
/DISCARD/ : { *(.text.exit) *(.data.exit) *(.exitcall.exit) } /DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) }
} }
...@@ -403,7 +403,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) ...@@ -403,7 +403,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
b sys_exit \n\ b sys_exit \n\
1: " 1: "
: "=r" (__ret) : "=r" (__ret)
: "Ir" (flags), "I" (CLONE_VM), "r" (fn), "r" (arg) : "Ir" (flags), "r" (CLONE_VM | CLONE_UNTRACED), "r" (fn), "r" (arg)
: "r0", "r1", "lr"); : "r0", "r1", "lr");
return __ret; return __ret;
} }
......
...@@ -692,16 +692,8 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat ...@@ -692,16 +692,8 @@ static int do_ptrace(int request, struct task_struct *child, long addr, long dat
ret = ptrace_setfpregs(child, (void *)data); ret = ptrace_setfpregs(child, (void *)data);
break; break;
case PTRACE_SETOPTIONS:
if (data & PTRACE_O_TRACESYSGOOD)
child->ptrace |= PT_TRACESYSGOOD;
else
child->ptrace &= ~PT_TRACESYSGOOD;
ret = 0;
break;
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
break; break;
} }
......
...@@ -748,6 +748,7 @@ kernel_thread: ...@@ -748,6 +748,7 @@ kernel_thread:
/* r11 is argument 2 to clone, the flags */ /* r11 is argument 2 to clone, the flags */
move.d $r12, $r11 move.d $r12, $r11
or.w LCLONE_VM, $r11 or.w LCLONE_VM, $r11
or.w LCLONE_UNTRACED, $r11
/* Save FN for later. */ /* Save FN for later. */
move.d $r10, $r12 move.d $r10, $r12
......
...@@ -57,5 +57,6 @@ OF (LTHREAD_DCCR, struct thread_struct, dccr) ...@@ -57,5 +57,6 @@ OF (LTHREAD_DCCR, struct thread_struct, dccr)
/* linux/sched.h values - doesn't have an #ifdef __ASSEMBLY__ for these. */ /* linux/sched.h values - doesn't have an #ifdef __ASSEMBLY__ for these. */
VAL (LCLONE_VM, CLONE_VM) VAL (LCLONE_VM, CLONE_VM)
VAL (LCLONE_UNTRACED, CLONE_UNTRACED)
__asm__ (".endif"); __asm__ (".endif");
...@@ -292,7 +292,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -292,7 +292,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
} }
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
break; break;
} }
out_tsk: out_tsk:
...@@ -307,10 +307,8 @@ asmlinkage void syscall_trace(void) ...@@ -307,10 +307,8 @@ asmlinkage void syscall_trace(void)
if ((current->ptrace & (PT_PTRACED | PT_TRACESYS)) != if ((current->ptrace & (PT_PTRACED | PT_TRACESYS)) !=
(PT_PTRACED | PT_TRACESYS)) (PT_PTRACED | PT_TRACESYS))
return; return;
/* TODO: make a way to distinguish between a syscall stop and SIGTRAP current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
* delivery like in the i386 port ? ? 0x80 : 0);
*/
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED; current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD); notify_parent(current, SIGCHLD);
schedule(); schedule();
......
#include <linux/init.h> #include <linux/init.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/cpu.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/processor.h> #include <asm/processor.h>
...@@ -51,9 +50,16 @@ static int __init tsc_setup(char *str) ...@@ -51,9 +50,16 @@ static int __init tsc_setup(char *str)
tsc_disable = 1; tsc_disable = 1;
return 1; return 1;
} }
#else
#define tsc_disable 0
__setup("notsc", tsc_setup); static int __init tsc_setup(char *str)
{
printk("notsc: Kernel compiled with CONFIG_X86_TSC, cannot disable TSC.\n");
return 1;
}
#endif #endif
__setup("notsc", tsc_setup);
int __init get_model_name(struct cpuinfo_x86 *c) int __init get_model_name(struct cpuinfo_x86 *c)
{ {
...@@ -304,10 +310,8 @@ void __init identify_cpu(struct cpuinfo_x86 *c) ...@@ -304,10 +310,8 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
*/ */
/* TSC disabled? */ /* TSC disabled? */
#ifndef CONFIG_X86_TSC
if ( tsc_disable ) if ( tsc_disable )
clear_bit(X86_FEATURE_TSC, c->x86_capability); clear_bit(X86_FEATURE_TSC, c->x86_capability);
#endif
/* FXSR disabled? */ /* FXSR disabled? */
if (disable_x86_fxsr) { if (disable_x86_fxsr) {
...@@ -443,14 +447,12 @@ void __init cpu_init (void) ...@@ -443,14 +447,12 @@ void __init cpu_init (void)
if (cpu_has_vme || cpu_has_tsc || cpu_has_de) if (cpu_has_vme || cpu_has_tsc || cpu_has_de)
clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE);
#ifndef CONFIG_X86_TSC
if (tsc_disable && cpu_has_tsc) { if (tsc_disable && cpu_has_tsc) {
printk(KERN_NOTICE "Disabling TSC...\n"); printk(KERN_NOTICE "Disabling TSC...\n");
/**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/ /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/
clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability); clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability);
set_in_cr4(X86_CR4_TSD); set_in_cr4(X86_CR4_TSD);
} }
#endif
/* /*
* Initialize the per-CPU GDT with the boot GDT, * Initialize the per-CPU GDT with the boot GDT,
...@@ -507,37 +509,3 @@ void __init cpu_init (void) ...@@ -507,37 +509,3 @@ void __init cpu_init (void)
current->used_math = 0; current->used_math = 0;
stts(); stts();
} }
/*
* Bulk registration of the cpu devices with the system.
* Some of this stuff could possibly be moved into a shared
* location..
* Also, these devices should be integrated with other CPU data..
*/
static struct cpu cpu_devices[NR_CPUS];
static struct device_driver cpu_driver = {
.name = "cpu",
.bus = &system_bus_type,
.devclass = &cpu_devclass,
};
static int __init register_cpus(void)
{
int i;
driver_register(&cpu_driver);
for (i = 0; i < NR_CPUS; i++) {
struct sys_device * sysdev = &cpu_devices[i].sysdev;
sysdev->name = "cpu";
sysdev->id = i;
sysdev->dev.driver = &cpu_driver;
if (cpu_possible(i))
sys_device_register(sysdev);
}
return 0;
}
subsys_initcall(register_cpus);
...@@ -312,8 +312,6 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base, ...@@ -312,8 +312,6 @@ static void generic_set_mtrr(unsigned int reg, unsigned long base,
{ {
prepare_set(); prepare_set();
printk("MTRR: setting reg %x\n",reg);
if (size == 0) { if (size == 0) {
/* The invalid bit is kept in the mask, so we simply clear the /* The invalid bit is kept in the mask, so we simply clear the
relevant mask register to disable a range. */ relevant mask register to disable a range. */
......
...@@ -110,7 +110,7 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on) ...@@ -110,7 +110,7 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int turn_on)
asmlinkage int sys_iopl(unsigned long unused) asmlinkage int sys_iopl(unsigned long unused)
{ {
struct pt_regs * regs = (struct pt_regs *) &unused; volatile struct pt_regs * regs = (struct pt_regs *) &unused;
unsigned int level = regs->ebx; unsigned int level = regs->ebx;
unsigned int old = (regs->eflags >> 12) & 3; unsigned int old = (regs->eflags >> 12) & 3;
......
...@@ -52,6 +52,7 @@ static void __init smp_dump_qct(void) ...@@ -52,6 +52,7 @@ static void __init smp_dump_qct(void)
numnodes = 0; numnodes = 0;
for(node = 0; node < MAX_NUMNODES; node++) { for(node = 0; node < MAX_NUMNODES; node++) {
if(scd->quads_present31_0 & (1 << node)) { if(scd->quads_present31_0 & (1 << node)) {
node_set_online(node);
numnodes++; numnodes++;
eq = &scd->eq[node]; eq = &scd->eq[node];
/* Convert to pages */ /* Convert to pages */
......
...@@ -224,7 +224,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -224,7 +224,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs.eflags = 0x286; regs.eflags = 0x286;
/* Ok, create the new process.. */ /* Ok, create the new process.. */
p = do_fork(flags | CLONE_VM, 0, &regs, 0, NULL); p = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL);
return IS_ERR(p) ? PTR_ERR(p) : p->pid; return IS_ERR(p) ? PTR_ERR(p) : p->pid;
} }
......
...@@ -416,17 +416,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -416,17 +416,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
break; break;
} }
case PTRACE_SETOPTIONS: {
if (data & PTRACE_O_TRACESYSGOOD)
child->ptrace |= PT_TRACESYSGOOD;
else
child->ptrace &= ~PT_TRACESYSGOOD;
ret = 0;
break;
}
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
break; break;
} }
out_tsk: out_tsk:
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
EXTRA_CFLAGS += -I../kernel EXTRA_CFLAGS += -I../kernel
obj-y := setup.o obj-y := setup.o topology.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
/*
* arch/i386/mach-generic/topology.c - Populate driverfs with topology information
*
* Written by: Matthew Dobson, IBM Corporation
* Original Code: Paul Dorwin, IBM Corporation, Patrick Mochel, OSDL
*
* Copyright (C) 2002, IBM Corp.
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
* NON INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Send feedback to <colpatch@us.ibm.com>
*/
#include <linux/init.h>
#include <asm/cpu.h>
struct i386_cpu cpu_devices[NR_CPUS];
#ifdef CONFIG_NUMA
#include <linux/mmzone.h>
#include <asm/node.h>
#include <asm/memblk.h>
struct i386_node node_devices[MAX_NUMNODES];
struct i386_memblk memblk_devices[MAX_NR_MEMBLKS];
static int __init topology_init(void)
{
int i;
for (i = 0; i < num_online_nodes(); i++)
arch_register_node(i);
for (i = 0; i < NR_CPUS; i++)
if (cpu_possible(i)) arch_register_cpu(i);
for (i = 0; i < num_online_memblks(); i++)
arch_register_memblk(i);
return 0;
}
#else /* !CONFIG_NUMA */
static int __init topology_init(void)
{
int i;
for (i = 0; i < NR_CPUS; i++)
if (cpu_possible(i)) arch_register_cpu(i);
return 0;
}
#endif /* CONFIG_NUMA */
subsys_initcall(topology_init);
...@@ -3076,7 +3076,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data, ...@@ -3076,7 +3076,7 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
break; break;
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
break; break;
} }
......
...@@ -516,7 +516,7 @@ kernel_thread (int (*fn)(void *), void *arg, unsigned long flags) ...@@ -516,7 +516,7 @@ kernel_thread (int (*fn)(void *), void *arg, unsigned long flags)
struct task_struct *parent = current; struct task_struct *parent = current;
int result, tid; int result, tid;
tid = clone(flags | CLONE_VM, 0); tid = clone(flags | CLONE_VM | CLONE_UNTRACED, 0);
if (parent != current) { if (parent != current) {
result = (*fn)(arg); result = (*fn)(arg);
_exit(result); _exit(result);
......
...@@ -1268,16 +1268,8 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, ...@@ -1268,16 +1268,8 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
ret = ptrace_setregs(child, (struct pt_all_user_regs*) data); ret = ptrace_setregs(child, (struct pt_all_user_regs*) data);
goto out_tsk; goto out_tsk;
case PTRACE_SETOPTIONS:
if (data & PTRACE_O_TRACESYSGOOD)
child->ptrace |= PT_TRACESYSGOOD;
else
child->ptrace &= ~PT_TRACESYSGOOD;
ret = 0;
break;
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
goto out_tsk; goto out_tsk;
} }
out_tsk: out_tsk:
......
...@@ -311,26 +311,24 @@ static void __init hades_fixup(int pci_modify) ...@@ -311,26 +311,24 @@ static void __init hades_fixup(int pci_modify)
slot = PCI_SLOT(dev->devfn); /* Determine slot number. */ slot = PCI_SLOT(dev->devfn); /* Determine slot number. */
dev->irq = irq_tab[slot]; dev->irq = irq_tab[slot];
if (pci_modify) if (pci_modify)
pcibios_write_config_byte(dev->bus->number, dev->devfn, pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
PCI_INTERRUPT_LINE, dev->irq);
} }
} }
} }
/* /*
* static void hades_conf_device(unsigned char bus, unsigned char device_fn) * static void hades_conf_device(struct pci_dev *dev)
* *
* Machine dependent Configure the given device. * Machine dependent Configure the given device.
* *
* Parameters: * Parameters:
* *
* bus - bus number of the device. * dev - the pci device.
* device_fn - device and function number of the device.
*/ */
static void __init hades_conf_device(unsigned char bus, unsigned char device_fn) static void __init hades_conf_device(struct pci_dev *dev)
{ {
pcibios_write_config_byte(bus, device_fn, PCI_CACHE_LINE_SIZE, 0); pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0);
} }
static struct pci_ops hades_pci_ops = { static struct pci_ops hades_pci_ops = {
......
...@@ -95,7 +95,6 @@ struct pci_fixup pcibios_fixups[] = ...@@ -95,7 +95,6 @@ struct pci_fixup pcibios_fixups[] =
static void __init disable_dev(struct pci_dev *dev) static void __init disable_dev(struct pci_dev *dev)
{ {
struct pci_bus *bus;
unsigned short cmd; unsigned short cmd;
if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) || if (((dev->class >> 8 == PCI_CLASS_NOT_DEFINED_VGA) ||
...@@ -103,11 +102,10 @@ static void __init disable_dev(struct pci_dev *dev) ...@@ -103,11 +102,10 @@ static void __init disable_dev(struct pci_dev *dev)
(dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga) (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga)
return; return;
bus = dev->bus; pci_read_config_word(dev, PCI_COMMAND, &cmd);
pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER); cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER);
pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
/* /*
...@@ -122,7 +120,6 @@ static void __init disable_dev(struct pci_dev *dev) ...@@ -122,7 +120,6 @@ static void __init disable_dev(struct pci_dev *dev)
static void __init layout_dev(struct pci_dev *dev) static void __init layout_dev(struct pci_dev *dev)
{ {
struct pci_bus *bus;
unsigned short cmd; unsigned short cmd;
unsigned int base, mask, size, reg; unsigned int base, mask, size, reg;
unsigned int alignto; unsigned int alignto;
...@@ -137,8 +134,7 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -137,8 +134,7 @@ static void __init layout_dev(struct pci_dev *dev)
(dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga) (dev->class >> 8 == PCI_CLASS_DISPLAY_XGA)) && skip_vga)
return; return;
bus = dev->bus; pci_read_config_word(dev, PCI_COMMAND, &cmd);
pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
for (reg = PCI_BASE_ADDRESS_0, i = 0; reg <= PCI_BASE_ADDRESS_5; reg += 4, i++) for (reg = PCI_BASE_ADDRESS_0, i = 0; reg <= PCI_BASE_ADDRESS_5; reg += 4, i++)
{ {
...@@ -147,9 +143,8 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -147,9 +143,8 @@ static void __init layout_dev(struct pci_dev *dev)
* device wants. * device wants.
*/ */
pcibios_write_config_dword(bus->number, dev->devfn, reg, pci_write_config_dword(dev, reg, 0xffffffff);
0xffffffff); pci_read_config_dword(dev, reg, &base);
pcibios_read_config_dword(bus->number, dev->devfn, reg, &base);
if (!base) if (!base)
{ {
...@@ -184,8 +179,7 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -184,8 +179,7 @@ static void __init layout_dev(struct pci_dev *dev)
alignto = MAX(0x040, size) ; alignto = MAX(0x040, size) ;
base = ALIGN(io_base, alignto); base = ALIGN(io_base, alignto);
io_base = base + size; io_base = base + size;
pcibios_write_config_dword(bus->number, dev->devfn, pci_write_config_dword(dev, reg, base | PCI_BASE_ADDRESS_SPACE_IO);
reg, base | PCI_BASE_ADDRESS_SPACE_IO);
dev->resource[i].start = base; dev->resource[i].start = base;
dev->resource[i].end = dev->resource[i].start + size - 1; dev->resource[i].end = dev->resource[i].start + size - 1;
...@@ -228,8 +222,7 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -228,8 +222,7 @@ static void __init layout_dev(struct pci_dev *dev)
alignto = MAX(0x1000, size) ; alignto = MAX(0x1000, size) ;
base = ALIGN(mem_base, alignto); base = ALIGN(mem_base, alignto);
mem_base = base + size; mem_base = base + size;
pcibios_write_config_dword(bus->number, dev->devfn, pci_write_config_dword(dev, reg, base);
reg, base);
dev->resource[i].start = base; dev->resource[i].start = base;
dev->resource[i].end = dev->resource[i].start + size - 1; dev->resource[i].end = dev->resource[i].start + size - 1;
...@@ -243,8 +236,7 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -243,8 +236,7 @@ static void __init layout_dev(struct pci_dev *dev)
*/ */
reg += 4; reg += 4;
pcibios_write_config_dword(bus->number, dev->devfn, pci_write_config_dword(dev, reg, 0);
reg, 0);
i++; i++;
dev->resource[i].start = 0; dev->resource[i].start = 0;
...@@ -272,17 +264,15 @@ static void __init layout_dev(struct pci_dev *dev) ...@@ -272,17 +264,15 @@ static void __init layout_dev(struct pci_dev *dev)
cmd |= PCI_COMMAND_IO; cmd |= PCI_COMMAND_IO;
} }
pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND, pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MASTER);
cmd | PCI_COMMAND_MASTER);
pcibios_write_config_byte(bus->number, dev->devfn, PCI_LATENCY_TIMER, pci_write_config_byte(dev, PCI_LATENCY_TIMER, (disable_pci_burst) ? 0 : 32);
(disable_pci_burst) ? 0 : 32);
if (bus_info != NULL) if (bus_info != NULL)
bus_info->conf_device(bus->number, dev->devfn); /* Machine dependent configuration. */ bus_info->conf_device(dev); /* Machine dependent configuration. */
DBG_DEVS(("layout_dev: bus %d slot 0x%x VID 0x%x DID 0x%x class 0x%x\n", DBG_DEVS(("layout_dev: bus %d slot 0x%x VID 0x%x DID 0x%x class 0x%x\n",
bus->number, PCI_SLOT(dev->devfn), dev->vendor, dev->device, dev->class)); dev->bus->number, PCI_SLOT(dev->devfn), dev->vendor, dev->device, dev->class));
} }
/* /*
......
...@@ -152,7 +152,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) ...@@ -152,7 +152,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{ {
register long retval __asm__ ("d0"); register long retval __asm__ ("d0");
register long clone_arg __asm__ ("d1") = flags | CLONE_VM; register long clone_arg __asm__ ("d1") = flags | CLONE_VM | CLONE_UNTRACED;
retval = __NR_clone; retval = __NR_clone;
__asm__ __volatile__ __asm__ __volatile__
......
...@@ -355,7 +355,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -355,7 +355,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
} }
default: default:
ret = -EIO; ret = ptrace_request(child, request, addr, data);
break; break;
} }
out_tsk: out_tsk:
...@@ -370,7 +370,8 @@ asmlinkage void syscall_trace(void) ...@@ -370,7 +370,8 @@ asmlinkage void syscall_trace(void)
if (!current->thread.work.delayed_trace && if (!current->thread.work.delayed_trace &&
!current->thread.work.syscall_trace) !current->thread.work.syscall_trace)
return; return;
current->exit_code = SIGTRAP; current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
? 0x80 : 0);
current->state = TASK_STOPPED; current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD); notify_parent(current, SIGCHLD);
schedule(); schedule();
......
This diff is collapsed.
#
# arch/m68knommu/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# (C) Copyright 2002, Greg Ungerer <gerg@snapgear.com>
#
platform-$(CONFIG_M68328) := 68328
platform-$(CONFIG_M68EZ328) := 68EZ328
platform-$(CONFIG_M68VZ328) := 68VZ328
platform-$(CONFIG_M68360) := 68360
platform-$(CONFIG_M5206) := 5206
platform-$(CONFIG_M5206e) := 5206e
platform-$(CONFIG_M5249) := 5249
platform-$(CONFIG_M5272) := 5272
platform-$(CONFIG_M5307) := 5307
platform-$(CONFIG_M5407) := 5407
PLATFORM := $(platform-y)
board-$(CONFIG_PILOT) := pilot
board-$(CONFIG_UCSIMM) := ucsimm
board-$(CONFIG_UCDIMM) := ucdimm
board-$(CONFIG_UCQUICC) := uCquicc
board-$(CONFIG_DRAGEN2) := de2
board-$(CONFIG_ARNEWSH) := ARNEWSH
board-$(CONFIG_MOTOROLA) := MOTOROLA
board-$(CONFIG_ELITE) := eLITE
board-$(CONFIG_eLIA) := eLIA
board-$(CONFIG_NETtel) := NETtel
board-$(CONFIG_SECUREEDGEMP3) := MP3
board-$(CONFIG_CLEOPATRA) := CLEOPATRA
BOARD := $(board-y)
model-$(CONFIG_RAMKERNEL) := ram
model-$(CONFIG_ROMKERNEL) := rom
model-$(CONFIG_HIMEMKERNEL) := himem
MODEL := $(model-y)
#
# Some code support is grouped together for a common cpu-subclass (for
# example all ColdFire cpu's are very similar). Determine the sub-class
# for the selected cpu. ONLY need to define this for the non-core member
# of the family.
#
cpuclass-$(CONFIG_M5206) := 5307
cpuclass-$(CONFIG_M5206e) := 5307
cpuclass-$(CONFIG_M5249) := 5307
cpuclass-$(CONFIG_M5272) := 5307
cpuclass-$(CONFIG_M5407) := 5307
cpuclass-$(CONFIG_M68EZ328) := 68328
cpuclass-$(CONFIG_M68VZ328) := 68328
CPUCLASS := $(cpuclass-y)
CLASSDIR := arch/m68knommu/platform/$(cpuclass-y)/
export PLATFORM BOARD MODEL CPUCLASS
#
# Some CFLAG additions based on specific CPU type.
#
cflags-$(CONFIG_M5206) := -m5200 -Wa,-S -Wa,-m5200
cflags-$(CONFIG_M5206e) := -m5200 -Wa,-S -Wa,-m5200
cflags-$(CONFIG_M5249) := -m5200 -Wa,-S -Wa,-m5200
cflags-$(CONFIG_M5272) := -m5307 -Wa,-S -Wa,-m5307
cflags-$(CONFIG_M5307) := -m5307 -Wa,-S -Wa,-m5307
cflags-$(CONFIG_M5407) := -m5200 -Wa,-S -Wa,-m5200
cflags-$(CONFIG_M68328) := -m68000
cflags-$(CONFIG_M68EZ328) := -m68000
cflags-$(CONFIG_M68VZ328) := -m68000
cflags-$(CONFIG_M68360) := -m68332
AFLAGS += $(cflags-y)
CFLAGS += $(cflags-y)
CFLAGS += -fno-builtin
CFLAGS += -O2 -g
CFLAGS += -D__linux__
CFLAGS += -DUTS_SYSNAME=\"uClinux\"
HEAD := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o
clean-files := include/asm-$(ARCH)/asm-offsets.h.tmp \
include/asm-$(ARCH)/asm-offsets.h \
arch/$(ARCH)/kernel/asm-offsets.s
core-y += arch/m68knommu/kernel/ \
arch/m68knommu/mm/ \
$(CLASSDIR) \
arch/m68knommu/platform/$(PLATFORM)/
libs-y += arch/m68knommu/lib/
include $(TOPDIR)/Rules.make
prepare: include/asm-$(ARCH)/asm-offsets.h
archmrproper:
archclean:
$(call descend arch/$(ARCH)/boot, subdirclean)
include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
include/asm include/linux/version.h \
include/config/MARKER
@echo -n ' Generating $@'
@$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
This diff is collapsed.
#
# Makefile for arch/m68knommu/kernel.
#
export-objs := m68k_ksyms.o
obj-y += init_task.o ints.o m68k_ksyms.o process.o ptrace.o semaphore.o \
setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o
obj-$(CONFIG_COMEMPCI) += comempci.o
include $(TOPDIR)/Rules.make
/*
* This program is used to generate definitions needed by
* assembly language modules.
*
* We use the technique used in the OSF Mach kernel code:
* generate asm statements containing #defines,
* compile this file to assembler, and then extract the
* #defines from the assembly-language output.
*/
#include <linux/stddef.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <asm/bootinfo.h>
#include <asm/irq.h>
#include <asm/hardirq.h>
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
#define BLANK() asm volatile("\n->" : : )
int main(void)
{
/* offsets into the task struct */
DEFINE(TASK_STATE, offsetof(struct task_struct, state));
DEFINE(TASK_FLAGS, offsetof(struct task_struct, flags));
DEFINE(TASK_PTRACE, offsetof(struct task_struct, ptrace));
DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));
DEFINE(TASK_THREAD, offsetof(struct task_struct, thread));
DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, thread_info));
DEFINE(TASK_MM, offsetof(struct task_struct, mm));
DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
/* offsets into the irq_cpustat_t struct */
DEFINE(CPUSTAT_SOFTIRQ_PENDING, offsetof(irq_cpustat_t, __softirq_pending));
/* offsets into the thread struct */
DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
DEFINE(THREAD_SR, offsetof(struct thread_struct, sr));
DEFINE(THREAD_FS, offsetof(struct thread_struct, fs));
DEFINE(THREAD_CRP, offsetof(struct thread_struct, crp));
DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0));
DEFINE(THREAD_FPREG, offsetof(struct thread_struct, fp));
DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl));
DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate));
/* offsets into the pt_regs */
DEFINE(PT_D0, offsetof(struct pt_regs, d0));
DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0));
DEFINE(PT_D1, offsetof(struct pt_regs, d1));
DEFINE(PT_D2, offsetof(struct pt_regs, d2));
DEFINE(PT_D3, offsetof(struct pt_regs, d3));
DEFINE(PT_D4, offsetof(struct pt_regs, d4));
DEFINE(PT_D5, offsetof(struct pt_regs, d5));
DEFINE(PT_A0, offsetof(struct pt_regs, a0));
DEFINE(PT_A1, offsetof(struct pt_regs, a1));
DEFINE(PT_A2, offsetof(struct pt_regs, a2));
DEFINE(PT_PC, offsetof(struct pt_regs, pc));
DEFINE(PT_SR, offsetof(struct pt_regs, sr));
/* bitfields are a bit difficult */
DEFINE(PT_VECTOR, offsetof(struct pt_regs, pc) + 4);
#ifndef CONFIG_COLDFIRE
/* offsets into the irq_handler struct */
DEFINE(IRQ_HANDLER, offsetof(struct irq_node, handler));
DEFINE(IRQ_DEVID, offsetof(struct irq_node, dev_id));
DEFINE(IRQ_NEXT, offsetof(struct irq_node, next));
#endif
/* offsets into the kernel_stat struct */
DEFINE(STAT_IRQ, offsetof(struct kernel_stat, irqs));
/* signal defines */
DEFINE(SIGSEGV, SIGSEGV);
DEFINE(SEGV_MAPERR, SEGV_MAPERR);
DEFINE(SIGTRAP, SIGTRAP);
DEFINE(TRAP_TRACE, TRAP_TRACE);
DEFINE(PT_PTRACED, PT_PTRACED);
DEFINE(PT_DTRACE, PT_DTRACE);
return 0;
}
This diff is collapsed.
/*
* linux/arch/m68knommu/kernel/init_task.c
*/
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/init_task.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
static struct fs_struct init_fs = INIT_FS;
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
struct mm_struct init_mm = INIT_MM(init_mm);
/*
* Initial task structure.
*
* All other task structs will be allocated on slabs in fork.c
*/
__asm__(".align 4");
struct task_struct init_task = INIT_TASK(init_task);
/*
* Initial thread structure.
*
* We need to make sure that this is 8192-byte aligned due to the
* way process stacks are handled. This is done by having a special
* "init_task" linker map entry..
*/
union thread_union init_thread_union
__attribute__((__section__(".data.init_task"))) =
{ INIT_THREAD_INFO(init_task) };
/*
* linux/arch/m68knommu/kernel/ints.c -- General interrupt handling code
*
* Copyright (C) 1999-2002 Greg Ungerer (gerg@snapgear.com)
* Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
* Kenneth Albanowski <kjahds@kjahds.com>,
* Copyright (C) 2000 Lineo Inc. (www.lineo.com)
*
* Based on:
*
* linux/arch/m68k/kernel/ints.c -- Linux/m68k general interrupt handling code
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/types.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/errno.h>
#include <linux/config.h>
#include <linux/seq_file.h>
#include <asm/system.h>
#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/page.h>
#include <asm/machdep.h>
/*
* This table stores the address info for each vector handler.
*/
irq_handler_t irq_list[SYS_IRQS];
unsigned int *mach_kstat_irqs;
#define NUM_IRQ_NODES 16
static irq_node_t nodes[NUM_IRQ_NODES];
/* The number of spurious interrupts */
volatile unsigned int num_spurious;
unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
static void default_irq_handler(int irq, void *ptr, struct pt_regs *regs)
{
#if 1
printk("%s(%d): default irq handler vec=%d [0x%x]\n",
__FILE__, __LINE__, irq, irq);
#endif
}
/*
* void init_IRQ(void)
*
* Parameters: None
*
* Returns: Nothing
*
* This function should be called during kernel startup to initialize
* the IRQ handling routines.
*/
void __init init_IRQ(void)
{
int i;
for (i = 0; i < SYS_IRQS; i++) {
if (mach_default_handler)
irq_list[i].handler = (*mach_default_handler)[i];
else
irq_list[i].handler = default_irq_handler;
irq_list[i].flags = IRQ_FLG_STD;
irq_list[i].dev_id = NULL;
irq_list[i].devname = NULL;
}
for (i = 0; i < NUM_IRQ_NODES; i++)
nodes[i].handler = NULL;
if (mach_init_IRQ)
mach_init_IRQ();
mach_kstat_irqs = &kstat.irqs[0][0];
}
irq_node_t *new_irq_node(void)
{
irq_node_t *node;
short i;
for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--)
if (!node->handler)
return node;
printk("new_irq_node: out of nodes\n");
return NULL;
}
int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id)
{
if (irq < 0 || irq >= NR_IRQS) {
printk("%s: Incorrect IRQ %d from %s\n", __FUNCTION__,
irq, devname);
return -ENXIO;
}
if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
if (irq_list[irq].flags & IRQ_FLG_LOCK) {
printk("%s: IRQ %d from %s is not replaceable\n",
__FUNCTION__, irq, irq_list[irq].devname);
return -EBUSY;
}
if (flags & IRQ_FLG_REPLACE) {
printk("%s: %s can't replace IRQ %d from %s\n",
__FUNCTION__, devname, irq, irq_list[irq].devname);
return -EBUSY;
}
}
#ifdef CONFIG_COLDFIRE
if (flags & IRQ_FLG_FAST) {
extern asmlinkage void fasthandler(void);
extern void set_evector(int vecnum, void (*handler)(void));
set_evector(irq, fasthandler);
}
#endif
irq_list[irq].handler = handler;
irq_list[irq].flags = flags;
irq_list[irq].dev_id = dev_id;
irq_list[irq].devname = devname;
return 0;
}
void free_irq(unsigned int irq, void *dev_id)
{
if (irq >= NR_IRQS) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
return;
}
if (irq_list[irq].dev_id != dev_id)
printk("%s: Removing probably wrong IRQ %d from %s\n",
__FUNCTION__, irq, irq_list[irq].devname);
#ifdef CONFIG_COLDFIRE
if (irq_list[irq].flags & IRQ_FLG_FAST) {
extern asmlinkage void inthandler(void);
extern void set_evector(int vecnum, void (*handler)(void));
set_evector(irq, inthandler);
}
#endif
if (mach_default_handler)
irq_list[irq].handler = (*mach_default_handler)[irq];
else
irq_list[irq].handler = default_irq_handler;
irq_list[irq].flags = IRQ_FLG_STD;
irq_list[irq].dev_id = NULL;
irq_list[irq].devname = NULL;
}
int sys_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *devname, void *dev_id)
{
if (irq > IRQ7) {
printk("%s: Incorrect IRQ %d from %s\n",
__FUNCTION__, irq, devname);
return -ENXIO;
}
#if 0
if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
if (irq_list[irq].flags & IRQ_FLG_LOCK) {
printk("%s: IRQ %d from %s is not replaceable\n",
__FUNCTION__, irq, irq_list[irq].devname);
return -EBUSY;
}
if (!(flags & IRQ_FLG_REPLACE)) {
printk("%s: %s can't replace IRQ %d from %s\n",
__FUNCTION__, devname, irq, irq_list[irq].devname);
return -EBUSY;
}
}
#endif
irq_list[irq].handler = handler;
irq_list[irq].flags = flags;
irq_list[irq].dev_id = dev_id;
irq_list[irq].devname = devname;
return 0;
}
void sys_free_irq(unsigned int irq, void *dev_id)
{
if (irq > IRQ7) {
printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
return;
}
if (irq_list[irq].dev_id != dev_id)
printk("%s: Removing probably wrong IRQ %d from %s\n",
__FUNCTION__, irq, irq_list[irq].devname);
irq_list[irq].handler = (*mach_default_handler)[irq];
irq_list[irq].flags = 0;
irq_list[irq].dev_id = NULL;
irq_list[irq].devname = NULL;
}
/*
* Do we need these probe functions on the m68k?
*
* ... may be usefull with ISA devices
*/
unsigned long probe_irq_on (void)
{
return 0;
}
int probe_irq_off (unsigned long irqs)
{
return 0;
}
asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
{
if (vec >= VEC_INT1 && vec <= VEC_INT7) {
vec -= VEC_SPUR;
kstat.irqs[0][vec]++;
irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
} else {
if (mach_process_int)
mach_process_int(vec, fp);
else
panic("Can't process interrupt vector %ld\n", vec);
return;
}
}
int show_interrupts(struct seq_file *p, void *v)
{
int i;
for (i = 0; i < NR_IRQS; i++) {
if (irq_list[i].flags & IRQ_FLG_STD)
continue;
seq_printf(p, "%3d: %10u ", i,
(i ? kstat.irqs[0][i] : num_spurious));
if (irq_list[i].flags & IRQ_FLG_LOCK)
seq_printf(p, "L ");
else
seq_printf(p, " ");
seq_printf(p, "%s\n", irq_list[i].devname);
}
if (mach_get_irq_list)
mach_get_irq_list(p, v);
return(0);
}
void init_irq_proc(void)
{
/* Insert /proc/irq driver here */
}
#include <linux/module.h>
#include <linux/linkage.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/user.h>
#include <linux/elfcore.h>
#include <linux/in6.h>
#include <linux/interrupt.h>
#include <linux/config.h>
#include <asm/setup.h>
#include <asm/machdep.h>
#include <asm/pgalloc.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
#include <asm/softirq.h>
#include <asm/current.h>
extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(elf_fpregset_t *);
/* platform dependent support */
EXPORT_SYMBOL(__ioremap);
EXPORT_SYMBOL(iounmap);
EXPORT_SYMBOL(dump_fpu);
EXPORT_SYMBOL(dump_thread);
EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strrchr);
EXPORT_SYMBOL(strstr);
EXPORT_SYMBOL(strchr);
EXPORT_SYMBOL(strcat);
EXPORT_SYMBOL(strlen);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strncmp);
EXPORT_SYMBOL(ip_fast_csum);
EXPORT_SYMBOL(mach_enable_irq);
EXPORT_SYMBOL(mach_disable_irq);
EXPORT_SYMBOL(kernel_thread);
/* Networking helper routines. */
EXPORT_SYMBOL(csum_partial_copy);
/* The following are special because they're not called
explicitly (the C compiler generates them). Fortunately,
their interface isn't gonna change any time soon now, so
it's OK to leave it out of version control. */
EXPORT_SYMBOL_NOVERS(memcpy);
EXPORT_SYMBOL_NOVERS(memset);
EXPORT_SYMBOL_NOVERS(memcmp);
EXPORT_SYMBOL_NOVERS(memscan);
EXPORT_SYMBOL_NOVERS(memmove);
EXPORT_SYMBOL_NOVERS(__down_failed);
EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
EXPORT_SYMBOL_NOVERS(__up_wakeup);
EXPORT_SYMBOL(get_wchan);
/*
* libgcc functions - functions that are used internally by the
* compiler... (prototypes are not correct though, but that
* doesn't really matter since they're not versioned).
*/
extern void __gcc_bcmp(void);
extern void __ashldi3(void);
extern void __ashrdi3(void);
extern void __cmpdi2(void);
extern void __divdi3(void);
extern void __divsi3(void);
extern void __lshrdi3(void);
extern void __moddi3(void);
extern void __modsi3(void);
extern void __muldi3(void);
extern void __mulsi3(void);
extern void __negdi2(void);
extern void __ucmpdi2(void);
extern void __udivdi3(void);
extern void __udivmoddi4(void);
extern void __udivsi3(void);
extern void __umoddi3(void);
extern void __umodsi3(void);
/* gcc lib functions */
EXPORT_SYMBOL_NOVERS(__gcc_bcmp);
EXPORT_SYMBOL_NOVERS(__ashldi3);
EXPORT_SYMBOL_NOVERS(__ashrdi3);
EXPORT_SYMBOL_NOVERS(__cmpdi2);
EXPORT_SYMBOL_NOVERS(__divdi3);
EXPORT_SYMBOL_NOVERS(__divsi3);
EXPORT_SYMBOL_NOVERS(__lshrdi3);
EXPORT_SYMBOL_NOVERS(__moddi3);
EXPORT_SYMBOL_NOVERS(__modsi3);
EXPORT_SYMBOL_NOVERS(__muldi3);
EXPORT_SYMBOL_NOVERS(__mulsi3);
EXPORT_SYMBOL_NOVERS(__negdi2);
EXPORT_SYMBOL_NOVERS(__ucmpdi2);
EXPORT_SYMBOL_NOVERS(__udivdi3);
EXPORT_SYMBOL_NOVERS(__udivmoddi4);
EXPORT_SYMBOL_NOVERS(__udivsi3);
EXPORT_SYMBOL_NOVERS(__umoddi3);
EXPORT_SYMBOL_NOVERS(__umodsi3);
EXPORT_SYMBOL_NOVERS(is_in_rom);
#ifdef CONFIG_COLDFIRE
extern unsigned int *dma_device_address;
extern unsigned long dma_base_addr, _ramend;
EXPORT_SYMBOL_NOVERS(dma_base_addr);
EXPORT_SYMBOL_NOVERS(dma_device_address);
EXPORT_SYMBOL_NOVERS(_ramend);
extern asmlinkage void trap(void);
extern void *_ramvec;
EXPORT_SYMBOL_NOVERS(trap);
EXPORT_SYMBOL_NOVERS(_ramvec);
#endif /* CONFIG_COLDFIRE */
This diff is collapsed.
/*
* linux/arch/m68knommu/kernel/ptrace.c
*
* Copyright (C) 1994 by Hamish Macdonald
* Taken from linux/kernel/ptrace.c and modified for M680x0.
* linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of
* this archive for more details.
*/
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/errno.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/config.h>
#include <asm/uaccess.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/system.h>
#include <asm/processor.h>
/*
* does not yet catch signals sent when the child dies.
* in exit.c or in signal.c.
*/
/* determines which bits in the SR the user has access to. */
/* 1 = access 0 = no access */
#define SR_MASK 0x001f
/* sets the trace bits. */
#define TRACE_BITS 0x8000
/* Find the stack offset for a register, relative to thread.esp0. */
#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
#define SW_REG(reg) ((long)&((struct switch_stack *)0)->reg \
- sizeof(struct switch_stack))
/* Mapping from PT_xxx to the stack offset at which the register is
saved. Notice that usp has no stack-slot and needs to be treated
specially (see get_reg/put_reg below). */
static int regoff[] = {
PT_REG(d1), PT_REG(d2), PT_REG(d3), PT_REG(d4),
PT_REG(d5), SW_REG(d6), SW_REG(d7), PT_REG(a0),
PT_REG(a1), PT_REG(a2), SW_REG(a3), SW_REG(a4),
SW_REG(a5), SW_REG(a6), PT_REG(d0), -1,
PT_REG(orig_d0), PT_REG(sr), PT_REG(pc),
};
/*
* Get contents of register REGNO in task TASK.
*/
static inline long get_reg(struct task_struct *task, int regno)
{
unsigned long *addr;
if (regno == PT_USP)
addr = &task->thread.usp;
else if (regno < sizeof(regoff)/sizeof(regoff[0]))
addr = (unsigned long *)(task->thread.esp0 + regoff[regno]);
else
return 0;
return *addr;
}
/*
* Write contents of register REGNO in task TASK.
*/
static inline int put_reg(struct task_struct *task, int regno,
unsigned long data)
{
unsigned long *addr;
if (regno == PT_USP)
addr = &task->thread.usp;
else if (regno < sizeof(regoff)/sizeof(regoff[0]))
addr = (unsigned long *) (task->thread.esp0 + regoff[regno]);
else
return -1;
*addr = data;
return 0;
}
/*
* Called by kernel/ptrace.c when detaching..
*
* Make sure the single step bit is not set.
*/
void ptrace_disable(struct task_struct *child)
{
unsigned long tmp;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
}
asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
{
struct task_struct *child;
int ret;
lock_kernel();
ret = -EPERM;
if (request == PTRACE_TRACEME) {
/* are we already being traced? */
if (current->ptrace & PT_PTRACED)
goto out;
/* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED;
ret = 0;
goto out;
}
ret = -ESRCH;
read_lock(&tasklist_lock);
child = find_task_by_pid(pid);
if (child)
get_task_struct(child);
read_unlock(&tasklist_lock);
if (!child)
goto out;
ret = -EPERM;
if (pid == 1) /* you may not mess with init */
goto out_tsk;
if (request == PTRACE_ATTACH) {
ret = ptrace_attach(child);
goto out_tsk;
}
ret = -ESRCH;
if (!(child->ptrace & PT_PTRACED))
goto out_tsk;
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
goto out_tsk;
}
ret = ptrace_check_attach(child, request == PTRACE_KILL);
if (ret < 0)
goto out_tsk;
switch (request) {
/* when I and D space are separate, these will need to be fixed. */
case PTRACE_PEEKTEXT: /* read word at location addr. */
case PTRACE_PEEKDATA: {
unsigned long tmp;
int copied;
copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
ret = -EIO;
if (copied != sizeof(tmp))
break;
ret = put_user(tmp,(unsigned long *) data);
break;
}
/* read the word at location addr in the USER area. */
case PTRACE_PEEKUSR: {
unsigned long tmp;
ret = -EIO;
if ((addr & 3) || addr < 0 ||
addr > sizeof(struct user) - 3)
break;
tmp = 0; /* Default return condition */
addr = addr >> 2; /* temporary hack. */
ret = -EIO;
if (addr < 19) {
tmp = get_reg(child, addr);
if (addr == PT_SR)
tmp >>= 16;
} else if (addr >= 21 && addr < 49) {
tmp = child->thread.fp[addr - 21];
#ifdef CONFIG_M68KFPU_EMU
/* Convert internal fpu reg representation
* into long double format
*/
if (FPU_IS_EMU && (addr < 45) && !(addr % 3))
tmp = ((tmp & 0xffff0000) << 15) |
((tmp & 0x0000ffff) << 16);
#endif
} else if (addr == 49) {
tmp = child->mm->start_code;
} else if (addr == 50) {
tmp = child->mm->start_data;
} else if (addr == 51) {
tmp = child->mm->end_code;
} else
break;
ret = put_user(tmp,(unsigned long *) data);
break;
}
/* when I and D space are separate, this will have to be fixed. */
case PTRACE_POKETEXT: /* write the word at location addr. */
case PTRACE_POKEDATA:
ret = 0;
if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data))
break;
ret = -EIO;
break;
case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
ret = -EIO;
if ((addr & 3) || addr < 0 ||
addr > sizeof(struct user) - 3)
break;
addr = addr >> 2; /* temporary hack. */
if (addr == PT_SR) {
data &= SR_MASK;
data <<= 16;
data |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
}
if (addr < 19) {
if (put_reg(child, addr, data))
break;
ret = 0;
break;
}
if (addr >= 21 && addr < 48)
{
#ifdef CONFIG_M68KFPU_EMU
/* Convert long double format
* into internal fpu reg representation
*/
if (FPU_IS_EMU && (addr < 45) && !(addr % 3)) {
data = (unsigned long)data << 15;
data = (data & 0xffff0000) |
((data & 0x0000ffff) >> 1);
}
#endif
child->thread.fp[addr - 21] = data;
ret = 0;
}
break;
case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
case PTRACE_CONT: { /* restart after signal. */
long tmp;
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
if (request == PTRACE_SYSCALL)
set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
else
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
wake_up_process(child);
ret = 0;
break;
}
/*
* make the child exit. Best I can do is send it a sigkill.
* perhaps it should be put in the status that it wants to
* exit.
*/
case PTRACE_KILL: {
long tmp;
ret = 0;
if (child->state == TASK_ZOMBIE) /* already dead */
break;
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
wake_up_process(child);
break;
}
case PTRACE_SINGLESTEP: { /* set the trap flag. */
long tmp;
ret = -EIO;
if ((unsigned long) data > _NSIG)
break;
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
put_reg(child, PT_SR, tmp);
child->exit_code = data;
/* give it a chance to run. */
wake_up_process(child);
ret = 0;
break;
}
case PTRACE_DETACH: /* detach a process that was attached. */
ret = ptrace_detach(child, data);
break;
case PTRACE_GETREGS: { /* Get all gp regs from the child. */
int i;
unsigned long tmp;
for (i = 0; i < 19; i++) {
tmp = get_reg(child, i);
if (i == PT_SR)
tmp >>= 16;
if (put_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
break;
}
data += sizeof(long);
}
ret = 0;
break;
}
case PTRACE_SETREGS: { /* Set all gp regs in the child. */
int i;
unsigned long tmp;
for (i = 0; i < 19; i++) {
if (get_user(tmp, (unsigned long *) data)) {
ret = -EFAULT;
break;
}
if (i == PT_SR) {
tmp &= SR_MASK;
tmp <<= 16;
tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
}
put_reg(child, i, tmp);
data += sizeof(long);
}
ret = 0;
break;
}
#ifdef PTRACE_GETFPREGS
case PTRACE_GETFPREGS: { /* Get the child FPU state. */
ret = 0;
if (copy_to_user((void *)data, &child->thread.fp,
sizeof(struct user_m68kfp_struct)))
ret = -EFAULT;
break;
}
#endif
#ifdef PTRACE_SETFPREGS
case PTRACE_SETFPREGS: { /* Set the child FPU state. */
ret = 0;
if (copy_from_user(&child->thread.fp, (void *)data,
sizeof(struct user_m68kfp_struct)))
ret = -EFAULT;
break;
}
#endif
default:
ret = -EIO;
break;
}
out_tsk:
put_task_struct(child);
out:
unlock_kernel();
return ret;
}
asmlinkage void syscall_trace(void)
{
if (!test_thread_flag(TIF_SYSCALL_TRACE))
return;
if (!(current->ptrace & PT_PTRACED))
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
/*
* this isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
* stopping signal is not SIGTRAP. -brl
*/
if (current->exit_code) {
send_sig(current->exit_code, current, 1);
current->exit_code = 0;
}
}
/*
* Generic semaphore code. Buyer beware. Do your own
* specific changes in <asm/semaphore-helper.h>
*/
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/err.h>
#include <asm/semaphore-helper.h>
#ifndef CONFIG_RMW_INSNS
spinlock_t semaphore_wake_lock;
#endif
/*
* Semaphores are implemented using a two-way counter:
* The "count" variable is decremented for each process
* that tries to sleep, while the "waking" variable is
* incremented when the "up()" code goes to wake up waiting
* processes.
*
* Notably, the inline "up()" and "down()" functions can
* efficiently test if they need to do any extra work (up
* needs to do something only if count was negative before
* the increment operation.
*
* waking_non_zero() (from asm/semaphore.h) must execute
* atomically.
*
* When __up() is called, the count was negative before
* incrementing it, and we need to wake up somebody.
*
* This routine adds one to the count of processes that need to
* wake up and exit. ALL waiting processes actually wake up but
* only the one that gets to the "waking" field first will gate
* through and acquire the semaphore. The others will go back
* to sleep.
*
* Note that these functions are only called when there is
* contention on the lock, and as such all this is the
* "non-critical" part of the whole semaphore business. The
* critical part is the inline stuff in <asm/semaphore.h>
* where we want to avoid any extra jumps and calls.
*/
void __up(struct semaphore *sem)
{
wake_one_more(sem);
wake_up(&sem->wait);
}
/*
* Perform the "down" function. Return zero for semaphore acquired,
* return negative for signalled out of the function.
*
* If called from __down, the return is ignored and the wait loop is
* not interruptible. This means that a task waiting on a semaphore
* using "down()" cannot be killed until someone does an "up()" on
* the semaphore.
*
* If called from __down_interruptible, the return value gets checked
* upon return. If the return value is negative then the task continues
* with the negative value in the return register (it can be tested by
* the caller).
*
* Either form may be used in conjunction with "up()".
*
*/
#define DOWN_HEAD(task_state) \
\
\
current->state = (task_state); \
add_wait_queue(&sem->wait, &wait); \
\
/* \
* Ok, we're set up. sem->count is known to be less than zero \
* so we must wait. \
* \
* We can let go the lock for purposes of waiting. \
* We re-acquire it after awaking so as to protect \
* all semaphore operations. \
* \
* If "up()" is called before we call waking_non_zero() then \
* we will catch it right away. If it is called later then \
* we will have to go through a wakeup cycle to catch it. \
* \
* Multiple waiters contend for the semaphore lock to see \
* who gets to gate through and who has to wait some more. \
*/ \
for (;;) {
#define DOWN_TAIL(task_state) \
current->state = (task_state); \
} \
current->state = TASK_RUNNING; \
remove_wait_queue(&sem->wait, &wait);
void __down(struct semaphore * sem)
{
DECLARE_WAITQUEUE(wait, current);
DOWN_HEAD(TASK_UNINTERRUPTIBLE)
if (waking_non_zero(sem))
break;
schedule();
DOWN_TAIL(TASK_UNINTERRUPTIBLE)
}
int __down_interruptible(struct semaphore * sem)
{
DECLARE_WAITQUEUE(wait, current);
int ret = 0;
DOWN_HEAD(TASK_INTERRUPTIBLE)
ret = waking_non_zero_interruptible(sem, current);
if (ret)
{
if (ret == 1)
/* ret != 0 only if we get interrupted -arca */
ret = 0;
break;
}
schedule();
DOWN_TAIL(TASK_INTERRUPTIBLE)
return ret;
}
int __down_trylock(struct semaphore * sem)
{
return waking_non_zero_trylock(sem);
}
This diff is collapsed.
This diff is collapsed.
/*
* linux/arch/m68knommu/kernel/sys_m68k.c
*
* This file contains various random system calls that
* have a non-standard calling sequence on the Linux/m68k
* platform.
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/utsname.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
#include <asm/cachectl.h>
#include <asm/traps.h>
#include <asm/ipc.h>
#include <asm/cacheflush.h>
/*
* sys_pipe() is the normal C calling standard for creating
* a pipe. It's not the way unix traditionally does this, though.
*/
asmlinkage int sys_pipe(unsigned long * fildes)
{
int fd[2];
int error;
error = do_pipe(fd);
if (!error) {
if (copy_to_user(fildes, fd, 2*sizeof(int)))
error = -EFAULT;
}
return error;
}
/* common code for old and new mmaps */
static inline long do_mmap2(
unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
int error = -EBADF;
struct file * file = NULL;
flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
if (!(flags & MAP_ANONYMOUS)) {
file = fget(fd);
if (!file)
goto out;
}
down_write(&current->mm->mmap_sem);
error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
up_write(&current->mm->mmap_sem);
if (file)
fput(file);
out:
return error;
}
asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff)
{
return do_mmap2(addr, len, prot, flags, fd, pgoff);
}
/*
* Perform the select(nd, in, out, ex, tv) and mmap() system
* calls. Linux/m68k cloned Linux/i386, which didn't use to be able to
* handle more than 4 system call parameters, so these system calls
* used a memory block for parameter passing..
*/
struct mmap_arg_struct {
unsigned long addr;
unsigned long len;
unsigned long prot;
unsigned long flags;
unsigned long fd;
unsigned long offset;
};
asmlinkage int old_mmap(struct mmap_arg_struct *arg)
{
struct mmap_arg_struct a;
int error = -EFAULT;
if (copy_from_user(&a, arg, sizeof(a)))
goto out;
error = -EINVAL;
if (a.offset & ~PAGE_MASK)
goto out;
a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
out:
return error;
}
extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
struct sel_arg_struct {
unsigned long n;
fd_set *inp, *outp, *exp;
struct timeval *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;
/* sys_select() does the appropriate kernel locking */
return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
}
/*
* sys_ipc() is the de-multiplexer for the SysV IPC calls..
*
* This is really horribly ugly.
*/
asmlinkage int sys_ipc (uint call, int first, int second,
int third, void *ptr, long fifth)
{
int version;
version = call >> 16; /* hack for backward compatibility */
call &= 0xffff;
if (call <= SEMCTL)
switch (call) {
case SEMOP:
return sys_semop (first, (struct sembuf *)ptr, second);
case SEMGET:
return sys_semget (first, second, third);
case SEMCTL: {
union semun fourth;
if (!ptr)
return -EINVAL;
if (get_user(fourth.__pad, (void **) ptr))
return -EFAULT;
return sys_semctl (first, second, third, fourth);
}
default:
return -EINVAL;
}
if (call <= MSGCTL)
switch (call) {
case MSGSND:
return sys_msgsnd (first, (struct msgbuf *) ptr,
second, third);
case MSGRCV:
switch (version) {
case 0: {
struct ipc_kludge tmp;
if (!ptr)
return -EINVAL;
if (copy_from_user (&tmp,
(struct ipc_kludge *)ptr,
sizeof (tmp)))
return -EFAULT;
return sys_msgrcv (first, tmp.msgp, second,
tmp.msgtyp, third);
}
default:
return sys_msgrcv (first,
(struct msgbuf *) ptr,
second, fifth, third);
}
case MSGGET:
return sys_msgget ((key_t) first, second);
case MSGCTL:
return sys_msgctl (first, second,
(struct msqid_ds *) ptr);
default:
return -EINVAL;
}
return -EINVAL;
}
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
{
return -ENOSYS;
}
/* sys_cacheflush -- flush (part of) the processor cache. */
asmlinkage int
sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
{
flush_cache_all();
return(0);
}
asmlinkage int sys_getpagesize(void)
{
return PAGE_SIZE;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# Makefile for m68knommu specific library files..
#
L_TARGET = lib.a
obj-y := ashldi3.o ashrdi3.o lshrdi3.o \
muldi3.o mulsi3.o divsi3.o udivsi3.o modsi3.o umodsi3.o \
checksum.o semaphore.o memcpy.o memset.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# Makefile for the linux m68knommu specific parts of the memory manager.
#
obj-y += init.o fault.o memory.o kmap.o
include $(TOPDIR)/Rules.make
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment