Skip to content
Browse files

sync with head.

  • Loading branch information...
1 parent 759ae7e commit 6e4fcb90b10b0c2b8d5df59db4b085b6ae94dcb1 yamt committed Dec 13, 2007
Showing with 7,980 additions and 10,575 deletions.
  1. +107 −79 sys/arch/README
  2. +40 −152 sys/arch/amd64/amd64/identcpu.c
  3. +39 −141 sys/arch/arm/arm/arm_machdep.c
  4. +60 −284 sys/arch/arm/include/cpu.h
  5. +53 −467 sys/arch/arm/xscale/becc_icu.c
  6. +452 −188 sys/arch/arm/xscale/becc_timer.c
  7. +253 −520 sys/arch/arm/xscale/i80321_icu.c
  8. +109 −450 sys/arch/arm/xscale/ixp425_intr.c
  9. +76 −395 sys/arch/arm/xscale/pxa2x0_intr.c
  10. +190 −77 sys/arch/bebox/bebox/pic_bebox.c
  11. 0 sys/arch/i386/acpi/Makefile.wakecode
  12. +188 −66 sys/arch/i386/acpi/acpi_wakeup_low.S
  13. 0 sys/arch/i386/acpi/genwakecode.sh
  14. +314 −46 sys/arch/i386/i386/bioscall.S
  15. +223 −437 sys/arch/i386/i386/busfunc.S
  16. +125 −682 sys/arch/i386/i386/copy.S
  17. +82 −406 sys/arch/i386/i386/cpufunc.S
  18. +471 −264 sys/arch/i386/i386/darwin_commpage_machdep.S
  19. +895 −124 sys/arch/i386/i386/db_dbgreg.S
  20. +318 −90 sys/arch/i386/i386/freebsd_sigcode.S
  21. +1,058 −159 sys/arch/i386/i386/i386func.S
  22. +68 −69 sys/arch/i386/i386/ibcs2_sigcode.S
  23. +424 −431 sys/arch/i386/i386/in_cksum.S
  24. +98 −81 sys/arch/i386/i386/linux_sigcode.S
  25. +99 −304 sys/arch/i386/i386/lock_stubs.S
  26. +68 −1,001 sys/arch/i386/i386/locore.S
  27. +52 −93 sys/arch/i386/i386/mach_sigcode.S
  28. +118 −249 sys/arch/i386/i386/mptramp.S
  29. +125 −295 sys/arch/i386/i386/spl.S
  30. +119 −99 sys/arch/i386/i386/svr4_sigcode.S
  31. +345 −999 sys/arch/i386/i386/vector.S
  32. +335 −184 sys/arch/i386/include/asm.h
  33. +88 −72 sys/arch/i386/pnpbios/pnpbioscall.S
  34. +145 −53 sys/arch/landisk/include/intr.h
  35. +187 −157 sys/arch/landisk/landisk/autoconf.c
  36. +65 −350 sys/arch/landisk/landisk/intr.c
  37. +350 −299 sys/arch/macppc/conf/files.macppc
  38. +0 −85 sys/arch/macppc/conf/majors.macppc
  39. +168 −418 sys/arch/macppc/dev/apm.c
  40. +73 −309 sys/arch/macppc/dev/battery.c
