diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/defconfig linux-2.5.67-ac1/arch/alpha/defconfig --- linux-2.5.67/arch/alpha/defconfig 2003-02-10 18:38:38.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/defconfig 2003-02-14 22:35:17.000000000 +0000 @@ -19,6 +19,8 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set # # Loadable module support diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/core_cia.c linux-2.5.67-ac1/arch/alpha/kernel/core_cia.c --- linux-2.5.67/arch/alpha/kernel/core_cia.c 2003-02-10 18:38:43.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/core_cia.c 2003-04-03 23:49:57.000000000 +0100 @@ -610,7 +610,7 @@ *(vip)CIA_IOC_CIA_CNFG = temp; } - /* Syncronize with all previous changes. */ + /* Synchronize with all previous changes. */ mb(); *(vip)CIA_IOC_CIA_REV; diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/pci.c linux-2.5.67-ac1/arch/alpha/kernel/pci.c --- linux-2.5.67/arch/alpha/kernel/pci.c 2003-04-08 00:37:34.000000000 +0100 +++ linux-2.5.67-ac1/arch/alpha/kernel/pci.c 2003-04-03 23:49:57.000000000 +0100 @@ -230,7 +230,7 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) { - /* Propogate hose info into the subordinate devices. */ + /* Propagate hose info into the subordinate devices. */ struct pci_controller *hose = bus->sysdata; struct list_head *ln; diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/pci_iommu.c linux-2.5.67-ac1/arch/alpha/kernel/pci_iommu.c --- linux-2.5.67/arch/alpha/kernel/pci_iommu.c 2003-03-06 17:04:22.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/pci_iommu.c 2003-04-03 23:49:57.000000000 +0100 @@ -431,7 +431,7 @@ /* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must be values that were returned from pci_alloc_consistent. SIZE must be the same as what as passed into pci_alloc_consistent. - References to the memory and mappings assosciated with CPU_ADDR or + References to the memory and mappings associated with CPU_ADDR or DMA_ADDR past this call are illegal. */ void diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/semaphore.c linux-2.5.67-ac1/arch/alpha/kernel/semaphore.c --- linux-2.5.67/arch/alpha/kernel/semaphore.c 2003-02-10 18:38:38.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/semaphore.c 2003-04-03 23:49:57.000000000 +0100 @@ -122,7 +122,7 @@ long tmp, tmp2, tmp3; /* We must undo the sem->count down_interruptible decrement - simultaneously and atomicly with the sem->waking + simultaneously and atomically with the sem->waking adjustment, otherwise we can race with __up. This is accomplished by doing a 64-bit ll/sc on two 32-bit words. diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/setup.c linux-2.5.67-ac1/arch/alpha/kernel/setup.c --- linux-2.5.67/arch/alpha/kernel/setup.c 2003-02-10 18:38:01.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/setup.c 2003-04-03 23:49:57.000000000 +0100 @@ -486,7 +486,7 @@ notifier_chain_register(&panic_notifier_list, &alpha_panic_block); #ifdef CONFIG_ALPHA_GENERIC - /* Assume that we've booted from SRM if we havn't booted from MILO. + /* Assume that we've booted from SRM if we haven't booted from MILO. Detect the later by looking for "MILO" in the system serial nr. */ alpha_using_srm = strncmp((const char *)hwrpb->ssn, "MILO", 4) != 0; #endif @@ -569,7 +569,7 @@ #endif /* - * Indentify and reconfigure for the current system. + * Identify and reconfigure for the current system. */ cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset); diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/sys_cabriolet.c linux-2.5.67-ac1/arch/alpha/kernel/sys_cabriolet.c --- linux-2.5.67/arch/alpha/kernel/sys_cabriolet.c 2003-02-10 18:38:11.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/sys_cabriolet.c 2003-04-06 23:26:41.000000000 +0100 @@ -132,11 +132,14 @@ setup_irq(16+4, &isa_cascade_irqaction); } +#ifndef CONFIG_ALPHA_PC164 +/* PC164 is the only case we don't want this to be defined */ static void __init cabriolet_init_irq(void) { common_init_irq(srm_device_interrupt); } +#endif #if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_PC164) /* In theory, the PC164 has the same interrupt hardware as the other diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/kernel/time.c linux-2.5.67-ac1/arch/alpha/kernel/time.c --- linux-2.5.67/arch/alpha/kernel/time.c 2003-03-06 17:04:22.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/kernel/time.c 2003-04-03 23:49:57.000000000 +0100 @@ -331,7 +331,7 @@ /* From John Bowman : allow the values to settle, as the Update-In-Progress bit going low isn't good - enough on some hardware. 2ms is our guess; we havn't found + enough on some hardware. 2ms is our guess; we haven't found bogomips yet, but this is close on a 500Mhz box. */ __delay(1000000); diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/lib/strrchr.S linux-2.5.67-ac1/arch/alpha/lib/strrchr.S --- linux-2.5.67/arch/alpha/lib/strrchr.S 2003-02-10 18:38:51.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/lib/strrchr.S 2003-04-03 23:49:57.000000000 +0100 @@ -2,7 +2,7 @@ * arch/alpha/lib/strrchr.S * Contributed by Richard Henderson (rth@tamu.edu) * - * Return the address of the last occurrance of a given character + * Return the address of the last occurrence of a given character * within a null-terminated string, or null if it is not found. */ diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/alpha/math-emu/math.c linux-2.5.67-ac1/arch/alpha/math-emu/math.c --- linux-2.5.67/arch/alpha/math-emu/math.c 2003-02-10 18:38:59.000000000 +0000 +++ linux-2.5.67-ac1/arch/alpha/math-emu/math.c 2003-04-03 23:49:57.000000000 +0100 @@ -294,7 +294,7 @@ * the appropriate signal to the translated program. * * In addition, properly track the exception state in software - * as described in the Alpha Architectre Handbook section 4.7.7.3. + * as described in the Alpha Architecture Handbook section 4.7.7.3. */ done: if (_fex) { diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/arm/defconfig linux-2.5.67-ac1/arch/arm/defconfig --- linux-2.5.67/arch/arm/defconfig 2003-02-10 18:38:13.000000000 +0000 +++ linux-2.5.67-ac1/arch/arm/defconfig 2003-02-14 22:35:17.000000000 +0000 @@ -80,6 +80,8 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set CONFIG_NWFPE=y CONFIG_KCORE_ELF=y # CONFIG_KCORE_AOUT is not set diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/arm/Kconfig linux-2.5.67-ac1/arch/arm/Kconfig --- linux-2.5.67/arch/arm/Kconfig 2003-03-26 19:59:49.000000000 +0000 +++ linux-2.5.67-ac1/arch/arm/Kconfig 2003-03-23 16:50:48.000000000 +0000 @@ -20,6 +20,10 @@ bool default y +config SWAP + bool + default y + config EISA bool ---help--- diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/cris/defconfig linux-2.5.67-ac1/arch/cris/defconfig --- linux-2.5.67/arch/cris/defconfig 2003-02-10 18:38:15.000000000 +0000 +++ linux-2.5.67-ac1/arch/cris/defconfig 2003-02-14 22:37:05.000000000 +0000 @@ -17,6 +17,8 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_SYSCTL is not set +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set CONFIG_BINFMT_ELF=y # CONFIG_ETRAX_KGDB is not set # CONFIG_ETRAX_WATCHDOG is not set diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/defconfig linux-2.5.67-ac1/arch/h8300/defconfig --- linux-2.5.67/arch/h8300/defconfig 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/defconfig 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,257 @@ +# +# Automatically generated by make menuconfig: don't edit +# +CONFIG_UCLINUX=y +CONFIG_UID16=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# Target Selection +# +CONFIG_BOARD_GENERIC=y +# CONFIG_BOARD_AKI3068NET is not set +# CONFIG_BOARD_H8MAX is not set + +# +# Platform dependant setup +# +# CONFIG_H83002 is not set +CONFIG_H83007=y +# CONFIG_H83048 is not set +# CONFIG_H83068 is not set +CONFIG_CLK_FREQ=16000 +# CONFIG_RAMKERNEL is not set +CONFIG_ROMKERNEL=y +CONFIG_CPU_H8300H=y + +# +# General setup +# +# CONFIG_NET is not set +# CONFIG_SYSVIPC is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_SYSCTL is not set +CONFIG_KCORE_ELF=y +# CONFIG_KCORE_AOUT is not set +CONFIG_BINFMT_FLAT=y +# CONFIG_BINFMT_ZFLAT is not set +# CONFIG_BINFMT_SHARED_FLAT is not set +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_ELF is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_DEFAULT_CMDLINE=y +CONFIG_KERNEL_COMMAND="console=ttySC0,38400n81" + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play configuration +# +# CONFIG_PNP is not set +# CONFIG_ISAPNP is not set + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_XD is not set +# CONFIG_PARIDE is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_CISS_SCSI_TAPE is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_LOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_BLK_DEV_RAMDISK_DATA is not set +CONFIG_BLK_DEV_BLKMEM=y +CONFIG_NOFLASH=y +# CONFIG_AMDFLASH is not set +# CONFIG_INTELFLASH is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set +# CONFIG_PHONE_IXJ is not set +# CONFIG_PHONE_IXJ_PCMCIA is not set + +# +# ATA/IDE/MFM/RLL support +# +# CONFIG_IDE is not set +# CONFIG_BLK_DEV_IDE_MODES is not set +# CONFIG_BLK_DEV_HD is not set + +# +# Character devices +# +CONFIG_SH_SCI=y +CONFIG_SERIAL_CONSOLE=y +# CONFIG_LEDMAN is not set +# CONFIG_DS1302 is not set +# CONFIG_VT is not set +# CONFIG_SERIAL is not set +# CONFIG_SERIAL_EXTENDED is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_UNIX98_PTYS is not set + +# +# I2C support +# +# CONFIG_I2C is not set + +# +# Mice +# +# CONFIG_BUSMOUSE is not set +# CONFIG_MOUSE is not set + +# +# Joysticks +# +# CONFIG_INPUT_GAMEPORT is not set +# CONFIG_INPUT_NS558 is not set +# CONFIG_INPUT_LIGHTNING is not set +# CONFIG_INPUT_PCIGAME is not set +# CONFIG_INPUT_CS461X is not set +# CONFIG_INPUT_EMU10K1 is not set +# CONFIG_INPUT_SERIO is not set +# CONFIG_INPUT_SERPORT is not set +# CONFIG_INPUT_ANALOG is not set +# CONFIG_INPUT_A3D is not set +# CONFIG_INPUT_ADI is not set +# CONFIG_INPUT_COBRA is not set +# CONFIG_INPUT_GF2K is not set +# CONFIG_INPUT_GRIP is not set +# CONFIG_INPUT_INTERACT is not set +# CONFIG_INPUT_TMDC is not set +# CONFIG_INPUT_SIDEWINDER is not set +# CONFIG_INPUT_IFORCE_USB is not set +# CONFIG_INPUT_IFORCE_232 is not set +# CONFIG_INPUT_WARRIOR is not set +# CONFIG_INPUT_MAGELLAN is not set +# CONFIG_INPUT_SPACEORB is not set +# CONFIG_INPUT_SPACEBALL is not set +# CONFIG_INPUT_STINGER is not set +# CONFIG_INPUT_DB9 is not set +# CONFIG_INPUT_GAMECON is not set +# CONFIG_INPUT_TURBOGRAFX is not set +# CONFIG_QIC02_TAPE is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +# CONFIG_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_FTAPE is not set +# CONFIG_AGP is not set +# CONFIG_DRM is not set + +# +# File systems +# +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADFS_FS_RW is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EXT3_FS is not set +# CONFIG_JBD is not set +# CONFIG_JBD_DEBUG is not set +# CONFIG_FAT_FS is not set +# CONFIG_MSDOS_FS is not set +# CONFIG_UMSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_JFFS_FS is not set +# CONFIG_JFFS2_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_TMPFS is not set +CONFIG_RAMFS=y +# CONFIG_ISO9660_FS is not set +# CONFIG_JOLIET is not set +# CONFIG_ZISOFS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_HPFS_FS is not set +CONFIG_PROC_FS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVFS_MOUNT is not set +# CONFIG_DEVFS_DEBUG is not set +# CONFIG_DEVPTS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX4FS_RW is not set +CONFIG_ROMFS_FS=y +# CONFIG_EXT2_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UDF_FS is not set +# CONFIG_UDF_RW is not set +# CONFIG_UFS_FS is not set +# CONFIG_UFS_FS_WRITE is not set +# CONFIG_NCPFS_NLS is not set +# CONFIG_SMB_FS is not set +# CONFIG_ZISOFS_FS is not set +# CONFIG_ZLIB_FS_INFLATE is not set + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +# CONFIG_SMB_NLS is not set +# CONFIG_NLS is not set + +# +# USB support +# +# CONFIG_USB is not set + +# +# Kernel hacking +# +CONFIG_FULLDEBUG=y +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_CONTIGUOUS_PAGE_ALLOC is not set +# CONFIG_MEM_MAP is not set +# CONFIG_PROFILE is not set +CONFIG_NO_KERNEL_MSG=y +# CONFIG_SMALL_TASKS is not set +CONFIG_GDB_EXEC=y +CONFIG_GDB_MAGICPRINT=y diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/Kconfig linux-2.5.67-ac1/arch/h8300/Kconfig --- linux-2.5.67/arch/h8300/Kconfig 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/Kconfig 2003-03-20 18:43:51.000000000 +0000 @@ -0,0 +1,282 @@ +# +# For a description of the syntax of this configuration file, +# see Documentation/kbuild/config-language.txt. +# + +mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration" + +config MMU + bool + default n + +config SWAP + bool + default n + +config FPU + bool + default n + +config UID16 + bool + default y + +config RWSEM_GENERIC_SPINLOCK + bool + default y + +config RWSEM_XCHGADD_ALGORITHM + bool + default n + + +source "init/Kconfig" + +menu "Processor type and features" + +choice + prompt "H8/300 platform" + default H8300H_GENERIC + +config H8300H_GENERIC + bool "Generic" + help + H8/300H CPU Generic Hardware Support + +config H8300H_AKI3068NET + bool "AE-3068/69" + help + AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Suppot + More Information. (Japanese Only) + + AE-3068/69 Evalution Board Support + More Information. + + +config H8300H_H8MAX + bool "H8MAX" + help + H8MAX Evalution Board Suooprt + More Information. (Japanese Only) + + +config H8300H_SIM + bool "H8/300H Simulator" + help + GDB Simulator Support + More Information. + arch/h8300/Doc/simulator.txt + +endchoice + +choice + prompt "CPU Selection" + +config H83002 + bool "H8/3001,3002,3003" + depends on H8300H_GENERIC + +config H83007 + bool "H8/3006,3007" + depends on (H8300H_GENERIC || H8300H_SIM) + +config H83048 + bool "H8/3044,3045,3046,3047,3048,3052" + depends on H8300H_GENERIC + +config H83068 + bool "H8/3065,3066,3067,3068,3069" + depends on (H8300H_GENERIC || H8300H_AKI3068NET || H8300H_H8MAX) + +endchoice + +config H8300H + bool + depends on (H8300H_GENERIC || H8300H_AKI3068NET || H8300H_H8MAX || H8300H_SIM) + default y + +config CPU_CLOCK + int "CPU Clock Frequency (/1KHz)" + default "20000" if H8300H_AKI3068NET + default "25000" if H8300H_H8MAX + default "16000" if H8300H_SIM + default "16000" if H8300H_GENERIC + help + CPU Clock Frequency divide to 1000 +choice + prompt "Kernel executes from" + ---help--- + Choose the memory type that the kernel will be running in. + +config RAMKERNEL + bool "RAM" + help + The kernel will be resident in RAM when running. + +config ROMKERNEL + bool "ROM" + help + The kernel will be resident in FLASH/ROM when running. + +endchoice + +endmenu + +menu "Executable file formats" + +config KCORE_AOUT + bool + default y + +config KCORE_ELF + default y + +config BINFMT_FLAT + tristate "Kernel support for flat binaries" + help + Support uClinux FLAT format binaries. + +endmenu + +source "drivers/block/Kconfig" + + +menu "ATA/IDE/MFM/RLL support" + +config IDE + tristate "ATA/ATAPI/MFM/RLL device support" + ---help--- + If you say Y here, your kernel will be able to manage low cost mass + storage units such as ATA/(E)IDE and ATAPI units. The most common + cases are IDE hard drives and ATAPI CD-ROM drives. + + It only makes sense to choose this option if your board actually + has an IDE interface. If unsure, say N. + +source "drivers/ide/Kconfig" + +endmenu + +source "net/Kconfig" + + +menu "Network device support" + depends on NET + +config NETDEVICES + bool "Network device support" + ---help--- + You can say N here if you don't intend to connect your Linux box to + any other computer at all or if all your connections will be over a + telephone line with a modem either via UUCP (UUCP is a protocol to + forward mail and news between unix hosts over telephone lines; read + the UUCP-HOWTO, available from + ) or dialing up a shell + account or a BBS, even using term (term is a program which gives you + almost full Internet connectivity if you have a regular dial up + shell account on some Internet connected Unix computer. Read + ). + + You'll have to say Y if your computer contains a network card that + you want to use under Linux (make sure you know its name because you + will be asked for it and read the Ethernet-HOWTO (especially if you + plan to use more than one network card under Linux)) or if you want + to use SLIP (Serial Line Internet Protocol is the protocol used to + send Internet traffic over telephone lines or null modem cables) or + CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better + and newer replacement for SLIP) or PLIP (Parallel Line Internet + Protocol is mainly used to create a mini network by connecting the + parallel ports of two local machines) or AX.25/KISS (protocol for + sending Internet traffic over amateur radio links). + + Make sure to read the NET-3-HOWTO. Eventually, you will have to read + Olaf Kirch's excellent and free book "Network Administrator's + Guide", to be found in . If + unsure, say Y. + +source "drivers/net/Kconfig" + +source "drivers/atm/Kconfig" + +endmenu + +source "net/ax25/Kconfig" + +source "net/irda/Kconfig" + +source "drivers/isdn/Kconfig" + +source "drivers/telephony/Kconfig" + +# +# input before char - char/joystick depends on it. As does USB. +# +source "drivers/input/Kconfig" + +source "drivers/char/Kconfig" + +#source drivers/misc/Config.in +source "drivers/media/Kconfig" + +source "fs/Kconfig" + +source "drivers/usb/Kconfig" + +source "net/bluetooth/Kconfig" + + +menu "Kernel hacking" + +config FULLDEBUG + bool "Full Symbolic/Source Debugging support" + help + Enable debugging symbols on kernel build. + +config MAGIC_SYSRQ + bool "Magic SysRq key" + help + Enables console device to interprent special characters as + commands to dump state information. + +config HIGHPROFILE + bool "Use fast second timer for profiling" + help + Use a fast secondary clock to produce profiling information. + +config NO_KERNEL_MSG + bool "Suppress Kernel BUG Messages" + help + Do not output any debug BUG messages within the kernel. + +config GDB_MAGICPRINT + bool "Message Output for GDB MagicPrint service" + depends on H8300H_SIM + help + kernel messages output useing MagicPrint service from GDB + +config SYSCALL_PRINT + bool "SystemCall trace print" + help + outout history of systemcall + +config GDB_DEBUG + bool "Use gdb stub" + depends on !H8300H_SIM + help + gdb stub exception support + +config CONFIG_SH_STANDARD_BIOS + bool "Use gdb protocol serial console" + depends on !H8300H_SIM + help + serial console output using GDB protocol. + Require eCos/RedBoot + +endmenu + +source "security/Kconfig" + +source "crypto/Kconfig" + +source "lib/Kconfig" + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/asm-offsets.c linux-2.5.67-ac1/arch/h8300/kernel/asm-offsets.c --- linux-2.5.67/arch/h8300/kernel/asm-offsets.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/asm-offsets.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * 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 +#include +#include +#include +#include +#include + +#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_CCR, offsetof(struct thread_struct, ccr)); + DEFINE(THREAD_VFORK, offsetof(struct thread_struct, vfork_ret)); + + DEFINE(PT_PTRACED, PT_PTRACED); + DEFINE(PT_DTRACE, PT_DTRACE); + + return 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/gpio.c linux-2.5.67-ac1/arch/h8300/kernel/gpio.c --- linux-2.5.67/arch/h8300/kernel/gpio.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/gpio.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * linux/arch/h8300/kernel/gpio.c + * + * Yoshinori Sato + * + */ + +/* + * H8/300H Internal I/O Port Management + */ + +#include +#include +#include +#include +#include +#include + +#if defined(CONFIG_H83007) || defined(CONFIG_H83068) +#define P1DDR (unsigned char *)0xfee000 +#define P2DDR (unsigned char *)0xfee001 +#define P3DDR (unsigned char *)0xfee002 +#define P4DDR (unsigned char *)0xfee003 +#define P5DDR (unsigned char *)0xfee004 +#define P6DDR (unsigned char *)0xfee005 +#define P8DDR (unsigned char *)0xfee007 +#define P9DDR (unsigned char *)0xfee008 +#define PADDR (unsigned char *)0xfee009 +#define PBDDR (unsigned char *)0xfee00A +#endif +#if defined(CONFIG_H83002) || defined(CONFIG_H8048) +#define P1DDR (unsigned char *)0xffffc0 +#define P2DDR (unsigned char *)0xffffc1 +#define P3DDR (unsigned char *)0xffffc4 +#define P4DDR (unsigned char *)0xffffc5 +#define P5DDR (unsigned char *)0xffffc8 +#define P6DDR (unsigned char *)0xffffc9 +#define P8DDR (unsigned char *)0xffffcd +#define P9DDR (unsigned char *)0xffffd0 +#define PADDR (unsigned char *)0xffffd1 +#define PBDDR (unsigned char *)0xffffd4 +#endif + +#if defined(P1DDR) + +#define MAX_PORT 11 + +static struct { + unsigned char used; + unsigned char ddr; +} gpio_regs[MAX_PORT]; + +static volatile unsigned char *ddrs[] = { + P1DDR,P2DDR,P3DDR,P4DDR,P5DDR,P6DDR,NULL,P8DDR,P9DDR,PADDR,PBDDR, +}; + +extern char *_platform_gpio_table(int length); + +int h8300_reserved_gpio(int port, unsigned int bits) +{ + unsigned char *used; + if (port < 0 || port >= MAX_PORT) + return -1; + used = &(gpio_regs[port].used); + if ((*used & bits) != 0) + return 0; + *used |= bits; + return 1; +} + +int h8300_free_gpio(int port, unsigned int bits) +{ + unsigned char *used; + if (port < 0 || port >= MAX_PORT) + return -1; + used = &(gpio_regs[port].used); + if ((*used & bits) != bits) + return 0; + *used &= (~bits); + return 1; +} + +int h8300_set_gpio_dir(int port_bit,int dir) +{ + const unsigned char mask[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; + int port = (port_bit >> 8) & 0xff; + int bit = port_bit & 0x07; + if (ddrs[port] == NULL) + return 0; + if (gpio_regs[port].used & mask[bit]) { + if (dir) + gpio_regs[port].ddr |= mask[bit]; + else + gpio_regs[port].ddr &= ~mask[bit]; + *ddrs[port] = gpio_regs[port].ddr; + return 1; + } else + return 0; +} + +int h8300_get_gpio_dir(int port_bit) +{ + const unsigned char mask[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80}; + int port = (port_bit >> 8) & 0xff; + int bit = port_bit & 0x07; + if (ddrs[port] == NULL) + return 0; + if (gpio_regs[port].used & mask[bit]) { + return (gpio_regs[port].ddr & mask[bit]) != 0; + } else + return -1; +} + +#if defined(CONFIG_PROC_FS) +static char *port_status(int portno) +{ + static char result[10]; + const static char io[2]={'I','O'}; + char *rp; + int c; + unsigned char used,ddr; + + used = gpio_regs[portno].used; + ddr = gpio_regs[portno].ddr; + result[8]='\0'; + rp = result + 7; + for (c = 8; c > 0; c--,rp--,used >>= 1, ddr >>= 1) + if (used & 0x01) + *rp = io[ ddr & 0x01]; + else + *rp = '-'; + return result; +} + +static int gpio_proc_read(char *buf, char **start, off_t offset, int len, int unused) +{ + int c,outlen; + const static char port_name[]="123456789AB"; + outlen = 0; + for (c = 0; c < MAX_PORT; c++) { + if (ddrs[c] == NULL) + continue ; + len = sprintf(buf,"P%c: %s\n",port_name[c],port_status(c)); + buf += len; + outlen += len; + } + return outlen; +} + +static const struct proc_dir_entry proc_gpio = { + 0, 4,"gpio",S_IFREG | S_IRUGO, 1, 0, 0, 0, NULL, gpio_proc_read, +}; +#endif + +int h8300_gpio_init(void) +{ + memcpy(gpio_regs,_platform_gpio_table(sizeof(gpio_regs)),sizeof(gpio_regs)); +#if 0 && defined(CONFIG_PROC_FS) + proc_register(&proc_root,&proc_gpio); +#endif + return 0; +} + +#else +#error Unsuppoted CPU Selection +#endif diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/h8300_ksyms.c linux-2.5.67-ac1/arch/h8300/kernel/h8300_ksyms.c --- linux-2.5.67/arch/h8300/kernel/h8300_ksyms.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/h8300_ksyms.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,113 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//asmlinkage long long __ashrdi3 (long long, int); +//asmlinkage long long __lshrdi3 (long long, int); +extern char h8300_debug_device[]; + +extern void dump_thread(struct pt_regs *, struct user *); + +/* platform dependent support */ + +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(__ashrdi3); +//EXPORT_SYMBOL_NOVERS(__lshrdi3); +EXPORT_SYMBOL_NOVERS(memcpy); +EXPORT_SYMBOL_NOVERS(memset); +EXPORT_SYMBOL_NOVERS(memcmp); +EXPORT_SYMBOL_NOVERS(memscan); +EXPORT_SYMBOL_NOVERS(memmove); + +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(_current_task); + +EXPORT_SYMBOL_NOVERS(is_in_rom); + +EXPORT_SYMBOL_NOVERS(h8300_reserved_gpio) +EXPORT_SYMBOL_NOVERS(h8300_free_gpio) +EXPORT_SYMBOL_NOVERS(h8300_set_gpio_dir) diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/init_task.c linux-2.5.67-ac1/arch/h8300/kernel/init_task.c --- linux-2.5.67/arch/h8300/kernel/init_task.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/init_task.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * linux/arch/h8300/kernel/init_task.c + */ +#include +#include +#include +#include +#include + +#include +#include + +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) }; + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/Makefile linux-2.5.67-ac1/arch/h8300/kernel/Makefile --- linux-2.5.67/arch/h8300/kernel/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,18 @@ +# +# Makefile for the linux kernel. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... + +obj-y := process.o traps.o ptrace.o \ + sys_h8300.o time.o semaphore.o signal.o \ + setup.o h8300_ksyms.o gpio.o init_task.o \ + syscalls.o + +export-objs := h8300_ksyms.o + +include $(TOPDIR)/Rules.make + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/process.c linux-2.5.67-ac1/arch/h8300/kernel/process.c --- linux-2.5.67/arch/h8300/kernel/process.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/process.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,316 @@ +/* + * linux/arch/h8300/kernel/process.c + * + * Yoshinori Sato + * + * Based on: + * + * linux/arch/m68knommu/kernel/process.c + * + * Copyright (C) 1998 D. Jeff Dionne , + * Kenneth Albanowski , + * The Silver Hammer Group, Ltd. + * + * linux/arch/m68k/kernel/process.c + * + * Copyright (C) 1995 Hamish Macdonald + * + * 68060 fixes by Jesper Skov + */ + +/* + * This file handles the architecture-dependent parts of process handling.. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +asmlinkage void ret_from_exception(void); + +/* + * The idle loop on an H8/300.. + */ +#if !defined(CONFIG_H8300H_SIM) +void default_idle(void) +{ + while(1) { + if (need_resched()) { + sti(); + __asm__("sleep"); + cli(); + } + schedule(); + } +} +#else +void default_idle(void) +{ + while(1) { + if (need_resched()) + schedule(); + } +} +#endif +void (*idle)(void) = default_idle; + +/* + * The idle thread. There's no useful work to be + * done, so just try to conserve power and have a + * low exit latency (ie sit in a loop waiting for + * somebody to say that they'd like to reschedule) + */ +void cpu_idle(void) +{ + idle(); +} + +void machine_restart(char * __unused) +{ + cli(); + __asm__("jmp @@0"); +} + +void machine_halt(void) +{ + cli(); + __asm__("sleep"); + for (;;); +} + +void machine_power_off(void) +{ + cli(); + __asm__("sleep"); + for (;;); +} + +void show_regs(struct pt_regs * regs) +{ + printk("\n"); + printk("PC: %08lx Status: %02x\n", + regs->pc, regs->ccr); + printk("ORIG_ER0: %08lx ER0: %08lx ER1: %08lx\n", + regs->orig_er0, regs->er0, regs->er1); + printk("ER2: %08lx ER3: %08lx\n", + regs->er2, regs->er3); + if (!(regs->ccr & 0x10)) + printk("USP: %08lx\n", rdusp()); +} + +/* + * Create a kernel thread + */ +int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) +{ + long retval; + register long clone_arg asm("er1"); + mm_segment_t fs; + + fs = get_fs(); + set_fs (KERNEL_DS); + clone_arg = flags | CLONE_VM; + + __asm__ __volatile__ ( + "mov.l sp, er2\n\t" + "mov.l %1,er0\n\t" + "mov.l %5,er1\n\t" + "trapa #0\n\t" + "cmp.l sp, er2\n\t" + "beq 1f\n\t" + "mov.l %3, er0\n\t" + "jsr @%4\n\t" + "mov.l %2, er0\n\t" + "trapa #0\n" + "1:" + : "=r" (retval) + : "i" (__NR_clone), + "i" (__NR_exit), + "r" (arg), + "r" (fn), + "r" (clone_arg) + : "cc", "er0", "er1", "er2", "er3"); + + set_fs (fs); + return retval; +} + +void flush_thread(void) +{ +} + +/* + * "h8300_fork()".. By the time we get here, the + * non-volatile registers have also been saved on the + * stack. We do some ugly pointer stuff here.. (see + * also copy_thread) + */ + +asmlinkage int h8300_fork(struct pt_regs *regs) +{ + return -EINVAL; +} + +asmlinkage int h8300_vfork(struct pt_regs *regs) +{ + struct task_struct *p; + p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, rdusp(), regs, 0, NULL, NULL); + return IS_ERR(p) ? PTR_ERR(p) : p->pid; +} + +asmlinkage int h8300_clone(struct pt_regs *regs) +{ + unsigned long clone_flags; + unsigned long newsp; + struct task_struct *p; + + /* syscall2 puts clone_flags in er1 and usp in er2 */ + clone_flags = regs->er1; + newsp = regs->er2; + if (!newsp) + newsp = rdusp(); + p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0, NULL, NULL); + return IS_ERR(p) ? PTR_ERR(p) : p->pid; + +} + +int copy_thread(int nr, unsigned long clone_flags, + unsigned long usp, unsigned long topstk, + struct task_struct * p, struct pt_regs * regs) +{ + struct pt_regs * childregs; + struct switch_stack * childstack, *stack; + unsigned long stack_offset, *retp; + + stack_offset = KTHREAD_SIZE - sizeof(struct pt_regs); + childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; + + *childregs = *regs; + + retp = (unsigned long *) regs-2; + stack = ((struct switch_stack *) retp) - 1; + + childstack = ((struct switch_stack *) childregs) - 1; + *childstack = *stack; + childregs->er0 = 0; + childstack->retpc = (unsigned long) ret_from_exception; + + p->thread.usp = usp; + p->thread.ksp = (unsigned long)childstack; + p->thread.vfork_ret = 0; + + return 0; +} + +/* + * fill in the user structure for a core dump.. + */ +void dump_thread(struct pt_regs * regs, struct user * dump) +{ + struct switch_stack *sw; + +/* changed the size calculations - should hopefully work better. lbt */ + dump->magic = CMAGIC; + dump->start_code = 0; + dump->start_stack = rdusp() & ~(PAGE_SIZE - 1); + dump->u_tsize = ((unsigned long) current->mm->end_code) >> PAGE_SHIFT; + dump->u_dsize = ((unsigned long) (current->mm->brk + + (PAGE_SIZE-1))) >> PAGE_SHIFT; + dump->u_dsize -= dump->u_tsize; + dump->u_ssize = 0; + + dump->u_ar0 = (struct user_regs_struct *)(((int)(&dump->regs)) -((int)(dump))); + sw = ((struct switch_stack *)regs) - 1; + dump->regs.er0 = regs->er0; + dump->regs.er1 = regs->er1; + dump->regs.er2 = regs->er2; + dump->regs.er3 = regs->er3; + dump->regs.er4 = sw->er4; + dump->regs.er5 = sw->er5; + dump->regs.er6 = sw->er6; + dump->regs.orig_er0 = regs->orig_er0; + dump->regs.ccr = regs->ccr; + dump->regs.pc = regs->pc; +} + +/* + * sys_execve() executes a new program. + */ +asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...) +{ + int error; + char * filename; + struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy+4); + + lock_kernel(); + filename = getname(name); + error = PTR_ERR(filename); + if (IS_ERR(filename)) + goto out; + error = do_execve(filename, argv, envp, regs); + putname(filename); +out: + unlock_kernel(); + return error; +} + +/* + * These bracket the sleeping functions.. + */ +extern void scheduling_functions_start_here(void); +extern void scheduling_functions_end_here(void); +#define first_sched ((unsigned long) scheduling_functions_start_here) +#define last_sched ((unsigned long) scheduling_functions_end_here) + +unsigned long thread_saved_pc(struct task_struct *tsk) +{ + struct switch_stack *sw = (struct switch_stack *)(tsk->thread.ksp); + + /* Check whether the thread is blocked in resume() */ + if (sw->retpc > (unsigned long)scheduling_functions_start_here && + sw->retpc < (unsigned long)scheduling_functions_end_here) + return ((unsigned long *)sw->er6)[1]; + else + return sw->retpc; +} + +unsigned long get_wchan(struct task_struct *p) +{ + unsigned long fp, pc; + unsigned long stack_page; + int count = 0; + if (!p || p == current || p->state == TASK_RUNNING) + return 0; + + stack_page = (unsigned long)p; + fp = ((struct switch_stack *)p->thread.ksp)->er6; + do { + if (fp < stack_page+sizeof(struct task_struct) || + fp >= 8184+stack_page) + return 0; + pc = ((unsigned long *)fp)[1]; + /* FIXME: This depends on the order of these functions. */ + if (pc < first_sched || pc >= last_sched) + return pc; + fp = *(unsigned long *) fp; + } while (count++ < 16); + return 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/ptrace.c linux-2.5.67-ac1/arch/h8300/kernel/ptrace.c --- linux-2.5.67/arch/h8300/kernel/ptrace.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/ptrace.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,470 @@ +/* + * linux/arch/h8300/kernel/ptrace.c + * + * Yoshinori Sato + * + * Based on: + * linux/arch/m68k/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 +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * 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 const int regoff[] = { + PT_REG(er1), PT_REG(er2), PT_REG(er3), SW_REG(er4), + SW_REG(er5), SW_REG(er6), PT_REG(er0), PT_REG(orig_er0), + PT_REG(ccr), 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. + */ +int ptrace_cancel_bpt(struct task_struct *child) +{ + int i,r=0; + + for(i=0; i<4; i++) { + if (child->thread.debugreg[i]) { + if (child->thread.debugreg[i] != ~0) + put_user(child->thread.debugreg[i+4], + (unsigned short *)child->thread.debugreg[i]); + r = 1; + child->thread.debugreg[i] = 0; + } + } + return r; +} + +const static unsigned char opcode0[]={ + 0x04,0x02,0x04,0x02,0x04,0x02,0x04,0x02, /* 0x58 */ + 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, /* 0x60 */ + 0x02,0x02,0x11,0x11,0x02,0x02,0x04,0x04, /* 0x68 */ + 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, /* 0x70 */ + 0x08,0x04,0x06,0x04,0x04,0x04,0x04,0x04}; /* 0x78 */ + +static int table_parser01(unsigned char *pc); +static int table_parser02(unsigned char *pc); +static int table_parser100(unsigned char *pc); +static int table_parser101(unsigned char *pc); + +const static int (*parsers[])(unsigned char *pc)={table_parser01,table_parser02}; + +static int insn_length(unsigned char *pc) +{ + if (*pc == 0x01) + return table_parser01(pc+1); + if (*pc < 0x58 || *pc>=0x80) + return 2; + else + if (opcode0[*pc-0x58]<0x10) + return opcode0[*pc-0x58]; + else + return (*parsers[opcode0[*pc-0x58]-0x10])(pc+1); +} + +static int table_parser01(unsigned char *pc) +{ + const unsigned char codelen[]={0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00, + 0x02,0x00,0x00,0x00,0x04,0x04,0x00,0x04}; + const static int (*parsers[])(unsigned char *)={table_parser100,table_parser101}; + unsigned char second_index; + second_index = (*pc) >> 4; + if (codelen[second_index]<0x10) + return codelen[second_index]; + else + return parsers[codelen[second_index]-0x10](pc); +} + +static int table_parser02(unsigned char *pc) +{ + return (*pc & 0x20)?0x06:0x04; +} + +static int table_parser100(unsigned char *pc) +{ + return (*(pc+2) & 0x02)?0x08:0x06; +} + +static int table_parser101(unsigned char *pc) +{ + return (*(pc+2) & 0x02)?0x08:0x06; +} + +#define BREAK_INST 0x5730 /* TRAPA #3 */ + +int ptrace_set_bpt(struct task_struct *child) +{ + unsigned long pc,next; + unsigned short insn; + pc = get_reg(child,PT_PC); + next = insn_length((unsigned char *)pc) + pc; + get_user(insn,(unsigned short *)pc); + if (insn == 0x5470) { + /* rts */ + unsigned long sp; + sp = get_reg(child,PT_USP); + get_user(next,(unsigned long *)sp); + } else if ((insn & 0xfb00) != 0x5800) { + /* jmp / jsr */ + int regs; + const short reg_tbl[]={PT_ER0,PT_ER1,PT_ER2,PT_ER3, + PT_ER4,PT_ER5,PT_ER6,PT_USP}; + switch(insn & 0xfb00) { + case 0x5900: + regs = (insn & 0x0070) >> 8; + next = get_reg(child,reg_tbl[regs]); + break; + case 0x5a00: + get_user(next,(unsigned long *)(pc+2)); + next &= 0x00ffffff; + break; + case 0x5b00: + /* unneccessary? */ + next = *(unsigned long *)(insn & 0xff); + break; + } + } else if (((insn & 0xf000) == 0x4000) || ((insn &0xff00) == 0x5500)) { + /* b**:8 */ + unsigned long dsp; + dsp = (long)(insn && 0xff)+pc+2; + child->thread.debugreg[1] = dsp; + get_user(child->thread.debugreg[5],(unsigned short *)dsp); + put_user(BREAK_INST,(unsigned short *)dsp); + } else if (((insn & 0xff00) == 0x5800) || ((insn &0xff00) == 0x5c00)) { + /* b**:16 */ + unsigned long dsp; + get_user(dsp,(unsigned short *)(pc+2)); + dsp = (long)dsp+pc+4; + child->thread.debugreg[1] = dsp; + get_user(child->thread.debugreg[5],(unsigned short *)dsp); + put_user(BREAK_INST,(unsigned short *)dsp); + } + child->thread.debugreg[0] = next; + get_user(child->thread.debugreg[4],(unsigned short *)next); + put_user(BREAK_INST,(unsigned short *)next); + return 0; +} + +inline +static int read_long(struct task_struct * tsk, unsigned long addr, + unsigned long * result) +{ + *result = *(unsigned long *)addr; + return 0; +} + +void ptrace_disable(struct task_struct *child) +{ + ptrace_cancel_bpt(child); +} + +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) { + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: { + unsigned long tmp; + + ret = read_long(child, addr, &tmp); + if (ret < 0) + break ; + ret = verify_area(VERIFY_WRITE, (void *) data, sizeof(long)); + if (!ret) + put_user(tmp, (unsigned long *) data); + break ; + } + + /* read the word at location addr in the USER area. */ + case PTRACE_PEEKUSR: { + unsigned long tmp; + + if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) + ret = -EIO; + + ret = verify_area(VERIFY_WRITE, (void *) data, + sizeof(long)); + if (ret) + break ; + tmp = 0; /* Default return condition */ + addr = addr >> 2; /* temporary hack. */ + if (addr < 10) + tmp = get_reg(child, addr); + else { + ret = -EIO; + break ; + } + put_user(tmp,(unsigned long *) data); + ret = 0; + 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 */ + if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { + ret = -EIO; + break ; + } + addr = addr >> 2; /* temporary hack. */ + + if (addr == PT_ORIG_ER0) { + ret = -EIO; + break ; + } + if (addr == PT_CCR) { + data &= SR_MASK; + } + if (addr < 10) { + if (put_reg(child, addr, data)) + ret = -EIO; + else + ret = 0; + break ; + } + ret = -EIO; + break ; + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + 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; + wake_up_process(child); + /* make sure the single step bit is not set. */ + ptrace_cancel_bpt(child); + ret = 0; + } + +/* + * 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: { + + ret = 0; + if (child->state == TASK_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + ptrace_cancel_bpt(child); + wake_up_process(child); + break; + } + + case PTRACE_SINGLESTEP: { /* set the trap flag. */ + ret = -EIO; + if ((unsigned long) data > _NSIG) + break; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->thread.debugreg[0]=-1; + child->exit_code = data; + 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 (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 < 10; i++) { + if (get_user(tmp, (unsigned long *) data)) { + ret = -EFAULT; + break; + } + put_reg(child, i, tmp); + data += sizeof(long); + } + ret = 0; + break; + } + + 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; + } +} + +asmlinkage void trace_trap(unsigned long bp) +{ + if (current->thread.debugreg[0] == bp || + current->thread.debugreg[1] == bp) { + ptrace_cancel_bpt(current); + force_sig(SIGTRAP,current); + } else + force_sig(SIGILL,current); +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/semaphore.c linux-2.5.67-ac1/arch/h8300/kernel/semaphore.c --- linux-2.5.67/arch/h8300/kernel/semaphore.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/semaphore.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Generic semaphore code. Buyer beware. Do your own + * specific changes in + */ + +#include +#include +#include + +#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 + * 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); +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/setup.c linux-2.5.67-ac1/arch/h8300/kernel/setup.c --- linux-2.5.67/arch/h8300/kernel/setup.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/setup.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,231 @@ +/* + * linux/arch/h8300h/kernel/setup.c + * + * Copyleft ()) 2000 James D. Schettine {james@telos-systems.com} + * Copyright (C) 1999,2000 Greg Ungerer (gerg@snapgear.com) + * Copyright (C) 1998,1999 D. Jeff Dionne + * Copyright (C) 1998 Kenneth Albanowski + * Copyright (C) 1995 Hamish Macdonald + * Copyright (C) 2000 Lineo Inc. (www.lineo.com) + * Copyright (C) 2001 Lineo, Inc. + * + * H8/300H porting Yoshinori Sato + */ + +/* + * This file handles the architecture-dependent parts of system setup + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef CONFIG_BLK_DEV_INITRD +#include +#include +#endif + +#if defined(CONFIG_H8300H) +#define CPU "H8/300H" +#endif + +unsigned long rom_length; +unsigned long memory_start; +unsigned long memory_end; + +struct task_struct *_current_task; + +char command_line[512]; +char saved_command_line[512]; + +extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; +extern int _ramstart, _ramend; +extern char _target_name[]; + +#if defined(CONFIG_H8300H_SIM) && defined(CONFIG_GDB_MAGICPRINT) +/* printk with gdb service */ +static void gdb_console_output(struct console *c, char *msg, unsigned len) +{ + for (; len > 0; len--) { + asm("mov.w %0,r2\n\t" + "jsr @0xc4"::"r"(*msg++):"er2"); + } +} + +/* + * Setup initial baud/bits/parity. We do two things here: + * - construct a cflag setting for the first rs_open() + * - initialize the serial port + * Return non-zero if we didn't find a serial port. + */ +static int __init gdb_console_setup(struct console *co, char *options) +{ + return 0; +} + +static const struct console gdb_console = { + name: "gdb", + write: gdb_console_output, + device: NULL, + setup: gdb_console_setup, + flags: CON_PRINTBUFFER, + index: -1, +}; +#endif + +void setup_arch(char **cmdline_p) +{ + int bootmap_size; + + memory_start = PAGE_ALIGN((unsigned long)(&_ramstart)); + memory_end = &_ramend; /* by now the stack is part of the init task */ + + init_mm.start_code = (unsigned long) &_stext; + init_mm.end_code = (unsigned long) &_etext; + init_mm.end_data = (unsigned long) &_edata; + init_mm.brk = (unsigned long) 0; + +#if defined(CONFIG_H8300H_SIM) && defined(CONFIG_GDB_MAGICPRINT) + register_console(&gdb_console); +#endif + + printk("\x0F\r\n\nuClinux " CPU "\n"); + printk("Target Hardware: %s\n",_target_name); + printk("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n"); + printk("H8/300H support by Yoshinori Sato \n"); + +#ifdef DEBUG + printk("KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x " + "BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext, + (int) &_sdata, (int) &_edata, + (int) &_sbss, (int) &_ebss); + printk("KERNEL -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x " + "STACK=0x%06x-0x%06x\n", + (int) &_ebss, (int) memory_start, + (int) memory_start, (int) memory_end, + (int) memory_end, (int) &_ramend); +#endif + +#ifdef CONFIG_BLK_DEV_BLKMEM + ROOT_DEV = MKDEV(BLKMEM_MAJOR,0); +#endif + +#ifdef CONFIG_DEFAULT_CMDLINE + /* set from default command line */ + if (*command_line == '\0') + strcpy(command_line,CONFIG_KERNEL_COMMAND); +#endif + /* Keep a copy of command line */ + *cmdline_p = &command_line[0]; + memcpy(saved_command_line, command_line, sizeof(saved_command_line)); + saved_command_line[sizeof(saved_command_line)-1] = 0; + +#ifdef DEBUG + if (strlen(*cmdline_p)) + printk("Command line: '%s'\n", *cmdline_p); +#endif + + /* + * give all the memory to the bootmap allocator, tell it to put the + * boot mem_map at the start of memory + */ + bootmap_size = init_bootmem_node( + NODE_DATA(0), + memory_start >> PAGE_SHIFT, /* map goes here */ + PAGE_OFFSET >> PAGE_SHIFT, /* 0 on coldfire */ + memory_end >> PAGE_SHIFT); + /* + * free the usable memory, we have to make sure we do not free + * the bootmem bitmap so we then reserve it after freeing it :-) + */ + free_bootmem(memory_start, memory_end - memory_start); + reserve_bootmem(memory_start, bootmap_size); + /* + * get kmalloc into gear + */ + paging_init(); +#ifdef DEBUG + printk("Done setup_arch\n"); +#endif +} + +int get_cpuinfo(char * buffer) +{ + char *cpu; + u_long clockfreq; + + cpu = CPU; + + clockfreq = CONFIG_CPU_CLOCK; + + return(sprintf(buffer, "CPU:\t\t%s\n" + "Clock:\t%lu.%1luMHz\n" + "BogoMips:\t%lu.%02lu\n" + "Calibration:\t%lu loops\n", + cpu, + clockfreq/100,clockfreq%100, + (loops_per_jiffy*HZ)/500000,((loops_per_jiffy*HZ)/5000)%100, + (loops_per_jiffy*HZ))); + +} + +/* + * Get CPU information for use by the procfs. + */ + +static int show_cpuinfo(struct seq_file *m, void *v) +{ + char *cpu; + u_long clockfreq; + + cpu = CPU; + + clockfreq = CONFIG_CPU_CLOCK; + + seq_printf(m, "CPU:\t\t%s\n" + "Clock:\t%lu.%1luMHz\n" + "BogoMips:\t%lu.%02lu\n" + "Calibration:\t%lu loops\n", + cpu, + clockfreq/100,clockfreq%100, + (loops_per_jiffy*HZ)/500000,((loops_per_jiffy*HZ)/5000)%100, + (loops_per_jiffy*HZ)); + + return 0; +} + +static void *c_start(struct seq_file *m, loff_t *pos) +{ + return *pos < NR_CPUS ? ((void *) 0x12345678) : NULL; +} + +static void *c_next(struct seq_file *m, void *v, loff_t *pos) +{ + ++*pos; + return c_start(m, pos); +} + +static void c_stop(struct seq_file *m, void *v) +{ +} + +struct seq_operations cpuinfo_op = { + start: c_start, + next: c_next, + stop: c_stop, + show: show_cpuinfo, +}; diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/signal.c linux-2.5.67-ac1/arch/h8300/kernel/signal.c --- linux-2.5.67/arch/h8300/kernel/signal.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/signal.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,637 @@ +/* + * linux/arch/h8300/kernel/signal.c + * + * Copyright (C) 1991, 1992 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. + */ + +/* + * uClinux H8/300 support by Yoshinori Sato + * + * Based on + * Linux/m68k by Hamish Macdonald + */ + +/* + * ++roman (07/09/96): implemented signal stacks (specially for tosemu on + * Atari :-) Current limitation: Only one sigstack can be active at one time. + * If a second signal with SA_ONSTACK set arrives while working on a sigstack, + * SA_ONSTACK is ignored. This behaviour avoids lots of trouble with nested + * signal handlers! + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) + +asmlinkage long sys_wait4(pid_t pid, unsigned int * stat_addr, int options, + struct rusage * ru); +asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); + +/* + * Atomically swap in the new signal mask, and wait for a signal. + */ +asmlinkage int do_sigsuspend(struct pt_regs *regs) +{ + old_sigset_t mask = regs->er3; + sigset_t saveset; + + mask &= _BLOCKABLE; + spin_lock_irq(¤t->sig->siglock); + saveset = current->blocked; + siginitset(¤t->blocked, mask); + recalc_sigpending(); + spin_unlock_irq(¤t->sig->siglock); + + regs->er0 = -EINTR; + while (1) { + current->state = TASK_INTERRUPTIBLE; + schedule(); + if (do_signal(&saveset, regs)) + return -EINTR; + } +} + +asmlinkage int +do_rt_sigsuspend(struct pt_regs *regs) +{ + sigset_t *unewset = (sigset_t *)regs->er1; + size_t sigsetsize = (size_t)regs->er2; + sigset_t saveset, newset; + + /* XXX: Don't preclude handling different sized sigset_t's. */ + if (sigsetsize != sizeof(sigset_t)) + return -EINVAL; + + if (copy_from_user(&newset, unewset, sizeof(newset))) + return -EFAULT; + sigdelsetmask(&newset, ~_BLOCKABLE); + + spin_lock_irq(¤t->sig->siglock); + saveset = current->blocked; + current->blocked = newset; + recalc_sigpending(); + spin_unlock_irq(¤t->sig->siglock); + + regs->er0 = -EINTR; + while (1) { + current->state = TASK_INTERRUPTIBLE; + schedule(); + if (do_signal(&saveset, regs)) + return -EINTR; + } +} + +asmlinkage int +sys_sigaction(int sig, const struct old_sigaction *act, + struct old_sigaction *oact) +{ + struct k_sigaction new_ka, old_ka; + int ret; + + if (act) { + old_sigset_t mask; + if (verify_area(VERIFY_READ, act, sizeof(*act)) || + __get_user(new_ka.sa.sa_handler, &act->sa_handler) || + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) + return -EFAULT; + __get_user(new_ka.sa.sa_flags, &act->sa_flags); + __get_user(mask, &act->sa_mask); + siginitset(&new_ka.sa.sa_mask, mask); + } + + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); + + if (!ret && oact) { + if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) + return -EFAULT; + __put_user(old_ka.sa.sa_flags, &oact->sa_flags); + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); + } + + return ret; +} + +asmlinkage int +sys_sigaltstack(const stack_t *uss, stack_t *uoss) +{ + return do_sigaltstack(uss, uoss, rdusp()); +} + + +/* + * Do a signal return; undo the signal stack. + * + * Keep the return code on the stack quadword aligned! + * That makes the cache flush below easier. + */ + +struct sigframe +{ + char *pretcode; + int sig; + int code; + struct sigcontext *psc; + char retcode[6]; + unsigned long extramask[_NSIG_WORDS-1]; + struct sigcontext sc; +}; + +struct rt_sigframe +{ + char *pretcode; + int sig; + struct siginfo *pinfo; + void *puc; + char retcode[6]; + struct siginfo info; + struct ucontext uc; +}; + + +static inline int +restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, + int *pd0) +{ + struct sigcontext context; + int err = 0; + + /* get previous context */ + if (copy_from_user(&context, usc, sizeof(context))) + goto badframe; + + /* restore passed registers */ + regs->er1 = context.sc_er1; + regs->er2 = context.sc_er2; + regs->er3 = context.sc_er3; + regs->ccr = (regs->ccr & 0x10)|(context.sc_ccr & 0xef); + regs->pc = context.sc_pc; + regs->orig_er0 = -1; /* disable syscall checks */ + wrusp(context.sc_usp); + + *pd0 = context.sc_er0; + return err; + +badframe: + return 1; +} + +static inline int +rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, + struct ucontext *uc, int *pd0) +{ + int temp; + greg_t *gregs = uc->uc_mcontext.gregs; + unsigned long usp; + int err; + + err = __get_user(temp, &uc->uc_mcontext.version); + if (temp != MCONTEXT_VERSION) + goto badframe; + /* restore passed registers */ + err |= __get_user(regs->er0, &gregs[0]); + err |= __get_user(regs->er1, &gregs[1]); + err |= __get_user(regs->er2, &gregs[2]); + err |= __get_user(regs->er3, &gregs[3]); + err |= __get_user(sw->er4, &gregs[4]); + err |= __get_user(sw->er5, &gregs[5]); + err |= __get_user(sw->er6, &gregs[6]); + err |= __get_user(usp, &gregs[7]); + wrusp(usp); + err |= __get_user(regs->pc, &gregs[8]); + err |= __get_user(temp, &gregs[9]); + regs->ccr = (regs->ccr & 0x10) | (temp & 0xef); + regs->orig_er0 = -1; /* disable syscall checks */ + + if (do_sigaltstack(&uc->uc_stack, NULL, usp) == -EFAULT) + goto badframe; + + *pd0 = regs->er0; + return err; + +badframe: + return 1; +} + +asmlinkage int do_sigreturn(unsigned long __unused,...) +{ + struct switch_stack *sw = (struct switch_stack *) &__unused; + struct pt_regs *regs = (struct pt_regs *) (sw + 1); + unsigned long usp = rdusp(); + struct sigframe *frame = (struct sigframe *)(usp - 4); + sigset_t set; + int er0; + + if (verify_area(VERIFY_READ, frame, sizeof(*frame))) + goto badframe; + if (__get_user(set.sig[0], &frame->sc.sc_mask) || + (_NSIG_WORDS > 1 && + __copy_from_user(&set.sig[1], &frame->extramask, + sizeof(frame->extramask)))) + goto badframe; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sig->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sig->siglock); + + if (restore_sigcontext(regs, &frame->sc, frame + 1, &er0)) + goto badframe; + return er0; + +badframe: + force_sig(SIGSEGV, current); + return 0; +} + +asmlinkage int do_rt_sigreturn(unsigned long __unused,...) +{ + struct switch_stack *sw = (struct switch_stack *) &__unused; + struct pt_regs *regs = (struct pt_regs *) (sw + 1); + unsigned long usp = rdusp(); + struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); + sigset_t set; + int er0; + + if (verify_area(VERIFY_READ, frame, sizeof(*frame))) + goto badframe; + if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) + goto badframe; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_unlock_irq(¤t->sig->siglock); + current->blocked = set; + recalc_sigpending(); + spin_lock_irq(¤t->sig->siglock); + + if (rt_restore_ucontext(regs, sw, &frame->uc, &er0)) + goto badframe; + return er0; + +badframe: + force_sig(SIGSEGV, current); + return 0; +} + +static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, + unsigned long mask) +{ + sc->sc_mask = mask; + sc->sc_usp = rdusp(); + sc->sc_er0 = regs->er0; + sc->sc_er1 = regs->er1; + sc->sc_er2 = regs->er2; + sc->sc_er3 = regs->er3; + sc->sc_ccr = regs->ccr; + sc->sc_pc = regs->pc; +} + +static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) +{ + struct switch_stack *sw = (struct switch_stack *)regs - 1; + greg_t *gregs = uc->uc_mcontext.gregs; + int err = 0; + + err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); + err |= __put_user(regs->er0, &gregs[0]); + err |= __put_user(regs->er1, &gregs[1]); + err |= __put_user(regs->er2, &gregs[2]); + err |= __put_user(regs->er3, &gregs[3]); + err |= __put_user(sw->er4, &gregs[4]); + err |= __put_user(sw->er5, &gregs[5]); + err |= __put_user(sw->er6, &gregs[6]); + err |= __put_user(rdusp(), &gregs[7]); + err |= __put_user(regs->pc, &gregs[8]); + err |= __put_user(regs->ccr, &gregs[9]); + return err; +} + +static inline void * +get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) +{ + unsigned long usp; + + /* Default to using normal stack. */ + usp = rdusp(); + + /* This is the X/Open sanctioned signal stack switching. */ + if (ka->sa.sa_flags & SA_ONSTACK) { + if (!on_sig_stack(usp)) + usp = current->sas_ss_sp + current->sas_ss_size; + } + return (void *)((usp - frame_size) & -8UL); +} + +static void setup_frame (int sig, struct k_sigaction *ka, + sigset_t *set, struct pt_regs *regs) +{ + struct sigframe *frame; + struct sigcontext context; + int err = 0; + + frame = get_sigframe(ka, regs, sizeof(*frame)); + + err |= __put_user((current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig), + &frame->sig); + + err |= __put_user(&frame->sc, &frame->psc); + + if (_NSIG_WORDS > 1) + err |= copy_to_user(frame->extramask, &set->sig[1], + sizeof(frame->extramask)); + + setup_sigcontext(&context, regs, set->sig[0]); + err |= copy_to_user (&frame->sc, &context, sizeof(context)); + + /* Set up to return from userspace. */ + err |= __put_user(frame->retcode, &frame->pretcode); + + /* sub.l er0,er0; mov.b #__NR_sigreturn,r0l; trapa #0 */ + err != __put_user(0x1a80f800 + (__NR_sigreturn & 0xff), + (long *)(frame->retcode + 0)); + err |= __put_user(0x5700, (short *)(frame->retcode + 4)); + + + if (err) + goto give_sigsegv; + + /* Set up registers for signal handler */ + wrusp ((unsigned long) frame); + regs->pc = (unsigned long) ka->sa.sa_handler; + + return; + +give_sigsegv: + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); +} + +static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, + sigset_t *set, struct pt_regs *regs) +{ + struct rt_sigframe *frame; + int err = 0; + + frame = get_sigframe(ka, regs, sizeof(*frame)); + + err |= __put_user((current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig), + &frame->sig); + err |= __put_user(&frame->info, &frame->pinfo); + err |= __put_user(&frame->uc, &frame->puc); + err |= copy_siginfo_to_user(&frame->info, info); + + /* Create the ucontext. */ + err |= __put_user(0, &frame->uc.uc_flags); + err |= __put_user(0, &frame->uc.uc_link); + err |= __put_user((void *)current->sas_ss_sp, + &frame->uc.uc_stack.ss_sp); + err |= __put_user(sas_ss_flags(rdusp()), + &frame->uc.uc_stack.ss_flags); + err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); + err |= rt_setup_ucontext(&frame->uc, regs); + err |= copy_to_user (&frame->uc.uc_sigmask, set, sizeof(*set)); + + /* Set up to return from userspace. */ + err |= __put_user(frame->retcode, &frame->pretcode); + + /* moveq #,d0; notb d0; movea.l #,a5; trap #0 */ + /* sub.l er0,er0; mov.b #__NR_rt_sigreturn,r0l; trapa #0 */ + err != __put_user(0x1a80f800 + (__NR_rt_sigreturn & 0xff), + (long *)(frame->retcode + 0)); + err |= __put_user(0x5700, (short *)(frame->retcode + 4)); + + if (err) + goto give_sigsegv; + + /* Set up registers for signal handler */ + wrusp ((unsigned long) frame); + regs->pc = (unsigned long) ka->sa.sa_handler; + + return; + +give_sigsegv: + if (sig == SIGSEGV) + ka->sa.sa_handler = SIG_DFL; + force_sig(SIGSEGV, current); +} + +static inline void +handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) +{ + switch (regs->er0) { + case -ERESTARTNOHAND: + if (!has_handler) + goto do_restart; + regs->er0 = -EINTR; + break; + + case -ERESTARTSYS: + if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { + regs->er0 = -EINTR; + break; + } + /* fallthrough */ + case -ERESTARTNOINTR: + do_restart: + regs->er0 = regs->orig_er0; + regs->pc -= 2; + break; + } +} + +/* + * OK, we're invoking a handler + */ +static void +handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, + sigset_t *oldset, struct pt_regs *regs) +{ + /* are we from a system call? */ + if (regs->orig_er0 >= 0) + /* If so, check system call restarting.. */ + handle_restart(regs, ka, 1); + + /* set up the stack frame */ + if (ka->sa.sa_flags & SA_SIGINFO) + setup_rt_frame(sig, ka, info, oldset, regs); + else + setup_frame(sig, ka, oldset, regs); + + if (ka->sa.sa_flags & SA_ONESHOT) + ka->sa.sa_handler = SIG_DFL; + + if (!(ka->sa.sa_flags & SA_NODEFER)) { + spin_lock_irq(¤t->sig->siglock); + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); + sigaddset(¤t->blocked,sig); + recalc_sigpending(); + spin_unlock_irq(¤t->sig->siglock); + } +} + +/* + * Note that 'init' is a special process: it doesn't get signals it doesn't + * want to handle. Thus you cannot kill init even with a SIGKILL even by + * mistake. + * + * Note that we go through the signals twice: once to check the signals + * that the kernel can handle, and then we build all the user-level signal + * handling stack-frames in one go after that. + */ +asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) +{ + siginfo_t info; + struct k_sigaction *ka; + + current->thread.esp0 = (unsigned long) regs; + + if (!oldset) + oldset = ¤t->blocked; + + for (;;) { + int signr; + + signr = get_signal_to_deliver(&info, regs); + + if (!signr) + break; + + if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { + current->exit_code = signr; + current->state = TASK_STOPPED; + + /* Did we come from a system call? */ + if (regs->orig_er0 >= 0) { + /* Restart the system call the same way as + if the process were not traced. */ + struct k_sigaction *ka = + ¤t->sig->action[signr-1]; + int has_handler = + (ka->sa.sa_handler != SIG_IGN && + ka->sa.sa_handler != SIG_DFL); + handle_restart(regs, ka, has_handler); + } + notify_parent(current, SIGCHLD); + schedule(); + + /* We're back. Did the debugger cancel the sig? */ + if (!(signr = current->exit_code)) { + discard_frame: + continue; + } + current->exit_code = 0; + + /* The debugger continued. Ignore SIGSTOP. */ + if (signr == SIGSTOP) + goto discard_frame; + + /* Update the siginfo structure. Is this good? */ + if (signr != info.si_signo) { + info.si_signo = signr; + info.si_errno = 0; + info.si_code = SI_USER; + info.si_pid = current->parent->pid; + info.si_uid = current->parent->uid; + } + + /* If the (new) signal is now blocked, requeue it. */ + if (sigismember(¤t->blocked, signr)) { + send_sig_info(signr, &info, current); + continue; + } + } + + ka = ¤t->sig->action[signr-1]; + if (ka->sa.sa_handler == SIG_IGN) { + if (signr != SIGCHLD) + continue; + /* Check for SIGCHLD: it's special. */ + while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) + /* nothing */; + continue; + } + + if (ka->sa.sa_handler == SIG_DFL) { + int exit_code = signr; + + if (current->pid == 1) + continue; + + switch (signr) { + case SIGCONT: case SIGCHLD: + case SIGWINCH: case SIGURG: + continue; + + case SIGTSTP: case SIGTTIN: case SIGTTOU: + if (is_orphaned_pgrp(current->pgrp)) + continue; + /* FALLTHRU */ + + case SIGSTOP: { + struct signal_struct *sig; + current->state = TASK_STOPPED; + current->exit_code = signr; + sig = current->parent->sig; + if (sig && !(sig->action[SIGCHLD-1].sa.sa_flags +& SA_NOCLDSTOP)) + notify_parent(current, SIGCHLD); + schedule(); + continue; + } + + case SIGQUIT: case SIGILL: case SIGTRAP: + case SIGIOT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: + if (do_coredump(signr, regs)) + exit_code |= 0x80; + /* FALLTHRU */ + + default: + sig_exit(signr, exit_code, &info); + /* NOTREACHED */ + } + } + + /* Whee! Actually deliver the signal. */ + handle_signal(signr, ka, &info, oldset, regs); + return 1; + } + + /* Did we come from a system call? */ + if (regs->orig_er0 >= 0) + /* Restart the system call - no handlers present */ + handle_restart(regs, NULL, 0); + + return 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/sys_h8300.c linux-2.5.67-ac1/arch/h8300/kernel/sys_h8300.c --- linux-2.5.67/arch/h8300/kernel/sys_h8300.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/sys_h8300.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,289 @@ +/* + * linux/arch/h8300/kernel/sys_h8300.c + * + * This file contains various random system calls that + * have a non-standard calling sequence on the H8/300 + * platform. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * 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(¤t->mm->mmap_sem); + error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); + up_write(¤t->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; +} + +#if 0 /* DAVIDM - do we want this */ +struct mmap_arg_struct64 { + __u32 addr; + __u32 len; + __u32 prot; + __u32 flags; + __u64 offset; /* 64 bits */ + __u32 fd; +}; + +asmlinkage long sys_mmap64(struct mmap_arg_struct64 *arg) +{ + int error = -EFAULT; + struct file * file = NULL; + struct mmap_arg_struct64 a; + unsigned long pgoff; + + if (copy_from_user(&a, arg, sizeof(a))) + return -EFAULT; + + if ((long)a.offset & ~PAGE_MASK) + return -EINVAL; + + pgoff = a.offset >> PAGE_SHIFT; + if ((a.offset >> PAGE_SHIFT) != pgoff) + return -EINVAL; + + if (!(a.flags & MAP_ANONYMOUS)) { + error = -EBADF; + file = fget(a.fd); + if (!file) + goto out; + } + a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + + down_write(¤t->mm->mmap_sem); + error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); + up_write(¤t->mm->mmap_sem); + if (file) + fput(file); +out: + return error; +} +#endif + +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, ret; + + 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; + } + if (call <= SHMCTL) + switch (call) { + case SHMAT: + switch (version) { + default: { + ulong raddr; + ret = sys_shmat (first, (char *) ptr, + second, &raddr); + if (ret) + return ret; + return put_user (raddr, (ulong *) third); + } + } + case SHMDT: + return sys_shmdt ((char *)ptr); + case SHMGET: + return sys_shmget (first, second, third); + case SHMCTL: + return sys_shmctl (first, second, + (struct shmid_ds *) ptr); + default: + return -EINVAL; + } + + return -EINVAL; +} + +asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) +{ + return -ENOSYS; +} + +/* sys_cacheflush -- no support. */ +asmlinkage int +sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) +{ + return -EINVAL; +} + +asmlinkage int sys_getpagesize(void) +{ + return PAGE_SIZE; +} + +#if defined(CONFIG_SYSCALL_PRINT) +asmlinkage void syscall_print(void *dummy,...) +{ + struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy); + unsigned long *usp=rdusp()+8; + printk("call %06x:%d 1:%08x,2:%08x,3:%08x,ret:%08x\n", + ((*usp) & 0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0); +} +#endif diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/sys_h8300.c.new linux-2.5.67-ac1/arch/h8300/kernel/sys_h8300.c.new --- linux-2.5.67/arch/h8300/kernel/sys_h8300.c.new 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/sys_h8300.c.new 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,299 @@ +/* + * linux/arch/h8300/kernel/sys_h8300.c + * + * This file contains various random system calls that + * have a non-standard calling sequence on the H8/300 + * platform. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * 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(¤t->mm->mmap_sem); + error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); + up_write(¤t->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; +} + +#if 0 /* DAVIDM - do we want this */ +struct mmap_arg_struct64 { + __u32 addr; + __u32 len; + __u32 prot; + __u32 flags; + __u64 offset; /* 64 bits */ + __u32 fd; +}; + +asmlinkage long sys_mmap64(struct mmap_arg_struct64 *arg) +{ + int error = -EFAULT; + struct file * file = NULL; + struct mmap_arg_struct64 a; + unsigned long pgoff; + + if (copy_from_user(&a, arg, sizeof(a))) + return -EFAULT; + + if ((long)a.offset & ~PAGE_MASK) + return -EINVAL; + + pgoff = a.offset >> PAGE_SHIFT; + if ((a.offset >> PAGE_SHIFT) != pgoff) + return -EINVAL; + + if (!(a.flags & MAP_ANONYMOUS)) { + error = -EBADF; + file = fget(a.fd); + if (!file) + goto out; + } + a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + + down_write(¤t->mm->mmap_sem); + error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); + up_write(¤t->mm->mmap_sem); + if (file) + fput(file); +out: + return error; +} +#endif + +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, ret; + + 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; + } + if (call <= SHMCTL) + switch (call) { + case SHMAT: + switch (version) { + default: { + ulong raddr; + ret = sys_shmat (first, (char *) ptr, + second, &raddr); + if (ret) + return ret; + return put_user (raddr, (ulong *) third); + } + } + case SHMDT: + return sys_shmdt ((char *)ptr); + case SHMGET: + return sys_shmget (first, second, third); + case SHMCTL: + return sys_shmctl (first, second, + (struct shmid_ds *) ptr); + default: + return -EINVAL; + } + + return -EINVAL; +} + +asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) +{ + return -ENOSYS; +} + +/* sys_cacheflush -- no support. */ +asmlinkage int +sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) +{ + return -EINVAL; +} + +asmlinkage int sys_getpagesize(void) +{ + return PAGE_SIZE; +} + +/* + * Old cruft + */ +asmlinkage int sys_pause(void) +{ + current->state = TASK_INTERRUPTIBLE; + schedule(); + return -ERESTARTNOHAND; +} + +#if defined(CONFIG_SYSCALL_PRINT) +asmlinkage void syscall_print(void *dummy,...) +{ + struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy); + unsigned long *usp=rdusp()+8; + printk("call %06x:%d 1:%08x,2:%08x,3:%08x,ret:%08x\n", + ((*usp) & 0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0); +} +#endif diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/time.c linux-2.5.67-ac1/arch/h8300/kernel/time.c --- linux-2.5.67/arch/h8300/kernel/time.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/time.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,162 @@ +/* + * linux/arch/h8300/kernel/time.c + * + * Yoshinori Sato + * + * Copied/hacked from: + * + * linux/arch/m68k/kernel/time.c + * + * Copyright (C) 1991, 1992, 1995 Linus Torvalds + * + * This file contains the m68k-specific time handling details. + * Most of the stuff is located in the machine specific files. + * + * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 + * "A Kernel Model for Precision Timekeeping" by Dave Mills + */ + +#include /* CONFIG_HEARTBEAT */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define TICK_SIZE (tick_nsec / 1000) + +u64 jiffies_64; + +static inline void do_profile (unsigned long pc) +{ + if (prof_buffer && current->pid) { + extern int _stext; + pc -= (unsigned long) &_stext; + pc >>= prof_shift; + if (pc < prof_len) + ++prof_buffer[pc]; + else + /* + * Don't ignore out-of-bounds PC values silently, + * put them into the last histogram slot, so if + * present, they will show up as a sharp peak. + */ + ++prof_buffer[prof_len-1]; + } +} + +/* + * timer_interrupt() needs to keep up the real-time clock, + * as well as call the "do_timer()" routine every clocktick + */ +static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs) +{ + /* last time the cmos clock got updated */ + static long last_rtc_update=0; + + /* may need to kick the hardware timer */ + platform_timer_eoi(); + + do_timer(regs); + + if (!user_mode(regs)) + do_profile(regs->pc); + +#ifdef CONFIG_HEARTBEAT + /* use power LED as a heartbeat instead -- much more useful + for debugging -- based on the version for PReP by Cort */ + /* acts like an actual heart beat -- ie thump-thump-pause... */ + if (mach_heartbeat) { + static unsigned cnt = 0, period = 0, dist = 0; + + if (cnt == 0 || cnt == dist) + mach_heartbeat( 1 ); + else if (cnt == 7 || cnt == dist+7) + mach_heartbeat( 0 ); + + if (++cnt > period) { + cnt = 0; + /* The hyperbolic function below modifies the heartbeat period + * length in dependency of the current (5min) load. It goes + * through the points f(0)=126, f(1)=86, f(5)=51, + * f(inf)->30. */ + period = ((672<= 1000000) { + usec -= 1000000; + sec++; + } + + tv->tv_sec = sec; + tv->tv_usec = usec; +} + +void do_settimeofday(struct timeval *tv) +{ + write_lock_irq(&xtime_lock); + /* This is revolting. We need to set the xtime.tv_usec + * correctly. However, the value in this location is + * is value at the last tick. + * Discover what correction gettimeofday + * would have done, and then undo it! + */ + while (tv->tv_usec < 0) { + tv->tv_usec += 1000000; + tv->tv_sec--; + } + + xtime.tv_sec = tv->tv_sec; + xtime.tv_nsec = (tv->tv_usec * 1000); + time_adjust = 0; /* stop active adjtime() */ + time_status |= STA_UNSYNC; + time_maxerror = NTP_PHASE_LIMIT; + time_esterror = NTP_PHASE_LIMIT; + write_unlock_irq(&xtime_lock); +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/kernel/traps.c linux-2.5.67-ac1/arch/h8300/kernel/traps.c --- linux-2.5.67/arch/h8300/kernel/traps.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/kernel/traps.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,124 @@ +/* + * linux/arch/h8300/boot/traps.c -- general exception handling code + * H8/300 support Yoshinori Sato + * + * Cloned from Linux/m68k. + * + * No original Copyright holder listed, + * Probabily original (C) Roman Zippel (assigned DJD, 1999) + * + * Copyright 1999-2000 D. Jeff Dionne, + * + * 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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * this must be called very early as the kernel might + * use some instruction that are emulated on the 060 + */ + +void __init base_trap_init(void) +{ +} + +void __init trap_init (void) +{ +} + +asmlinkage void set_esp0 (unsigned long ssp) +{ + current->thread.esp0 = ssp; +} + +/* + * Generic dumping code. Used for panic and debug. + */ + +static void dump(struct pt_regs *fp) +{ + unsigned long *sp; + unsigned char *tp; + int i; + + printk("\nCURRENT PROCESS:\n\n"); +#if 0 +{ + extern int swt_lastjiffies, swt_reference; + printk("WATCHDOG: jiffies=%d lastjiffies=%d [%d] reference=%d\n", + jiffies, swt_lastjiffies, (swt_lastjiffies - jiffies), + swt_reference); +} +#endif + printk("COMM=%s PID=%d\n", current->comm, current->pid); + if (current->mm) { + printk("TEXT=%08x-%08x DATA=%08x-%08x BSS=%08x-%08x\n", + (int) current->mm->start_code, + (int) current->mm->end_code, + (int) current->mm->start_data, + (int) current->mm->end_data, + (int) current->mm->end_data, + (int) current->mm->brk); + printk("USER-STACK=%08x KERNEL-STACK=%08x\n\n", + (int) current->mm->start_stack, + (int) PAGE_SIZE+(unsigned long)current); + } + + printk("PC: %08lx\n", (long)fp->pc); + printk("CCR: %08lx SP: %08lx\n", fp->ccr, (long) fp); + printk("ER0: %08lx ER1: %08lx ER2: %08lx ER3: %08lx\n", + fp->er0, fp->er1, fp->er2, fp->er3); + printk("\nCODE:"); + tp = ((unsigned char *) fp->pc) - 0x20; + for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) { + if ((i % 0x10) == 0) + printk("\n%08x: ", (int) (tp + i)); + printk("%08x ", (int) *sp++); + } + printk("\n"); + + printk("\nKERNEL STACK:"); + tp = ((unsigned char *) fp) - 0x40; + for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) { + if ((i % 0x10) == 0) + printk("\n%08x: ", (int) (tp + i)); + printk("%08x ", (int) *sp++); + } + printk("\n"); + if (STACK_MAGIC != *(unsigned long *)((unsigned long)current+PAGE_SIZE)) + printk("(Possibly corrupted stack page??)\n"); + + printk("\n\n"); +} + +void show_trace_task(struct task_struct *tsk) +{ + /* DAVIDM: we can do better, need a proper stack dump */ + printk("STACK ksp=0x%lx, usp=0x%lx\n", tsk->thread.ksp, tsk->thread.usp); +} + +void die_if_kernel (char *str, struct pt_regs *fp, int nr) +{ + extern int console_loglevel; + + if (!(fp->ccr & PS_S)) + return; + + console_loglevel = 15; + dump(fp); + + do_exit(SIGSEGV); +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/lib/ashrdi3.c linux-2.5.67-ac1/arch/h8300/lib/ashrdi3.c --- linux-2.5.67/arch/h8300/lib/ashrdi3.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/lib/ashrdi3.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,63 @@ +/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */ +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC 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, or (at your option) +any later version. + +GNU CC 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. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define BITS_PER_UNIT 8 + +typedef int SItype __attribute__ ((mode (SI))); +typedef unsigned int USItype __attribute__ ((mode (SI))); +typedef int DItype __attribute__ ((mode (DI))); +typedef int word_type __attribute__ ((mode (__word__))); + +struct DIstruct {SItype high, low;}; + +typedef union +{ + struct DIstruct s; + DItype ll; +} DIunion; + +DItype +__ashrdi3 (DItype u, word_type b) +{ + DIunion w; + word_type bm; + DIunion uu; + + if (b == 0) + return u; + + uu.ll = u; + + bm = (sizeof (SItype) * BITS_PER_UNIT) - b; + if (bm <= 0) + { + /* w.s.high = 1..1 or 0..0 */ + w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1); + w.s.low = uu.s.high >> -bm; + } + else + { + USItype carries = (USItype)uu.s.high << bm; + w.s.high = uu.s.high >> b; + w.s.low = ((USItype)uu.s.low >> b) | carries; + } + + return w.ll; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/lib/checksum.c linux-2.5.67-ac1/arch/h8300/lib/checksum.c --- linux-2.5.67/arch/h8300/lib/checksum.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/lib/checksum.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * INET An implementation of the TCP/IP protocol suite for the LINUX + * operating system. INET is implemented using the BSD Socket + * interface as the means of communication with the user level. + * + * IP/TCP/UDP checksumming routines + * + * Authors: Jorge Cwik, + * Arnt Gulbrandsen, + * Tom May, + * Andreas Schwab, + * Lots of code moved from tcp.c and ip.c; see those files + * for more names. + * + * 03/02/96 Jes Sorensen, Andreas Schwab, Roman Hodek: + * Fixed some nasty bugs, causing some horrible crashes. + * A: At some points, the sum (%0) was used as + * length-counter instead of the length counter + * (%1). Thanks to Roman Hodek for pointing this out. + * B: GCC seems to mess up if one uses too many + * data-registers to hold input values and one tries to + * specify d0 and d1 as scratch registers. Letting gcc choose these + * registers itself solves the problem. + * + * 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. + */ + +/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access kills, so most + of the assembly has to go. */ + +#include + +static inline unsigned short from32to16(unsigned long x) +{ + /* add up 16-bit and 16-bit for 16+c bit */ + x = (x & 0xffff) + (x >> 16); + /* add up carry.. */ + x = (x & 0xffff) + (x >> 16); + return x; +} + +static unsigned long do_csum(const unsigned char * buff, int len) +{ + int odd, count; + unsigned long result = 0; + + if (len <= 0) + goto out; + odd = 1 & (unsigned long) buff; + if (odd) { + result = *buff; + len--; + buff++; + } + count = len >> 1; /* nr of 16-bit words.. */ + if (count) { + if (2 & (unsigned long) buff) { + result += *(unsigned short *) buff; + count--; + len -= 2; + buff += 2; + } + count >>= 1; /* nr of 32-bit words.. */ + if (count) { + unsigned long carry = 0; + do { + unsigned long w = *(unsigned long *) buff; + count--; + buff += 4; + result += carry; + result += w; + carry = (w > result); + } while (count); + result += carry; + result = (result & 0xffff) + (result >> 16); + } + if (len & 2) { + result += *(unsigned short *) buff; + buff += 2; + } + } + if (len & 1) + result += (*buff << 8); + result = from32to16(result); + if (odd) + result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); +out: + return result; +} + +/* + * This is a version of ip_compute_csum() optimized for IP headers, + * which always checksum on 4 octet boundaries. + */ +unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl) +{ + return ~do_csum(iph,ihl*4); +} + +/* + * computes the checksum of a memory block at buff, length len, + * and adds in "sum" (32-bit) + * + * returns a 32-bit number suitable for feeding into itself + * or csum_tcpudp_magic + * + * this function must be called with even lengths, except + * for the last fragment, which may be odd + * + * it's best to have buff aligned on a 32-bit boundary + */ +unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) +{ + unsigned int result = do_csum(buff, len); + + /* add in old sum, and carry.. */ + result += sum; + /* 16+c bits -> 16 bits */ + result = (result & 0xffff) + (result >> 16); + return result; +} + +/* + * this routine is used for miscellaneous IP-like checksums, mainly + * in icmp.c + */ +unsigned short ip_compute_csum(const unsigned char * buff, int len) +{ + return ~do_csum(buff,len); +} + +/* + * copy from fs while checksumming, otherwise like csum_partial + */ + +unsigned int +csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) +{ + if (csum_err) *csum_err = 0; + memcpy(dst, src, len); + return csum_partial(dst, len, sum); +} + +/* + * copy from ds while checksumming, otherwise like csum_partial + */ + +unsigned int +csum_partial_copy(const char *src, char *dst, int len, int sum) +{ + memcpy(dst, src, len); + return csum_partial(dst, len, sum); +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/lib/Makefile linux-2.5.67-ac1/arch/h8300/lib/Makefile --- linux-2.5.67/arch/h8300/lib/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/lib/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,11 @@ +# +# Makefile for H8/300-specific library files.. +# + +.S.o: + $(CC) $(AFLAGS) -D__ASSEMBLY__ -c $< -o $@ + +L_TARGET = lib.a +obj-y = ashrdi3.o checksum.o memcpy.o memset.o abs.o + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/lib/memcpy.S linux-2.5.67-ac1/arch/h8300/lib/memcpy.S --- linux-2.5.67/arch/h8300/lib/memcpy.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/lib/memcpy.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,79 @@ +;;; memcpy.S + +#include + + .h8300h + + .text +.global SYMBOL_NAME(memcpy) + +;;; void *memcpy(void *to, void *from, size_t n) +SYMBOL_NAME_LABEL(memcpy) + mov.l er2,er2 + bne 1f + rts +1: + ;; address check + bld #0,r0l + bxor #0,r1l + bcs 4f + mov.l er4,@-sp + mov.l er0,@-sp + btst #0,r0l + beq 1f + ;; (aligned even) odd address + mov.b @er1,r3l + mov.b r3l,@er0 + adds #1,er1 + adds #1,er0 + dec.l #1,er2 + beq 3f +1: + ;; n < sizeof(unsigned long) check + sub.l er4,er4 + adds #4,er4 ; loop count check value + cmp.l er4,er2 + blo 2f + ;; unsigned long copy +1: + mov.l @er1,er3 + mov.l er3,@er0 + adds #4,er0 + adds #4,er1 + subs #4,er2 + cmp.l er4,er2 + bcc 1b + ;; rest +2: + mov.l er2,er2 + beq 3f +1: + mov.b @er1,r3l + mov.b r3l,@er0 + adds #1,er1 + adds #1,er0 + dec.l #1,er2 + bne 1b +3: + mov.l @sp+,er0 + mov.l @sp+,er4 + rts + + ;; odd <- even / even <- odd +4: + mov.l er4,er3 + mov.l er2,er4 + mov.l er5,er2 + mov.l er1,er5 + mov.l er6,er1 + mov.l er0,er6 +1: + eepmov.w + mov.w r4,r4 + bne 1b + dec.w #1,e4 + bpl 1b + mov.l er1,er6 + mov.l er2,er5 + mov.l er3,er4 + rts diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/lib/memset.S linux-2.5.67-ac1/arch/h8300/lib/memset.S --- linux-2.5.67/arch/h8300/lib/memset.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/lib/memset.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,56 @@ +/* memset.S */ + +#include + + .h8300h + .text + +.global SYMBOL_NAME(memset) + +;;void *memset(*ptr, int c, size_t count) +;; ptr = er0 +;; c = er1(r1l) +;; count = er2 +SYMBOL_NAME_LABEL(memset) + mov.l er2,er2 + beq 7f + mov.l er0,@-sp + btst #0,r0l + beq 2f + + ;; odd address +1: + mov.b r1l,@er0 + adds #1,er0 + dec.l #1,er2 + beq 6f + + ;; even address +2: + mov.l er2,er3 + cmp.l #4,er2 + blo 4f + ;; count>=4 -> count/4 + shlr.l er2 + shlr.l er2 + ;; byte -> long + mov.b r1l,r1h + mov.w r1,e1 +3: + mov.l er1,@er0 + adds #4,er0 + dec.l #1,er2 + bne 3b +4: + ;; count % 4 + and.b #3,r3l + beq 6f +5: + mov.b r1l,@er0 + adds #1,er0 + dec.b r3l + bne 5b +6: + mov.l @sp+,er0 +7: + rts diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/Makefile linux-2.5.67-ac1/arch/h8300/Makefile --- linux-2.5.67/arch/h8300/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,62 @@ +# +# arch/h8300/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, Yoshinori Sato +# +ifndef include-config +-include $(TOPDIR)/.config +endif + +platform-$(CONFIG_H8300H) := h8300h +PLATFORM := $(platform-y) + +board-$(CONFIG_H8300H_GENERIC) := generic +board-$(CONFIG_H8300H_AKI3068NET) := ucsimm +board-$(CONFIG_H8300H_H8MAX) := ucdimm +board-$(CONFIG_H8300H_SIM) := generic +BOARD := $(board-y) + +model-$(CONFIG_RAMKERNEL) := ram +model-$(CONFIG_ROMKERNEL) := rom +MODEL := $(model-y) + +cflags-$(CONFIG_H8300H) := -mh +ldflags-$(CONFIG_H8300H) := -mh8300helf + +CFLAGS += $(cflags-y) +CFLAGS += -mint32 -fno-builtin +CFLAGS += -O2 -g +CFLAGS += -D__linux__ +CFLAGS += -DUTS_SYSNAME=\"uClinux\" -DTARGET=$(BOARD) +AFLAGS += -DPLATFORM=$(PLATFORM) -DTARGET=$(BOARD) -DMODEL=$(MODEL) +LDFLAGS += $(ldflags-y) + +CROSS_COMPILE = h8300-elf- +HEAD := arch/$(ARCH)/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o +LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(CFLAGS) -print-libgcc-file-name) + +core-y += arch/$(ARCH)/kernel/ \ + arch/$(ARCH)/mm/ \ + arch/$(ARCH)/platform/$(PLATFORM)/ \ + arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/ + +libs-y += arch/$(ARCH)/lib/ $(LIBGCC) + +export MODEL + +archmrproper: + +archclean: + $(call descend arch/$(ARCH)/platform, subdirclean) + +prepare: include/asm-$(ARCH)/asm-offsets.h + +include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ + include/asm include/linux/version.h + @echo -n ' Generating $@' + @$(generate-asm-offsets.h) < $< > $@.tmp + @$(update-if-changed) diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/mm/fault.c linux-2.5.67-ac1/arch/h8300/mm/fault.c --- linux-2.5.67/arch/h8300/mm/fault.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/mm/fault.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * linux/arch/h8300/mm/fault.c + * + * Copyright (C) 1998 D. Jeff Dionne , + * Copyright (C) 2000 Lineo, Inc. (www.lineo.com) + * + * Based on: + * + * linux/arch/m68knommu/mm/fault.c + * linux/arch/m68k/mm/fault.c + * + * Copyright (C) 1995 Hamish Macdonald + */ + +#include +#include +#include +#include + +#include +#include + +extern void die_if_kernel(char *, struct pt_regs *, long); + +/* + * This routine handles page faults. It determines the problem, and + * then passes it off to one of the appropriate routines. + * + * error_code: + * bit 0 == 0 means no page found, 1 means protection fault + * bit 1 == 0 means read, 1 means write + * + * If this routine detects a bad access, it returns 1, otherwise it + * returns 0. + */ +asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, + unsigned long error_code) +{ +#ifdef DEBUG + printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld\n", + regs->sr, regs->pc, address, error_code); +#endif + +/* + * Oops. The kernel tried to access some bad page. We'll have to + * terminate things with extreme prejudice. + */ + if ((unsigned long) address < PAGE_SIZE) { + printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); + } else + printk(KERN_ALERT "Unable to handle kernel access"); + printk(" at virtual address %08lx\n",address); + die_if_kernel("Oops", regs, error_code); + do_exit(SIGKILL); + + return 1; +} + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/mm/init.c linux-2.5.67-ac1/arch/h8300/mm/init.c --- linux-2.5.67/arch/h8300/mm/init.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/mm/init.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,235 @@ +/* + * linux/arch/h8300/mm/init.c + * + * Copyright (C) 1998 D. Jeff Dionne , + * Kenneth Albanowski , + * Copyright (C) 2000 Lineo, Inc. (www.lineo.com) + * + * Based on: + * + * linux/arch/m68knommu/mm/init.c + * linux/arch/m68k/mm/init.c + * + * Copyright (C) 1995 Hamish Macdonald + * + * JAN/1999 -- hacked to support ColdFire (gerg@snapgear.com) + * DEC/2000 -- linux 2.4 support + */ + +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_BLK_DEV_RAM +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#undef DEBUG + +extern void die_if_kernel(char *,struct pt_regs *,long); +extern void free_initmem(void); + +/* + * BAD_PAGE is the page that is used for page faults when linux + * is out-of-memory. Older versions of linux just did a + * do_exit(), but using this instead means there is less risk + * for a process dying in kernel mode, possibly leaving a inode + * unused etc.. + * + * BAD_PAGETABLE is the accompanying page-table: it is initialized + * to point to BAD_PAGE entries. + * + * ZERO_PAGE is a special page that is used for zero-initialized + * data and COW. + */ +static unsigned long empty_bad_page_table; + +static unsigned long empty_bad_page; + +unsigned long empty_zero_page; + +extern unsigned long rom_length; + +void show_mem(void) +{ + unsigned long i; + int free = 0, total = 0, reserved = 0, shared = 0; + int cached = 0; + + printk("\nMem-info:\n"); + show_free_areas(); + i = max_mapnr; + while (i-- > 0) { + total++; + if (PageReserved(mem_map+i)) + reserved++; + else if (PageSwapCache(mem_map+i)) + cached++; + else if (!page_count(mem_map+i)) + free++; + else + shared += page_count(mem_map+i) - 1; + } + printk("%d pages of RAM\n",total); + printk("%d free pages\n",free); + printk("%d reserved pages\n",reserved); + printk("%d pages shared\n",shared); + printk("%d pages swap cached\n",cached); +} + +extern unsigned long memory_start; +extern unsigned long memory_end; + +/* + * paging_init() continues the virtual memory environment setup which + * was begun by the code in arch/head.S. + * The parameters are pointers to where to stick the starting and ending + * addresses of available kernel virtual memory. + */ +void paging_init(void) +{ + /* + * Make sure start_mem is page aligned, otherwise bootmem and + * page_alloc get different views og the world. + */ +#ifdef DEBUG + unsigned long start_mem = PAGE_ALIGN(memory_start); +#endif + unsigned long end_mem = memory_end & PAGE_MASK; + +#ifdef DEBUG + printk ("start_mem is %#lx\nvirtual_end is %#lx\n", + start_mem, end_mem); +#endif + + /* + * Initialize the bad page table and bad page to point + * to a couple of allocated pages. + */ + empty_bad_page_table = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); + empty_bad_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); + empty_zero_page = (unsigned long)alloc_bootmem_pages(PAGE_SIZE); + memset((void *)empty_zero_page, 0, PAGE_SIZE); + + /* + * Set up SFC/DFC registers (user data space). + */ + set_fs (USER_DS); + +#ifdef DEBUG + printk ("before free_area_init\n"); + + printk ("free_area_init -> start_mem is %#lx\nvirtual_end is %#lx\n", + start_mem, end_mem); +#endif + + { + unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; + + zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; + zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT; +#ifdef CONFIG_HIGHMEM + zones_size[ZONE_HIGHMEM] = 0; +#endif + free_area_init(zones_size); + } +} + +void mem_init(void) +{ + int codek = 0, datak = 0, initk = 0; + /* DAVIDM look at setup memory map generically with reserved area */ + unsigned long tmp; + extern char _etext, _stext, _sdata, _ebss, __init_begin, __init_end; + extern unsigned char _ramend, _ramstart; + unsigned long len = &_ramend - &_ramstart; + unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */ + unsigned long end_mem = memory_end; /* DAVIDM - this must not include kernel stack at top */ + +#ifdef DEBUG + printk("Mem_init: start=%lx, end=%lx\n", start_mem, end_mem); +#endif + + end_mem &= PAGE_MASK; + high_memory = (void *) end_mem; + + start_mem = PAGE_ALIGN(start_mem); + max_mapnr = num_physpages = MAP_NR(high_memory); + + /* this will put all memory onto the freelists */ + totalram_pages = free_all_bootmem(); + + codek = (&_etext - &_stext) >> 10; + datak = (&_ebss - &_sdata) >> 10; + initk = (&__init_begin - &__init_end) >> 10; + + tmp = nr_free_pages() << PAGE_SHIFT; + printk("Memory available: %luk/%luk RAM, %luk/%luk ROM (%dk kernel code, %dk data)\n", + tmp >> 10, + len >> 10, + (rom_length > 0) ? ((rom_length >> 10) - codek) : 0, + rom_length >> 10, + codek, + datak + ); +} + + +#ifdef CONFIG_BLK_DEV_INITRD +void free_initrd_mem(unsigned long start, unsigned long end) +{ + int pages = 0; + for (; start < end; start += PAGE_SIZE) { + ClearPageReserved(virt_to_page(start)); + set_page_count(virt_to_page(start), 1); + free_page(start); + totalram_pages++; + pages++; + } + printk ("Freeing initrd memory: %dk freed\n", pages); +} +#endif + +void +free_initmem() +{ +#ifdef CONFIG_RAMKERNEL + unsigned long addr; + extern char __init_begin, __init_end; +/* + * the following code should be cool even if these sections + * are not page aligned. + */ + addr = PAGE_ALIGN((unsigned long)(&__init_begin)); + /* next to check that the page we free is not a partial page */ + for (; addr + PAGE_SIZE < (unsigned long)(&__init_end); addr +=PAGE_SIZE) { + ClearPageReserved(virt_to_page(addr)); + set_page_count(virt_to_page(addr), 1); + free_page(addr); + totalram_pages++; + } + printk("Freeing unused kernel memory: %ldk freed (0x%x - 0x%x)\n", + (addr - PAGE_ALIGN((long) &__init_begin)) >> 10, + (int)(PAGE_ALIGN((unsigned long)(&__init_begin))), + (int)(addr - PAGE_SIZE)); +#endif +} + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/mm/kmap.c linux-2.5.67-ac1/arch/h8300/mm/kmap.c --- linux-2.5.67/arch/h8300/mm/kmap.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/mm/kmap.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * linux/arch/h8300/mm/kmap.c + * + * Based on + * linux/arch/m68knommu/mm/kmap.c + * + * Copyright (C) 2000 Lineo, + * Copyright (C) 2000-2002 David McCullough + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#undef DEBUG + +/* + * Map some physical address range into the kernel address space. + */ +void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) +{ + return (void *)physaddr; +} + +/* + * Unmap a ioremap()ed region again. + */ +void iounmap(void *addr) +{ +} + +/* + * __iounmap unmaps nearly everything, so be careful + * it doesn't free currently pointer/page tables anymore but it + * wans't used anyway and might be added later. + */ +void __iounmap(void *addr, unsigned long size) +{ +} + +/* + * Set new cache mode for some kernel address space. + * The caller must push data for that range itself, if such data may already + * be in the cache. + */ +void kernel_set_cachemode(void *addr, unsigned long size, int cmode) +{ +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/mm/Makefile linux-2.5.67-ac1/arch/h8300/mm/Makefile --- linux-2.5.67/arch/h8300/mm/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/mm/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,12 @@ +# +# Makefile for the linux m68k-specific parts of the memory manager. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definition is now in the main makefile... + +obj-y := init.o fault.o memory.o kmap.o + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/mm/memory.c linux-2.5.67-ac1/arch/h8300/mm/memory.c --- linux-2.5.67/arch/h8300/mm/memory.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/mm/memory.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * linux/arch/h8300/mm/memory.c + * + * Copyright (C) 2002 Yoshinori Sato , + * + * Based on: + * + * linux/arch/m68knommu/mm/memory.c + * + * Copyright (C) 1998 Kenneth Albanowski , + * Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com) + * + * Based on: + * + * linux/arch/m68k/mm/memory.c + * + * Copyright (C) 1995 Hamish Macdonald + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +void cache_clear (unsigned long paddr, int len) +{ +} + + +void cache_push (unsigned long paddr, int len) +{ +} + +void cache_push_v (unsigned long vaddr, int len) +{ +} + +/* Map some physical address range into the kernel address space. The + * code is copied and adapted from map_chunk(). + */ + +unsigned long kernel_map(unsigned long paddr, unsigned long size, + int nocacheflag, unsigned long *memavailp ) +{ + return paddr; +} + +#ifdef MAGIC_ROM_PTR + +int is_in_rom(unsigned long addr) +{ + /* Anything not in operational RAM is returned as in rom! */ + if (addr < _ramstart || addr >= _ramend) + return 1; + else + return 0; +} + +#endif + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S --- linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,109 @@ +/* + * linux/arch/h8300/platform/h8300h/aki3068net/crt0_ram.S + * + * Yoshinori Sato + * + * Platform depend startup for uClinux-2.4.x + * Target Archtecture: AE-3068 (aka. aki3068net) + * Memory Layout : RAM + */ + +#define ASSEMBLY + +#include +#include + + .global SYMBOL_NAME(_start) + .global SYMBOL_NAME(command_line) + .global SYMBOL_NAME(_platform_gpio_table) + .global SYMBOL_NAME(_target_name) + + .h8300h + + .section .text + .file "crt0_ram.S" + + /* CPU Reset entry */ +SYMBOL_NAME_LABEL(_start) + mov.l #__ramend,sp + ldc #0x80,ccr + + /* Peripheral Setup */ + + /* .bss clear */ + mov.l #__sbss,er5 + mov.l er5,er6 + inc.l #1,er6 + mov.l #__ebss,er4 + sub.l er5,er4 + sub.w r0,r0 + mov.b r0l,@er5 +1: + eepmov.w + dec.w #1,e4 + bpl 1b + + /* copy kernel commandline */ + mov.l #COMMAND_START,er5 + mov.l #SYMBOL_NAME(command_line),er6 + mov.w #512,r4 + eepmov.w + + /* RAM Interrupt Vector Table Setup */ +#if defined(CONFIG_GDB_DEBUG) + mov.l @SYMBOL_NAME(interrupt_redirect_table)+11*4,er0 +#endif + mov.l #SYMBOL_NAME(_vector_lma),er5 + mov.l #SYMBOL_NAME(interrupt_redirect_table),er6 + mov.w #0x100,r4 + eepmov.w +#if defined(CONFIG_GDB_DEBUG) + mov.l er0,@SYMBOL_NAME(interrupt_redirect_table)+11*4 +#endif + + /* uClinux kernel start */ + ldc #0x90,ccr /* running kernel */ + mov.l #SYMBOL_NAME(init_task_union),sp + mov.l sp,@SYMBOL_NAME(_current_task) + add.l #0x2000,sp + jsr @_start_kernel +_exit: + + jmp _exit + + rts + + /* I/O port assign information */ +__platform_gpio_table: + mov.l #gpio_table,er0 + rts + +gpio_table: + ;; P1DDR + .byte 0xff,0xff + ;; P2DDR + .byte 0xff,0xff + ;; P3DDR + .byte 0xff,0x00 + ;; P4DDR + .byte 0x00,0x00 + ;; P5DDR + .byte 0x01,0x01 + ;; P6DDR + .byte 0x00,0x00 + ;; dummy + .byte 0x00,0x00 + ;; P8DDR + .byte 0x0c,0x0c + ;; P9DDR + .byte 0x00,0x00 + ;; PADDR + .byte 0x00,0x00 + ;; PBDDR + .byte 0x30,0x30 + +__target_name: + .asciz "AE-3068" + + .section .bootvec,"ax" + jmp @SYMBOL_NAME(_start) diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/Makefile linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/Makefile --- linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,18 @@ +# +# Makefile for the linux kernel. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# + +all: $(BOARD).o +O_TARGET := $(BOARD).o +obj-y := timer.o + +timer.o: timer.c + +clean: + rm -f *.[oa] + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/ram.ld linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/ram.ld --- linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/ram.ld 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/ram.ld 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,90 @@ +/* AE-3068 (aka. aki3068net) RAM */ + +OUTPUT_ARCH(h8300h) +ENTRY("__start") + +MEMORY + { + ram : ORIGIN = 0x400000, LENGTH = 0x600000-0x400000-0x80000 + disk : ORIGIN = 0x600000-0x80000, LENGTH = 0x60000 + eram : ORIGIN = 0x600000, LENGTH = 0 + iram : ORIGIN = 0xffbf20, LENGTH = 0x4000 + } + +SECTIONS +{ + .bootvec : + { + *(.bootvec) + } > ram + .text : + { + __stext = . ; + *(.text) + . = ALIGN(0x4) ; + *(.text.*) + . = ALIGN(0x4) ; + *(.kstrtab) + . = ALIGN(0x4) ; + *(.rodata*) + . = ALIGN(16); /* Exception table */ + ___start___ex_table = .; + *(__ex_table) + ___stop___ex_table = .; + + ___start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + ___stop___ksymtab = .; + + . = ALIGN(0x4) ; + __etext = . ; + } > ram + .data : + { + __sdata = . ; + ___data_start = . ; + *(.data) + *(.data.*) + *(.exitcall.exit) + + . = ALIGN(0x2000) ; + *(.data.init_task) + . = ALIGN(0x2000) ; + ___init_begin = .; + *(.text.init) + *(.data.init) + . = ALIGN(16); + ___setup_start = .; + *(.setup.init) + ___setup_end = .; + ___initcall_start = .; + *(.initcall.init) + . = ALIGN(4) ; + ___initcall_end = .; + ___init_end = .; + __edata = . ; + . = ALIGN(0x4) ; + __sbss = . ; + *(.bss) + . = ALIGN(0x4) ; + *(COMMON) + . = ALIGN(0x4) ; + __ebss = . ; + __end = . ; + __ramstart = .; + } > ram + .blkimg : + { + __ramend = . ; + __blkimg = . ; + } > disk + .ram_vec : AT(ADDR(.data) + SIZEOF(.data)) + { + *(.int_redirect) + } > iram + __vector_lma = LOADADDR(.ram_vec); + .dummy2 : + { + COMMAND_START = . - 0x200 ; + } > eram +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/timer.c linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/timer.c --- linux-2.5.67/arch/h8300/platform/h8300h/aki3068net/timer.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/aki3068net/timer.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * linux/arch/h8300/platform/h8300h/aki3068net/timer.c + * + * Yoshinori Sato + * + * Platform depend Timer Handler + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define TMR8CMA2 0x00ffff94 +#define TMR8TCSR2 0x00ffff92 +#define TMR8TCNT2 0x00ffff90 +#define CMFA 6 + +int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *)) +{ + outb(CONFIG_CLK_FREQ*10/8192,TMR8CMA2); + outb(0x00,TMR8TCSR2); + request_irq(40,timer_int,0,"timer",0); + outb(0x40|0x08|0x03,TMR8TCNT2); +} + +void platform_timer_eoi(void) +{ + *(unsigned char *)TMR8TCSR2 &= ~(1 << CMFA); +} + +void platform_gettod(int *year, int *mon, int *day, int *hour, + int *min, int *sec) +{ + *year = *mon = *day = *hour = *min = *sec = 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/entry.S linux-2.5.67-ac1/arch/h8300/platform/h8300h/entry.S --- linux-2.5.67/arch/h8300/platform/h8300h/entry.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/entry.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,391 @@ +/* -*- mode: asm -*- + * + * linux/arch/h8300/platform/h8300h/entry.S + * + * Yoshinori Sato + * + */ + +/* + * entry.S + * include exception/interrupt gateway + * system call entry + */ + +#include +#include +#include +#include +#include +#include + +#define PT_PTRACED 0x00000001 +#define PT_TRACESYS 0x00000002 +#define PT_DTRACE 0x00000004 /* delayed trace (used on m68k, i386) */ +#define PT_TRACESYSGOOD 0x00000008 +#define PT_PTRACE_CAP 0x00000010 /* ptracer can follow suid-exec */ + +ENOSYS = 38 + +LSIGTRAP = 5 + +SOFTIRQ_PENDING = 0 + +/* + * these are offsets into the task-struct + */ +state = 0 +flags = 4 +sigpending = 8 +need_resched = 20 +ptrace = 24 + +/* the following macro is used when enabling interrupts */ + +LER3 = 0 +LER2 = 4 +LER1 = 8 +LORIG = 12 +LCCR = 16 +LER0 = 18 +LVEC = 22 +LRET = 24 + + .h8300h + +/* CPU context save/restore macros. */ + + .macro SAVE_ALL + mov.l er0,@-sp + stc ccr,r0l + orc #0x10,ccr + btst #4,r0l + bne 1f + mov.l sp,@SYMBOL_NAME(sw_usp) + mov.l @sp,er0 + mov.l @SYMBOL_NAME(sw_ksp),sp + mov.l er0,@-sp + stc ccr,r0l + and #0xef,r0l + mov.w r0,@-sp + mov.l @(2:16,sp),er0 + bra 2f +1: + mov.l @sp,er0 + stc ccr,@-sp +2: + mov.l er0,@-sp + mov.l er1,@-sp + mov.l er2,@-sp + mov.l er3,@-sp + .endm + + .macro RESTORE_REGS + mov.w @(LCCR:16,sp),r0 + btst #4,r0l + bne 1f + mov.l @SYMBOL_NAME(sw_usp),er0 + mov.l @(LER0:16,sp),er1 + mov.l er1,@er0 +/* + mov.l @(LRET:16,sp),er1 + mov.l er1,@(8:16,er0) +*/ + mov.l @sp+,er3 + mov.l @sp+,er2 + mov.l @sp+,er1 + add.l #10,sp + mov.l sp,@SYMBOL_NAME(sw_ksp) + mov.l er0,sp + bra 2f +1: + mov.l @sp+,er3 + mov.l @sp+,er2 + mov.l @sp+,er1 + adds #4,sp + adds #2,sp +2: + mov.l @sp+,er0 + adds #4,sp + .endm + + .macro RESTORE_ALL + RESTORE_REGS + rte + .endm + +#define SWITCH_STACK_SIZE (3*4+12) /* includes return address */ + + .macro SAVE_SWITCH_STACK + mov.l er4,@-sp + mov.l er5,@-sp + mov.l er6,@-sp + .endm + + .macro RESTORE_SWITCH_STACK + mov.l @sp+,er6 + mov.l @sp+,er5 + mov.l @sp+,er4 + .endm + +.globl SYMBOL_NAME(system_call) +.globl SYMBOL_NAME(ret_from_exception) +.globl SYMBOL_NAME(ret_from_signal) +.globl SYMBOL_NAME(ret_from_interrupt), SYMBOL_NAME(bad_interrupt) +.globl SYMBOL_NAME(interrupt_redirect_table) +.globl SYMBOL_NAME(sw_ksp),SYMBOL_NAME(sw_usp) +.globl SYMBOL_NAME(resume) +.globl SYMBOL_NAME(sys_vfork) +.globl SYMBOL_NAME(syscall_trampoline) + + .section .int_redirect,"ax" +SYMBOL_NAME_LABEL(interrupt_redirect_table) + .rept 7 + .long 0 + .endr + jsr @interrupt_entry /* NMI */ + jmp @SYMBOL_NAME(system_call) /* TRAPA #0 (System call) */ + .long 0 + .long 0 + jmp @SYMBOL_NAME(trace_break) /* TRAPA #3 (breakpoint) */ + .rept 64-12 + jsr @interrupt_entry + .endr + + .section .text + .align 2 +interrupt_entry: + SAVE_ALL + mov.w @(LCCR,sp),r0 + btst #4,r0l + bne 1f + mov.l @SYMBOL_NAME(sw_usp),er0 + mov.l @(4:16,er0),er0 + bra 2f +1: + mov.l @(LVEC,sp),er0 +2: + sub.l #SYMBOL_NAME(interrupt_redirect_table),er0 + shlr.l er0 + shlr.l er0 + dec.l #1,er0 + mov.l sp,er1 + jsr @SYMBOL_NAME(process_int) + mov.l @SYMBOL_NAME(irq_stat)+SOFTIRQ_PENDING,er0 + beq 1f + jsr @SYMBOL_NAME(do_softirq) +1: + jmp @SYMBOL_NAME(ret_from_exception) + +SYMBOL_NAME_LABEL(reschedule) + /* save top of frame */ + mov.l sp,er0 + mov.l er0,@-sp + jsr @SYMBOL_NAME(set_esp0) + adds #4,sp + + mov.l #SYMBOL_NAME(ret_from_exception),er0 + mov.l er0,@-sp + jmp @SYMBOL_NAME(schedule) + +SYMBOL_NAME_LABEL(system_call) + subs #4,sp + SAVE_ALL + mov.l er0,er3 + mov.l #-ENOSYS,er0 + mov.l er0,@(LER0:16,sp) + + /* save top of frame */ + mov.l sp,er0 + mov.l er3,@-sp + jsr @SYMBOL_NAME(set_esp0) + mov.l @sp+,er3 + cmp.l #NR_syscalls,er3 + bcc SYMBOL_NAME(ret_from_exception):16 + shll.l er3 + shll.l er3 + mov.l #SYMBOL_NAME(sys_call_table),er0 + add.l er3,er0 + mov.l @er0,er0 + mov.l er0,er3 + beq SYMBOL_NAME(ret_from_exception):16 + mov.l @SYMBOL_NAME(_current_task),er2 + mov.b @((flags+3-(PT_TRACESYS >> 3)):16,er2),r2l + btst #(PT_TRACESYS & 7),r2l + bne 1f + mov.l @(LER1:16,sp),er0 + mov.l @(LER2:16,sp),er1 + mov.l @(LER3:16,sp),er2 + mov.l er5,@-sp + mov.l er4,@-sp + jsr @er3 + adds #4,sp + adds #4,sp + mov.l er0,@(LER0,sp) /* save the return value */ +#if defined(CONFIG_SYSCALL_PRINT) + jsr @SYMBOL_NAME(syscall_print) +#endif + jmp @SYMBOL_NAME(ret_from_exception) +1: + SAVE_SWITCH_STACK + mov.l er3,er5 /* save syscall entry */ + jsr SYMBOL_NAME(syscall_trace) + mov.l er5,er3 + RESTORE_SWITCH_STACK + mov.l @(LER1:16,sp),er0 + mov.l @(LER2:16,sp),er1 + mov.l @(LER3:16,sp),er2 + mov.l er4,@-sp + jsr @er3 + adds #4,sp + mov.l er0,@(LER0:16,sp) /* save the return value */ + SAVE_SWITCH_STACK + jsr SYMBOL_NAME(syscall_trace) + +SYMBOL_NAME_LABEL(ret_from_signal) + RESTORE_SWITCH_STACK + +SYMBOL_NAME_LABEL(ret_from_exception) + mov.b @(LCCR+1:16,sp),r0l + btst #4,r0l /* check if returning to kernel */ + bne 3f:16 /* if so, skip resched, signals */ + mov.l @SYMBOL_NAME(_current_task),er0 + mov.l @(need_resched:16,er0),er0 + beq 1f + jmp @SYMBOL_NAME(reschedule) +1: + mov.l @SYMBOL_NAME(_current_task),er0 + mov.l @(sigpending:16,er0),er1 + beq 2f:16 + mov.b @((flags+(PT_DTRACE >> 3)):16,er0),r1l + mov.b r1l,r1h + bclr #(PT_DTRACE & 7),r1h + mov.b r1h,@((flags+3-(PT_DTRACE >> 3)):16,er0) + btst #(PT_DTRACE & 7),r1l /* check for delayed trace */ + beq 1f + sub.l er2,er2 + inc.l #1,er2 + mov.l er0,er1 + sub.l er0,er0 + mov.b #LSIGTRAP,r0l + jsr @SYMBOL_NAME(send_sig) /* send_sig(LSIGTRAP,_current_task,1) */ + mov.l @SYMBOL_NAME(_current_task),er0 +1: + mov.l @(state:16,er0),er1 /* state */ + beq 1f + jmp @SYMBOL_NAME(reschedule) +1: + mov.l @(sigpending:16,er0),er1 + bne Lsignal_return:16 +2: + mov.l @((TASK_THREAD+THREAD_VFORK):16,er0),er1 + bne Lvfork_return +3: + RESTORE_ALL /* Does RTE */ + +Lvfork_return: + sub.l er2,er2 + mov.l er2,@((TASK_THREAD+THREAD_VFORK):16,er0) + mov.l @SYMBOL_NAME(sw_usp),er0 + mov.l er1,@(8:16,er0) + RESTORE_ALL + +Lsignal_return: + SAVE_SWITCH_STACK + mov.l sp,er1 + add #12,er1 + mov.l er2,er0 + jsr @SYMBOL_NAME(do_signal) + RESTORE_SWITCH_STACK + RESTORE_ALL + + SYMBOL_NAME_LABEL(resume) + /* + * Beware - when entering resume, offset of tss is in d1, + * prev (the current task) is in a0, next (the new task) + * is in a1 and d2.b is non-zero if the mm structure is + * shared between the tasks, so don't change these + * registers until their contents are no longer needed. + */ + + /* save sr */ + sub.w r3,r3 + stc ccr,r3l + mov.w r3,@(THREAD_CCR:16,er0) + SAVE_SWITCH_STACK + + /* disable interrupts */ + orc #0x80,ccr + mov.l @SYMBOL_NAME(sw_usp),er3 + mov.l er3,@(THREAD_USP:16,er0) + mov.l sp,@(THREAD_KSP:16,er0) + + /* get pointer to tss struct (a1 contains new task) */ + mov.l er1,@SYMBOL_NAME(_current_task) + + /* Skip address space switching if they are the same. */ + /* FIXME: what did we hack out of here, this does nothing! */ + + mov.l @(THREAD_USP:16,er1),er0 + mov.l er0,@SYMBOL_NAME(sw_usp) + mov.l @(THREAD_KSP:16,er1),sp + RESTORE_SWITCH_STACK + + /* restore status register */ + mov.w @(THREAD_CCR:16,er1),r3 + + ldc r3l,ccr + + rts + +/* Handler for uninitialized and spurious interrupts */ + +SYMBOL_NAME_LABEL(bad_interrupt) + mov.l @SYMBOL_NAME(num_spurious),er0 + inc.l #1,er0 + mov.l er0,@SYMBOL_NAME(num_spurious) + rts + +SYMBOL_NAME_LABEL(trace_break) + subs #4,sp + SAVE_ALL + sub.l er1,er1 + dec.l #1,er1 + mov.l er1,@(LORIG,sp) + mov.l sp,er0 + jsr @SYMBOL_NAME(set_esp0) + mov.l @SYMBOL_NAME(sw_usp),er0 + mov.l @er0,er1 + subs #2,er1 + mov.l er1,@er0 + and.w #0xff,e1 + mov.l er1,er0 + jsr @SYMBOL_NAME(trace_trap) + jmp @SYMBOL_NAME(ret_from_exception) + +SYMBOL_NAME_LABEL(sys_vfork) + SAVE_SWITCH_STACK + mov.l @SYMBOL_NAME(sw_usp),er6 + mov.l @(8:16,er6),er6 + mov.l sp,er0 + add.l #SWITCH_STACK_SIZE,er0 + jsr @SYMBOL_NAME(h8300_vfork) + mov.l @SYMBOL_NAME(_current_task),er5 + mov.l er6,@((TASK_THREAD+THREAD_VFORK):16,er5) + RESTORE_SWITCH_STACK + rts + +SYMBOL_NAME_LABEL(syscall_trampoline) + SAVE_SWITCH_STACK + mov.l er0,er6 + mov.l sp,er0 + add.l #SWITCH_STACK_SIZE,er0 + jsr @er6 + RESTORE_SWITCH_STACK + rts + + .section .bss +SYMBOL_NAME_LABEL(sw_ksp) + .space 4 +SYMBOL_NAME_LABEL(sw_usp) + .space 4 diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/generic/crt0_rom.S linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/crt0_rom.S --- linux-2.5.67/arch/h8300/platform/h8300h/generic/crt0_rom.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/crt0_rom.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * linux/arch/h8300/platform/h8300h/generic/crt0_rom.S + * + * Yoshinori Sato + * + * Platform depend startup for uClinux-2.4.x + * Target Archtecture: generic + * Memory Layout : ROM + */ + +#define ASSEMBLY + +#include +#include + + .global SYMBOL_NAME(_start) + .global SYMBOL_NAME(_command_line) + .global SYMBOL_NAME(_platform_gpio_table) + .global SYMBOL_NAME(_target_name) + + .h8300h + .section .text + .file "crt0_rom.S" + + /* CPU Reset entry */ +SYMBOL_NAME_LABEL(_start) + mov.l #__ramend,sp + ldc #0x80,ccr + + /* Peripheral Setup */ + + /* .bss clear */ + mov.l #__sbss,er5 + mov.l er5,er6 + inc.l #1,er6 + mov.l #__ebss,er4 + sub.l er5,er4 + sub.w r0,r0 + mov.b r0l,@er5 +1: + eepmov.w + dec.w #1,e4 + bpl 1b + + /* copy .data */ +#if !defined(CONFIG_H8300H_SIM) + mov.l #__begin_data,er5 + mov.l #__sdata,er6 + mov.l #__edata,er4 + sub.l er6,er4 +1: + eepmov.w + dec.w #1,e4 + bpl 1b +#endif + + /* copy kernel commandline */ + mov.l #COMMAND_START,er5 + mov.l #SYMBOL_NAME(_command_line),er6 + mov.w #512,r4 + eepmov.w + + /* uClinux kernel start */ + ldc #0x90,ccr /* running kernel */ + mov.l #SYMBOL_NAME(init_thread_union),sp + mov.l sp,@SYMBOL_NAME(_current_task) + add.l #0x2000,sp + jsr @_start_kernel +_exit: + + jmp _exit + + rts + + /* I/O port assign information */ +__platform_gpio_table: + mov.l #gpio_table,er0 + rts + +gpio_table: + ;; P1DDR + .byte 0x00,0x00 + ;; P2DDR + .byte 0x00,0x00 + ;; P3DDR + .byte 0x00,0x00 + ;; P4DDR + .byte 0x00,0x00 + ;; P5DDR + .byte 0x00,0x00 + ;; P6DDR + .byte 0x00,0x00 + ;; dummy + .byte 0x00,0x00 + ;; P8DDR + .byte 0x00,0x00 + ;; P9DDR + .byte 0x00,0x00 + ;; PADDR + .byte 0x00,0x00 + ;; PBDDR + .byte 0x00,0x00 + +__target_name: + .asciz "generic" + + .section .bss +__command_line: + .space 512 + + /* interrupt vector */ + .section .vectors,"ax" + .long __start +vector = 1 + .rept 64-1 + .long _interrupt_redirect_table+vector*4 +vector = vector + 1 + .endr diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/generic/Makefile linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/Makefile --- linux-2.5.67/arch/h8300/platform/h8300h/generic/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,16 @@ +# +# Makefile for the linux kernel. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# + +obj-y := timer.o + +EXTRA_TARGETS := crt0_$(MODEL).o + +clean: + rm -f *.[oa] + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/generic/ram.ld linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/ram.ld --- linux-2.5.67/arch/h8300/platform/h8300h/generic/ram.ld 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/ram.ld 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,76 @@ +/* AKI3068NET RAM */ + +OUTPUT_ARCH(h8300h) +ENTRY("__start") + +MEMORY + { + ram : ORIGIN = 0x400000, LENGTH = 0xA0000 +/* rdisk : ORIGIN = 0x4A0000, LENGTH = 0x70000 */ +/* uram : ORIGIN = 0x510000, LENGTH = 0xF0000 */ + uram : ORIGIN = 0x4A0000, LENGTH = 0x160000 + eram : ORIGIN = 0x600000, LENGTH = 0 + iram : ORIGIN = 0xffbf20, LENGTH = 0x4000 + } + +SECTIONS +{ + .bootvec : + { + *(.bootvec) + } > ram + .text : + { + __stext = . ; + *(.text) + __etext = . ; + } > ram + .rodata : + { + ___data_rom_start = ALIGN ( 4 ) ; + } > ram + .erom : + { + __erom = . ; + } > ram + .data : + { + __ramstart = . ; + __sdata = . ; + ___data_start = . ; + *(.data) + __edata = . ; + edata = ALIGN( 0x10 ) ; + ___data_end = ALIGN( 0x10 ) ; + } > ram + .bss : + { + __sbss = . ; + ___bss_start = . ; + *(.bss) + *(COMMON) + __ebss = . ; + ___bss_end = . ; + } > ram +/* + .rootimg : + { + __rootimage = . ; + } > rdisk +*/ + .dummy1 : + { + end = ALIGN( 0x10 ) ; + __end = ALIGN( 0x10 ) ; + } > uram + .ram_vec : AT(___bss_end) + { + __ram_vector = . ; + } > iram + __ram_vector_image = LOADADDR(.ram_vec) ; + .dummy2 : + { + _COMMAND_START = . - 0x200 ; + __ramend = . ; + } > eram +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/generic/rom.ld linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/rom.ld --- linux-2.5.67/arch/h8300/platform/h8300h/generic/rom.ld 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/rom.ld 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,117 @@ +OUTPUT_ARCH(h8300h) +ENTRY("__start") + +/*INPUT(rootimage.o)*/ + +_jiffies = _jiffies_64 + 4; + +MEMORY + { + vector : ORIGIN = 0x000000, LENGTH = 0x000100 + rom : ORIGIN = 0x000100, LENGTH = 0x200000-0x000100 + erom : ORIGIN = 0x200000, LENGTH = 1 + ram : ORIGIN = 0x200000, LENGTH = 0x100000 + eram : ORIGIN = 0x2fa000, LENGTH = 1 + } + +SECTIONS +{ + .vectors : + { + __vector = . ; + *(.vectors*) + } > vector + .text : + { + *(.int_redirect) + __stext = . ; + *(.text) + . = ALIGN(0x4) ; + *(.exit.text) + *(.text.*) + . = ALIGN(0x4) ; + *(.exitcall.exit) + . = ALIGN(0x4) ; + *(.kstrtab) + . = ALIGN(0x4) ; + *(.rodata*) + . = ALIGN(16); /* Exception table */ + ___start___ex_table = .; + *(__ex_table) + ___stop___ex_table = .; + + ___start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + ___stop___ksymtab = .; + + . = ALIGN(0x4) ; + __etext = . ; + } > rom + .data : AT( ADDR(.text)+SIZEOF(.text)) + { + __sdata = . ; + ___data_start = . ; + + . = ALIGN(0x2000) ; + *(.data.init_task) + . = ALIGN(0x4) ; + *(.data) + . = ALIGN(0x4) ; + *(.data.*) + + . = ALIGN(0x4) ; + ___init_begin = .; + *(.init.text) + *(.init.data) + . = ALIGN(0x4) ; + ___setup_start = .; + *(.init.setup) + . = ALIGN(0x4) ; + ___setup_end = .; + + . = ALIGN(0x4) ; + ___initcall_start = .; + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + ___initcall_end = .; + ___initramfs_start = .; + *(.init.initramfs) + ___initramfs_end = .; + . = ALIGN(0x4) ; + ___init_end = .; + + __edata = . ; + } > ram + __begin_data = LOADADDR(.data) ; + .blkimg : AT( LOADADDR(.data) + SIZEOF(.data)) + { + __blkimg = . ; + *(.rootimg*) + } > rom + .erom : + { + __erom = . ; + } > erom + .bss : + { + . = ALIGN(0x4) ; + __sbss = . ; + *(.bss) + . = ALIGN(0x4) ; + *(COMMON) + . = ALIGN(0x4) ; + __ebss = . ; + __end = . ; + __ramstart = .; + } > ram + .dummy : + { + COMMAND_START = . - 0x200 ; + __ramend = . ; + } > eram +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/generic/timer.c linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/timer.c --- linux-2.5.67/arch/h8300/platform/h8300h/generic/timer.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/generic/timer.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * linux/arch/h8300/platform/h8300h/generic/timer.c + * + * Yoshinori Sato + * + * Platform depend Timer Handler + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#if defined(CONFIG_H83007) || defined(CONFIG_H83068) +#define TMR8CMA2 0x00ffff94 +#define TMR8TCSR2 0x00ffff92 +#define TMR8TCNT2 0x00ffff90 + +int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *)) +{ + outb(H8300_TIMER_COUNT_DATA,TMR8CMA2); + outb(0x00,TMR8TCSR2); + request_irq(40,timer_int,0,"timer",0); + outb(0x40|0x08|0x03,TMR8TCNT2); +} + +void platform_timer_eoi(void) +{ + __asm__("bclr #6,@0xffff92:8"); +} +#endif + +#if defined(H8_3002) || defined(CONFIG_H83048) +#define TSTR 0x00ffff60 +#define TSNC 0x00ffff61 +#define TMDR 0x00ffff62 +#define TFCR 0x00ffff63 +#define TOER 0x00ffff90 +#define TOCR 0x00ffff91 +#define TCR 0x00ffff64 +#define TIOR 0x00ffff65 +#define TIER 0x00ffff66 +#define TSR 0x00ffff67 +#define TCNT 0x00ffff68 +#define GRA 0x00ffff6a +#define GRB 0x00ffff6c + +int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *)) +{ + *(unsigned short *)GRA= H8300_TIMER_COUNT_DATA; + *(unsigned short *)TCNT=0; + outb(0x23,TCR); + outb(0x00,TIOR); + request_irq(26,timer_int,0,"timer",0); + outb(inb(TIER) | 0x01,TIER); + outb(inb(TSNC) & ~0x01,TSNC); + outb(inb(TMDR) & ~0x01,TMDR); + outb(inb(TSTR) | 0x01,TSTR); +} + +void platform_timer_eoi(void) +{ + outb(inb(TSR) & ~0x01,TSR); +} +#endif + +void platform_gettod(int *year, int *mon, int *day, int *hour, + int *min, int *sec) +{ + *year = *mon = *day = *hour = *min = *sec = 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/h8max/crt0_ram.S linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/crt0_ram.S --- linux-2.5.67/arch/h8300/platform/h8300h/h8max/crt0_ram.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/crt0_ram.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,109 @@ +/* + * linux/arch/h8300/platform/h8300h/h8max/crt0_ram.S + * + * Yoshinori Sato + * + * Platform depend startup for uClinux-2.4.x + * Target Archtecture: H8MAX + * Memory Layout : RAM + */ + +#define ASSEMBLY + +#include +#include + + .global SYMBOL_NAME(_start) + .global SYMBOL_NAME(command_line) + .global SYMBOL_NAME(_platform_gpio_table) + .global SYMBOL_NAME(_target_name) + + .h8300h + + .section .text + .file "crt0_ram.S" + + /* CPU Reset entry */ +SYMBOL_NAME_LABEL(_start) + mov.l #__ramend,sp + ldc #0x80,ccr + + /* Peripheral Setup */ + + /* .bss clear */ + mov.l #__sbss,er5 + mov.l er5,er6 + inc.l #1,er6 + mov.l #__ebss,er4 + sub.l er5,er4 + sub.w r0,r0 + mov.b r0l,@er5 +1: + eepmov.w + dec.w #1,e4 + bpl 1b + + /* copy kernel commandline */ + mov.l #COMMAND_START,er5 + mov.l #SYMBOL_NAME(command_line),er6 + mov.w #512,r4 + eepmov.w + + /* RAM Interrupt Vector Table Setup */ +#if defined(CONFIG_GDB_DEBUG) + mov.l @SYMBOL_NAME(interrupt_redirect_table)+11*4,er0 +#endif + mov.l #SYMBOL_NAME(_vector_lma),er5 + mov.l #SYMBOL_NAME(interrupt_redirect_table),er6 + mov.w #0x100,r4 + eepmov.w +#if defined(CONFIG_GDB_DEBUG) + mov.l er0,@SYMBOL_NAME(interrupt_redirect_table)+11*4 +#endif + + /* uClinux kernel start */ + ldc #0x90,ccr /* running kernel */ + mov.l #SYMBOL_NAME(init_task_union),sp + mov.l sp,@SYMBOL_NAME(_current_task) + add.l #0x2000,sp + jsr @_start_kernel +_exit: + + jmp _exit + + rts + + /* I/O port assign information */ +__platform_gpio_table: + mov.l #gpio_table,er0 + rts + +gpio_table: + ;; P1DDR + .byte 0xff,0xff + ;; P2DDR + .byte 0xff,0xff + ;; P3DDR + .byte 0x00,0x00 + ;; P4DDR + .byte 0x00,0x00 + ;; P5DDR + .byte 0x01,0x01 + ;; P6DDR + .byte 0xf6,0xf6 + ;; dummy + .byte 0x00,0x00 + ;; P8DDR + .byte 0xee,0xee + ;; P9DDR + .byte 0x00,0x00 + ;; PADDR + .byte 0x00,0x00 + ;; PBDDR + .byte 0x30,0x30 + +__target_name: + .asciz "H8MAX" + + .section .bootvec,"ax" + jmp @SYMBOL_NAME(_start) diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/h8max/Makefile linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/Makefile --- linux-2.5.67/arch/h8300/platform/h8300h/h8max/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,18 @@ +# +# Makefile for the linux kernel. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# + +all: $(BOARD).o +O_TARGET := $(BOARD).o +obj-y := timer.o + +timer.o: timer.c + +clean: + rm -f *.[oa] + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/h8max/ram.ld linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/ram.ld --- linux-2.5.67/arch/h8300/platform/h8300h/h8max/ram.ld 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/ram.ld 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,90 @@ +/* H8MAX RAM */ + +OUTPUT_ARCH(h8300h) +ENTRY("__start") + +MEMORY + { + ram : ORIGIN = 0x400000, LENGTH = 0x600000-0x400000-0xc000 + disk : ORIGIN = 0x600000-0xc000, LENGTH = 0xc000 + eram : ORIGIN = 0x600000, LENGTH = 0 + iram : ORIGIN = 0xfffd20, LENGTH = 0x100 + } + +SECTIONS +{ + .bootvec : + { + *(.bootvec) + } > ram + .text : + { + __stext = . ; + *(.text) + . = ALIGN(0x4) ; + *(.text.*) + . = ALIGN(0x4) ; + *(.kstrtab) + . = ALIGN(0x4) ; + *(.rodata*) + . = ALIGN(16); /* Exception table */ + ___start___ex_table = .; + *(__ex_table) + ___stop___ex_table = .; + + ___start___ksymtab = .; /* Kernel symbol table */ + *(__ksymtab) + ___stop___ksymtab = .; + + . = ALIGN(0x4) ; + __etext = . ; + } > ram + .data : + { + __sdata = . ; + ___data_start = . ; + *(.data) + *(.data.*) + *(.exitcall.exit) + + . = ALIGN(0x2000) ; + *(.data.init_task) + . = ALIGN(0x2000) ; + ___init_begin = .; + *(.text.init) + *(.data.init) + . = ALIGN(16); + ___setup_start = .; + *(.setup.init) + ___setup_end = .; + ___initcall_start = .; + *(.initcall.init) + . = ALIGN(4) ; + ___initcall_end = .; + ___init_end = .; + __edata = . ; + . = ALIGN(0x4) ; + __sbss = . ; + *(.bss) + . = ALIGN(0x4) ; + *(COMMON) + . = ALIGN(0x4) ; + __ebss = . ; + __end = . ; + __ramstart = .; + } > ram + .blkimg : + { + __ramend = . ; + __blkimg = . ; + } > disk + .ram_vec : AT(ADDR(.data) + SIZEOF(.data)) + { + *(.int_redirect) + } > iram + __vector_lma = LOADADDR(.ram_vec); + .dummy2 : + { + COMMAND_START = . - 0x200 ; + } > eram +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/h8max/timer.c linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/timer.c --- linux-2.5.67/arch/h8300/platform/h8300h/h8max/timer.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/h8max/timer.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,46 @@ +/* + * linux/arch/h8300/platform/h8300h/h8max/timer.c + * + * Yoshinori Sato + * + * Platform depend Timer Handler + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define TMR8CMA2 0x00ffff94 +#define TMR8TCSR2 0x00ffff92 +#define TMR8TCNT2 0x00ffff90 +#define CMFA 6 + +int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *)) +{ + outb(CONFIG_CLK_FREQ*10/8192,TMR8CMA2); + outb(0x00,TMR8TCSR2); + request_irq(40,timer_int,0,"timer",0); + outb(0x40|0x08|0x03,TMR8TCNT2); +} + +void platform_timer_eoi(void) +{ + *(unsigned char *)TMR8TCSR2 &= ~(1 << CMFA); +} + +void platform_gettod(int *year, int *mon, int *day, int *hour, + int *min, int *sec) +{ + *year = *mon = *day = *hour = *min = *sec = 0; +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/ints.c linux-2.5.67-ac1/arch/h8300/platform/h8300h/ints.c --- linux-2.5.67/arch/h8300/platform/h8300h/ints.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/ints.c 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,251 @@ +/* + * linux/arch/h8300/platform/h8300h/ints.c + * + * Yoshinori Sato + * + * Based on linux/arch/$(ARCH)/platform/$(PLATFORM)/ints.c + * + * 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. + * + * Copyright 1996 Roman Zippel + * Copyright 1999 D. Jeff Dionne + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define INTERNAL_IRQS (64) + +#define EXT_IRQ0 12 +#define EXT_IRQ1 13 +#define EXT_IRQ2 14 +#define EXT_IRQ3 15 +#define EXT_IRQ4 16 +#define EXT_IRQ5 17 +#define EXT_IRQ6 18 +#define EXT_IRQ7 19 + +#define WDT_IRQ 20 + +/* table for system interrupt handlers */ +static irq_handler_t irq_list[SYS_IRQS]; + +/* The number of spurious interrupts */ +volatile unsigned int num_spurious; + +/* assembler routines */ +asmlinkage void system_call(void); +asmlinkage void bad_interrupt(void); + +/* irq node variables for the 32 (potential) on chip sources */ +/*static irq_node_t *int_irq_list[INTERNAL_IRQS];*/ +static int int_irq_count[INTERNAL_IRQS]; + +#if 0 +static void int_badint(int irq, void *dev_id, struct pt_regs *fp) +{ + num_spurious += 1; +} +#endif + +void init_IRQ(void) +{ + int i; + + for (i = 0; i < SYS_IRQS; i++) { + irq_list[i].handler = NULL; + irq_list[i].flags = 0; + irq_list[i].devname = NULL; + irq_list[i].dev_id = 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 >= EXT_IRQ0 && irq <= EXT_IRQ3) { + if (H8300_GPIO_RESERVE(H8300_GPIO_P8, 1 << (irq - EXT_IRQ0)) == 0) + return 1; + H8300_GPIO_DDR(H8300_GPIO_P8, (irq - EXT_IRQ0), 0); + } + if (irq >= EXT_IRQ4 && irq <= EXT_IRQ5) { + if (H8300_GPIO_RESERVE(H8300_GPIO_P9, 1 << (irq - EXT_IRQ0)) == 0) + return 1; + H8300_GPIO_DDR(H8300_GPIO_P9, (irq - EXT_IRQ0), 0); + } + irq_list[irq].handler = handler; + irq_list[irq].flags = flags; + irq_list[irq].devname = devname; + irq_list[irq].dev_id = dev_id; + if (irq >= EXT_IRQ0 && irq <= EXT_IRQ5) + *(volatile unsigned char *)IER |= 1 << (irq - EXT_IRQ0); + return 0; +} + +void free_irq(unsigned int irq, void *dev_id) +{ + if (irq_list[irq].dev_id != dev_id) + printk("%s: Removing probably wrong IRQ %d from %s\n", + __FUNCTION__, irq, irq_list[irq].devname); + if (irq >= EXT_IRQ0 && irq <= EXT_IRQ5) + *(volatile unsigned char *)IER &= ~(1 << (irq - EXT_IRQ0)); + irq_list[irq].handler = NULL; + 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? + */ +unsigned long probe_irq_on (void) +{ + return 0; +} + +int probe_irq_off (unsigned long irqs) +{ + return 0; +} + +struct int_regs { + unsigned long ier; + unsigned long isr; + unsigned char mask; +}; + +#define REGS_DEF(ier,isr,mask) {ier,isr,mask} + +const struct int_regs interrupt_registers[]= { + REGS_DEF(IER,ISR,0x01), + REGS_DEF(IER,ISR,0x02), + REGS_DEF(IER,ISR,0x04), + REGS_DEF(IER,ISR,0x08), + REGS_DEF(IER,ISR,0x10), + REGS_DEF(IER,ISR,0x20), + REGS_DEF(IER,ISR,0x40), + REGS_DEF(IER,ISR,0x80), + REGS_DEF(TCSR,TCSR,0x20), + REGS_DEF(RTMCSR,RTMCSR,0x40), + REGS_DEF(0,0,0), + REGS_DEF(ADCSR,ADCSR,0x40), + REGS_DEF(TISRA,TISRA,0x10), + REGS_DEF(TISRB,TISRB,0x10), + REGS_DEF(TISRC,TISRC,0x10), + REGS_DEF(0,0,0), + REGS_DEF(TISRA,TISRA,0x20), + REGS_DEF(TISRB,TISRB,0x20), + REGS_DEF(TISRC,TISRC,0x20), + REGS_DEF(0,0,0), + REGS_DEF(TISRA,TISRA,0x40), + REGS_DEF(TISRB,TISRB,0x40), + REGS_DEF(TISRC,TISRC,0x40), + REGS_DEF(0,0,0), + REGS_DEF(_8TCR0,_8TCSR0,0x40), + REGS_DEF(_8TCR0,_8TCSR0,0x80), + REGS_DEF(_8TCR1,_8TCSR1,0xC0), + REGS_DEF(_8TCR0,_8TCSR0,0x20), + REGS_DEF(_8TCR2,_8TCSR2,0x40), + REGS_DEF(_8TCR2,_8TCSR2,0x80), + REGS_DEF(_8TCR3,_8TCSR3,0xC0), + REGS_DEF(_8TCR2,_8TCSR2,0x20), + REGS_DEF(DTCR0A,DTCR0A,0x0), + REGS_DEF(DTCR0B,DTCR0B,0x0), + REGS_DEF(DTCR1A,DTCR1A,0x0), + REGS_DEF(DTCR1B,DTCR1B,0x0), + REGS_DEF(0,0,0), + REGS_DEF(0,0,0), + REGS_DEF(0,0,0), + REGS_DEF(0,0,0), + REGS_DEF(SCR0,SSR0,0x40), + REGS_DEF(SCR0,SSR0,0x40), + REGS_DEF(SCR0,SSR0,0x80), + REGS_DEF(SCR0,SSR0,0x04), + REGS_DEF(SCR1,SSR1,0x40), + REGS_DEF(SCR1,SSR1,0x40), + REGS_DEF(SCR1,SSR1,0x80), + REGS_DEF(SCR1,SSR1,0x04), + REGS_DEF(SCR2,SSR2,0x40), + REGS_DEF(SCR2,SSR2,0x40), + REGS_DEF(SCR2,SSR2,0x80), + REGS_DEF(SCR2,SSR2,0x04) +}; + +void enable_irq(unsigned int irq) +{ + unsigned char ier; + const struct int_regs *regs=&interrupt_registers[irq - 12]; + if (irq == WDT_IRQ) { + ier = ctrl_inb(TCSR); + ier |= 0x20; + ctrl_outb((0xa500 | ier),TCSR); + } else { + if ((irq > 12) && regs->ier) { + ier = ctrl_inb(regs->ier); + ier |= regs->mask; + ctrl_outb(ier, regs->ier); + } else + panic("Unknown interrupt vector"); + } +} + +void disable_irq(unsigned int irq) +{ + unsigned char ier; + const struct int_regs *regs=&interrupt_registers[irq - 12]; + if (irq == WDT_IRQ) { + ier = ctrl_inb(TCSR); + ier &= ~0x20; + ctrl_outb((0xa500 | ier),TCSR); + } else { + if ((irq > 12) && regs->ier) { + ier = ctrl_inb(regs->ier); + ier &= ~(regs->mask); + ctrl_outb(ier, regs->ier); + } else + panic("Unknown interrupt vector"); + } +} + +asmlinkage void process_int(unsigned long vec, struct pt_regs *fp) +{ + irq_enter(); + if (irq_list[vec].handler) { + irq_list[vec].handler(vec, irq_list[vec].dev_id, fp); + int_irq_count[vec]++; + } else + panic("No interrupt handler for %ld\n", vec); + if (vec >= EXT_IRQ0 && vec <= EXT_IRQ5) + *(volatile unsigned char *)ISR &= ~(1 << (vec - EXT_IRQ0)); + irq_exit(); +} + +int show_interrupts(struct seq_file *p, void *v) +{ + int i; + + for (i = 0; i < NR_IRQS; i++) { + seq_printf(p, "%3d: %10u ",int_irq_count[i]); + seq_printf(p, "%s\n", irq_list[i].devname); + } + + return 0; +} + +void init_irq_proc(void) +{ +} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/Makefile linux-2.5.67-ac1/arch/h8300/platform/h8300h/Makefile --- linux-2.5.67/arch/h8300/platform/h8300h/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/Makefile 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,24 @@ +# +# Makefile for the linux kernel. +# +# Reuse any files we can from the H8/300H +# + +#VPATH := $(VPATH):$(BOARD) + +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +.S.o: + $(CC) -D__ASSEMBLY__ $(AFLAGS) -I. -c $< -o $*.o + +obj-y := entry.o ints.o + +$(BOARD)/crt0_$(MODEL).o: $(BOARD)/crt0_$(MODEL).S + +entry.o: entry.S + +ints.o: ints.c + +include $(TOPDIR)/Rules.make diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/platform/h8300h/Rules.make linux-2.5.67-ac1/arch/h8300/platform/h8300h/Rules.make --- linux-2.5.67/arch/h8300/platform/h8300h/Rules.make 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/platform/h8300h/Rules.make 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,51 @@ +# +# h8300h/Makefile +# +# This file is included by the global makefile so that you can add your own +# platform-specific flags and dependencies. +# +# 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. +# +# Copyright (c) 2001 Lineo, Inc, +# Copyright (c) 2000,2001 D. Jeff Dionne +# Copyright (c) 1998,1999 D. Jeff Dionne +# Copyright (C) 1998 Kenneth Albanowski +# Copyright (C) 1994 Hamish Macdonald +# +# 68VZ328 Fixes By Evan Stawnyczy +# H8/300H Modify By Yoshinori Sato + +CROSS_COMPILE = h8300-elf- + +GCC_DIR = $(shell $(CC) -v 2>&1 | grep specs | sed -e 's/.* \(.*\)specs/\1\./') + +INCGCC = $(GCC_DIR)/include +LIBGCC = $(GCC_DIR)/h8300h/int32/libgcc.a + +CFLAGS := -fno-builtin -DNO_CACHE $(CFLAGS) -pipe -DNO_MM -DNO_FPU -DNO_CACHE -mh -mint32 -D__ELF__ -DNO_FORGET -DUTS_SYSNAME=\"uClinux\" -D__linux__ -DTARGET=$(BOARD) +AFLAGS := $(AFLAGS) -pipe -DNO_MM -DNO_FPU -DNO_CACHE -mh -D__ELF__ -DUTS_SYSNAME=\"uClinux\" + +LINKFLAGS = -T arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/$(MODEL).ld +LDFLAGS := $(LDFLAGS) -mh8300helf + +HEAD := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o + +SUBDIRS := arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/lib \ + arch/$(ARCH)/platform/$(PLATFORM) \ + arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD) \ + $(SUBDIRS) + +CORE_FILES := arch/$(ARCH)/kernel/kernel.o arch/$(ARCH)/mm/mm.o \ + arch/$(ARCH)/platform/$(PLATFORM)/platform.o \ + arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/$(BOARD).o \ + $(CORE_FILES) + +LIBS += arch/$(ARCH)/lib/lib.a $(LIBGCC) + +linux.bin: linux + $(OBJCOPY) -O binary linux linux.bin + +archclean: + rm -f linux diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/README linux-2.5.67-ac1/arch/h8300/README --- linux-2.5.67/arch/h8300/README 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/README 2003-03-20 18:43:51.000000000 +0000 @@ -0,0 +1,35 @@ +uClinux-2.4 for H8/300 README +Yoshinori Sato + +* Supported CPU +H8/300H +H8S is planning. + +* Supported Target +1.simulator of GDB + require patches. + +2.AE 3068/AE 3069 + more information + MICROTRONIQUE + Akizuki Denshi Tsusho Ltd. (Japanese Only) + +3.H8MAX + Under development + see http://www.strawbelly-linux.com (Japanese Only) + +* Toolchain Version +gcc-3.1 or higher and patch +see arch/h8300/tools_patch/README +binutils-2.12 or higher +gdb-5.2 or higher +The environment that can compile a h8300-elf binary is necessary. + +* Userland Develop environment +Tempolary used h8300-hms(h8300-coff) Toolchain. +I prepare toolchain corresponding to h8300-elf. + +* A few words of thanks +Porting to H8/300H is support of Information-technology Promotion Agency, Japan. +I thank support. +and All developer/user. diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/tools_patch/gcc.diff linux-2.5.67-ac1/arch/h8300/tools_patch/gcc.diff --- linux-2.5.67/arch/h8300/tools_patch/gcc.diff 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/tools_patch/gcc.diff 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,278 @@ +diff -Nru gcc-3.1.1/gcc/config/float-h8300.h gcc-3.1.1.dblfix/gcc/config/float-h8300.h +--- gcc-3.1.1/gcc/config/float-h8300.h Thu Jan 1 09:00:00 1970 ++++ gcc-3.1.1.dblfix/gcc/config/float-h8300.h Mon Sep 23 00:40:52 2002 +@@ -0,0 +1,128 @@ ++/* float.h for target h8300-elf with optional IEEE 32 bit double format: based float-sh.h */ ++#ifndef _FLOAT_H_ ++#define _FLOAT_H_ ++#include "config/h8300/h8300.h" ++ ++/* Produced by enquire version 4.3, CWI, Amsterdam */ ++ ++ /* Radix of exponent representation */ ++#undef FLT_RADIX ++#define FLT_RADIX 2 ++ /* Number of base-FLT_RADIX digits in the significand of a float */ ++#undef FLT_MANT_DIG ++#define FLT_MANT_DIG 24 ++ /* Number of decimal digits of precision in a float */ ++#undef FLT_DIG ++#define FLT_DIG 6 ++ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ ++#undef FLT_ROUNDS ++#define FLT_ROUNDS 1 ++ /* Difference between 1.0 and the minimum float greater than 1.0 */ ++#undef FLT_EPSILON ++#define FLT_EPSILON 1.19209290e-07F ++ /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ ++#undef FLT_MIN_EXP ++#define FLT_MIN_EXP (-125) ++ /* Minimum normalised float */ ++#undef FLT_MIN ++#define FLT_MIN 1.17549435e-38F ++ /* Minimum int x such that 10**x is a normalised float */ ++#undef FLT_MIN_10_EXP ++#define FLT_MIN_10_EXP (-37) ++ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ ++#undef FLT_MAX_EXP ++#define FLT_MAX_EXP 128 ++ /* Maximum float */ ++#undef FLT_MAX ++#define FLT_MAX 3.40282347e+38F ++ /* Maximum int x such that 10**x is a representable float */ ++#undef FLT_MAX_10_EXP ++#define FLT_MAX_10_EXP 38 ++ ++ /* Number of base-FLT_RADIX digits in the significand of a double */ ++#undef DBL_MANT_DIG ++#define DBL_MANT_DIG (DOUBLE_TYPE_SIZE == 64?53:24) ++ /* Number of decimal digits of precision in a double */ ++#undef DBL_DIG ++#define DBL_DIG (DOUBLE_TYPE_SIZE == 64?15:6) ++ /* Difference between 1.0 and the minimum double greater than 1.0 */ ++#undef DBL_EPSILON ++#define DBL_EPSILON (DOUBLE_TYPE_SIZE == 64?2.2204460492503131e-16:1.19209290e-07F) ++ /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ ++#undef DBL_MIN_EXP ++#define DBL_MIN_EXP (DOUBLE_TYPE_SIZE == 64?(-1021):(-125)) ++ /* Minimum normalised double */ ++#undef DBL_MIN ++#define DBL_MIN (DOUBLE_TYPE_SIZE == 64?2.2250738585072014e-308:1.17549435e-38F) ++ /* Minimum int x such that 10**x is a normalised double */ ++#undef DBL_MIN_10_EXP ++#define DBL_MIN_10_EXP (DOUBLE_TYPE_SIZE == 64?(-307):(-37)) ++ /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ ++#undef DBL_MAX_EXP ++#define DBL_MAX_EXP (DOUBLE_TYPE_SIZE == 64?1024:128) ++ /* Maximum double */ ++#undef DBL_MAX ++#define DBL_MAX (DOUBLE_TYPE_SIZE == 64?1.7976931348623157e+308:3.40282347e+38F) ++ /* Maximum int x such that 10**x is a representable double */ ++#undef DBL_MAX_10_EXP ++#define DBL_MAX_10_EXP (DOUBLE_TYPE_SIZE == 64?308:38) ++ ++/* Because -m3e and -m4-single-only have 32-bit doubles, we append L ++ to the doubles below, so that they're not truncated. */ ++ ++ /* Number of base-FLT_RADIX digits in the significand of a long double */ ++#undef LDBL_MANT_DIG ++#define LDBL_MANT_DIG (DOUBLE_TYPE_SIZE == 64?53:24) ++ /* Number of decimal digits of precision in a long double */ ++#undef LDBL_DIG ++#define LDBL_DIG (DOUBLE_TYPE_SIZE == 64?15:6) ++ /* Difference between 1.0 and the minimum long double greater than 1.0 */ ++#undef LDBL_EPSILON ++#define LDBL_EPSILON (DOUBLE_TYPE_SIZE == 64?2.2204460492503131e-16L:1.19209290e-07F) ++ /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ ++#undef LDBL_MIN_EXP ++#define LDBL_MIN_EXP (DOUBLE_TYPE_SIZE == 64?(-1021):(-125)) ++ /* Minimum normalised long double */ ++#undef LDBL_MIN ++#define LDBL_MIN (DOUBLE_TYPE_SIZE == 64?2.2250738585072014e-308L:1.17549435e-38F) ++ /* Minimum int x such that 10**x is a normalised long double */ ++#undef LDBL_MIN_10_EXP ++#define LDBL_MIN_10_EXP (DOUBLE_TYPE_SIZE == 64?(-307):(-37)) ++ /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ ++#undef LDBL_MAX_EXP ++#define LDBL_MAX_EXP (DOUBLE_TYPE_SIZE == 64?1024:128) ++ /* Maximum long double */ ++#undef LDBL_MAX ++#define LDBL_MAX (DOUBLE_TYPE_SIZE == 64?1.7976931348623157e+308L:3.40282347e+38F) ++ /* Maximum int x such that 10**x is a representable long double */ ++#undef LDBL_MAX_10_EXP ++#define LDBL_MAX_10_EXP (DOUBLE_TYPE_SIZE == 64?308:38) ++ ++#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ++ /* The floating-point expression evaluation method. ++ -1 indeterminate ++ 0 evaluate all operations and constants just to the range and ++ precision of the type ++ 1 evaluate operations and constants of type float and double ++ to the range and precision of the double type, evaluate ++ long double operations and constants to the range and ++ precision of the long double type ++ 2 evaluate all operations and constants to the range and ++ precision of the long double type ++ */ ++# undef FLT_EVAL_METHOD ++# define FLT_EVAL_METHOD 0 ++ ++ /* Number of decimal digits to enable rounding to the given number of ++ decimal digits without loss of precision. ++ if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) ++ else : ceil (1 + #mantissa * log10 (FLT_RADIX)) ++ where #mantissa is the number of bits in the mantissa of the widest ++ supported floating-point type. ++ */ ++# undef DECIMAL_DIG ++# define DECIMAL_DIG 17 ++ ++#endif /* C99 */ ++ ++#endif /* _FLOAT_H_ */ +diff -Nru gcc-3.1.1/gcc/config/h8300/extfloatlib.c gcc-3.1.1.dblfix/gcc/config/h8300/extfloatlib.c +--- gcc-3.1.1/gcc/config/h8300/extfloatlib.c Thu Jan 1 09:00:00 1970 ++++ gcc-3.1.1.dblfix/gcc/config/h8300/extfloatlib.c Sun Sep 22 23:06:11 2002 +@@ -0,0 +1,11 @@ ++/* from /gcc/config/m68k/fpgnulib.c */ ++ ++/* convert float to int */ ++long ++__fixdfsi (double a1); ++int ++__fixsfsi (float a1) ++{ ++ double foo = a1; ++ return __fixdfsi (foo); ++} +diff -Nru gcc-3.1.1/gcc/config/h8300/h8300.h gcc-3.1.1.dblfix/gcc/config/h8300/h8300.h +--- gcc-3.1.1/gcc/config/h8300/h8300.h Wed May 22 08:44:58 2002 ++++ gcc-3.1.1.dblfix/gcc/config/h8300/h8300.h Sun Sep 22 23:06:11 2002 +@@ -38,9 +38,12 @@ + extern const char * const *h8_reg_names; + + /* Names to predefine in the preprocessor for this target machine. */ +- ++/* + #define CPP_PREDEFINES \ + "-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L" ++*/ ++#define CPP_PREDEFINES \ ++"-D__LONG_MAX__=2147483647L" + + #define CPP_SPEC \ + "%{!mh:%{!ms:-D__H8300__}} %{mh:-D__H8300H__} %{ms:-D__H8300S__} \ +@@ -51,6 +54,7 @@ + %{mh:-Acpu=h8300h -Amachine=h8300h} \ + %{ms:-Acpu=h8300s -Amachine=h8300s} \ + %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647} \ ++ %{!mint32:-D__LONG_LONG_MAX__=2147483647L} %{mint32:-D__LONG_LONG_MAX__=9223372036854775807LL} \ + %(subtarget_cpp_spec)" + + #define SUBTARGET_CPP_SPEC "" +@@ -220,9 +224,9 @@ + #define SHORT_TYPE_SIZE 16 + #define INT_TYPE_SIZE (TARGET_INT32 ? 32 : 16) + #define LONG_TYPE_SIZE 32 +-#define LONG_LONG_TYPE_SIZE 32 ++#define LONG_LONG_TYPE_SIZE (TARGET_INT32 ? 64 : 32) + #define FLOAT_TYPE_SIZE 32 +-#define DOUBLE_TYPE_SIZE 32 ++#define DOUBLE_TYPE_SIZE (TARGET_INT32 ? 64 : 32) + #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE + + #define MAX_FIXED_MODE_SIZE 32 +@@ -1337,4 +1341,20 @@ + + #define MOVE_RATIO 3 + ++#ifdef IN_LIBGCC2 ++#undef LONG_LONG_TYPE_SIZE ++#undef DOUBLE_TYPE_SIZE ++#undef LONG_DOUBLE_TYPE_SIZE ++#if __INT_MAX__ == 32767 ++#define DI SI ++#define DF SF ++#define LONG_LONG_TYPE_SIZE 32 ++#define DOUBLE_TYPE_SIZE 32 ++#else ++#define LONG_LONG_TYPE_SIZE 64 ++#define DOUBLE_TYPE_SIZE 64 ++#endif ++#define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE ++#endif ++ + #endif /* ! GCC_H8300_H */ +diff -Nru gcc-3.1.1/gcc/config/h8300/t-h8300 gcc-3.1.1.dblfix/gcc/config/h8300/t-h8300 +--- gcc-3.1.1/gcc/config/h8300/t-h8300 Fri Aug 31 02:51:04 2001 ++++ gcc-3.1.1.dblfix/gcc/config/h8300/t-h8300 Sun Sep 22 23:06:11 2002 +@@ -5,25 +5,7 @@ + LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \ + _floatdisf _fixsfdi _fixunssfdi _fixunssfsi_asm + +-LIB2FUNCS_EXTRA = $(srcdir)/config/h8300/fixunssfsi.c +- +-# We do not have DF or DI types, so fake out the libgcc2 compilation. +-TARGET_LIBGCC2_CFLAGS = -DDF=SF -DDI=SI +- +-# We want fine grained libraries, so use the new code to build the +-# floating point emulation libraries. +-FPBIT = fp-bit.c +- +-fp-bit.c: $(srcdir)/config/fp-bit.c +- echo '#define FLOAT' > fp-bit.c +- echo '#define FLOAT_ONLY' >> fp-bit.c +- echo '#define SMALL_MACHINE' >> fp-bit.c +- echo '#ifdef __H8300__' >> fp-bit.c +- echo '#define CMPtype HItype' >> fp-bit.c +- echo '#else' >> fp-bit.c +- echo '#define CMPtype SItype' >> fp-bit.c +- echo '#endif' >> fp-bit.c +- cat $(srcdir)/config/fp-bit.c >> fp-bit.c ++LIB2FUNCS_EXTRA = $(srcdir)/config/h8300/fixunssfsi.c $(srcdir)/floatlib.c $(srcdir)/config/h8300/extfloatlib.c + + MULTILIB_OPTIONS = mh/ms mint32 + MULTILIB_DIRNAMES = h8300h h8300s int32 +diff -Nru gcc-3.1.1/gcc/config.gcc gcc-3.1.1.dblfix/gcc/config.gcc +--- gcc-3.1.1/gcc/config.gcc Sat Jun 8 08:35:31 2002 ++++ gcc-3.1.1.dblfix/gcc/config.gcc Sun Sep 22 23:23:29 2002 +@@ -852,7 +852,7 @@ + h8300-*-elf*) + tmake_file="h8300/t-h8300 h8300/t-elf" + tm_file="h8300/h8300.h h8300/elf.h" +- float_format=i32 ++ float_format=h8300 + ;; + h8300-*-*) + float_format=i32 +diff -Nru gcc-3.1.1/gcc/cp/decl.c gcc-3.1.1.dblfix/gcc/cp/decl.c +--- gcc-3.1.1/gcc/cp/decl.c Wed Jul 10 08:46:07 2002 ++++ gcc-3.1.1.dblfix/gcc/cp/decl.c Sun Sep 22 23:06:11 2002 +@@ -3500,7 +3500,7 @@ + except for any that we copy here from the old type. */ + DECL_ATTRIBUTES (newdecl) + = (*targetm.merge_decl_attributes) (olddecl, newdecl); +- decl_attributes (&newdecl, DECL_ATTRIBUTES (newdecl), 0); ++ /*decl_attributes (&newdecl, DECL_ATTRIBUTES (newdecl), 0);*/ + + if (TREE_CODE (newdecl) == TEMPLATE_DECL) + { +diff -Nru gcc-3.1.1/gcc/floatlib.c gcc-3.1.1.dblfix/gcc/floatlib.c +--- gcc-3.1.1/gcc/floatlib.c Thu Oct 11 12:15:38 2001 ++++ gcc-3.1.1.dblfix/gcc/floatlib.c Sun Sep 22 23:06:11 2002 +@@ -430,13 +430,13 @@ + float + __floatsisf (long a1) + { +- (float)__floatsidf(a1); ++ return (float)__floatsidf(a1); + } + + float + __floatdisf (long long a1) + { +- (float)__floatdidf(a1); ++ return (float)__floatdidf(a1); + } + + /* negate a float */ diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/tools_patch/gdd.diff linux-2.5.67-ac1/arch/h8300/tools_patch/gdd.diff --- linux-2.5.67/arch/h8300/tools_patch/gdd.diff 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/tools_patch/gdd.diff 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,687 @@ +diff -Nru gdb-5.2.1/gdb/config/h8300/tm-h8300.h gdb-5.2.1.h8sim/gdb/config/h8300/tm-h8300.h +--- gdb-5.2.1/gdb/config/h8300/tm-h8300.h Tue Jan 29 13:42:36 2002 ++++ gdb-5.2.1.h8sim/gdb/config/h8300/tm-h8300.h Wed Sep 11 23:50:22 2002 +@@ -89,7 +89,7 @@ + #define INNER_THAN(lhs,rhs) ((lhs) < (rhs)) + + /*#define BREAKPOINT {0x7A, 0xFF} */ +-#define BREAKPOINT {0x01, 0x80} /* Sleep */ ++#define BREAKPOINT {0x01, 0x81} /* bkpt(?) */ + #define REMOTE_BREAKPOINT { 0x57, 0x30} /* trapa #3 */ + /* If your kernel resets the pc after the trap happens you may need to + define this before including this file. */ +diff -Nru gdb-5.2.1/include/opcode/h8300.h gdb-5.2.1.h8sim/include/opcode/h8300.h +--- gdb-5.2.1/include/opcode/h8300.h Mon Jan 21 23:03:26 2002 ++++ gdb-5.2.1.h8sim/include/opcode/h8300.h Wed Sep 11 23:50:22 2002 +@@ -304,7 +304,8 @@ + #define O_LDM 85 + #define O_STM 86 + #define O_STMAC 87 +-#define O_LAST 88 ++#define O_BKPT 88 ++#define O_LAST 89 + #define SB 0 + #define SW 1 + #define SL 2 +@@ -375,6 +376,8 @@ + EBITOP(O(O_BTST,SB), IMM3|B30,"btst",0x6,0x3,0x7,0xC,0x7,0xE,0x0), + BITOP(O(O_BXOR,SB), IMM3|B30,"bxor",0x7,0x5,0x7,0xC,0x7,0xE,0x0), + ++ SOP(O(O_BKPT,SN),2,"bkpt"),{{E,0,0}},{{ 0x0,0x1,0x8,0x1,E,0,0,0,0}} EOP, ++ + TWOOP(O(O_CMP,SB), "cmp.b",0xA,0x1,0xC), + WTWOP(O(O_CMP,SW), "cmp.w",0x1,0xD), + +diff -Nru gdb-5.2.1/sim/h8300/Makefile.in gdb-5.2.1.h8sim/sim/h8300/Makefile.in +--- gdb-5.2.1/sim/h8300/Makefile.in Fri Apr 16 10:35:02 1999 ++++ gdb-5.2.1.h8sim/sim/h8300/Makefile.in Wed Sep 11 23:50:22 2002 +@@ -18,7 +18,7 @@ + + ## COMMON_PRE_CONFIG_FRAG + +-SIM_OBJS = compile.o sim-load.o ++SIM_OBJS = compile.o sim-load.o io.o + + ## COMMON_POST_CONFIG_FRAG + +diff -Nru gdb-5.2.1/sim/h8300/compile.c gdb-5.2.1.h8sim/sim/h8300/compile.c +--- gdb-5.2.1/sim/h8300/compile.c Fri May 17 22:24:13 2002 ++++ gdb-5.2.1.h8sim/sim/h8300/compile.c Fri Oct 18 12:56:11 2002 +@@ -81,7 +81,7 @@ + #define HIGH_BYTE(x) (((x) >> 8) & 0xff) + #define P(X,Y) ((X << 8) | Y) + +-#define BUILDSR() cpu.ccr = (N << 3) | (Z << 2) | (V << 1) | C; ++#define BUILDSR() cpu.ccr = (cpu.ccr & 0xf0) | (N << 3) | (Z << 2) | (V<<1) | C; + + #define GETSR() \ + c = (cpu.ccr >> 0) & 1;\ +@@ -319,6 +319,10 @@ + + bit = thisnib; + } ++ else if (looking_for & (L_2 | IMM)) ++ { ++ plen = 1; ++ } + else if (looking_for == E) + { + dst->op = q; +@@ -443,7 +447,7 @@ + return; + } + else +- printf ("Don't understand %x \n", looking_for); ++ printf ("Don't understand %x:%x \n", addr, looking_for); + } + + len++; +@@ -485,6 +489,8 @@ + cpu.cache_idx[pc] = idx; + } + ++extern int iosimulation(cpu_state_type *cpu,int cycles); ++extern void init_ioregs(cpu_state_type *cpu); + + static unsigned char *breg[18]; + static unsigned short *wreg[18]; +@@ -515,18 +521,33 @@ + (x < memory_size ? (cpu.memory[x]) : (cpu.eightbit[x & 0xff])) + + #define SET_MEMORY_L(x,y) \ ++if (x >= 0x100) \ + { register unsigned char *_p; register int __y = y; \ + _p = (x < memory_size ? cpu.memory+x : cpu.eightbit + (x & 0xff)); \ + _p[0] = (__y)>>24; _p[1] = (__y)>>16; \ +- _p[2] = (__y)>>8; _p[3] = (__y)>>0;} ++ _p[2] = (__y)>>8; _p[3] = (__y)>>0;} \ ++else \ ++{ cpu.state = SIM_STATE_STOPPED; \ ++ cpu.exception = SIGSEGV; \ ++} + + #define SET_MEMORY_W(x,y) \ ++if (x >= 0x100) \ + { register unsigned char *_p; register int __y = y; \ + _p = (x < memory_size ? cpu.memory+x : cpu.eightbit + (x & 0xff)); \ +- _p[0] = (__y)>>8; _p[1] =(__y);} ++ _p[0] = (__y)>>8; _p[1] =(__y);} \ ++else \ ++{ cpu.state = SIM_STATE_STOPPED; \ ++ cpu.exception = SIGSEGV; \ ++} + + #define SET_MEMORY_B(x,y) \ +- (x < memory_size ? (cpu.memory[(x)] = y) : (cpu.eightbit[x & 0xff] = y)) ++if (x >= 0x100) { \ ++ (x < memory_size ? (cpu.memory[(x)] = y) : (cpu.eightbit[x & 0xff] = y)); \ ++} else \ ++{ cpu.state = SIM_STATE_STOPPED; \ ++ cpu.exception = SIGSEGV; \ ++} + + int + fetch (arg, n) +@@ -918,12 +939,13 @@ + return 1; + } + ++ + void + sim_resume (sd, step, siggnal) + SIM_DESC sd; + { + static int init1; +- int cycles = 0; ++ static int cycles = 0; + int insts = 0; + int tick_start = get_now (); + void (*prev) (); +@@ -936,6 +958,7 @@ + int pc; + int c, nz, v, n; + int oldmask; ++ int vector; + init_pointers (); + + prev = signal (SIGINT, control_c); +@@ -994,6 +1017,15 @@ + + #endif + ++ if ((vector=iosimulation(&cpu,cycles)) && !(cpu.ccr & 0x80)) ++ { ++ BUILDSR(); ++ cpu.regs[7]-=4; ++ SET_MEMORY_L(cpu.regs[7],(cpu.ccr<<24)|pc); ++ pc=GET_MEMORY_L(vector*(h8300hmode?4:2)); ++ cpu.ccr|=0x80; ++ goto top; ++ } + if (code->opcode) + { + cycles += code->cycles; +@@ -1066,12 +1098,21 @@ + + case O (O_MOV_TO_MEM, SB): + res = GET_B_REG (code->src.reg); ++ if ( (code->dst.type == X (OP_DEC, SB)) && ++ (code->src.reg == code->dst.reg)) ++ res -= 1; + goto log8; + case O (O_MOV_TO_MEM, SW): + res = GET_W_REG (code->src.reg); ++ if ( (code->dst.type == X (OP_DEC, SW)) && ++ (code->src.reg == code->dst.reg)) ++ res -= 2; + goto log16; + case O (O_MOV_TO_MEM, SL): + res = GET_L_REG (code->src.reg); ++ if ( (code->dst.type == X (OP_DEC, SL)) && ++ (code->src.reg == code->dst.reg)) ++ res -= 4; + goto log32; + + +@@ -1355,6 +1396,7 @@ + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGILL; + goto end; ++#if 0 + case O (O_SLEEP, SN): + /* FIXME: Doesn't this break for breakpoints when r0 + contains just the right (er, wrong) value? */ +@@ -1368,6 +1410,29 @@ + else + cpu.exception = SIGTRAP; + goto end; ++#endif ++#define SIM_WIFEXITED(v) (((v) & 0xff) == 0) ++#define SIM_WIFSIGNALED(v) (((v) & 0x7f) > 0 && (((v) & 0x7f) < 0x7f)) ++ case O (O_SLEEP, SN): ++ if (cpu.ccr & 0x80) ++ { ++ cpu.state = SIM_STATE_STOPPED; ++ cpu.exception = SIGTRAP; ++ } else ++ while (cpu.state = SIM_STATE_RUNNING) { ++ if ((vector=iosimulation(&cpu,cycles)) && !(cpu.ccr & 0x80)) ++ { ++ usleep(100); ++ BUILDSR(); ++ cpu.regs[7]-=4; ++ SET_MEMORY_L(cpu.regs[7],(cpu.ccr<<24)|pc+2); ++ pc=GET_MEMORY_L(vector*(h8300hmode?4:2)); ++ cpu.ccr|=0x80; ++ goto top; ++ } ++ cycles++; ++ } ++ goto end; + case O (O_BPT, SN): + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGTRAP; +@@ -1528,7 +1593,143 @@ + } + } + goto next; +- ++ case O (O_LDC, SB): ++ { ++ switch(GET_MEMORY_B(pc)) { ++ case 0x03: ++ cpu.ccr = GET_B_REG(code->src.reg); ++ break; ++ case 0x07: ++ cpu.ccr = code->src.literal; ++ break; ++ case 0x01: ++ { ++ switch(GET_MEMORY_B(pc+2)) { ++ case 0x69: ++ cpu.ccr = GET_MEMORY_W(GET_L_REG(code->dst.reg)); ++ break; ++ case 0x6f: ++ case 0x78: ++ code->src.type=X(OP_DISP,SW); ++ cpu.ccr = fetch (&code->src); ++ break; ++ case 0x6d: ++ code->src.type=X(OP_INC,SW); ++ cpu.ccr = fetch (&code->src); ++ break; ++ case 0x6b: ++ cpu.ccr = GET_MEMORY_W(code->src.literal); ++ break; ++ } ++ } ++ } ++ GETSR(); ++ } ++ goto next; ++ case O (O_STC, SB): ++ { ++ BUILDSR(); ++ switch(GET_MEMORY_B(pc)) { ++ case 0x02: ++ SET_B_REG(code->dst.reg,cpu.ccr); ++ break; ++ case 0x01: ++ switch(GET_MEMORY_B(pc+2)) { ++ case 0x69: ++ SET_MEMORY_W(GET_L_REG(code->dst.reg),cpu.ccr); ++ break; ++ case 0x6f: ++ case 0x78: ++ code->dst.type=X(OP_DISP,SW); ++ store (&code->dst,cpu.ccr); ++ break; ++ case 0x6d: ++ code->dst.type=X(OP_DEC,SW); ++ store (&code->dst,cpu.ccr); ++ break; ++ case 0x6b: ++ SET_MEMORY_W(code->dst.literal,cpu.ccr); ++ break; ++ } ++ } ++ } ++ goto next; ++ case O (O_EEPMOV, SB): ++ { ++ int cnt=GET_B_REG(4); ++ if(cnt==0) cnt=0x100; ++ while(cnt!=0) { ++ SET_MEMORY_B(cpu.regs[6],GET_MEMORY_B(cpu.regs[5])); ++ cpu.regs[5]++; ++ cpu.regs[6]++; ++ --cnt; ++ } ++ SET_B_REG(4,cnt); ++ } ++ goto next; ++ case O (O_EEPMOV, SW): ++ { ++ int cnt=GET_W_REG(4); ++ if(cnt==0) cnt=0x10000; ++ while(cnt!=0) { ++ SET_MEMORY_B(cpu.regs[6],GET_MEMORY_B(cpu.regs[5])); ++ cpu.regs[5]++; ++ cpu.regs[6]++; ++ --cnt; ++ } ++ SET_W_REG(4,cnt); ++ } ++ goto next; ++ case O (O_RTE, SN): ++ { ++ unsigned int frame; ++ frame = GET_MEMORY_L (cpu.regs[7]); ++ cpu.ccr=frame>>24; ++ GETSR(); ++ pc=frame & 0xffffff; ++ cpu.regs[7]+=4; ++ }; ++ goto end; ++ case O (O_TRAPA, SB): ++ { ++ int v; ++ v=GET_MEMORY_W(pc)>>4; ++ v&=3; ++ BUILDSR(); ++ cpu.regs[7]-=4; ++ SET_MEMORY_L(cpu.regs[7],(cpu.ccr<<24)|code->next_pc); ++ pc=GET_MEMORY_L(v*(h8300hmode?4:2)+0x08*(h8300hmode?4:2)); ++ cpu.ccr|=0x80; ++ }; ++ goto end; ++ case O (O_BKPT, SN): ++ /* The format of r0 is defined by devo/include/wait.h. */ ++#if 0 /* FIXME: Ugh. A breakpoint is the sleep insn. */ ++ if (WIFEXITED (cpu.regs[0])) ++ { ++ cpu.state = SIM_STATE_EXITED; ++ cpu.exception = WEXITSTATUS (cpu.regs[0]); ++ } ++ else if (WIFSTOPPED (cpu.regs[0])) ++ { ++ cpu.state = SIM_STATE_STOPPED; ++ cpu.exception = WSTOPSIG (cpu.regs[0]); ++ } ++ else ++ { ++ cpu.state = SIM_STATE_SIGNALLED; ++ cpu.exception = WTERMSIG (cpu.regs[0]); ++ } ++#else ++ /* FIXME: Doesn't this break for breakpoints when r0 ++ contains just the right (er, wrong) value? */ ++ cpu.state = SIM_STATE_STOPPED; ++ if (! SIM_WIFEXITED (cpu.regs[0]) && SIM_WIFSIGNALED (cpu.regs[0])) ++ cpu.exception = SIGILL; ++ else ++ cpu.exception = SIGTRAP; ++#endif ++ goto end; + default: + cpu.state = SIM_STATE_STOPPED; + cpu.exception = SIGILL; +@@ -2016,10 +2217,14 @@ + char **argv; + { + /* FIXME: Much of the code in sim_load can be moved here. */ ++ char *ptyname; + + sim_kind = kind; + myname = argv[0]; + sim_callback = ptr; ++ if((ptyname=openpty())!=NULL) ++ (*sim_callback->printf_filtered) (sim_callback, ++ "SCI0 = %s\n",ptyname); + /* Fudge our descriptor. */ + return (SIM_DESC) 1; + } +@@ -2030,6 +2235,7 @@ + int quitting; + { + /* Nothing to do. */ ++ closepty(); + } + + /* Called by gdb to load a program into memory. */ +@@ -2100,6 +2306,7 @@ + abort (); + cpu.mask = memory_size - 1; + ++ init_ioregs(&cpu); + if (sim_load_file (sd, myname, sim_callback, prog, prog_bfd, + sim_kind == SIM_OPEN_DEBUG, + 0, sim_write) +diff -Nru gdb-5.2.1/sim/h8300/inst.h gdb-5.2.1.h8sim/sim/h8300/inst.h +--- gdb-5.2.1/sim/h8300/inst.h Fri Apr 16 10:35:02 1999 ++++ gdb-5.2.1.h8sim/sim/h8300/inst.h Wed Sep 11 23:50:22 2002 +@@ -15,7 +15,7 @@ + can only happen when simulating H8/300H programs). We make no attempt + to catch overlapping addresses, wrapped addresses, etc etc. */ + #define H8300_MSIZE (1<<16) +-#define H8300H_MSIZE (1<<18) ++#define H8300H_MSIZE (1<<24) + + #define CSIZE 1000 + +diff -Nru gdb-5.2.1/sim/h8300/io.c gdb-5.2.1.h8sim/sim/h8300/io.c +--- gdb-5.2.1/sim/h8300/io.c Thu Jan 1 09:00:00 1970 ++++ gdb-5.2.1.h8sim/sim/h8300/io.c Mon Sep 16 12:01:28 2002 +@@ -0,0 +1,272 @@ ++/* ++ H8 simulator Internal Peripheral Support ++*/ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "inst.h" ++ ++#define SMR (cpu->memory[0xffffb0]) ++#define BRR (cpu->memory[0xffffb1]) ++#define SCR (cpu->memory[0xffffb2]) ++#define TDR (cpu->memory[0xffffb3]) ++#define SSR (cpu->memory[0xffffb4]) ++#define RDR (cpu->memory[0xffffb5]) ++ ++#define TCR 0 ++#define TCSR 2 ++#define TCORA 4 ++#define TCORB 6 ++#define TCNT 8 ++ ++static int scifd=-1; ++static struct termios old_attr; ++static unsigned char ssr=0; ++static unsigned char tcsr[4]={0x00,0x00,0x00,0x00}; ++static int prescale[3]={8,64,8192}; ++const int base[4]={0xffff80,0xffff81,0xffff90,0xffff91}; ++const int prescale_div[3]={8,64,8192}; ++static unsigned int prev_cycle=0; ++ ++static void ++timer8(cpu_state_type *cpu,int cycles) ++{ ++ int tm,cnt,cyc,pcnt; ++ cyc=(unsigned int)cycles-prev_cycle; ++ prev_cycle=cycles; ++ for (pcnt = 0; pcnt < 3; pcnt++) { ++ prescale[pcnt] -= cyc; ++ if (prescale[pcnt]<=0) ++ { ++ for(tm=0;tm<4;tm++) { ++ tcsr[tm] &= (cpu->memory[base[tm]+TCSR] & 0xe0); ++ if ((cpu->memory[base[tm]+TCR]&0x07) == (pcnt+1)) ++ { ++ cnt=++cpu->memory[base[tm]+TCNT]; ++ if (cnt>=0x100) ++ { ++ tcsr[tm]|=0x20; ++ cnt=0; ++ } ++ cpu->memory[base[tm]+TCNT]=cnt; ++ } ++ if (cpu->memory[base[tm]+TCNT] >= cpu->memory[base[tm]+TCORA]) ++ { ++ tcsr[tm]|=0x40; ++ if ((cpu->memory[base[tm]+TCR]&0x18) == 0x08) ++ cpu->memory[base[tm]+TCNT] = 0; ++ } ++ if (cpu->memory[base[tm]+TCNT] >= cpu->memory[base[tm]+TCORB]) ++ { ++ tcsr[tm]|=0x80; ++ if ((cpu->memory[base[tm]+TCR]&0x18) == 0x10) ++ cpu->memory[base[tm]+TCNT] = 0; ++ } ++ cpu->memory[base[tm]+TCSR] &= 0x1f; ++ cpu->memory[base[tm]+TCSR] |= (tcsr[tm] & 0xe0); ++ } ++ prescale[pcnt]+=prescale_div[pcnt]; ++ } ++ } ++} ++ ++static unsigned int complete_time(cpu_state_type *cpu,int cycles) ++{ ++ int length; ++ int div[]={1,4,16,64}; ++ length=(SMR & 0x40)?7:8; ++ length+=(SMR & 0x20)?1:0; ++ length+=(SMR & 0x08)?1:0; ++ length+=2; ++ return length*32*div[SMR & 0x03]*BRR+cycles; ++} ++ ++static void send_data(int txd) ++{ ++ char dt; ++ dt=txd; ++ write(scifd,&dt,1); ++ fsync(scifd); ++} ++ ++static int rcv_data(int *rxd) ++{ ++ char rd; ++ if(read(scifd,&rd,1)>0) { ++ *rxd=rd; ++ return 1; ++ } else ++ return 0; ++} ++ ++static int sci(cpu_state_type *cpu,int cycles) ++{ ++ static int tx_end_time=0; ++ static int rx_end_time=0; ++ static int data=-1; ++ ssr &= SSR; ++ if((SCR & 0x20) && !(ssr & 0x80)) { ++ send_data(TDR); ++ ssr |= 0x80; ++ tx_end_time=complete_time(cpu,cycles); ++ } ++ if ((data == -1) && !rcv_data(&data)) ++ data = -1; ++ if((data != -1) && (SCR & 0x10) && ((rx_end_time==0) || (rx_end_time-cycles)<0)) { ++ if(ssr & 0x40) { ++ ssr |= 0x20; ++ } else { ++ RDR=data; ++ ssr |= 0x40; ++ data=-1; ++ } ++ rx_end_time=complete_time(cpu,cycles); ++ } ++ if((tx_end_time>0) && (tx_end_time-cycles)<0) { ++ if(ssr & 0x80) { ++ ssr |= 0x04; ++ } ++ } ++ SSR = ssr; ++} ++ ++static int ++intcont(cpu_state_type *cpu) ++{ ++ struct INT_LIST { ++ int vector; ++ int isr_adr; ++ unsigned char isr_mask; ++ int ier_adr; ++ unsigned char ier_mask; ++ } int_table[]= { ++ {36,0xffff82,0x40,0xffff80,0x40}, ++ {37,0xffff82,0x80,0xffff80,0x80}, ++ {38,0xffff83,0x40,0xffff81,0x40}, ++ {38,0xffff83,0x80,0xffff81,0x40}, ++ {39,0xffff82,0x20,0xffff80,0x20}, ++ {39,0xffff83,0x20,0xffff81,0x20}, ++ {40,0xffff92,0x40,0xffff90,0x40}, ++ {41,0xffff92,0x80,0xffff90,0x80}, ++ {42,0xffff93,0x40,0xffff91,0x40}, ++ {42,0xffff93,0x80,0xffff91,0x40}, ++ {43,0xffff92,0x20,0xffff90,0x20}, ++ {43,0xffff93,0x20,0xffff91,0x20}, ++ {52,0xffffb4,0x38,0xffffb2,0x40}, ++ {53,0xffffb4,0x40,0xffffb2,0x40}, ++ {54,0xffffb4,0x80,0xffffb2,0x80}, ++ {55,0xffffb4,0x04,0xffffb2,0x04} ++ }; ++ int irqno; ++ for (irqno=0;irqnomemory[int_table[irqno].ier_adr]&int_table[irqno].ier_mask) ++ if(cpu->memory[int_table[irqno].isr_adr]&int_table[irqno].isr_mask) ++ return int_table[irqno].vector; ++ } ++ return 0; ++} ++ ++int ++iosimulation(cpu_state_type *cpu,int cycles) ++{ ++ timer8(cpu,cycles); ++ sci(cpu,cycles); ++ return intcont(cpu); ++} ++ ++void init_ioregs(cpu_state_type *cpu) ++{ ++ struct INITTABLE { ++ int addr; ++ short data; ++ } reg_ini[] = { ++ 0xffff80,0x00, ++ 0xffff81,0x00, ++ 0xffff82,0x00, ++ 0xffff83,0x00, ++ 0xffff84,0xff, ++ 0xffff85,0xff, ++ 0xffff86,0xff, ++ 0xffff87,0xff, ++ 0xffff88,0x00, ++ 0xffff89,0x00, ++ 0xffff90,0x00, ++ 0xffff91,0x00, ++ 0xffff92,0x00, ++ 0xffff93,0x00, ++ 0xffff94,0xff, ++ 0xffff95,0xff, ++ 0xffff96,0xff, ++ 0xffff97,0xff, ++ 0xffff98,0x00, ++ 0xffff99,0x00, ++ 0xffffb0,0x00, ++ 0xffffb1,0xff, ++ 0xffffb2,0x00, ++ 0xffffb3,0xff, ++ 0xffffb4,0x84, ++ 0xffffb8,0x00, ++ 0xffffb9,0xff, ++ 0xffffba,0x00, ++ 0xffffbb,0xff, ++ 0xffffbc,0x84, ++ 0xffffc0,0x00, ++ 0xffffc1,0xff, ++ 0xffffc2,0x00, ++ 0xffffc3,0xff, ++ 0xffffc4,0x84, ++ }; ++ int c; ++ for(c=0;cmemory[reg_ini[c].addr]=reg_ini[c].data; ++ ssr = 0x84; ++} ++ ++char *openpty(void) ++{ ++ const char nm[]="0123456789ABCDEF"; ++ static char ptyname[16]; ++ int c1,c2,fd; ++ struct termios attr; ++ fd = open("/dev/ptmx",O_RDWR|O_NONBLOCK); ++ if(fd >= 0) { ++ grantpt(fd); ++ unlockpt(fd); ++ strncpy(ptyname,ptsname(fd),sizeof(ptyname)-1); ++ ptyname[sizeof(ptyname)-1]='\0'; ++ } else { ++ for(c1='a';c1<='z';c1++) ++ for(c2=0;c2= 0) { ++ scifd=fd; ++ tcgetattr(scifd,&attr); ++ memcpy(&old_attr,&attr,sizeof(struct termios)); ++ attr.c_lflag&=~ICANON; ++ attr.c_cc[VMIN]=0; ++ attr.c_cc[VTIME]=0; ++ tcsetattr(scifd,TCSAFLUSH,&attr); ++ return ptyname; ++ } else ++ return NULL; ++} ++ ++void closepty(void) ++{ ++ struct termios attr; ++ if(scifd!=-1) { ++ tcsetattr(scifd,TCSAFLUSH,&old_attr); ++ close(scifd); ++ } ++} diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/tools_patch/README linux-2.5.67-ac1/arch/h8300/tools_patch/README --- linux-2.5.67/arch/h8300/tools_patch/README 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/tools_patch/README 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,23 @@ +gcc.diff +Please compile it after applying a patch in gcc. +It is gcc-3.1.1 only. + +Procedure +$ tar xzf gcc-3.1.1.tar.gz +$ cd gcc-3.1.1 +$ patch -p1 < gcc.diff +$ configure --target=h8300-elf --disable-nls -enable-languages='c,c++' +$ make +$ make install + +gdb.diff +It is necessary when I execute it on GDB sim. +It is gdb-5.2.1 only. + +Procedure +$ tar xzf gdb-5.2.1.tar.gz +$ cd gdb-5.2.1 +$ patch -p1 < gdb.diff +$ configure --target=h8300-elf +$ make +$ make install diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/h8300/vmlinux.lds.S linux-2.5.67-ac1/arch/h8300/vmlinux.lds.S --- linux-2.5.67/arch/h8300/vmlinux.lds.S 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.5.67-ac1/arch/h8300/vmlinux.lds.S 2003-02-17 00:01:58.000000000 +0000 @@ -0,0 +1,38 @@ +#include + +#ifdef CONFIG_H8300H_GENERIC +#ifdef CONFIG_ROMKERNEL +#include "platform/h8300h/generic/rom.ld" +#endif +#ifdef CONFIG_RAMKERNEL +#include "platform/h8300h/generic/ram.ld" +#endif +#endif + +#ifdef CONFIG_H8300H_AKI3068NET +#ifdef CONFIG_ROMKERNEL +#include "platform/h8300h/aki3068net/rom.ld" +#endif +#ifdef CONFIG_RAMKERNEL +#include "platform/h8300h/aki3068net/ram.ld" +#endif +#endif + +#ifdef CONFIG_H8300H_H8MAX +#ifdef CONFIG_ROMKERNEL +#include "platform/h8300h/h8max/rom.ld" +#endif +#ifdef CONFIG_RAMKERNEL +#include "platform/h8300h/h8max/ram.ld" +#endif +#endif + +#ifdef CONFIG_H8300H_SIM +#ifdef CONFIG_ROMKERNEL +#include "platform/h8300h/generic/rom.ld" +#endif +#ifdef CONFIG_RAMKERNEL +#include "platform/h8300h/generic/ram.ld" +#endif +#endif + diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/i386/boot/Makefile linux-2.5.67-ac1/arch/i386/boot/Makefile --- linux-2.5.67/arch/i386/boot/Makefile 2003-03-18 16:46:45.000000000 +0000 +++ linux-2.5.67-ac1/arch/i386/boot/Makefile 2003-03-18 16:50:46.000000000 +0000 @@ -31,6 +31,10 @@ host-progs := tools/build +ifdef CONFIG_X86_HAL +AFLAGS += -DNO_X86_HAL_INCLUDES +endif + # --------------------------------------------------------------------------- $(obj)/zImage: IMAGE_OFFSET := 0x1000 diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/i386/boot/setup.S linux-2.5.67-ac1/arch/i386/boot/setup.S --- linux-2.5.67/arch/i386/boot/setup.S 2003-04-08 00:37:34.000000000 +0100 +++ linux-2.5.67-ac1/arch/i386/boot/setup.S 2003-04-03 16:46:29.000000000 +0100 @@ -213,7 +213,7 @@ # Part of above routine, this one just prints ascii al prtchr: pushw %ax pushw %cx - xorb %bh, %bh + movw $7,%bx movw $0x01, %cx movb $0x0e, %ah int $0x10 diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/i386/defconfig linux-2.5.67-ac1/arch/i386/defconfig --- linux-2.5.67/arch/i386/defconfig 2003-02-10 18:38:45.000000000 +0000 +++ linux-2.5.67-ac1/arch/i386/defconfig 2003-02-14 22:38:07.000000000 +0000 @@ -19,6 +19,8 @@ CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set # # Loadable module support diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.67/arch/i386/Kconfig linux-2.5.67-ac1/arch/i386/Kconfig --- linux-2.5.67/arch/i386/Kconfig 2003-03-26 19:59:49.000000000 +0000 +++ linux-2.5.67-ac1/arch/i386/Kconfig 2003-04-04 16:22:18.000000000 +0100 @@ -31,9 +31,17 @@ source "init/Kconfig" - menu "Processor type and features" +config SWAP + bool "Support for paging of anonymous memory" + default y + help + This option allows you to choose whether you want to have support + for so-called swap devices or swap files in your kernel that are + used to provide more virtual memory than the actual RAM present + in your computer. If unsure say Y. + choice prompt "Subarchitecture Type" default X86_PC @@ -52,7 +60,7 @@ *** WARNING *** If you do not specifically know you have a Voyager based machine, - say N here otherwise the kernel you build will not be bootable. + say N here, otherwise the kernel you build will not be bootable. config X86_NUMAQ bool "NUMAQ (IBM/Sequent)" @@ -142,7 +150,7 @@ config M486 bool "486" help - Select this for a x486 processor, ether Intel or one of the + Select this for a 486 series processor, either Intel or one of the compatible processors from AMD, Cyrix, IBM, or Intel. Includes DX, DX2, and DX4 variants; also SL/SLC/SLC2/SLC3/SX/SX2 and UMC U5D or U5S. @@ -150,8 +158,8 @@ config M586 bool "586/K5/5x86/6x86/6x86MX" help - Select this for an x586 or x686 processor such as the AMD K5, the - Intel 5x86 or 6x86, or the Intel 6x86MX. This choice does not + Select this for an 586 or 686 series processor such as the AMD K5, + the Intel 5x86 or 6x86, or the Intel 6x86MX. This choice does not assume the RDTSC (Read Time Stamp Counter) instruction. config M586TSC @@ -226,28 +234,28 @@ config MCRUSOE bool "Crusoe" help - Select this for Transmeta Crusoe processor. Treats the processor + Select this for a Transmeta Crusoe processor. Treats the processor like a 586 with TSC, and sets some GCC optimization flags (like a Pentium Pro with no alignment requirements). config MWINCHIPC6 bool "Winchip-C6" help - Select this for a IDT Winchip C6 chip. Linux and GCC + Select this for an IDT Winchip C6 chip. Linux and GCC treat this chip as a 586TSC with some extended instructions and alignment requirements. config MWINCHIP2 bool "Winchip-2" help - Select this for a IDT Winchip-2. Linux and GCC + Select this for an IDT Winchip-2. Linux and GCC treat this chip as a 586TSC with some extended instructions and alignment requirements. config MWINCHIP3D bool "Winchip-2A/Winchip-3" help - Select this for a IDT Winchip-2A or 3. Linux and GCC + Select this for an IDT Winchip-2A or 3. Linux and GCC treat this chip as a 586TSC with some extended instructions and alignment reqirements. Development kernels also enable out of order memory stores for this CPU, which can increase @@ -260,15 +268,15 @@ treat this chip as a generic 586. Whilst the CPU is 686 class, it lacks the cmov extension which gcc assumes is present when generating 686 code. - Note, that Nehemiah (Model 9) and above will not boot with this - kernel due to them lacking the 3dnow instructions used in earlier + Note that Nehemiah (Model 9) and above will not boot with this + kernel due to them lacking the 3DNow! instructions used in earlier incarnations of the CPU. config MVIAC3_2 bool "VIA C3-2 (Nehemiah)" help - Select this for a VIA C3 "Nehemiah". Selecting this enables usage of SSE - and tells gcc to treat the CPU as a 686. + Select this for a VIA C3 "Nehemiah". Selecting this enables usage + of SSE and tells gcc to treat the CPU as a 686. Note, this kernel will not boot on older (pre model 9) C3s. endchoice @@ -435,7 +443,8 @@ enable and use it. If you say Y here even though your machine doesn't have a local APIC, then the kernel will still run with no slowdown at all. The local APIC supports CPU-generated self-interrupts (timer, - performance counters), and the NMI watchdog which detects hard lockups. + performance counters), and the NMI watchdog which detects hard + lockups. If you have a system with several CPUs, you do not need to say Y here: the local APIC will be used automatically. @@ -522,7 +531,7 @@ ---help--- This adds a driver to safely access the System Management Mode of the CPU on Toshiba portables with a genuine Toshiba BIOS. It does - not work on models with a Pheonix BIOS. The System Management Mode + not work on models with a Phoenix BIOS. The System Management Mode is used to set the BIOS and power saving options on Toshiba portables. For information on utilities to make use of this driver see the @@ -536,20 +545,24 @@ tristate "Dell laptop support" ---help--- This adds a driver to safely access the System Management Mode - of the CPU on the Dell Inspiron 8000. The System Management Mode - is used to read cpu temperature and cooling fan status and to - control the fans on the I8K portables. - - This driver has been tested only on the Inspiron 8000 but it may - also work with other Dell laptops. You can force loading on other - models by passing the parameter `force=1' to the module. Use at - your own risk. + of the CPU on several Dell Inspiron 8000 series compatible notebooks + and Latitude Cxxx series compatible notebooks. + The System Management Mode is used to read CPU temperature + and cooling fan status and to control the fans on the I8K portables. + + This driver has been tested only on the Inspiron 8000 but it will + also work with some other Dell laptops. You can force loading + on other models by passing the parameter `force=1' to the module. + Use at your own risk. For information on utilities to make use of this driver see the I8K Linux utilities web site at: - Say Y if you intend to run this kernel on a Dell Inspiron 8000. + Inspiron 5000 and 7000 series are not supported; use ACPI features + instead. + + Say Y if you intend to run this kernel on a I8K compatible notebook. Say N otherwise. config MICROCODE @@ -595,8 +608,8 @@ depends on EXPERIMENTAL help Say Y or M here if you want to enable BIOS Enhanced Disk Drive - Services real mode BIOS calls to determine which disk - BIOS tries boot from. This information is then exported via driverfs. + Services real mode BIOS calls to determine which disk the BIOS + tries to boot from. This information is then exported via driverfs. This option is experimental, but believed to be safe, and most disk controller BIOS vendors do not yet implement this feature. @@ -799,24 +812,26 @@ bool "Software Suspend (EXPERIMENTAL)" depends on EXPERIMENTAL && PM ---help--- - Enable the possibilty of suspendig machine. It doesn't need APM. - You may suspend your machine by 'swsusp' or 'shutdown -z