Sorry, we could not display the entire diff because it was too big.
View
186 sys/arch/README
@@ -1,79 +1,107 @@
-$NetBSD: README,v 1.47 2007/11/28 20:50:10 ad Exp $
-
-acorn26: Acorn ARM2- and ARM3-based machines (arm, 20000509)
-acorn32: Acorn computers Ltd. ARM 6/7/SA based machines (arm, 20011118)
-algor: Algorithmics, Ltd. MIPS evaluation boards (mips, 20010528)
-alpha: Compaq (formerly Digital Equipment Corp.) Alpha (alpha, 19950213)
-amd64: AMD's x86 64 bit architecture (x86_64, 20010619)
-amiga: Commodore et al. Amiga (m68k, 19930902)
-amigappc: Phase 5 Amiga (powerpc, 20000525)
-arc: MIPS Advanced Risc Computing spec machines (mips, 20000123)
-atari: Atari TT30, Falcon, and Hades (m68k, 19950326)
-bebox: Be Inc. BeBox (powerpc, 19971014)
-cats: Chalice Technologies, CATS motherboard (arm, 19981005)
-cesfic: FIC8234 VME processor board (m68k, 20010514)
-cobalt: Cobalt Networks Microservers (mips, 20000319)
-dreamcast: SEGA Dreamcast (sh3, 20010107)
-evbarm: ARM-based eval boards (arm, 20010905)
-evbmips: MIPS-based eval boards (mips, 20020307)
-evbppc: PowerPC-based eval boards (powerpc, 20021209)
-evbsh3: Hitachi SuperH(TM) sh3 and sh4 eval boards (sh3, 20010206)
-ews4800mips: NEC's MIPS based EWS4800 workstations (ews4800mips, 20051229)
-hp300: Hewlett Packard 300- and 400-series machines (m68k, 19930512)
-hp700: Hewlett Packard 700-series machines (hppa, 20020606)
-hpcarm: ARM based handheld PCs (arm, 20010220)
-hpcmips: MIPS based handheld PCs (mips, 19990925)
-hpcsh: Hitachi SuperH(TM) based handheld PCs (sh3, 20010117)
-i386: Intel/AMD etc. x86 processor line (i386, 19930321)
-ibmnws: IBM Network Station Thin Clients (powerpc, -)
-iyonix: Castle Technology xscale based workstations (arm, 20040713)
-luna68k: LUNA product line of OMRON Tateishi Electric (m68k, 20000105)
-mac68k: Apple Macintosh (m68k, 19930929)
-macppc: Apple Power Macintosh and clones (powerpc, 19980515)
-mipsco: MIPS Corp Magnum 3000 computers (mips, 20000812)
-mmeye: Hitachi SuperH(TM) computer controlled camera (sh3)
-mvme68k: Motorola's VMEbus 68K based single board computers (m68k, 19950725)
-mvmeppc: Motorola's PowerPC machines running older PPCBUG
- (powerpc, 20020227)
-netwinder: StrongARM based Netwinder machines (arm, 20010609)
-news68k: Sony's m68k based NET WORK STATION (m68k, 19991209)
-newsmips: Sony's MIPS based NET WORK STATION (mips, 19980218)
-next68k: NeXT Computer's cubes and slabs (m68k, 19980609)
-ofppc: Open Firmware based PowerPC machines (powerpc, 19980528)
-pc532: "PC-532" kit computer, based on NS 32532 CPU (ns32k, 19930909)
-playstation2: Sony PlayStation 2 (mips, 20011016)
-pmax: Digital Equipment Corp. MIPS based machines (mips, 19931012)
-prep: PowerPC Reference Platform machines (powerpc, 20000229)
-sandpoint: Motorola Sandpoint reference platform and DINK32 machines
- (powerpc, 20010211)
-sbmips: Broadcom's SiByte processor evaluation boards (mips, 20020306)
-sgimips: MIPS based Silicon Graphics machines (mips, 20000614)
-shark: Digital Network Appliance Reference Design ("Shark") (arm, 19960131)
-sparc: Sun Microsystems SPARC (sun4, sun4c, sun4m) 32 bit machines
- (sparc, 19931002)
-sparc64: Sun Microsystems UltraSPARC 64 bit machines (sparc64/sparc, 19980620)
-sun2: Sun m68010 based machines (m68k, 20010328)
-sun3: Sun m680[23]0 based machines (m68k, 19930625)
-vax: Digital Equipment Corp. VAX machines (vax, 19940802)
-x68k: Sharp X68000, X68030 (m68k, 19960505)
-xen: Xen virtual machine monitor (xen, 20040311)
-zaurus: Sharp Zaurus C3x00 PDAs (arm, 20061217)
-
-Generic cpu features shared among multiple ports
-arm: ARM CPU based platform files
-hppa: Hewlett Packard PA-RISC CPU based platform files
-m68k: Motorola 680x0 CPU based platform files
-mips: MIPS CPU based platform files
-powerpc: PowerPC CPU based platform files
-sh3: Hitachi SuperH(TM) sh3 and sh4 CPU based platform files
-sparc: Sun Microsystems SPARC(TM) CPU based platform files
-x86: Intel x86 based platform files.
-
-Generic architectural features shared among multiple ports
-hpc: Handheld PC reference platform files
-sun68k: Sun Microsystems Motorola 680x0 CPU based platform files
-
-Single port cpu families
-alpha: Digital Equipment Alpha processor
-m88k: Motorola 88xxx CPU based platform files
-ns32k: National Semiconductor NS 32532 processor
+/* $NetBSD: linux_oldmmap.c,v 1.66.28.1 2007/12/26 19:49:18 ad Exp $ */
+
+/*-
+ * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden and Eric Haszlakiewicz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.66.28.1 2007/12/26 19:49:18 ad Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mount.h>
+
+#include <sys/syscallargs.h>
+
+#include <uvm/uvm_param.h>
+
+#ifdef __amd64__
+#include <compat/netbsd32/netbsd32.h>
+
+#include <compat/linux32/common/linux32_types.h>
+#include <compat/linux32/common/linux32_machdep.h>
+#endif
+
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_mmap.h>
+#include <compat/linux/common/linux_oldmmap.h>
+#include <compat/linux/common/linux_signal.h>
+
+#include <compat/linux/linux_syscallargs.h>
+
+/* Used on: arm, i386, m68k */
+/* Used for linux32 on: amd64 */
+/* Not used on: alpha, mips, pcc, sparc, sparc64 */
+
+#undef DPRINTF
+#ifdef DEBUG_LINUX
+#define DPRINTF(a) uprintf a
+#else
+#define DPRINTF(a)
+#endif
+
+/*
+ * Linux wants to pass everything to a syscall in registers.
+ * However mmap() has 6 of them. Oops: out of register error.
+ * They just pass everything in a structure.
+ */
+int
+linux_sys_old_mmap(struct lwp *l, const struct linux_sys_old_mmap_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(struct linux_oldmmap *) lmp;
+ } */
+ struct linux_oldmmap lmap;
+ struct linux_sys_mmap_args nlmap;
+ int error;
+
+ if ((error = copyin(SCARG(uap, lmp), &lmap, sizeof lmap)))
+ return error;
+
+ if (lmap.lm_offset & PAGE_MASK)
+ return EINVAL;
+
+ SCARG(&nlmap,addr) = lmap.lm_addr;
+ SCARG(&nlmap,len) = lmap.lm_len;
+ SCARG(&nlmap,prot) = lmap.lm_prot;
+ SCARG(&nlmap,flags) = lmap.lm_flags;
+ SCARG(&nlmap,fd) = lmap.lm_fd;
+ SCARG(&nlmap,offset) = lmap.lm_offset;
+ DPRINTF(("old_mmap(%#x, %u, %u, %u, %d, %u)\n",
+ lmap.lm_addr, lmap.lm_len, lmap.lm_prot, lmap.lm_flags,
+ lmap.lm_fd, lmap.lm_offset));
+ return linux_sys_mmap(l, &nlmap, retval);
+}
+
View
192 sys/arch/amd64/amd64/identcpu.c
@@ -1,10 +1,11 @@
-/* $NetBSD: identcpu.c,v 1.31 2007/11/22 16:16:42 bouyer Exp $ */
+/* $NetBSD: linux_oldolduname.c,v 1.64.2.1 2007/12/26 19:49:18 ad Exp $ */
-/*
- * Copyright (c) 2003 Wasabi Systems, Inc.
+/*-
+ * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
- * Written by Frank van der Linden for Wasabi Systems, Inc.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden and Eric Haszlakiewicz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -16,16 +17,16 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -36,152 +37,39 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.31 2007/11/22 16:16:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.64.2.1 2007/12/26 19:49:18 ad Exp $");
-#include "opt_enhanced_speedstep.h"
-#include "opt_intel_coretemp.h"
-#include "opt_intel_odcm.h"
-#include "opt_powernow_k8.h"
-#include "opt_xen.h"
-
-#include <sys/types.h>
+#include <sys/param.h>
#include <sys/systm.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
-
-#include <x86/cpuvar.h>
-#include <x86/cputypes.h>
-#include <x86/powernow.h>
-
-/* sysctl wants this. */
-char cpu_model[48];
-int cpu_vendor;
-
-void
-identifycpu(struct cpu_info *ci)
-{
- u_int32_t val;
- char buf[512];
- u_int32_t brand[12], descs[4];
- const char *feature_str[3];
-
- x86_cpuid(0, descs);
-
- ci->ci_cpuid_level = descs[0];
- ci->ci_vendor[0] = descs[1];
- ci->ci_vendor[2] = descs[2];
- ci->ci_vendor[1] = descs[3];
- ci->ci_vendor[3] = 0;
-
- x86_cpuid(1, descs);
- ci->ci_signature = descs[0];
- val = descs[1];
- ci->ci_feature2_flags = descs[2];
- ci->ci_feature_flags = descs[3];
-
- x86_cpuid(0x80000001, descs);
- ci->ci_feature_flags |= descs[3];
-
- x86_cpuid(0x80000002, brand);
- x86_cpuid(0x80000003, brand + 4);
- x86_cpuid(0x80000004, brand + 8);
-
- strcpy(cpu_model, (char *)brand);
+#include <sys/kernel.h>
+#include <sys/mount.h>
- cpu_vendor = CPUVENDOR_AMD;
- if (cpu_model[0] == 0)
- strcpy(cpu_model, "Opteron or Athlon 64");
- else if (strstr(cpu_model, "AMD") == NULL)
- cpu_vendor = CPUVENDOR_INTEL;
+#include <sys/syscallargs.h>
- cpu_get_tsc_freq(ci);
- amd_cpu_cacheinfo(ci);
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_mmap.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_oldolduname.h>
+#include <compat/linux/common/linux_machdep.h>
- aprint_normal("%s: %s", ci->ci_dev->dv_xname, cpu_model);
+#include <compat/linux/linux_syscallargs.h>
- if (ci->ci_tsc_freq != 0)
- aprint_normal(", %lu.%02lu MHz",
- (ci->ci_tsc_freq + 4999) / 1000000,
- ((ci->ci_tsc_freq + 4999) / 10000) % 100);
- aprint_normal("\n");
-
- if (cpu_vendor == CPUVENDOR_INTEL) {
- feature_str[0] = CPUID_FLAGS1;
- feature_str[1] = CPUID_FLAGS2;
- feature_str[2] = CPUID_FLAGS3;
- } else {
- feature_str[0] = CPUID_FLAGS1;
- feature_str[1] = CPUID_EXT_FLAGS2;
- feature_str[2] = CPUID_EXT_FLAGS3;
- }
-
- if ((ci->ci_feature_flags & CPUID_MASK1) != 0) {
- bitmask_snprintf(ci->ci_feature_flags,
- feature_str[0], buf, sizeof(buf));
- aprint_verbose("%s: features: %s\n",
- ci->ci_dev->dv_xname, buf);
- }
- if ((ci->ci_feature_flags & CPUID_MASK2) != 0) {
- bitmask_snprintf(ci->ci_feature_flags,
- feature_str[1], buf, sizeof(buf));
- aprint_verbose("%s: features: %s\n",
- ci->ci_dev->dv_xname, buf);
- }
- if ((ci->ci_feature_flags & CPUID_MASK3) != 0) {
- bitmask_snprintf(ci->ci_feature_flags,
- feature_str[2], buf, sizeof(buf));
- aprint_verbose("%s: features: %s\n",
- ci->ci_dev->dv_xname, buf);
- }
-
- if (ci->ci_feature2_flags) {
- bitmask_snprintf(ci->ci_feature2_flags,
- CPUID2_FLAGS, buf, sizeof(buf));
- aprint_verbose("%s: features2: %s\n",
- ci->ci_dev->dv_xname, buf);
- }
-
- if (cpu_vendor == CPUVENDOR_INTEL &&
- (ci->ci_feature_flags & CPUID_MASK4) != 0) {
- bitmask_snprintf(ci->ci_feature_flags,
- CPUID_FLAGS4, buf, sizeof(buf));
- aprint_verbose("%s: features3: %s\n",
- ci->ci_dev->dv_xname, buf);
- }
-
- x86_print_cacheinfo(ci);
-
-#ifdef POWERNOW_K8
- if (CPUID2FAMILY(ci->ci_signature) == 15 &&
- (cpu_model[0] == 'A' || cpu_model[0] == 'O') &&
- powernow_probe(ci))
- k8_powernow_init();
-#endif
-
-#ifdef INTEL_ONDEMAND_CLOCKMOD
- clockmod_init();
-#endif
-
-#ifdef ENHANCED_SPEEDSTEP
- if ((cpu_vendor == CPUVENDOR_INTEL) &&
- (ci->ci_feature2_flags & CPUID2_EST)) {
- if (rdmsr(MSR_MISC_ENABLE) & (1 << 16))
- est_init(CPUVENDOR_INTEL);
- else
- aprint_normal("%s: Enhanced SpeedStep disabled by "
- "BIOS\n", device_xname(ci->ci_dev));
- }
-#endif
-
-#ifdef INTEL_CORETEMP
- if (cpu_vendor == CPUVENDOR_INTEL)
- coretemp_register(ci);
-#endif
-}
+/* Used on: arm, i386, mips, ppc */
+/* Not used on: alpha, m68k, sparc, sparc64 */
-void
-cpu_probe_features(struct cpu_info *ci)
+int
+linux_sys_oldolduname(struct lwp *l, const struct linux_sys_oldolduname_args *uap, register_t *retval)
{
- ci->ci_feature_flags = cpu_feature;
- ci->ci_signature = 0;
+ /* {
+ syscallarg(struct linux_oldoldutsname *) up;
+ } */
+ struct linux_oldoldutsname luts;
+
+ strlcpy(luts.l_sysname, linux_sysname, sizeof(luts.l_sysname));
+ strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
+ strlcpy(luts.l_release, linux_release, sizeof(luts.l_release));
+ strlcpy(luts.l_version, linux_version, sizeof(luts.l_version));
+ strlcpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
+
+ return copyout(&luts, SCARG(uap, up), sizeof(luts));
}
View
180 sys/arch/arm/arm/arm_machdep.c
@@ -1,10 +1,11 @@
-/* $NetBSD: arm_machdep.c,v 1.15 2007/04/22 08:29:55 dsl Exp $ */
+/* $NetBSD: linux_oldselect.c,v 1.54.28.1 2007/12/26 19:49:18 ad Exp $ */
-/*
- * Copyright (c) 2001 Wasabi Systems, Inc.
+/*-
+ * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden and Eric Haszlakiewicz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -16,16 +17,16 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -35,147 +36,44 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Copyright (c) 1994-1998 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
- * All rights reserved.
- *
- * This code is derived from software written for Brini by Mark Brinicombe
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Mark Brinicombe
- * for the NetBSD Project.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "opt_compat_netbsd.h"
-#include "opt_execfmt.h"
-#include "opt_arm_debug.h"
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: linux_oldselect.c,v 1.54.28.1 2007/12/26 19:49:18 ad Exp $");
#include <sys/param.h>
-
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.15 2007/04/22 08:29:55 dsl Exp $");
-
-#include <sys/exec.h>
-#include <sys/proc.h>
#include <sys/systm.h>
-#include <sys/user.h>
-#include <sys/pool.h>
-#include <sys/ucontext.h>
-#include <sys/evcnt.h>
-
-#include <arm/cpufunc.h>
+#include <sys/mount.h>
-#include <machine/pcb.h>
-#include <machine/vmparam.h>
+#include <sys/syscallargs.h>
-/*
- * The ARM architecture places the vector page at address 0.
- * Later ARM architecture versions, however, allow it to be
- * relocated to a high address (0xffff0000). This is primarily
- * to support the Fast Context Switch Extension.
- *
- * This variable contains the address of the vector page. It
- * defaults to 0; it only needs to be initialized if we enable
- * relocated vectors.
- */
-vaddr_t vector_page;
-
-#if defined(ARM_LOCK_CAS_DEBUG)
-/*
- * Event counters for tracking activity of the RAS-based _lock_cas()
- * routine.
- */
-struct evcnt _lock_cas_restart =
- EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "_lock_cas", "restart");
-EVCNT_ATTACH_STATIC(_lock_cas_restart);
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_misc.h>
+#include <compat/linux/common/linux_mmap.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_oldselect.h>
-struct evcnt _lock_cas_success =
- EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "_lock_cas", "success");
-EVCNT_ATTACH_STATIC(_lock_cas_success);
+#include <compat/linux/linux_syscallargs.h>
-struct evcnt _lock_cas_fail =
- EVCNT_INITIALIZER(EVCNT_TYPE_MISC, NULL, "_lock_cas", "fail");
-EVCNT_ATTACH_STATIC(_lock_cas_fail);
-#endif /* ARM_LOCK_CAS_DEBUG */
+/* Used on: arm, i386, m68k */
+/* Not used on: alpha, mips, ppc, sparc, sparc64 */
/*
- * Clear registers on exec
+ * Not sure why the arguments to this older version of select() were put
+ * into a structure, because there are 5, and that can all be handled
+ * in registers on the i386 like Linux wants to.
*/
-
-void
-setregs(struct lwp *l, struct exec_package *pack, u_long stack)
+int
+linux_sys_oldselect(struct lwp *l, const struct linux_sys_oldselect_args *uap, register_t *retval)
{
- struct trapframe *tf;
-
- tf = l->l_addr->u_pcb.pcb_tf;
+ /* {
+ syscallarg(struct linux_oldselect *) lsp;
+ } */
+ struct linux_oldselect ls;
+ int error;
- memset(tf, 0, sizeof(*tf));
- tf->tf_r0 = (u_int)l->l_proc->p_psstr;
-#ifdef COMPAT_13
- tf->tf_r12 = stack; /* needed by pre 1.4 crt0.c */
-#endif
- tf->tf_usr_sp = stack;
- tf->tf_usr_lr = pack->ep_entry;
- tf->tf_svc_lr = 0x77777777; /* Something we can see */
- tf->tf_pc = pack->ep_entry;
-#ifdef __PROG32
- tf->tf_spsr = PSR_USR32_MODE;
-#ifdef THUMB_CODE
- if (pack->ep_entry & 1)
- tf->tf_spsr |= PSR_T_bit;
-#endif
-#endif
+ if ((error = copyin(SCARG(uap, lsp), &ls, sizeof(ls))))
+ return error;
-#ifdef EXEC_AOUT
- if (pack->ep_esch->es_makecmds == exec_aout_makecmds)
- l->l_addr->u_pcb.pcb_flags = PCB_NOALIGNFLT;
- else
-#endif
- l->l_addr->u_pcb.pcb_flags = 0;
+ return linux_select1(l, retval, ls.nfds, ls.readfds, ls.writefds,
+ ls.exceptfds, ls.timeout);
}
-/*
- * startlwp:
- *
- * Start a new LWP.
- */
-void
-startlwp(void *arg)
-{
- int err;
- ucontext_t *uc = arg;
- struct lwp *l = curlwp;
-
- err = cpu_setmcontext(l, &uc->uc_mcontext, uc->uc_flags);
-#ifdef DIAGNOSTIC
- if (err)
- printf("Error %d from cpu_setmcontext.", err);
-#endif
- pool_put(&lwp_uc_pool, uc);
-
- userret(l);
-}
View
344 sys/arch/arm/include/cpu.h
@@ -1,11 +1,11 @@
-/* $NetBSD: cpu.h,v 1.47 2007/10/17 19:53:41 garbled Exp $ */
+/* $NetBSD: linux_olduname.c,v 1.64.2.1 2007/12/26 19:49:18 ad Exp $ */
-/*
- * Copyright (c) 1994-1996 Mark Brinicombe.
- * Copyright (c) 1994 Brini.
+/*-
+ * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
- * This code is derived from software written for Brini by Mark Brinicombe
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden and Eric Haszlakiewicz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -17,286 +17,62 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by Brini.
- * 4. The name of the company nor the name of the author may be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * RiscBSD kernel project
- *
- * cpu.h
- *
- * CPU specific symbols
- *
- * Created : 18/09/94
- *
- * Based on kate/katelib/arm6.h
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _ARM_CPU_H_
-#define _ARM_CPU_H_
-
-/*
- * User-visible definitions
- */
-
-/* CTL_MACHDEP definitions. */
-#define CPU_DEBUG 1 /* int: misc kernel debug control */
-#define CPU_BOOTED_DEVICE 2 /* string: device we booted from */
-#define CPU_BOOTED_KERNEL 3 /* string: kernel we booted */
-#define CPU_CONSDEV 4 /* struct: dev_t of our console */
-#define CPU_POWERSAVE 5 /* int: use CPU powersave mode */
-#define CPU_MAXID 6 /* number of valid machdep ids */
-
-#define CTL_MACHDEP_NAMES { \
- { 0, 0 }, \
- { "debug", CTLTYPE_INT }, \
- { "booted_device", CTLTYPE_STRING }, \
- { "booted_kernel", CTLTYPE_STRING }, \
- { "console_device", CTLTYPE_STRUCT }, \
- { "powersave", CTLTYPE_INT }, \
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.64.2.1 2007/12/26 19:49:18 ad Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/mbuf.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+
+#include <sys/syscallargs.h>
+
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_mmap.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_olduname.h>
+#include <compat/linux/common/linux_machdep.h>
+
+#include <compat/linux/linux_syscallargs.h>
+
+/* Used on: (alpha), arm, i386, mips, ppc */
+/* Not used on: sparc */
+/* Alpha: XXX Only if we assume osf_utsname is used by Linux programs. */
+
+int
+linux_sys_olduname(struct lwp *l, const struct linux_sys_olduname_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(struct linux_oldutsname *) up;
+ } */
+ struct linux_oldutsname luts;
+
+ strlcpy(luts.l_sysname, linux_sysname, sizeof(luts.l_sysname));
+ strlcpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
+ strlcpy(luts.l_release, linux_release, sizeof(luts.l_release));
+ strlcpy(luts.l_version, linux_version, sizeof(luts.l_version));
+ strlcpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
+
+ return copyout(&luts, SCARG(uap, up), sizeof(luts));
}
-
-#ifdef _KERNEL
-
-/*
- * Kernel-only definitions
- */
-
-#ifndef _LKM
-#include "opt_multiprocessor.h"
-#include "opt_lockdebug.h"
-#endif /* !_LKM */
-
-#include <arm/cpuconf.h>
-
-#include <machine/intr.h>
-#ifndef _LOCORE
-#include <sys/user.h>
-#include <machine/frame.h>
-#include <machine/pcb.h>
-#endif /* !_LOCORE */
-
-#include <arm/armreg.h>
-
-#ifndef _LOCORE
-/* 1 == use cpu_sleep(), 0 == don't */
-extern int cpu_do_powersave;
-#endif
-
-#ifdef __PROG32
-#ifdef _LOCORE
-#define IRQdisable \
- stmfd sp!, {r0} ; \
- mrs r0, cpsr ; \
- orr r0, r0, #(I32_bit) ; \
- msr cpsr_c, r0 ; \
- ldmfd sp!, {r0}
-
-#define IRQenable \
- stmfd sp!, {r0} ; \
- mrs r0, cpsr ; \
- bic r0, r0, #(I32_bit) ; \
- msr cpsr_c, r0 ; \
- ldmfd sp!, {r0}
-
-#else
-#define IRQdisable __set_cpsr_c(I32_bit, I32_bit);
-#define IRQenable __set_cpsr_c(I32_bit, 0);
-#endif /* _LOCORE */
-#else
-#define IRQdisable set_r15(R15_IRQ_DISABLE, R15_IRQ_DISABLE);
-#define IRQenable set_r15(R15_IRQ_DISABLE, 0);
-#endif
-
-#ifndef _LOCORE
-
-/* All the CLKF_* macros take a struct clockframe * as an argument. */
-
-/*
- * CLKF_USERMODE: Return TRUE/FALSE (1/0) depending on whether the
- * frame came from USR mode or not.
- */
-#ifdef __PROG32
-#define CLKF_USERMODE(frame) ((frame->cf_if.if_spsr & PSR_MODE) == PSR_USR32_MODE)
-#else
-#define CLKF_USERMODE(frame) ((frame->cf_if.if_r15 & R15_MODE) == R15_MODE_USR)
-#endif
-
-/*
- * CLKF_INTR: True if we took the interrupt from inside another
- * interrupt handler.
- */
-extern int current_intr_depth;
-#ifdef __PROG32
-/* Hack to treat FPE time as interrupt time so we can measure it */
-#define CLKF_INTR(frame) \
- ((current_intr_depth > 1) || \
- (frame->cf_if.if_spsr & PSR_MODE) == PSR_UND32_MODE)
-#else
-#define CLKF_INTR(frame) (current_intr_depth > 1)
-#endif
-
-/*
- * CLKF_PC: Extract the program counter from a clockframe
- */
-#ifdef __PROG32
-#define CLKF_PC(frame) (frame->cf_if.if_pc)
-#else
-#define CLKF_PC(frame) (frame->cf_if.if_r15 & R15_PC)
-#endif
-
-/*
- * LWP_PC: Find out the program counter for the given lwp.
- */
-#ifdef __PROG32
-#define LWP_PC(l) ((l)->l_addr->u_pcb.pcb_tf->tf_pc)
-#else
-#define LWP_PC(l) ((l)->l_addr->u_pcb.pcb_tf->tf_r15 & R15_PC)
-#endif
-
-/*
- * Validate a PC or PSR for a user process. Used by various system calls
- * that take a context passed by the user and restore it.
- */
-
-#ifdef __PROG32
-#define VALID_R15_PSR(r15,psr) \
- (((psr) & PSR_MODE) == PSR_USR32_MODE && \
- ((psr) & (I32_bit | F32_bit)) == 0)
-#else
-#define VALID_R15_PSR(r15,psr) \
- (((r15) & R15_MODE) == R15_MODE_USR && \
- ((r15) & (R15_IRQ_DISABLE | R15_FIQ_DISABLE)) == 0)
-#endif
-
-
-
-/* The address of the vector page. */
-extern vaddr_t vector_page;
-#ifdef __PROG32
-void arm32_vector_init(vaddr_t, int);
-
-#define ARM_VEC_RESET (1 << 0)
-#define ARM_VEC_UNDEFINED (1 << 1)
-#define ARM_VEC_SWI (1 << 2)
-#define ARM_VEC_PREFETCH_ABORT (1 << 3)
-#define ARM_VEC_DATA_ABORT (1 << 4)
-#define ARM_VEC_ADDRESS_EXCEPTION (1 << 5)
-#define ARM_VEC_IRQ (1 << 6)
-#define ARM_VEC_FIQ (1 << 7)
-
-#define ARM_NVEC 8
-#define ARM_VEC_ALL 0xffffffff
-#endif
-
-/*
- * Per-CPU information. For now we assume one CPU.
- */
-
-#include <sys/device.h>
-#include <sys/cpu_data.h>
-struct cpu_info {
- struct cpu_data ci_data; /* MI per-cpu data */
- struct device *ci_dev; /* Device corresponding to this CPU */
- cpuid_t ci_cpuid;
- u_int32_t ci_arm_cpuid; /* aggregate CPU id */
- u_int32_t ci_arm_cputype; /* CPU type */
- u_int32_t ci_arm_cpurev; /* CPU revision */
- u_int32_t ci_ctrl; /* The CPU control register */
- struct evcnt ci_arm700bugcount;
- int32_t ci_mtx_count;
- int ci_mtx_oldspl;
- int ci_want_resched;
-#ifdef MULTIPROCESSOR
- MP_CPU_INFO_MEMBERS
-#endif
-};
-
-#ifndef MULTIPROCESSOR
-extern struct cpu_info cpu_info_store;
-#define curcpu() (&cpu_info_store)
-#define cpu_number() 0
-#endif
-
-#ifdef __PROG32
-void cpu_proc_fork(struct proc *, struct proc *);
-#else
-#define cpu_proc_fork(p1, p2)
-#endif
-
-/*
- * Scheduling glue
- */
-
-extern int astpending;
-#define setsoftast() (astpending = 1)
-
-/*
- * Notify the current process (p) that it has a signal pending,
- * process as soon as possible.
- */
-
-#define cpu_signotify(l) setsoftast()
-
-/*
- * Give a profiling tick to the current process when the user profiling
- * buffer pages are invalid. On the i386, request an ast to send us
- * through trap(), marking the proc as needing a profiling tick.
- */
-#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
-
-#ifndef acorn26
-/*
- * cpu device glue (belongs in cpuvar.h)
- */
-
-struct device;
-void cpu_attach(struct device *);
-#endif
-
-/*
- * Random cruft
- */
-
-struct lwp;
-
-/* locore.S */
-void atomic_set_bit(u_int *, u_int);
-void atomic_clear_bit(u_int *, u_int);
-
-/* cpuswitch.S */
-struct pcb;
-void savectx(struct pcb *);
-
-/* ast.c */
-void userret(register struct lwp *);
-
-/* machdep.h */
-void bootsync(void);
-
-/* fault.c */
-int badaddr_read(void *, size_t, void *);
-
-/* syscall.c */
-void swi_handler(trapframe_t *);
-
-#endif /* !_LOCORE */
-
-#endif /* _KERNEL */
-
-#endif /* !_ARM_CPU_H_ */
-
-/* End of cpu.h */
View
520 sys/arch/arm/xscale/becc_icu.c
@@ -1,10 +1,11 @@
-/* $NetBSD: becc_icu.c,v 1.7 2006/11/24 21:20:05 wiz Exp $ */
+/* $NetBSD: linux_pipe.c,v 1.59.4.1 2007/12/26 19:49:18 ad Exp $ */
-/*
- * Copyright (c) 2002 Wasabi Systems, Inc.
+/*-
+ * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank van der Linden and Eric Haszlakiewicz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -16,16 +17,16 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -35,477 +36,62 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * Interrupt support for the ADI Engineering Big Endian Companion Chip.
- */
-
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_icu.c,v 1.7 2006/11/24 21:20:05 wiz Exp $");
-
-#ifndef EVBARM_SPL_NOINLINE
-#define EVBARM_SPL_NOINLINE
-#endif
+__KERNEL_RCSID(0, "$NetBSD: linux_pipe.c,v 1.59.4.1 2007/12/26 19:49:18 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/mbuf.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
-#include <uvm/uvm_extern.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <arm/cpufunc.h>
-
-#include <arm/xscale/beccreg.h>
-#include <arm/xscale/beccvar.h>
+#include <sys/syscallargs.h>
-#include <arm/xscale/i80200reg.h>
-#include <arm/xscale/i80200var.h>
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_mmap.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_ipc.h>
+#include <compat/linux/common/linux_sem.h>
-/* Interrupt handler queues. */
-struct intrq intrq[NIRQ];
-
-/* Interrupts to mask at each level. */
-uint32_t becc_imask[NIPL];
-
-/* Current interrupt priority level. */
-volatile uint32_t current_spl_level;
-
-/* Interrupts pending. */
-volatile uint32_t becc_ipending;
-volatile uint32_t becc_sipending;
-
-/* Software copy of the IRQs we have enabled. */
-volatile uint32_t intr_enabled;
-
-/* Mask if interrupts steered to FIQs. */
-uint32_t intr_steer;
-
-/*
- * Interrupt bit names.
- * XXX Some of these are BRH-centric.
- */
-const char *becc_irqnames[] = {
- "soft",
- "timer A",
- "timer B",
- "irq 3",
- "irq 4",
- "irq 5",
- "irq 6",
- "diagerr",
- "DMA EOT",
- "DMA PERR",
- "DMA TABT",
- "DMA MABT",
- "irq 12",
- "irq 13",
- "irq 14",
- "irq 15",
- "PCI PERR",
- "irq 17",
- "irq 18",
- "PCI SERR",
- "PCI OAPE",
- "PCI OATA",
- "PCI OAMA",
- "irq 23",
- "irq 24",
- "irq 25",
- "irq 26", /* PCI INTA */
- "irq 27", /* PCI INTB */
- "irq 28", /* PCI INTC */
- "irq 29", /* PCI INTD */
- "pushbutton",
- "irq 31",
-};
-
-void becc_intr_dispatch(struct irqframe *frame);
-
-static inline uint32_t
-becc_icsr_read(void)
-{
- uint32_t icsr;
-
- icsr = BECC_CSR_READ(BECC_ICSR);
-
- /*
- * The ICSR register shows bits that are active even if they are
- * masked in ICMR, so we have to mask them off with the interrupts
- * we consider enabled.
- */
- return (icsr & intr_enabled);
-}
-
-static inline void
-becc_set_intrsteer(void)
-{
-
- BECC_CSR_WRITE(BECC_ICSTR, intr_steer & ICU_VALID_MASK);
- (void) BECC_CSR_READ(BECC_ICSTR);
-}
-
-static inline void
-becc_enable_irq(int irq)
-{
-
- intr_enabled |= (1U << irq);
- becc_set_intrmask();
-}
-
-static inline void
-becc_disable_irq(int irq)
-{
+#include <compat/linux/linux_syscallargs.h>
- intr_enabled &= ~(1U << irq);
- becc_set_intrmask();
-}
+/* Used on: arm, i386, m68k, ppc, amd64 */
+/* Not used on: alpha, mips, sparc, sparc64 */
+/* Alpha, mips, sparc and sparc64 pass one of the fds in a register */
/*
- * NOTE: This routine must be called with interrupts disabled in the CPSR.
+ * NetBSD passes fd[0] in retval[0], and fd[1] in retval[1].
+ * Linux directly passes the pointer.
*/
-static void
-becc_intr_calculate_masks(void)
-{
- struct intrq *iq;
- struct intrhand *ih;
- int irq, ipl;
-
- /* First, figure out which IPLs each IRQ has. */
- for (irq = 0; irq < NIRQ; irq++) {
- int levels = 0;
- iq = &intrq[irq];
- becc_disable_irq(irq);
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- levels |= (1U << ih->ih_ipl);
- iq->iq_levels = levels;
- }
-
- /* Next, figure out which IRQs are used by each IPL. */
- for (ipl = 0; ipl < NIPL; ipl++) {
- int irqs = 0;
- for (irq = 0; irq < NIRQ; irq++) {
- if (intrq[irq].iq_levels & (1U << ipl))
- irqs |= (1U << irq);
- }
- becc_imask[ipl] = irqs;
- }
-
- becc_imask[IPL_NONE] = 0;
-
- /*
- * Initialize the soft interrupt masks to block themselves.
- * Note they all come in at the same physical IRQ.
- */
- becc_imask[IPL_SOFT] = (1U << ICU_SOFT);
- becc_imask[IPL_SOFTCLOCK] = (1U << ICU_SOFT);
- becc_imask[IPL_SOFTNET] = (1U << ICU_SOFT);
- becc_imask[IPL_SOFTSERIAL] = (1U << ICU_SOFT);
-
- /*
- * splsoftclock() is the only interface that users of the
- * generic software interrupt facility have to block their
- * soft intrs, so splsoftclock() must also block IPL_SOFT.
- */
- becc_imask[IPL_SOFTCLOCK] |= becc_imask[IPL_SOFT];
-
- /*
- * splsoftnet() must also block splsoftclock(), since we don't
- * want timer-driven network events to occur while we're
- * processing incoming packets.
- */
- becc_imask[IPL_SOFTNET] |= becc_imask[IPL_SOFTCLOCK];
-
- /*
- * Enforce a hierarchy that gives "slow" device (or devices with
- * limited input buffer space/"real-time" requirements) a better
- * chance at not dropping data.
- */
- becc_imask[IPL_BIO] |= becc_imask[IPL_SOFTNET];
- becc_imask[IPL_NET] |= becc_imask[IPL_BIO];
- becc_imask[IPL_SOFTSERIAL] |= becc_imask[IPL_NET];
- becc_imask[IPL_TTY] |= becc_imask[IPL_SOFTSERIAL];
-
- /*
- * splvm() blocks all interrupts that use the kernel memory
- * allocation facilities.
- */
- becc_imask[IPL_VM] |= becc_imask[IPL_TTY];
-
- /*
- * Audio devices are not allowed to perform memory allocation
- * in their interrupt routines, and they have fairly "real-time"
- * requirements, so give them a high interrupt priority.
- */
- becc_imask[IPL_AUDIO] |= becc_imask[IPL_VM];
-
- /*
- * splclock() must block anything that uses the scheduler.
- */
- becc_imask[IPL_CLOCK] |= becc_imask[IPL_AUDIO];
-
- /*
- * No separate statclock on the IQ80310.
- */
- becc_imask[IPL_STATCLOCK] |= becc_imask[IPL_CLOCK];
-
- /*
- * splhigh() must block "everything".
- */
- becc_imask[IPL_HIGH] |= becc_imask[IPL_STATCLOCK];
-
- /*
- * XXX We need serial drivers to run at the absolute highest priority
- * in order to avoid overruns, so serial > high.
- */
- becc_imask[IPL_SERIAL] |= becc_imask[IPL_HIGH];
-
- /*
- * Now compute which IRQs must be blocked when servicing any
- * given IRQ.
- */
- for (irq = 0; irq < NIRQ; irq++) {
- int irqs = (1U << irq);
- iq = &intrq[irq];
- if (TAILQ_FIRST(&iq->iq_list) != NULL)
- becc_enable_irq(irq);
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list))
- irqs |= becc_imask[ih->ih_ipl];
- iq->iq_mask = irqs;
- }
-}
-
-void
-splx(int new)
-{
-
- becc_splx(new);
-}
-
-int
-_spllower(int ipl)
-{
-
- return (becc_spllower(ipl));
-}
-
-int
-_splraise(int ipl)
-{
-
- return (becc_splraise(ipl));
-}
-
-void
-_setsoftintr(int si)
-{
-
- becc_setsoftintr(si);
-}
-
-static const int si_to_ipl[SI_NQUEUES] = {
- IPL_SOFT, /* SI_SOFT */
- IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
- IPL_SOFTNET, /* SI_SOFTNET */
- IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
-};
-
int
-becc_softint(void *arg)
-{
- static __cpu_simple_lock_t processing = __SIMPLELOCK_UNLOCKED;
- uint32_t new, oldirqstate;
-
- /* Clear interrupt */
- BECC_CSR_WRITE(BECC_ICSR, 0);
-
- if (__cpu_simple_lock_try(&processing) == 0)
- return 0;
-
- oldirqstate = disable_interrupts(I32_bit);
-
- new = current_spl_level;
-
-#define DO_SOFTINT(si) \
- if (becc_sipending & (1 << (si))) { \
- becc_sipending &= ~(1 << (si)); \
- current_spl_level |= becc_imask[si_to_ipl[(si)]]; \
- restore_interrupts(oldirqstate); \
- softintr_dispatch(si); \
- oldirqstate = disable_interrupts(I32_bit); \
- current_spl_level = new; \
- }
-
- DO_SOFTINT(SI_SOFTSERIAL);
- DO_SOFTINT(SI_SOFTNET);
- DO_SOFTINT(SI_SOFTCLOCK);
- DO_SOFTINT(SI_SOFT);
-
- __cpu_simple_unlock(&processing);
-
- restore_interrupts(oldirqstate);
-
- return 1;
-}
-
-/*
- * becc_icu_init:
- *
- * Initialize the BECC ICU. Called early in bootstrap
- * to make sure the ICU is in a pristine state.
- */
-void
-becc_icu_init(void)
-{
-
- intr_enabled = 0; /* All interrupts disabled */
- becc_set_intrmask();
-
- intr_steer = 0; /* All interrupts steered to IRQ */
- becc_set_intrsteer();
-
- i80200_extirq_dispatch = becc_intr_dispatch;
-
- i80200_intr_enable(INTCTL_IM);
-}
-
-/*
- * becc_intr_init:
- *
- * Initialize the rest of the interrupt subsystem, making it
- * ready to handle interrupts from devices.
- */
-void
-becc_intr_init(void)
-{
- struct intrq *iq;
- int i;
-
- intr_enabled = 0;
-
- for (i = 0; i < NIRQ; i++) {
- iq = &intrq[i];
- TAILQ_INIT(&iq->iq_list);
-
- evcnt_attach_dynamic(&iq->iq_ev, EVCNT_TYPE_INTR,
- NULL, "becc", becc_irqnames[i]);
- }
-
- becc_intr_calculate_masks();
-
- /* Enable IRQs (don't yet use FIQs). */
- enable_interrupts(I32_bit);
-}
-
-void *
-becc_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
-{
- struct intrq *iq;
- struct intrhand *ih;
- uint32_t oldirqstate;
-
- if (irq < 0 || irq > NIRQ)
- panic("becc_intr_establish: IRQ %d out of range", irq);
-
- ih = malloc(sizeof(*ih), M_DEVBUF, M_NOWAIT);
- if (ih == NULL)
- return (NULL);
-
- ih->ih_func = func;
- ih->ih_arg = arg;
- ih->ih_ipl = ipl;
- ih->ih_irq = irq;
-
- iq = &intrq[irq];
-
- /* All BECC interrupts are level-triggered. */
- iq->iq_ist = IST_LEVEL;
-
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_INSERT_TAIL(&iq->iq_list, ih, ih_list);
-
- becc_intr_calculate_masks();
-
- restore_interrupts(oldirqstate);
-
- return (ih);
-}
-
-void
-becc_intr_disestablish(void *cookie)
+linux_sys_pipe(struct lwp *l, const struct linux_sys_pipe_args *uap, register_t *retval)
{
- struct intrhand *ih = cookie;
- struct intrq *iq = &intrq[ih->ih_irq];
- uint32_t oldirqstate;
-
- oldirqstate = disable_interrupts(I32_bit);
-
- TAILQ_REMOVE(&iq->iq_list, ih, ih_list);
-
- becc_intr_calculate_masks();
-
- restore_interrupts(oldirqstate);
-}
-
-void
-becc_intr_dispatch(struct irqframe *frame)
-{
- struct intrq *iq;
- struct intrhand *ih;
- uint32_t oldirqstate, pcpl, irq, ibit, hwpend;
-
- pcpl = current_spl_level;
-
- hwpend = becc_icsr_read();
-
- /*
- * Disable all the interrupts that are pending. We will
- * reenable them once they are processed and not masked.
- */
- intr_enabled &= ~hwpend;
- becc_set_intrmask();
-
- while (hwpend != 0) {
- irq = ffs(hwpend) - 1;
- ibit = (1U << irq);
-
- hwpend &= ~ibit;
-
- if (pcpl & ibit) {
- /*
- * IRQ is masked; mark it as pending and check
- * the next one. Note: the IRQ is already disabled.
- */
- becc_ipending |= ibit;
- continue;
- }
-
- becc_ipending &= ~ibit;
+ /* {
+ syscallarg(int *) pfds;
+ } */
+ int error;
+#ifdef __amd64__
+ int pfds[2];
+#endif
- iq = &intrq[irq];
- iq->iq_ev.ev_count++;
- uvmexp.intrs++;
- current_spl_level |= iq->iq_mask;
- oldirqstate = enable_interrupts(I32_bit);
- for (ih = TAILQ_FIRST(&iq->iq_list); ih != NULL;
- ih = TAILQ_NEXT(ih, ih_list)) {
- (void) (*ih->ih_func)(ih->ih_arg ? ih->ih_arg : frame);
- }
- restore_interrupts(oldirqstate);
+ if ((error = sys_pipe(l, 0, retval)))
+ return error;
- current_spl_level = pcpl;
+#ifndef __amd64__
+ /* Assumes register_t is an int */
+ if ((error = copyout(retval, SCARG(uap, pfds), 2 * sizeof (int))))
+ return error;
+#else
+ /* On amd64, sizeof(register_t) != sizeof(int) */
+ pfds[0] = (int)retval[0];
+ pfds[1] = (int)retval[1];
- /* Re-enable this interrupt now that's it's cleared. */
- intr_enabled |= ibit;
- becc_set_intrmask();
- }
+ if ((error = copyout(pfds, SCARG(uap, pfds), sizeof(pfds))))
+ return error;
+#endif
- if (becc_ipending & ~pcpl) {
- intr_enabled |= (becc_ipending & ~pcpl);
- becc_set_intrmask();
- }
+ retval[0] = 0;
+ return 0;
}
View
640 sys/arch/arm/xscale/becc_timer.c
@@ -1,10 +1,12 @@
-/* $NetBSD: becc_timer.c,v 1.11 2007/01/06 16:18:18 christos Exp $ */
+/* $NetBSD: linux_sched.c,v 1.44.4.1 2007/12/26 19:49:19 ad Exp $ */
-/*
- * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
- * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center; by Matthias Scheler.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -16,16 +18,16 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -36,253 +38,515 @@
*/
/*
- * Timer/clock support for the ADI Engineering Big Endian Companion Chip.
+ * Linux compatibility module. Try to deal with scheduler related syscalls.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: becc_timer.c,v 1.11 2007/01/06 16:18:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.44.4.1 2007/12/26 19:49:19 ad Exp $");
#include <sys/param.h>
+#include <sys/mount.h>
+#include <sys/proc.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/time.h>
-
-#include <dev/clock_subr.h>
-
-#include <machine/bus.h>
-#include <arm/cpufunc.h>
-
-#include <arm/xscale/beccreg.h>
-#include <arm/xscale/beccvar.h>
+#include <sys/sysctl.h>
+#include <sys/malloc.h>
+#include <sys/syscallargs.h>
+#include <sys/wait.h>
+#include <sys/kauth.h>
+#include <sys/ptrace.h>
-void (*becc_hardclock_hook)(void);
-
-/*
- * Note, since COUNTS_PER_USEC doesn't divide evenly, we round up.
- */
-#define COUNTS_PER_SEC BECC_PERIPH_CLOCK
-#define COUNTS_PER_USEC ((COUNTS_PER_SEC / 1000000) + 1)
+#include <sys/cpu.h>
-static void *clock_ih;
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_signal.h>
+#include <compat/linux/common/linux_machdep.h> /* For LINUX_NPTL */
+#include <compat/linux/common/linux_emuldata.h>
+#include <compat/linux/common/linux_ipc.h>
+#include <compat/linux/common/linux_sem.h>
-/*
- * Since the timer interrupts when the counter underflows, we need to
- * subtract 1 from counts_per_hz when loading the preload register.
- */
-static uint32_t counts_per_hz;
+#include <compat/linux/linux_syscallargs.h>
-int clockhandler(void *);
+#include <compat/linux/common/linux_sched.h>
-/*
- * becc_calibrate_delay:
- *
- * Calibrate the delay loop.
- */
-void
-becc_calibrate_delay(void)
+int
+linux_sys_clone(struct lwp *l, const struct linux_sys_clone_args *uap, register_t *retval)
{
+ /* {
+ syscallarg(int) flags;
+ syscallarg(void *) stack;
+#ifdef LINUX_NPTL
+ syscallarg(void *) parent_tidptr;
+ syscallarg(void *) child_tidptr;
+#endif
+ } */
+ int flags, sig;
+ int error;
+#ifdef LINUX_NPTL
+ struct linux_emuldata *led;
+#endif
/*
- * Just use hz=100 for now -- we'll adjust it, if necessary,
- * in cpu_initclocks().
+ * We don't support the Linux CLONE_PID or CLONE_PTRACE flags.
*/
- counts_per_hz = COUNTS_PER_SEC / 100;
+ if (SCARG(uap, flags) & (LINUX_CLONE_PID|LINUX_CLONE_PTRACE))
+ return (EINVAL);
- /* Stop both timers, clear interrupts. */
- BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TIF);
- BECC_CSR_WRITE(BECC_TSCRB, TSCRx_TIF);
+ /*
+ * Thread group implies shared signals. Shared signals
+ * imply shared VM. This matches what Linux kernel does.
+ */
+ if (SCARG(uap, flags) & LINUX_CLONE_THREAD
+ && (SCARG(uap, flags) & LINUX_CLONE_SIGHAND) == 0)
+ return (EINVAL);
+ if (SCARG(uap, flags) & LINUX_CLONE_SIGHAND
+ && (SCARG(uap, flags) & LINUX_CLONE_VM) == 0)
+ return (EINVAL);
+
+ flags = 0;
+
+ if (SCARG(uap, flags) & LINUX_CLONE_VM)
+ flags |= FORK_SHAREVM;
+ if (SCARG(uap, flags) & LINUX_CLONE_FS)
+ flags |= FORK_SHARECWD;
+ if (SCARG(uap, flags) & LINUX_CLONE_FILES)
+ flags |= FORK_SHAREFILES;
+ if (SCARG(uap, flags) & LINUX_CLONE_SIGHAND)
+ flags |= FORK_SHARESIGS;
+ if (SCARG(uap, flags) & LINUX_CLONE_VFORK)
+ flags |= FORK_PPWAIT;
+
+ sig = SCARG(uap, flags) & LINUX_CLONE_CSIGNAL;
+ if (sig < 0 || sig >= LINUX__NSIG)
+ return (EINVAL);
+ sig = linux_to_native_signo[sig];
+
+#ifdef LINUX_NPTL
+ led = (struct linux_emuldata *)l->l_proc->p_emuldata;
+
+ led->parent_tidptr = SCARG(uap, parent_tidptr);
+ led->child_tidptr = SCARG(uap, child_tidptr);
+ led->clone_flags = SCARG(uap, flags);
+#endif /* LINUX_NPTL */
- /* Set the timer preload value. */
- BECC_CSR_WRITE(BECC_TPRA, counts_per_hz - 1);
+ /*
+ * Note that Linux does not provide a portable way of specifying
+ * the stack area; the caller must know if the stack grows up
+ * or down. So, we pass a stack size of 0, so that the code
+ * that makes this adjustment is a noop.
+ */
+ if ((error = fork1(l, flags, sig, SCARG(uap, stack), 0,
+ NULL, NULL, retval, NULL)) != 0)
+ return error;
- /* Start the timer. */
- BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TE | TSCRx_CM);
+ return 0;
}
+int
+linux_sys_sched_setparam(struct lwp *l, const struct linux_sys_sched_setparam_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(linux_pid_t) pid;
+ syscallarg(const struct linux_sched_param *) sp;
+ } */
+ int error;
+ struct linux_sched_param lp;
+ struct proc *p;
+
/*
- * cpu_initclocks:
- *
- * Initialize the clock and get them going.
+ * We only check for valid parameters and return afterwards.
*/
-void
-cpu_initclocks(void)
-{
- u_int oldirqstate;
-#if 0
- if (hz < 50 || COUNTS_PER_SEC % hz) {
- printf("Cannot get %d Hz clock; using 100 Hz\n", hz);
- hz = 100;
- }
-#endif
- tick = 1000000 / hz; /* number of microseconds between interrupts */
- tickfix = 1000000 - (hz * tick);
- if (tickfix) {
- int ftp;
-
- ftp = min(ffs(tickfix), ffs(hz));
- tickfix >>= (ftp - 1);
- tickfixinterval = hz >> (ftp - 1);
+ if (SCARG(uap, pid) < 0 || SCARG(uap, sp) == NULL)
+ return EINVAL;
+
+ error = copyin(SCARG(uap, sp), &lp, sizeof(lp));
+ if (error)
+ return error;
+
+ if (SCARG(uap, pid) != 0) {
+ kauth_cred_t pc = l->l_cred;
+
+ if ((p = pfind(SCARG(uap, pid))) == NULL)
+ return ESRCH;
+ if (!(l->l_proc == p ||
+ kauth_authorize_generic(pc, KAUTH_GENERIC_ISSUSER, NULL) == 0 ||
+ kauth_cred_getuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_getuid(pc) == kauth_cred_geteuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_geteuid(p->p_cred)))
+ return EPERM;
}
- /*
- * We only have one timer available; stathz and profhz are
- * always left as 0 (the upper-layer clock code deals with
- * this situation).
- */
- if (stathz != 0)
- printf("Cannot get %d Hz statclock\n", stathz);
- stathz = 0;
+ return 0;
+}
- if (profhz != 0)
- printf("Cannot get %d Hz profclock\n", profhz);
- profhz = 0;
+int
+linux_sys_sched_getparam(struct lwp *l, const struct linux_sys_sched_getparam_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(linux_pid_t) pid;
+ syscallarg(struct linux_sched_param *) sp;
+ } */
+ struct proc *p;
+ struct linux_sched_param lp;
- /* Report the clock frequency. */
- aprint_normal("clock: hz=%d stathz=%d profhz=%d\n", hz, stathz, profhz);
+/*
+ * We only check for valid parameters and return a dummy priority afterwards.
+ */
+ if (SCARG(uap, pid) < 0 || SCARG(uap, sp) == NULL)
+ return EINVAL;
+
+ if (SCARG(uap, pid) != 0) {
+ kauth_cred_t pc = l->l_cred;
+
+ if ((p = pfind(SCARG(uap, pid))) == NULL)
+ return ESRCH;
+ if (!(l->l_proc == p ||
+ kauth_authorize_generic(pc, KAUTH_GENERIC_ISSUSER, NULL) == 0 ||
+ kauth_cred_getuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_getuid(pc) == kauth_cred_geteuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_geteuid(p->p_cred)))
+ return EPERM;
+ }
- oldirqstate = disable_interrupts(I32_bit);
+ lp.sched_priority = 0;
+ return copyout(&lp, SCARG(uap, sp), sizeof(lp));
+}
- /* Hook up the clock interrupt handler. */
- clock_ih = becc_intr_establish(ICU_TIMERA, IPL_CLOCK,
- clockhandler, NULL);
- if (clock_ih == NULL)
- panic("cpu_initclocks: unable to register timer interrupt");
+int
+linux_sys_sched_setscheduler(struct lwp *l, const struct linux_sys_sched_setscheduler_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(linux_pid_t) pid;
+ syscallarg(int) policy;
+ syscallarg(cont struct linux_sched_scheduler *) sp;
+ } */
+ int error;
+ struct linux_sched_param lp;
+ struct proc *p;
- /* Set up the new clock parameters. */
+/*
+ * We only check for valid parameters and return afterwards.
+ */
- /* Stop timer, clear interrupt */
- BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TIF);
+ if (SCARG(uap, pid) < 0 || SCARG(uap, sp) == NULL)
+ return EINVAL;
+
+ error = copyin(SCARG(uap, sp), &lp, sizeof(lp));
+ if (error)
+ return error;
+
+ if (SCARG(uap, pid) != 0) {
+ kauth_cred_t pc = l->l_cred;
+
+ if ((p = pfind(SCARG(uap, pid))) == NULL)
+ return ESRCH;
+ if (!(l->l_proc == p ||
+ kauth_authorize_generic(pc, KAUTH_GENERIC_ISSUSER, NULL) == 0 ||
+ kauth_cred_getuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_getuid(pc) == kauth_cred_geteuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_geteuid(p->p_cred)))
+ return EPERM;
+ }
- counts_per_hz = COUNTS_PER_SEC / hz;
+ return 0;
+/*
+ * We can't emulate anything put the default scheduling policy.
+ */
+ if (SCARG(uap, policy) != LINUX_SCHED_OTHER || lp.sched_priority != 0)
+ return EINVAL;
- /* Set the timer preload value. */
- BECC_CSR_WRITE(BECC_TPRA, counts_per_hz - 1);
+ return 0;
+}
- /* ...and start it in motion. */
- BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TE | TSCRx_CM);
+int
+linux_sys_sched_getscheduler(struct lwp *l, const struct linux_sys_sched_getscheduler_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(linux_pid_t) pid;
+ } */
+ struct proc *p;
- /* register soft interrupt handler as well */
- becc_intr_establish(ICU_SOFT, IPL_SOFT, becc_softint, NULL);
+ *retval = -1;
+/*
+ * We only check for valid parameters and return afterwards.
+ */
- restore_interrupts(oldirqstate);
-}
+ if (SCARG(uap, pid) != 0) {
+ kauth_cred_t pc = l->l_cred;
+
+ if ((p = pfind(SCARG(uap, pid))) == NULL)
+ return ESRCH;
+ if (!(l->l_proc == p ||
+ kauth_authorize_generic(pc, KAUTH_GENERIC_ISSUSER, NULL) == 0 ||
+ kauth_cred_getuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_getuid(p->p_cred) ||
+ kauth_cred_getuid(pc) == kauth_cred_geteuid(p->p_cred) ||
+ kauth_cred_geteuid(pc) == kauth_cred_geteuid(p->p_cred)))
+ return EPERM;
+ }
/*
- * setstatclockrate:
- *
- * Set the rate of the statistics clock.
- *
- * We assume that hz is either stathz or profhz, and that neither
- * will change after being set by cpu_initclocks(). We could
- * recalculate the intervals here, but that would be a pain.
+ * We can't emulate anything put the default scheduling policy.
*/
-void
-setstatclockrate(int new_hz)
+ *retval = LINUX_SCHED_OTHER;
+ return 0;
+}
+
+int
+linux_sys_sched_yield(struct lwp *l, const void *v, register_t *retval)
{
- /*
- * XXX Use TMR1?
- */
+ yield();
+ return 0;
}
+int
+linux_sys_sched_get_priority_max(struct lwp *l, const struct linux_sys_sched_get_priority_max_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(int) policy;
+ } */
+
/*
- * microtime:
- *
- * Fill in the specified timeval struct with the current time
- * accurate to the microsecond.
+ * We can't emulate anything put the default scheduling policy.
*/
-void
-microtime(struct timeval *tvp)
+ if (SCARG(uap, policy) != LINUX_SCHED_OTHER) {
+ *retval = -1;
+ return EINVAL;
+ }
+
+ *retval = 0;
+ return 0;
+}
+
+int
+linux_sys_sched_get_priority_min(struct lwp *l, const struct linux_sys_sched_get_priority_min_args *uap, register_t *retval)
{
- static struct timeval lasttv;
- u_int oldirqstate;
- uint32_t counts;
+ /* {
+ syscallarg(int) policy;
+ } */
- oldirqstate = disable_interrupts(I32_bit);
+/*
+ * We can't emulate anything put the default scheduling policy.
+ */
+ if (SCARG(uap, policy) != LINUX_SCHED_OTHER) {
+ *retval = -1;
+ return EINVAL;
+ }
- /*
- * XXX How do we compensate for the -1 behavior of the preload value?
- */
- counts = counts_per_hz - BECC_CSR_READ(BECC_TCVRA);
+ *retval = 0;
+ return 0;
+}
- /* Fill in the timeval struct. */
- *tvp = time;
- tvp->tv_usec += (counts / COUNTS_PER_USEC);
+#ifndef __m68k__
+/* Present on everything but m68k */
+int
+linux_sys_exit_group(struct lwp *l, const struct linux_sys_exit_group_args *uap, register_t *retval)
+{
+#ifdef LINUX_NPTL
+ /* {
+ syscallarg(int) error_code;
+ } */
+ struct proc *p = l->l_proc;
+ struct linux_emuldata *led = p->p_emuldata;
+ struct linux_emuldata *e;
+
+ if (led->s->flags & LINUX_LES_USE_NPTL) {
+
+#ifdef DEBUG_LINUX
+ printf("%s:%d, led->s->refs = %d\n", __func__, __LINE__,
+ led->s->refs);
+#endif
- /* Make sure microseconds doesn't overflow. */
- while (tvp->tv_usec >= 1000000) {
- tvp->tv_usec -= 1000000;
- tvp->tv_sec++;
- }
+ /*
+ * The calling thread is supposed to kill all threads
+ * in the same thread group (i.e. all threads created
+ * via clone(2) with CLONE_THREAD flag set).
+ *
+ * If there is only one thread, things are quite simple
+ */
+ if (led->s->refs == 1)
+ return sys_exit(l, (const void *)uap, retval);
+
+#ifdef DEBUG_LINUX
+ printf("%s:%d\n", __func__, __LINE__);
+#endif
- /* Make sure the time has advanced. */
- if (tvp->tv_sec == lasttv.tv_sec &&
- tvp->tv_usec <= lasttv.tv_usec) {
- tvp->tv_usec = lasttv.tv_usec + 1;
- if (tvp->tv_usec >= 1000000) {
- tvp->tv_usec -= 1000000;
- tvp->tv_sec++;
+ led->s->flags |= LINUX_LES_INEXITGROUP;
+ led->s->xstat = W_EXITCODE(SCARG(uap, error_code), 0);
+
+ /*
+ * Kill all threads in the group. The emulation exit hook takes
+ * care of hiding the zombies and reporting the exit code
+ * properly.
+ */
+ mutex_enter(&proclist_mutex);
+ LIST_FOREACH(e, &led->s->threads, threads) {
+ if (e->proc == p)
+ continue;
+
+#ifdef DEBUG_LINUX
+ printf("%s: kill PID %d\n", __func__, e->proc->p_pid);
+#endif
+ psignal(e->proc, SIGKILL);
}
+
+ /* Now, kill ourselves */
+ psignal(p, SIGKILL);
+ mutex_exit(&proclist_mutex);
+
+ return 0;
+
}
+#endif /* LINUX_NPTL */
+
+ return sys_exit(l, (const void *)uap, retval);
+}
+#endif /* !__m68k__ */
+
+#ifdef LINUX_NPTL
+int
+linux_sys_set_tid_address(struct lwp *l, const struct linux_sys_set_tid_address_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(int *) tidptr;
+ } */
+ struct linux_emuldata *led;
+
+ led = (struct linux_emuldata *)l->l_proc->p_emuldata;
+ led->clear_tid = SCARG(uap, tid);
- lasttv = *tvp;
+ led->s->flags |= LINUX_LES_USE_NPTL;
- restore_interrupts(oldirqstate);
+ *retval = l->l_proc->p_pid;
+
+ return 0;
}
-/*
- * delay:
- *
- * Delay for at least N microseconds.
- */
-void
-delay(u_int n)
+/* ARGUSED1 */
+int
+linux_sys_gettid(struct lwp *l, const void *v, register_t *retval)
{
- uint32_t cur, last, delta, usecs;
+ /* The Linux kernel does it exactly that way */
+ *retval = l->l_proc->p_pid;
+ return 0;
+}
- /*
- * This works by polling the timer and counting the
- * number of microseconds that go by.
- */
- last = BECC_CSR_READ(BECC_TCVRA);
- delta = usecs = 0;
+#ifdef LINUX_NPTL
+/* ARGUSED1 */
+int
+linux_sys_getpid(struct lwp *l, const void *v, register_t *retval)
+{
+ struct linux_emuldata *led = l->l_proc->p_emuldata;
+
+ if (led->s->flags & LINUX_LES_USE_NPTL) {
+ /* The Linux kernel does it exactly that way */
+ *retval = led->s->group_pid;
+ } else {
+ *retval = l->l_proc->p_pid;
+ }
- while (n > usecs) {
- cur = BECC_CSR_READ(BECC_TCVRA);
+ return 0;
+}
- /* Check to see if the timer has wrapped around. */
- if (last < cur)
- delta += (last + (counts_per_hz - cur));
- else
- delta += (last - cur);
+/* ARGUSED1 */
+int
+linux_sys_getppid(struct lwp *l, const void *v, register_t *retval)
+{
+ struct proc *p = l->l_proc;
+ struct linux_emuldata *led = p->p_emuldata;
+ struct proc *glp;
+ struct proc *pp;
+
+ if (led->s->flags & LINUX_LES_USE_NPTL) {
+
+ /* Find the thread group leader's parent */
+ if ((glp = pfind(led->s->group_pid)) == NULL) {
+ /* Maybe panic... */
+ printf("linux_sys_getppid: missing group leader PID"
+ " %d\n", led->s->group_pid);
+ return -1;
+ }
+ pp = glp->p_pptr;
- last = cur;
+ /* If this is a Linux process too, return thread group PID */
+ if (pp->p_emul == p->p_emul) {
+ struct linux_emuldata *pled;
- if (delta >= COUNTS_PER_USEC) {
- usecs += delta / COUNTS_PER_USEC;
- delta %= COUNTS_PER_USEC;
+ pled = pp->p_emuldata;
+ *retval = pled->s->group_pid;
+ } else {
+ *retval = pp->p_pid;
}
+
+ } else {
+ *retval = p->p_pptr->p_pid;
}
+
+ return 0;
}
+#endif /* LINUX_NPTL */
-/*
- * clockhandler:
- *
- * Handle the hardclock interrupt.
- */
int
-clockhandler(void *arg)
+linux_sys_sched_getaffinity(struct lwp *l, const struct linux_sys_sched_getaffinity_args *uap, register_t *retval)
{
- struct clockframe *frame = arg;
+ /* {
+ syscallarg(pid_t) pid;
+ syscallarg(unsigned int) len;
+ syscallarg(unsigned long *) mask;
+ } */
+ int error;
+ int ret;
+ char *data;
+ int *retp;
+
+ if (SCARG(uap, mask) == NULL)
+ return EINVAL;
+
+ if (SCARG(uap, len) < sizeof(int))
+ return EINVAL;
+
+ if (pfind(SCARG(uap, pid)) == NULL)
+ return ESRCH;
+
+ /*
+ * return the actual number of CPU, tag all of them as available
+ * The result is a mask, the first CPU being in the least significant
+ * bit.
+ */
+ ret = (1 << ncpu) - 1;
+ data = malloc(SCARG(uap, len), M_TEMP, M_WAITOK|M_ZERO);
+ retp = (int *)&data[SCARG(uap, len) - sizeof(ret)];
+ *retp = ret;
- /* ACK the interrupt. */
- BECC_CSR_WRITE(BECC_TSCRA, TSCRx_TE | TSCRx_CM | TSCRx_TIF);
+ if ((error = copyout(data, SCARG(uap, mask), SCARG(uap, len))) != 0)
+ return error;
- hardclock(frame);
+ free(data, M_TEMP);
- if (becc_hardclock_hook != NULL)
- (*becc_hardclock_hook)();
+ return 0;
- return (1);
}
+
+int
+linux_sys_sched_setaffinity(struct lwp *l, const struct linux_sys_sched_setaffinity_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(pid_t) pid;
+ syscallarg(unsigned int) len;
+ syscallarg(unsigned long *) mask;
+ } */
+
+ if (pfind(SCARG(uap, pid)) == NULL)
+ return ESRCH;
+
+ /* Let's ignore it */
+#ifdef DEBUG_LINUX
+ printf("linux_sys_sched_setaffinity\n");
+#endif
+ return 0;
+};
+#endif /* LINUX_NPTL */
View
773 sys/arch/arm/xscale/i80321_icu.c
@@ -1,569 +1,302 @@
-/* $NetBSD: i80321_icu.c,v 1.15 2007/12/03 15:33:20 ad Exp $ */
+/* $NetBSD: linux_sg.c,v 1.11.4.1 2007/12/26 19:49:19 ad Exp $ */
/*
- * Copyright (c) 2001, 2002, 2006 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe and Steve C. Woodford for Wasabi Systems, Inc.
+ * Copyright (c) 2004 Soren S. Jorvang. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project by
- * Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
*
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i80321_icu.c,v 1.15 2007/12/03 15:33:20 ad Exp $");
-
-#ifndef EVBARM_SPL_NOINLINE
-#define EVBARM_SPL_NOINLINE
-#endif
-
-/*
- * Interrupt support for the Intel i80321 I/O Processor.
- */
+__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.11.4.1 2007/12/26 19:49:19 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/malloc.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/bus.h>
-#include <machine/intr.h>
-
-#include <arm/cpufunc.h>
-
-#include <arm/xscale/i80321reg.h>
-#include <arm/xscale/i80321var.h>
-
-/* Interrupt handler queues. */
-struct intrq intrq[NIRQ];
-
-/* Interrupts to mask at each level. */
-int i80321_imask[NIPL];
-
-/* Current interrupt priority level. */
-volatile int current_spl_level;
-
-/* Interrupts pending. */
-volatile int i80321_ipending;
-
-/* Software copy of the IRQs we have enabled. */
-volatile uint32_t intr_enabled;
-
-/* Mask if interrupts steered to FIQs. */
-uint32_t intr_steer;
-
-/*
- * Map a software interrupt queue index (to the unused bits in the
- * ICU registers -- XXX will need to revisit this if those bits are
- * ever used in future steppings).
- */
-static const uint32_t si_to_irqbit[4] = {
- ICU_INT_bit26, /* SI_SOFTCLOCK */
- ICU_INT_bit22, /* SI_SOFTBIO */
- ICU_INT_bit5, /* SI_SOFTNET */
- ICU_INT_bit4, /* SI_SOFTSERIAL */
-};
-
-#define SI_TO_IRQBIT(si) (1U << si_to_irqbit[(si)])
-
-/*
- * Map a software interrupt queue to an interrupt priority level.
- */
-static const int si_to_ipl[4] = {
- IPL_SOFTCLOCK, /* SI_SOFTCLOCK */
- IPL_SOFTBIO, /* SI_SOFTBIO */
- IPL_SOFTNET, /* SI_SOFTNET */
- IPL_SOFTSERIAL, /* SI_SOFTSERIAL */
-};
-
-/*
- * Interrupt bit names.
- */
-const char *i80321_irqnames[] = {
- "DMA0 EOT",
- "DMA0 EOC",
- "DMA1 EOT",
- "DMA1 EOC",
- "irq 4",
- "irq 5",
- "AAU EOT",
- "AAU EOC",
- "core PMU",
- "TMR0 (hardclock)",
- "TMR1",
- "I2C0",
- "I2C1",
- "MU",
- "BIST",
- "periph PMU",
- "XScale PMU",
- "BIU error",
- "ATU error",
- "MCU error",
- "DMA0 error",
- "DMA1 error",
- "irq 22",
- "AAU error",
- "MU error",
- "SSP",
- "irq 26",
- "irq 27",