mirror of https://gitee.com/openkylin/linux.git
Drop support for Renesas H8/300 (h8300) architecture
H8/300 has been dead for several years, and the kernel for it has not compiled for ages. Drop support for it. Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
272b98c645
commit
4b08478422
|
@ -65,11 +65,6 @@ Possible arch/ problems
|
|||
|
||||
Possible arch problems I found (and either tried to fix or didn't):
|
||||
|
||||
h8300 - Is such sleeping racy vs interrupts? (See #4a).
|
||||
The H8/300 manual I found indicates yes, however disabling IRQs
|
||||
over the sleep mean only NMIs can wake it up, so can't fix easily
|
||||
without doing spin waiting.
|
||||
|
||||
ia64 - is safe_halt call racy vs interrupts? (does it sleep?) (See #4a)
|
||||
|
||||
sh64 - Is sleeping racy vs interrupts? (See #4a)
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
config H8300
|
||||
bool
|
||||
default y
|
||||
select HAVE_IDE
|
||||
select GENERIC_ATOMIC64
|
||||
select HAVE_UID16
|
||||
select VIRT_TO_BUS
|
||||
select ARCH_WANT_IPC_PARSE_VERSION
|
||||
select GENERIC_IRQ_SHOW
|
||||
select GENERIC_CPU_DEVICES
|
||||
select MODULES_USE_ELF_RELA
|
||||
select OLD_SIGSUSPEND3
|
||||
select OLD_SIGACTION
|
||||
select HAVE_UNDERSCORE_SYMBOL_PREFIX
|
||||
|
||||
config MMU
|
||||
bool
|
||||
default n
|
||||
|
||||
config SWAP
|
||||
bool
|
||||
default n
|
||||
|
||||
config ZONE_DMA
|
||||
bool
|
||||
default y
|
||||
|
||||
config FPU
|
||||
bool
|
||||
default n
|
||||
|
||||
config RWSEM_GENERIC_SPINLOCK
|
||||
bool
|
||||
default y
|
||||
|
||||
config RWSEM_XCHGADD_ALGORITHM
|
||||
bool
|
||||
default n
|
||||
|
||||
config ARCH_HAS_ILOG2_U32
|
||||
bool
|
||||
default n
|
||||
|
||||
config ARCH_HAS_ILOG2_U64
|
||||
bool
|
||||
default n
|
||||
|
||||
config GENERIC_HWEIGHT
|
||||
bool
|
||||
default y
|
||||
|
||||
config GENERIC_CALIBRATE_DELAY
|
||||
bool
|
||||
default y
|
||||
|
||||
config GENERIC_BUG
|
||||
bool
|
||||
depends on BUG
|
||||
|
||||
config TIME_LOW_RES
|
||||
bool
|
||||
default y
|
||||
|
||||
config NO_IOPORT
|
||||
def_bool y
|
||||
|
||||
config NO_DMA
|
||||
def_bool y
|
||||
|
||||
config ISA
|
||||
bool
|
||||
default y
|
||||
|
||||
config PCI
|
||||
bool
|
||||
default n
|
||||
|
||||
config HZ
|
||||
int
|
||||
default 100
|
||||
|
||||
source "init/Kconfig"
|
||||
|
||||
source "kernel/Kconfig.freezer"
|
||||
|
||||
source "arch/h8300/Kconfig.cpu"
|
||||
|
||||
menu "Executable file formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
endmenu
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
source "arch/h8300/Kconfig.ide"
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
source "arch/h8300/Kconfig.debug"
|
||||
|
||||
source "security/Kconfig"
|
||||
|
||||
source "crypto/Kconfig"
|
||||
|
||||
source "lib/Kconfig"
|
|
@ -1,171 +0,0 @@
|
|||
menu "Processor type and features"
|
||||
|
||||
choice
|
||||
prompt "H8/300 platform"
|
||||
default H8300H_GENERIC
|
||||
|
||||
config H8300H_GENERIC
|
||||
bool "H8/300H Generic"
|
||||
help
|
||||
H8/300H CPU Generic Hardware Support
|
||||
|
||||
config H8300H_AKI3068NET
|
||||
bool "AE-3068/69"
|
||||
select H83068
|
||||
help
|
||||
AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support
|
||||
More Information. (Japanese Only)
|
||||
<http://akizukidenshi.com/catalog/default.aspx>
|
||||
AE-3068/69 Evaluation Board Support
|
||||
More Information.
|
||||
<http://www.microtronique.com/ae3069lan.htm>
|
||||
|
||||
config H8300H_H8MAX
|
||||
bool "H8MAX"
|
||||
select H83068
|
||||
help
|
||||
H8MAX Evaluation Board Support
|
||||
More Information. (Japanese Only)
|
||||
<http://strawberry-linux.com/h8/index.html>
|
||||
|
||||
config H8300H_SIM
|
||||
bool "H8/300H Simulator"
|
||||
select H83007
|
||||
help
|
||||
GDB Simulator Support
|
||||
More Information.
|
||||
<http://sourceware.org/sid/>
|
||||
|
||||
config H8S_GENERIC
|
||||
bool "H8S Generic"
|
||||
help
|
||||
H8S CPU Generic Hardware Support
|
||||
|
||||
config H8S_EDOSK2674
|
||||
bool "EDOSK-2674"
|
||||
select H8S2678
|
||||
help
|
||||
Renesas EDOSK-2674 Evaluation Board Support
|
||||
More Information.
|
||||
<http://www.azpower.com/H8-uClinux/index.html>
|
||||
<http://www.renesas.eu/products/tools/introductory_evaluation_tools/evaluation_development_os_kits/edosk2674r/edosk2674r_software_tools_root.jsp>
|
||||
|
||||
config H8S_SIM
|
||||
bool "H8S Simulator"
|
||||
help
|
||||
GDB Simulator Support
|
||||
More Information.
|
||||
<http://sourceware.org/sid/>
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "CPU Selection"
|
||||
|
||||
config H83002
|
||||
bool "H8/3001,3002,3003"
|
||||
depends on BROKEN
|
||||
select CPU_H8300H
|
||||
|
||||
config H83007
|
||||
bool "H8/3006,3007"
|
||||
select CPU_H8300H
|
||||
|
||||
config H83048
|
||||
bool "H8/3044,3045,3046,3047,3048,3052"
|
||||
depends on BROKEN
|
||||
select CPU_H8300H
|
||||
|
||||
config H83068
|
||||
bool "H8/3065,3066,3067,3068,3069"
|
||||
select CPU_H8300H
|
||||
|
||||
config H8S2678
|
||||
bool "H8S/2670,2673,2674R,2675,2676"
|
||||
select CPU_H8S
|
||||
|
||||
endchoice
|
||||
|
||||
config CPU_CLOCK
|
||||
int "CPU Clock Frequency (/1KHz)"
|
||||
default "20000"
|
||||
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
|
||||
|
||||
|
||||
config CPU_H8300H
|
||||
bool
|
||||
depends on (H83002 || H83007 || H83048 || H83068)
|
||||
default y
|
||||
|
||||
config CPU_H8S
|
||||
bool
|
||||
depends on H8S2678
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Timer"
|
||||
config H8300_TIMER8
|
||||
bool "8bit timer (2ch cascade)"
|
||||
depends on (H83007 || H83068 || H8S2678)
|
||||
|
||||
config H8300_TIMER16
|
||||
bool "16bit timer"
|
||||
depends on (H83007 || H83068)
|
||||
|
||||
config H8300_ITU
|
||||
bool "ITU"
|
||||
depends on (H83002 || H83048)
|
||||
|
||||
config H8300_TPU
|
||||
bool "TPU"
|
||||
depends on H8S2678
|
||||
endchoice
|
||||
|
||||
if H8300_TIMER8
|
||||
choice
|
||||
prompt "Timer Channel"
|
||||
config H8300_TIMER8_CH0
|
||||
bool "Channel 0"
|
||||
config H8300_TIMER8_CH2
|
||||
bool "Channel 2"
|
||||
depends on CPU_H8300H
|
||||
endchoice
|
||||
endif
|
||||
|
||||
config H8300_TIMER16_CH
|
||||
int "16bit timer channel (0 - 2)"
|
||||
depends on H8300_TIMER16
|
||||
range 0 2
|
||||
|
||||
config H8300_ITU_CH
|
||||
int "ITU channel"
|
||||
depends on H8300_ITU
|
||||
range 0 4
|
||||
|
||||
config H8300_TPU_CH
|
||||
int "TPU channel"
|
||||
depends on H8300_TPU
|
||||
range 0 4
|
||||
|
||||
source "kernel/Kconfig.preempt"
|
||||
|
||||
source "mm/Kconfig"
|
||||
|
||||
endmenu
|
|
@ -1,68 +0,0 @@
|
|||
menu "Kernel hacking"
|
||||
|
||||
source "lib/Kconfig.debug"
|
||||
|
||||
config FULLDEBUG
|
||||
bool "Full Symbolic/Source Debugging support"
|
||||
help
|
||||
Enable debugging symbols on kernel build.
|
||||
|
||||
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 || H8S_SIM)
|
||||
help
|
||||
kernel messages output using MagicPrint service from GDB
|
||||
|
||||
config SYSCALL_PRINT
|
||||
bool "SystemCall trace print"
|
||||
help
|
||||
output history of systemcall
|
||||
|
||||
config GDB_DEBUG
|
||||
bool "Use gdb stub"
|
||||
depends on (!H8300H_SIM && !H8S_SIM)
|
||||
help
|
||||
gdb stub exception support
|
||||
|
||||
config SH_STANDARD_BIOS
|
||||
bool "Use gdb protocol serial console"
|
||||
depends on (!H8300H_SIM && !H8S_SIM)
|
||||
help
|
||||
serial console output using GDB protocol.
|
||||
Require eCos/RedBoot
|
||||
|
||||
config DEFAULT_CMDLINE
|
||||
bool "Use builtin commandline"
|
||||
default n
|
||||
help
|
||||
builtin kernel commandline enabled.
|
||||
|
||||
config KERNEL_COMMAND
|
||||
string "Buildin command string"
|
||||
depends on DEFAULT_CMDLINE
|
||||
help
|
||||
builtin kernel commandline strings.
|
||||
|
||||
config BLKDEV_RESERVE
|
||||
bool "BLKDEV Reserved Memory"
|
||||
default n
|
||||
help
|
||||
Reserved BLKDEV area.
|
||||
|
||||
config BLKDEV_RESERVE_ADDRESS
|
||||
hex 'start address'
|
||||
depends on BLKDEV_RESERVE
|
||||
help
|
||||
BLKDEV start address.
|
||||
|
||||
endmenu
|
|
@ -1,44 +0,0 @@
|
|||
# uClinux H8/300 Target Board Selection Menu (IDE)
|
||||
|
||||
if (H8300H_AKI3068NET)
|
||||
menu "IDE Extra configuration"
|
||||
|
||||
config H8300_IDE_BASE
|
||||
hex "IDE register base address"
|
||||
depends on IDE
|
||||
default 0
|
||||
help
|
||||
IDE registers base address
|
||||
|
||||
config H8300_IDE_ALT
|
||||
hex "IDE register alternate address"
|
||||
depends on IDE
|
||||
default 0
|
||||
help
|
||||
IDE alternate registers address
|
||||
|
||||
config H8300_IDE_IRQ
|
||||
int "IDE IRQ no"
|
||||
depends on IDE
|
||||
default 0
|
||||
help
|
||||
IDE use IRQ no
|
||||
endmenu
|
||||
endif
|
||||
|
||||
if (H8300H_H8MAX)
|
||||
config H8300_IDE_BASE
|
||||
hex
|
||||
depends on IDE
|
||||
default 0x200000
|
||||
|
||||
config H8300_IDE_ALT
|
||||
hex
|
||||
depends on IDE
|
||||
default 0x60000c
|
||||
|
||||
config H8300_IDE_IRQ
|
||||
int
|
||||
depends on IDE
|
||||
default 5
|
||||
endif
|
|
@ -1,71 +0,0 @@
|
|||
#
|
||||
# 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,2003 Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
#
|
||||
|
||||
platform-$(CONFIG_CPU_H8300H) := h8300h
|
||||
platform-$(CONFIG_CPU_H8S) := h8s
|
||||
PLATFORM := $(platform-y)
|
||||
|
||||
board-$(CONFIG_H8300H_GENERIC) := generic
|
||||
board-$(CONFIG_H8300H_AKI3068NET) := aki3068net
|
||||
board-$(CONFIG_H8300H_H8MAX) := h8max
|
||||
board-$(CONFIG_H8300H_SIM) := generic
|
||||
board-$(CONFIG_H8S_GENERIC) := generic
|
||||
board-$(CONFIG_H8S_EDOSK2674) := edosk2674
|
||||
board-$(CONFIG_H8S_SIM) := generic
|
||||
BOARD := $(board-y)
|
||||
|
||||
model-$(CONFIG_RAMKERNEL) := ram
|
||||
model-$(CONFIG_ROMKERNEL) := rom
|
||||
MODEL := $(model-y)
|
||||
|
||||
cflags-$(CONFIG_CPU_H8300H) := -mh
|
||||
ldflags-$(CONFIG_CPU_H8300H) := -mh8300helf
|
||||
cflags-$(CONFIG_CPU_H8S) := -ms
|
||||
ldflags-$(CONFIG_CPU_H8S) := -mh8300self
|
||||
|
||||
KBUILD_CFLAGS += $(cflags-y)
|
||||
KBUILD_CFLAGS += -mint32 -fno-builtin
|
||||
KBUILD_CFLAGS += -g
|
||||
KBUILD_CFLAGS += -D__linux__
|
||||
KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
|
||||
KBUILD_AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
|
||||
LDFLAGS += $(ldflags-y)
|
||||
|
||||
CROSS_COMPILE = h8300-elf-
|
||||
LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
|
||||
|
||||
head-y := arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/crt0_$(MODEL).o
|
||||
|
||||
core-y += arch/$(ARCH)/kernel/ \
|
||||
arch/$(ARCH)/mm/
|
||||
ifdef PLATFORM
|
||||
core-y += arch/$(ARCH)/platform/$(PLATFORM)/ \
|
||||
arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/
|
||||
endif
|
||||
|
||||
libs-y += arch/$(ARCH)/lib/ $(LIBGCC)
|
||||
|
||||
boot := arch/h8300/boot
|
||||
|
||||
export MODEL PLATFORM BOARD
|
||||
|
||||
archmrproper:
|
||||
|
||||
archclean:
|
||||
$(Q)$(MAKE) $(clean)=$(boot)
|
||||
|
||||
vmlinux.srec vmlinux.bin zImage: vmlinux
|
||||
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
|
||||
|
||||
define archhelp
|
||||
@echo 'vmlinux.bin - Create raw binary'
|
||||
@echo 'vmlinux.srec - Create srec binary'
|
||||
@echo 'zImage - Compressed kernel image'
|
||||
endef
|
|
@ -1,38 +0,0 @@
|
|||
linux-2.6 for H8/300 README
|
||||
Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
|
||||
* Supported CPU
|
||||
H8/300H and H8S
|
||||
|
||||
* Supported Target
|
||||
1.simulator of GDB
|
||||
require patches.
|
||||
|
||||
2.AE 3068/AE 3069
|
||||
more information
|
||||
MICROTRONIQUE <http://www.microtronique.com/>
|
||||
Akizuki Denshi Tsusho Ltd. <http://akizukidenshi.com/> (Japanese Only)
|
||||
|
||||
3.H8MAX
|
||||
see http://ip-sol.jp/h8max/ (Japanese Only)
|
||||
|
||||
4.EDOSK2674
|
||||
see http://www.eu.renesas.com/products/mpumcu/tool/edk/support/edosk2674.html
|
||||
http://www.uclinux.org/pub/uClinux/ports/h8/HITACHI-EDOSK2674-HOWTO
|
||||
http://www.azpower.com/H8-uClinux/
|
||||
|
||||
* 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
|
||||
used h8300-elf toolchains.
|
||||
see http://www.uclinux.org/pub/uClinux/ports/h8/
|
||||
|
||||
* A few words of thanks
|
||||
Porting to H8/300 serieses is support of Information-technology Promotion Agency, Japan.
|
||||
I thank support.
|
||||
and All developer/user.
|
|
@ -1,22 +0,0 @@
|
|||
# arch/h8300/boot/Makefile
|
||||
|
||||
targets := vmlinux.srec vmlinux.bin zImage
|
||||
subdir- := compressed
|
||||
|
||||
OBJCOPYFLAGS_vmlinux.srec := -Osrec
|
||||
OBJCOPYFLAGS_vmlinux.bin := -Obinary
|
||||
OBJCOPYFLAGS_zImage := -O binary -R .note -R .comment -R .stab -R .stabstr -S
|
||||
|
||||
$(obj)/vmlinux.srec $(obj)/vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
@echo ' Kernel: $@ is ready'
|
||||
|
||||
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
@echo 'Kernel: $@ is ready'
|
||||
|
||||
$(obj)/compressed/vmlinux: FORCE
|
||||
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
||||
|
||||
CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
#
|
||||
# linux/arch/sh/boot/compressed/Makefile
|
||||
#
|
||||
# create a compressed vmlinux image from the original vmlinux
|
||||
#
|
||||
|
||||
targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
|
||||
asflags-y := -traditional
|
||||
|
||||
OBJECTS = $(obj)/head.o $(obj)/misc.o
|
||||
|
||||
#
|
||||
# IMAGE_OFFSET is the load offset of the compression loader
|
||||
# Assign dummy values if these 2 variables are not defined,
|
||||
# in order to suppress error message.
|
||||
#
|
||||
CONFIG_MEMORY_START ?= 0x00400000
|
||||
CONFIG_BOOT_LINK_OFFSET ?= 0x00140000
|
||||
IMAGE_OFFSET := $(shell printf "0x%08x" $$(($(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET))))
|
||||
|
||||
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds
|
||||
|
||||
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
|
||||
$(call if_changed,ld)
|
||||
@:
|
||||
|
||||
$(obj)/vmlinux.bin: vmlinux FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,gzip)
|
||||
|
||||
LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300 -T
|
||||
OBJCOPYFLAGS := -O binary
|
||||
|
||||
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
|
||||
$(call if_changed,ld)
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* linux/arch/h8300/boot/compressed/head.S
|
||||
*
|
||||
* Copyright (C) 2006 Yoshinori Sato
|
||||
*/
|
||||
|
||||
.h8300h
|
||||
#include <linux/linkage.h>
|
||||
|
||||
#define SRAM_START 0xff4000
|
||||
|
||||
.section .text..startup
|
||||
.global startup
|
||||
startup:
|
||||
mov.l #SRAM_START+0x8000, sp
|
||||
mov.l #__sbss, er0
|
||||
mov.l #__ebss, er1
|
||||
sub.l er0, er1
|
||||
shlr er1
|
||||
shlr er1
|
||||
sub.l er2, er2
|
||||
1:
|
||||
mov.l er2, @er0
|
||||
adds #4, er0
|
||||
dec.l #1, er1
|
||||
bne 1b
|
||||
jsr @_decompress_kernel
|
||||
jmp @0x400000
|
||||
|
||||
.align 9
|
||||
fake_headers_as_bzImage:
|
||||
.word 0
|
||||
.ascii "HdrS" ; header signature
|
||||
.word 0x0202 ; header version number (>= 0x0105)
|
||||
; or else old loadlin-1.5 will fail)
|
||||
.word 0 ; default_switch
|
||||
.word 0 ; SETUPSEG
|
||||
.word 0x1000
|
||||
.word 0 ; pointing to kernel version string
|
||||
.byte 0 ; = 0, old one (LILO, Loadlin,
|
||||
; 0xTV: T=0 for LILO
|
||||
; V = version
|
||||
.byte 1 ; Load flags bzImage=1
|
||||
.word 0x8000 ; size to move, when setup is not
|
||||
.long 0x100000 ; 0x100000 = default for big kernel
|
||||
.long 0 ; address of loaded ramdisk image
|
||||
.long 0 ; its size in bytes
|
|
@ -1,180 +0,0 @@
|
|||
/*
|
||||
* arch/h8300/boot/compressed/misc.c
|
||||
*
|
||||
* This is a collection of several routines from gzip-1.0.3
|
||||
* adapted for Linux.
|
||||
*
|
||||
* malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
|
||||
*
|
||||
* Adapted for h8300 by Yoshinori Sato 2006
|
||||
*/
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
/*
|
||||
* gzip declarations
|
||||
*/
|
||||
|
||||
#define OF(args) args
|
||||
#define STATIC static
|
||||
|
||||
#undef memset
|
||||
#undef memcpy
|
||||
#define memzero(s, n) memset ((s), 0, (n))
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef unsigned short ush;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
#define WSIZE 0x8000 /* Window size must be at least 32k, */
|
||||
/* and a power of two */
|
||||
|
||||
static uch *inbuf; /* input buffer */
|
||||
static uch window[WSIZE]; /* Sliding window buffer */
|
||||
|
||||
static unsigned insize = 0; /* valid bytes in inbuf */
|
||||
static unsigned inptr = 0; /* index of next byte to be processed in inbuf */
|
||||
static unsigned outcnt = 0; /* bytes in output buffer */
|
||||
|
||||
/* gzip flag byte */
|
||||
#define ASCII_FLAG 0x01 /* bit 0 set: file probably ASCII text */
|
||||
#define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */
|
||||
#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */
|
||||
#define ORIG_NAME 0x08 /* bit 3 set: original file name present */
|
||||
#define COMMENT 0x10 /* bit 4 set: file comment present */
|
||||
#define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */
|
||||
#define RESERVED 0xC0 /* bit 6,7: reserved */
|
||||
|
||||
#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
|
||||
|
||||
/* Diagnostic functions */
|
||||
#ifdef DEBUG
|
||||
# define Assert(cond,msg) {if(!(cond)) error(msg);}
|
||||
# define Trace(x) fprintf x
|
||||
# define Tracev(x) {if (verbose) fprintf x ;}
|
||||
# define Tracevv(x) {if (verbose>1) fprintf x ;}
|
||||
# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
|
||||
# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
|
||||
#else
|
||||
# define Assert(cond,msg)
|
||||
# define Trace(x)
|
||||
# define Tracev(x)
|
||||
# define Tracevv(x)
|
||||
# define Tracec(c,x)
|
||||
# define Tracecv(c,x)
|
||||
#endif
|
||||
|
||||
static int fill_inbuf(void);
|
||||
static void flush_window(void);
|
||||
static void error(char *m);
|
||||
|
||||
extern char input_data[];
|
||||
extern int input_len;
|
||||
|
||||
static long bytes_out = 0;
|
||||
static uch *output_data;
|
||||
static unsigned long output_ptr = 0;
|
||||
|
||||
static void error(char *m);
|
||||
|
||||
int puts(const char *);
|
||||
|
||||
extern int _end;
|
||||
static unsigned long free_mem_ptr;
|
||||
static unsigned long free_mem_end_ptr;
|
||||
|
||||
#define HEAP_SIZE 0x10000
|
||||
|
||||
#include "../../../../lib/inflate.c"
|
||||
|
||||
#define SCR *((volatile unsigned char *)0xffff8a)
|
||||
#define TDR *((volatile unsigned char *)0xffff8b)
|
||||
#define SSR *((volatile unsigned char *)0xffff8c)
|
||||
|
||||
int puts(const char *s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* memset(void* s, int c, size_t n)
|
||||
{
|
||||
int i;
|
||||
char *ss = (char*)s;
|
||||
|
||||
for (i=0;i<n;i++) ss[i] = c;
|
||||
return s;
|
||||
}
|
||||
|
||||
void* memcpy(void* __dest, __const void* __src,
|
||||
size_t __n)
|
||||
{
|
||||
int i;
|
||||
char *d = (char *)__dest, *s = (char *)__src;
|
||||
|
||||
for (i=0;i<__n;i++) d[i] = s[i];
|
||||
return __dest;
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
* Fill the input buffer. This is called only when the buffer is empty
|
||||
* and at least one byte is really needed.
|
||||
*/
|
||||
static int fill_inbuf(void)
|
||||
{
|
||||
if (insize != 0) {
|
||||
error("ran out of input data");
|
||||
}
|
||||
|
||||
inbuf = input_data;
|
||||
insize = input_len;
|
||||
inptr = 1;
|
||||
return inbuf[0];
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
* Write the output window window[0..outcnt-1] and update crc and bytes_out.
|
||||
* (Used for the decompressed data only.)
|
||||
*/
|
||||
static void flush_window(void)
|
||||
{
|
||||
ulg c = crc; /* temporary variable */
|
||||
unsigned n;
|
||||
uch *in, *out, ch;
|
||||
|
||||
in = window;
|
||||
out = &output_data[output_ptr];
|
||||
for (n = 0; n < outcnt; n++) {
|
||||
ch = *out++ = *in++;
|
||||
c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
|
||||
}
|
||||
crc = c;
|
||||
bytes_out += (ulg)outcnt;
|
||||
output_ptr += (ulg)outcnt;
|
||||
outcnt = 0;
|
||||
}
|
||||
|
||||
static void error(char *x)
|
||||
{
|
||||
puts("\n\n");
|
||||
puts(x);
|
||||
puts("\n\n -- System halted");
|
||||
|
||||
while(1); /* Halt */
|
||||
}
|
||||
|
||||
#define STACK_SIZE (4096)
|
||||
long user_stack [STACK_SIZE];
|
||||
long* stack_start = &user_stack[STACK_SIZE];
|
||||
|
||||
void decompress_kernel(void)
|
||||
{
|
||||
output_data = 0;
|
||||
output_ptr = (unsigned long)0x400000;
|
||||
free_mem_ptr = (unsigned long)&_end;
|
||||
free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;
|
||||
|
||||
makecrc();
|
||||
puts("Uncompressing Linux... ");
|
||||
gunzip();
|
||||
puts("Ok, booting the kernel.\n");
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__stext = . ;
|
||||
__text = .;
|
||||
*(.text..startup)
|
||||
*(.text)
|
||||
__etext = . ;
|
||||
}
|
||||
|
||||
.rodata :
|
||||
{
|
||||
*(.rodata)
|
||||
}
|
||||
.data :
|
||||
|
||||
{
|
||||
__sdata = . ;
|
||||
___data_start = . ;
|
||||
*(.data.*)
|
||||
}
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(0x4) ;
|
||||
__sbss = . ;
|
||||
*(.bss*)
|
||||
. = ALIGN(0x4) ;
|
||||
__ebss = . ;
|
||||
__end = . ;
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
SECTIONS
|
||||
{
|
||||
.data : {
|
||||
_input_len = .;
|
||||
LONG(_input_data_end - _input_data) _input_data = .;
|
||||
*(.data)
|
||||
_input_data_end = .;
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
CONFIG_EXPERT=y
|
||||
# CONFIG_UID16 is not set
|
||||
# CONFIG_SYSCTL_SYSCALL is not set
|
||||
# CONFIG_KALLSYMS is not set
|
||||
# CONFIG_HOTPLUG is not set
|
||||
# CONFIG_BASE_FULL is not set
|
||||
# CONFIG_FUTEX is not set
|
||||
# CONFIG_EPOLL is not set
|
||||
# CONFIG_SIGNALFD is not set
|
||||
# CONFIG_TIMERFD is not set
|
||||
# CONFIG_EVENTFD is not set
|
||||
# CONFIG_VM_EVENT_COUNTERS is not set
|
||||
# CONFIG_COMPAT_BRK is not set
|
||||
CONFIG_SLOB=y
|
||||
# CONFIG_BLK_DEV_BSG is not set
|
||||
# CONFIG_IOSCHED_DEADLINE is not set
|
||||
# CONFIG_IOSCHED_CFQ is not set
|
||||
CONFIG_H83007=y
|
||||
CONFIG_BINFMT_FLAT=y
|
||||
CONFIG_BINFMT_ZFLAT=y
|
||||
CONFIG_BINFMT_MISC=y
|
||||
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
|
||||
CONFIG_MTD=y
|
||||
CONFIG_MTD_PARTITIONS=y
|
||||
CONFIG_MTD_REDBOOT_PARTS=y
|
||||
CONFIG_MTD_CHAR=y
|
||||
CONFIG_MTD_RAM=y
|
||||
CONFIG_MTD_ROM=y
|
||||
CONFIG_MTD_UCLINUX=y
|
||||
# CONFIG_BLK_DEV is not set
|
||||
# CONFIG_INPUT is not set
|
||||
# CONFIG_SERIO is not set
|
||||
# CONFIG_HWMON is not set
|
||||
# CONFIG_USB_SUPPORT is not set
|
||||
# CONFIG_DNOTIFY is not set
|
||||
CONFIG_ROMFS_FS=y
|
||||
# CONFIG_ENABLE_WARN_DEPRECATED is not set
|
||||
# CONFIG_ENABLE_MUST_CHECK is not set
|
||||
# CONFIG_CRC32 is not set
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
generic-y += clkdev.h
|
||||
generic-y += exec.h
|
||||
generic-y += linkage.h
|
||||
generic-y += mmu.h
|
||||
generic-y += module.h
|
||||
generic-y += trace_clock.h
|
||||
generic-y += xor.h
|
|
@ -1 +0,0 @@
|
|||
#include <generated/asm-offsets.h>
|
|
@ -1,146 +0,0 @@
|
|||
#ifndef __ARCH_H8300_ATOMIC__
|
||||
#define __ARCH_H8300_ATOMIC__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <asm/cmpxchg.h>
|
||||
|
||||
/*
|
||||
* Atomic operations that C can't guarantee us. Useful for
|
||||
* resource counting etc..
|
||||
*/
|
||||
|
||||
#define ATOMIC_INIT(i) { (i) }
|
||||
|
||||
#define atomic_read(v) (*(volatile int *)&(v)->counter)
|
||||
#define atomic_set(v, i) (((v)->counter) = i)
|
||||
|
||||
#include <linux/kernel.h>
|
||||
|
||||
static __inline__ int atomic_add_return(int i, atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
local_irq_save(flags);
|
||||
ret = v->counter += i;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_add(i, v) atomic_add_return(i, v)
|
||||
#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
|
||||
|
||||
static __inline__ int atomic_sub_return(int i, atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
local_irq_save(flags);
|
||||
ret = v->counter -= i;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_sub(i, v) atomic_sub_return(i, v)
|
||||
#define atomic_sub_and_test(i,v) (atomic_sub_return(i, v) == 0)
|
||||
|
||||
static __inline__ int atomic_inc_return(atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
local_irq_save(flags);
|
||||
v->counter++;
|
||||
ret = v->counter;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_inc(v) atomic_inc_return(v)
|
||||
|
||||
/*
|
||||
* atomic_inc_and_test - increment and test
|
||||
* @v: pointer of type atomic_t
|
||||
*
|
||||
* Atomically increments @v by 1
|
||||
* and returns true if the result is zero, or false for all
|
||||
* other cases.
|
||||
*/
|
||||
#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
|
||||
|
||||
static __inline__ int atomic_dec_return(atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
local_irq_save(flags);
|
||||
--v->counter;
|
||||
ret = v->counter;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define atomic_dec(v) atomic_dec_return(v)
|
||||
|
||||
static __inline__ int atomic_dec_and_test(atomic_t *v)
|
||||
{
|
||||
unsigned long flags;
|
||||
int ret;
|
||||
local_irq_save(flags);
|
||||
--v->counter;
|
||||
ret = v->counter;
|
||||
local_irq_restore(flags);
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
static inline int atomic_cmpxchg(atomic_t *v, int old, int new)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
ret = v->counter;
|
||||
if (likely(ret == old))
|
||||
v->counter = new;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int __atomic_add_unless(atomic_t *v, int a, int u)
|
||||
{
|
||||
int ret;
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
ret = v->counter;
|
||||
if (ret != u)
|
||||
v->counter += a;
|
||||
local_irq_restore(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *v)
|
||||
{
|
||||
__asm__ __volatile__("stc ccr,r1l\n\t"
|
||||
"orc #0x80,ccr\n\t"
|
||||
"mov.l %0,er0\n\t"
|
||||
"and.l %1,er0\n\t"
|
||||
"mov.l er0,%0\n\t"
|
||||
"ldc r1l,ccr"
|
||||
: "=m" (*v) : "g" (~(mask)) :"er0","er1");
|
||||
}
|
||||
|
||||
static __inline__ void atomic_set_mask(unsigned long mask, unsigned long *v)
|
||||
{
|
||||
__asm__ __volatile__("stc ccr,r1l\n\t"
|
||||
"orc #0x80,ccr\n\t"
|
||||
"mov.l %0,er0\n\t"
|
||||
"or.l %1,er0\n\t"
|
||||
"mov.l er0,%0\n\t"
|
||||
"ldc r1l,ccr"
|
||||
: "=m" (*v) : "g" (mask) :"er0","er1");
|
||||
}
|
||||
|
||||
/* Atomic operations are already serializing */
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
#define smp_mb__before_atomic_inc() barrier()
|
||||
#define smp_mb__after_atomic_inc() barrier()
|
||||
|
||||
#endif /* __ARCH_H8300_ATOMIC __ */
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef _H8300_BARRIER_H
|
||||
#define _H8300_BARRIER_H
|
||||
|
||||
#define nop() asm volatile ("nop"::)
|
||||
|
||||
/*
|
||||
* Force strict CPU ordering.
|
||||
* Not really required on H8...
|
||||
*/
|
||||
#define mb() asm volatile ("" : : :"memory")
|
||||
#define rmb() asm volatile ("" : : :"memory")
|
||||
#define wmb() asm volatile ("" : : :"memory")
|
||||
#define set_mb(var, value) do { xchg(&var, value); } while (0)
|
||||
|
||||
#define read_barrier_depends() do { } while (0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
#define smp_rmb() rmb()
|
||||
#define smp_wmb() wmb()
|
||||
#define smp_read_barrier_depends() read_barrier_depends()
|
||||
#else
|
||||
#define smp_mb() barrier()
|
||||
#define smp_rmb() barrier()
|
||||
#define smp_wmb() barrier()
|
||||
#define smp_read_barrier_depends() do { } while(0)
|
||||
#endif
|
||||
|
||||
#endif /* _H8300_BARRIER_H */
|
|
@ -1,211 +0,0 @@
|
|||
#ifndef _H8300_BITOPS_H
|
||||
#define _H8300_BITOPS_H
|
||||
|
||||
/*
|
||||
* Copyright 1992, Linus Torvalds.
|
||||
* Copyright 2002, Yoshinori Sato
|
||||
*/
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef _LINUX_BITOPS_H
|
||||
#error only <linux/bitops.h> can be included directly
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Function prototypes to keep gcc -Wall happy
|
||||
*/
|
||||
|
||||
/*
|
||||
* ffz = Find First Zero in word. Undefined if no zero exists,
|
||||
* so code should check against ~0UL first..
|
||||
*/
|
||||
static __inline__ unsigned long ffz(unsigned long word)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = -1;
|
||||
__asm__("1:\n\t"
|
||||
"shlr.l %2\n\t"
|
||||
"adds #1,%0\n\t"
|
||||
"bcs 1b"
|
||||
: "=r" (result)
|
||||
: "0" (result),"r" (word));
|
||||
return result;
|
||||
}
|
||||
|
||||
#define H8300_GEN_BITOP_CONST(OP,BIT) \
|
||||
case BIT: \
|
||||
__asm__(OP " #" #BIT ",@%0"::"r"(b_addr):"memory"); \
|
||||
break;
|
||||
|
||||
#define H8300_GEN_BITOP(FNAME,OP) \
|
||||
static __inline__ void FNAME(int nr, volatile unsigned long* addr) \
|
||||
{ \
|
||||
volatile unsigned char *b_addr; \
|
||||
b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \
|
||||
if (__builtin_constant_p(nr)) { \
|
||||
switch(nr & 7) { \
|
||||
H8300_GEN_BITOP_CONST(OP,0) \
|
||||
H8300_GEN_BITOP_CONST(OP,1) \
|
||||
H8300_GEN_BITOP_CONST(OP,2) \
|
||||
H8300_GEN_BITOP_CONST(OP,3) \
|
||||
H8300_GEN_BITOP_CONST(OP,4) \
|
||||
H8300_GEN_BITOP_CONST(OP,5) \
|
||||
H8300_GEN_BITOP_CONST(OP,6) \
|
||||
H8300_GEN_BITOP_CONST(OP,7) \
|
||||
} \
|
||||
} else { \
|
||||
__asm__(OP " %w0,@%1"::"r"(nr),"r"(b_addr):"memory"); \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* clear_bit() doesn't provide any barrier for the compiler.
|
||||
*/
|
||||
#define smp_mb__before_clear_bit() barrier()
|
||||
#define smp_mb__after_clear_bit() barrier()
|
||||
|
||||
H8300_GEN_BITOP(set_bit ,"bset")
|
||||
H8300_GEN_BITOP(clear_bit ,"bclr")
|
||||
H8300_GEN_BITOP(change_bit,"bnot")
|
||||
#define __set_bit(nr,addr) set_bit((nr),(addr))
|
||||
#define __clear_bit(nr,addr) clear_bit((nr),(addr))
|
||||
#define __change_bit(nr,addr) change_bit((nr),(addr))
|
||||
|
||||
#undef H8300_GEN_BITOP
|
||||
#undef H8300_GEN_BITOP_CONST
|
||||
|
||||
static __inline__ int test_bit(int nr, const unsigned long* addr)
|
||||
{
|
||||
return (*((volatile unsigned char *)addr +
|
||||
((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0;
|
||||
}
|
||||
|
||||
#define __test_bit(nr, addr) test_bit(nr, addr)
|
||||
|
||||
#define H8300_GEN_TEST_BITOP_CONST_INT(OP,BIT) \
|
||||
case BIT: \
|
||||
__asm__("stc ccr,%w1\n\t" \
|
||||
"orc #0x80,ccr\n\t" \
|
||||
"bld #" #BIT ",@%4\n\t" \
|
||||
OP " #" #BIT ",@%4\n\t" \
|
||||
"rotxl.l %0\n\t" \
|
||||
"ldc %w1,ccr" \
|
||||
: "=r"(retval),"=&r"(ccrsave),"=m"(*b_addr) \
|
||||
: "0" (retval),"r" (b_addr) \
|
||||
: "memory"); \
|
||||
break;
|
||||
|
||||
#define H8300_GEN_TEST_BITOP_CONST(OP,BIT) \
|
||||
case BIT: \
|
||||
__asm__("bld #" #BIT ",@%3\n\t" \
|
||||
OP " #" #BIT ",@%3\n\t" \
|
||||
"rotxl.l %0\n\t" \
|
||||
: "=r"(retval),"=m"(*b_addr) \
|
||||
: "0" (retval),"r" (b_addr) \
|
||||
: "memory"); \
|
||||
break;
|
||||
|
||||
#define H8300_GEN_TEST_BITOP(FNNAME,OP) \
|
||||
static __inline__ int FNNAME(int nr, volatile void * addr) \
|
||||
{ \
|
||||
int retval = 0; \
|
||||
char ccrsave; \
|
||||
volatile unsigned char *b_addr; \
|
||||
b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \
|
||||
if (__builtin_constant_p(nr)) { \
|
||||
switch(nr & 7) { \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,0) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,1) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,2) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,3) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,4) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,5) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,6) \
|
||||
H8300_GEN_TEST_BITOP_CONST_INT(OP,7) \
|
||||
} \
|
||||
} else { \
|
||||
__asm__("stc ccr,%w1\n\t" \
|
||||
"orc #0x80,ccr\n\t" \
|
||||
"btst %w5,@%4\n\t" \
|
||||
OP " %w5,@%4\n\t" \
|
||||
"beq 1f\n\t" \
|
||||
"inc.l #1,%0\n" \
|
||||
"1:\n\t" \
|
||||
"ldc %w1,ccr" \
|
||||
: "=r"(retval),"=&r"(ccrsave),"=m"(*b_addr) \
|
||||
: "0" (retval),"r" (b_addr),"r"(nr) \
|
||||
: "memory"); \
|
||||
} \
|
||||
return retval; \
|
||||
} \
|
||||
\
|
||||
static __inline__ int __ ## FNNAME(int nr, volatile void * addr) \
|
||||
{ \
|
||||
int retval = 0; \
|
||||
volatile unsigned char *b_addr; \
|
||||
b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \
|
||||
if (__builtin_constant_p(nr)) { \
|
||||
switch(nr & 7) { \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,0) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,1) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,2) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,3) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,4) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,5) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,6) \
|
||||
H8300_GEN_TEST_BITOP_CONST(OP,7) \
|
||||
} \
|
||||
} else { \
|
||||
__asm__("btst %w4,@%3\n\t" \
|
||||
OP " %w4,@%3\n\t" \
|
||||
"beq 1f\n\t" \
|
||||
"inc.l #1,%0\n" \
|
||||
"1:" \
|
||||
: "=r"(retval),"=m"(*b_addr) \
|
||||
: "0" (retval),"r" (b_addr),"r"(nr) \
|
||||
: "memory"); \
|
||||
} \
|
||||
return retval; \
|
||||
}
|
||||
|
||||
H8300_GEN_TEST_BITOP(test_and_set_bit, "bset")
|
||||
H8300_GEN_TEST_BITOP(test_and_clear_bit, "bclr")
|
||||
H8300_GEN_TEST_BITOP(test_and_change_bit,"bnot")
|
||||
#undef H8300_GEN_TEST_BITOP_CONST
|
||||
#undef H8300_GEN_TEST_BITOP_CONST_INT
|
||||
#undef H8300_GEN_TEST_BITOP
|
||||
|
||||
#include <asm-generic/bitops/ffs.h>
|
||||
|
||||
static __inline__ unsigned long __ffs(unsigned long word)
|
||||
{
|
||||
unsigned long result;
|
||||
|
||||
result = -1;
|
||||
__asm__("1:\n\t"
|
||||
"shlr.l %2\n\t"
|
||||
"adds #1,%0\n\t"
|
||||
"bcc 1b"
|
||||
: "=r" (result)
|
||||
: "0"(result),"r"(word));
|
||||
return result;
|
||||
}
|
||||
|
||||
#include <asm-generic/bitops/find.h>
|
||||
#include <asm-generic/bitops/sched.h>
|
||||
#include <asm-generic/bitops/hweight.h>
|
||||
#include <asm-generic/bitops/lock.h>
|
||||
#include <asm-generic/bitops/le.h>
|
||||
#include <asm-generic/bitops/ext2-atomic.h>
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#include <asm-generic/bitops/fls.h>
|
||||
#include <asm-generic/bitops/__fls.h>
|
||||
#include <asm-generic/bitops/fls64.h>
|
||||
|
||||
#endif /* _H8300_BITOPS_H */
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
/* Nothing for h8300 */
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef _H8300_BUG_H
|
||||
#define _H8300_BUG_H
|
||||
|
||||
/* always true */
|
||||
#define is_valid_bugaddr(addr) (1)
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
|
||||
struct pt_regs;
|
||||
extern void die(const char *str, struct pt_regs *fp, unsigned long err);
|
||||
|
||||
#endif
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* include/asm-h8300/bugs.h
|
||||
*
|
||||
* Copyright (C) 1994 Linus Torvalds
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is included by init/main.c to check for architecture-dependent bugs.
|
||||
*
|
||||
* Needs:
|
||||
* void check_bugs(void);
|
||||
*/
|
||||
|
||||
static void check_bugs(void)
|
||||
{
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef __ARCH_H8300_CACHE_H
|
||||
#define __ARCH_H8300_CACHE_H
|
||||
|
||||
/* bytes per L1 cache line */
|
||||
#define L1_CACHE_SHIFT 2
|
||||
#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
|
||||
|
||||
/* m68k-elf-gcc 2.95.2 doesn't like these */
|
||||
|
||||
#define __cacheline_aligned
|
||||
#define ____cacheline_aligned
|
||||
|
||||
#endif
|
|
@ -1,14 +0,0 @@
|
|||
#ifndef _H8300_CACHECTL_H
|
||||
#define _H8300_CACHECTL_H
|
||||
|
||||
/* Definitions for the cacheflush system call. */
|
||||
|
||||
#define FLUSH_SCOPE_LINE 0 /* Flush a cache line */
|
||||
#define FLUSH_SCOPE_PAGE 0 /* Flush a page */
|
||||
#define FLUSH_SCOPE_ALL 0 /* Flush the whole cache -- superuser only */
|
||||
|
||||
#define FLUSH_CACHE_DATA 0 /* Writeback and flush data cache */
|
||||
#define FLUSH_CACHE_INSN 0 /* Flush instruction cache */
|
||||
#define FLUSH_CACHE_BOTH 0 /* Flush both caches */
|
||||
|
||||
#endif /* _H8300_CACHECTL_H */
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* (C) Copyright 2002, Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
*/
|
||||
|
||||
#ifndef _ASM_H8300_CACHEFLUSH_H
|
||||
#define _ASM_H8300_CACHEFLUSH_H
|
||||
|
||||
/*
|
||||
* Cache handling functions
|
||||
* No Cache memory all dummy functions
|
||||
*/
|
||||
|
||||
#define flush_cache_all()
|
||||
#define flush_cache_mm(mm)
|
||||
#define flush_cache_dup_mm(mm) do { } while (0)
|
||||
#define flush_cache_range(vma,a,b)
|
||||
#define flush_cache_page(vma,p,pfn)
|
||||
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
|
||||
#define flush_dcache_page(page)
|
||||
#define flush_dcache_mmap_lock(mapping)
|
||||
#define flush_dcache_mmap_unlock(mapping)
|
||||
#define flush_icache()
|
||||
#define flush_icache_page(vma,page)
|
||||
#define flush_icache_range(start,len)
|
||||
#define flush_cache_vmap(start, end)
|
||||
#define flush_cache_vunmap(start, end)
|
||||
#define cache_push_v(vaddr,len)
|
||||
#define cache_push(paddr,len)
|
||||
#define cache_clear(paddr,len)
|
||||
|
||||
#define flush_dcache_range(a,b)
|
||||
|
||||
#define flush_icache_user_range(vma,page,addr,len)
|
||||
|
||||
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
memcpy(dst, src, len)
|
||||
|
||||
#endif /* _ASM_H8300_CACHEFLUSH_H */
|
|
@ -1,102 +0,0 @@
|
|||
#ifndef _H8300_CHECKSUM_H
|
||||
#define _H8300_CHECKSUM_H
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
* checksums
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
|
||||
/*
|
||||
* the same as csum_partial_copy, but copies from user space.
|
||||
*
|
||||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *csum_err);
|
||||
|
||||
__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__("mov.l %0,er0\n\t"
|
||||
"add.w e0,r0\n\t"
|
||||
"xor.w e0,e0\n\t"
|
||||
"rotxl.w e0\n\t"
|
||||
"add.w e0,r0\n\t"
|
||||
"sub.w e0,e0\n\t"
|
||||
"mov.l er0,%0"
|
||||
: "=r"(sum)
|
||||
: "0"(sum)
|
||||
: "er0");
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__ ("sub.l er0,er0\n\t"
|
||||
"add.l %2,%0\n\t"
|
||||
"addx #0,r0l\n\t"
|
||||
"add.l %3,%0\n\t"
|
||||
"addx #0,r0l\n\t"
|
||||
"add.l %4,%0\n\t"
|
||||
"addx #0,r0l\n\t"
|
||||
"add.l er0,%0\n\t"
|
||||
"bcc 1f\n\t"
|
||||
"inc.l #1,%0\n"
|
||||
"1:"
|
||||
: "=&r" (sum)
|
||||
: "0" (sum), "r" (daddr), "r" (saddr), "r" (len + proto)
|
||||
:"er0");
|
||||
return sum;
|
||||
}
|
||||
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
||||
/*
|
||||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#endif /* _H8300_CHECKSUM_H */
|
|
@ -1,60 +0,0 @@
|
|||
#ifndef __ARCH_H8300_CMPXCHG__
|
||||
#define __ARCH_H8300_CMPXCHG__
|
||||
|
||||
#include <linux/irqflags.h>
|
||||
|
||||
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
|
||||
|
||||
struct __xchg_dummy { unsigned long a[100]; };
|
||||
#define __xg(x) ((volatile struct __xchg_dummy *)(x))
|
||||
|
||||
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
|
||||
{
|
||||
unsigned long tmp, flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
switch (size) {
|
||||
case 1:
|
||||
__asm__ __volatile__
|
||||
("mov.b %2,%0\n\t"
|
||||
"mov.b %1,%2"
|
||||
: "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
||||
break;
|
||||
case 2:
|
||||
__asm__ __volatile__
|
||||
("mov.w %2,%0\n\t"
|
||||
"mov.w %1,%2"
|
||||
: "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
||||
break;
|
||||
case 4:
|
||||
__asm__ __volatile__
|
||||
("mov.l %2,%0\n\t"
|
||||
"mov.l %1,%2"
|
||||
: "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory");
|
||||
break;
|
||||
default:
|
||||
tmp = 0;
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
#include <asm-generic/cmpxchg-local.h>
|
||||
|
||||
/*
|
||||
* cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
|
||||
* them available.
|
||||
*/
|
||||
#define cmpxchg_local(ptr, o, n) \
|
||||
((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
|
||||
(unsigned long)(n), sizeof(*(ptr))))
|
||||
#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
|
||||
|
||||
#ifndef CONFIG_SMP
|
||||
#include <asm-generic/cmpxchg.h>
|
||||
#endif
|
||||
|
||||
#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
|
||||
|
||||
#endif /* __ARCH_H8300_CMPXCHG__ */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __H8300_CPUTIME_H
|
||||
#define __H8300_CPUTIME_H
|
||||
|
||||
#include <asm-generic/cputime.h>
|
||||
|
||||
#endif /* __H8300_CPUTIME_H */
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef _H8300_CURRENT_H
|
||||
#define _H8300_CURRENT_H
|
||||
/*
|
||||
* current.h
|
||||
* (C) Copyright 2000, Lineo, David McCullough <davidm@lineo.com>
|
||||
* (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
|
||||
*
|
||||
* rather than dedicate a register (as the m68k source does), we
|
||||
* just keep a global, we should probably just change it all to be
|
||||
* current and lose _current_task.
|
||||
*/
|
||||
|
||||
#include <linux/thread_info.h>
|
||||
#include <asm/thread_info.h>
|
||||
|
||||
struct task_struct;
|
||||
|
||||
static inline struct task_struct *get_current(void)
|
||||
{
|
||||
return(current_thread_info()->task);
|
||||
}
|
||||
|
||||
#define current get_current()
|
||||
|
||||
#endif /* _H8300_CURRENT_H */
|
|
@ -1,2 +0,0 @@
|
|||
#define DEBUG 1
|
||||
#define BREAK asm volatile ("trap #3")
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef _H8300_DELAY_H
|
||||
#define _H8300_DELAY_H
|
||||
|
||||
#include <asm/param.h>
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Yoshinori Sato <ysato@sourceforge.jp>
|
||||
*
|
||||
* Delay routines, using a pre-computed "loops_per_second" value.
|
||||
*/
|
||||
|
||||
static inline void __delay(unsigned long loops)
|
||||
{
|
||||
__asm__ __volatile__ ("1:\n\t"
|
||||
"dec.l #1,%0\n\t"
|
||||
"bne 1b"
|
||||
:"=r" (loops):"0"(loops));
|
||||
}
|
||||
|
||||
/*
|
||||
* Use only for very small delays ( < 1 msec). Should probably use a
|
||||
* lookup table, really, as the multiplications take much too long with
|
||||
* short delays. This is a "reasonable" implementation, though (and the
|
||||
* first constant multiplications gets optimized away if the delay is
|
||||
* a constant)
|
||||
*/
|
||||
|
||||
extern unsigned long loops_per_jiffy;
|
||||
|
||||
static inline void udelay(unsigned long usecs)
|
||||
{
|
||||
usecs *= 4295; /* 2**32 / 1000000 */
|
||||
usecs /= (loops_per_jiffy*HZ);
|
||||
if (usecs)
|
||||
__delay(usecs);
|
||||
}
|
||||
|
||||
#endif /* _H8300_DELAY_H */
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/div64.h>
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef _H8300_DMA_H
|
||||
#define _H8300_DMA_H
|
||||
|
||||
|
||||
/*
|
||||
* Set number of channels of DMA on ColdFire for different implementations.
|
||||
*/
|
||||
#define MAX_DMA_CHANNELS 0
|
||||
#define MAX_DMA_ADDRESS PAGE_OFFSET
|
||||
|
||||
/* These are in kernel/dma.c: */
|
||||
extern int request_dma(unsigned int dmanr, const char *device_id); /* reserve a DMA channel */
|
||||
extern void free_dma(unsigned int dmanr); /* release it again */
|
||||
|
||||
#endif /* _H8300_DMA_H */
|
|
@ -1,101 +0,0 @@
|
|||
#ifndef __ASMH8300_ELF_H
|
||||
#define __ASMH8300_ELF_H
|
||||
|
||||
/*
|
||||
* ELF register definitions..
|
||||
*/
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/user.h>
|
||||
|
||||
typedef unsigned long elf_greg_t;
|
||||
|
||||
#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
|
||||
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
|
||||
typedef unsigned long elf_fpregset_t;
|
||||
|
||||
/*
|
||||
* This is used to ensure we don't load something for the wrong architecture.
|
||||
*/
|
||||
#define elf_check_arch(x) ((x)->e_machine == EM_H8_300)
|
||||
|
||||
/*
|
||||
* These are used to set parameters in the core dumps.
|
||||
*/
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_DATA ELFDATA2MSB
|
||||
#define ELF_ARCH EM_H8_300
|
||||
#if defined(__H8300H__)
|
||||
#define ELF_CORE_EFLAGS 0x810000
|
||||
#endif
|
||||
#if defined(__H8300S__)
|
||||
#define ELF_CORE_EFLAGS 0x820000
|
||||
#endif
|
||||
|
||||
#define ELF_PLAT_INIT(_r) _r->er1 = 0
|
||||
|
||||
#define ELF_EXEC_PAGESIZE 4096
|
||||
|
||||
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
|
||||
use of this is to invoke "./ld.so someprog" to test out a new version of
|
||||
the loader. We need to make sure that it is out of the way of the program
|
||||
that it will "exec", and that there is sufficient room for the brk. */
|
||||
|
||||
#define ELF_ET_DYN_BASE 0xD0000000UL
|
||||
|
||||
/* This yields a mask that user programs can use to figure out what
|
||||
instruction set this cpu supports. */
|
||||
|
||||
#define ELF_HWCAP (0)
|
||||
|
||||
/* This yields a string that ld.so will use to load implementation
|
||||
specific libraries for optimization. This is more specific in
|
||||
intent than poking at uname or /proc/cpuinfo. */
|
||||
|
||||
#define ELF_PLATFORM (NULL)
|
||||
|
||||
#define R_H8_NONE 0
|
||||
#define R_H8_DIR32 1
|
||||
#define R_H8_DIR32_28 2
|
||||
#define R_H8_DIR32_24 3
|
||||
#define R_H8_DIR32_16 4
|
||||
#define R_H8_DIR32U 6
|
||||
#define R_H8_DIR32U_28 7
|
||||
#define R_H8_DIR32U_24 8
|
||||
#define R_H8_DIR32U_20 9
|
||||
#define R_H8_DIR32U_16 10
|
||||
#define R_H8_DIR24 11
|
||||
#define R_H8_DIR24_20 12
|
||||
#define R_H8_DIR24_16 13
|
||||
#define R_H8_DIR24U 14
|
||||
#define R_H8_DIR24U_20 15
|
||||
#define R_H8_DIR24U_16 16
|
||||
#define R_H8_DIR16 17
|
||||
#define R_H8_DIR16U 18
|
||||
#define R_H8_DIR16S_32 19
|
||||
#define R_H8_DIR16S_28 20
|
||||
#define R_H8_DIR16S_24 21
|
||||
#define R_H8_DIR16S_20 22
|
||||
#define R_H8_DIR16S 23
|
||||
#define R_H8_DIR8 24
|
||||
#define R_H8_DIR8U 25
|
||||
#define R_H8_DIR8Z_32 26
|
||||
#define R_H8_DIR8Z_28 27
|
||||
#define R_H8_DIR8Z_24 28
|
||||
#define R_H8_DIR8Z_20 29
|
||||
#define R_H8_DIR8Z_16 30
|
||||
#define R_H8_PCREL16 31
|
||||
#define R_H8_PCREL8 32
|
||||
#define R_H8_BPOS 33
|
||||
#define R_H8_PCREL32 34
|
||||
#define R_H8_GOT32O 35
|
||||
#define R_H8_GOT16O 36
|
||||
#define R_H8_DIR16A8 59
|
||||
#define R_H8_DIR16R8 60
|
||||
#define R_H8_DIR24A8 61
|
||||
#define R_H8_DIR24R8 62
|
||||
#define R_H8_DIR32A16 63
|
||||
#define R_H8_ABS32 65
|
||||
#define R_H8_ABS32A16 127
|
||||
|
||||
#endif
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _ASM_EMERGENCY_RESTART_H
|
||||
#define _ASM_EMERGENCY_RESTART_H
|
||||
|
||||
#include <asm-generic/emergency-restart.h>
|
||||
|
||||
#endif /* _ASM_EMERGENCY_RESTART_H */
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef _ASM_FB_H_
|
||||
#define _ASM_FB_H_
|
||||
#include <linux/fb.h>
|
||||
|
||||
#define fb_pgprotect(...) do {} while (0)
|
||||
|
||||
static inline int fb_is_primary_device(struct fb_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* _ASM_FB_H_ */
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* include/asm-h8300/flat.h -- uClinux flat-format executables
|
||||
*/
|
||||
|
||||
#ifndef __H8300_FLAT_H__
|
||||
#define __H8300_FLAT_H__
|
||||
|
||||
#define flat_argvp_envp_on_stack() 1
|
||||
#define flat_old_ram_flag(flags) 1
|
||||
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
|
||||
#define flat_set_persistent(relval, p) 0
|
||||
|
||||
/*
|
||||
* on the H8 a couple of the relocations have an instruction in the
|
||||
* top byte. As there can only be 24bits of address space, we just
|
||||
* always preserve that 8bits at the top, when it isn't an instruction
|
||||
* is is 0 (davidm@snapgear.com)
|
||||
*/
|
||||
|
||||
#define flat_get_relocate_addr(rel) (rel)
|
||||
#define flat_get_addr_from_rp(rp, relval, flags, persistent) \
|
||||
(get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff))
|
||||
#define flat_put_addr_at_rp(rp, addr, rel) \
|
||||
put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp)
|
||||
|
||||
#endif /* __H8300_FLAT_H__ */
|
|
@ -1 +0,0 @@
|
|||
/* Nothing do */
|
|
@ -1 +0,0 @@
|
|||
/* empty */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _ASM_FUTEX_H
|
||||
#define _ASM_FUTEX_H
|
||||
|
||||
#include <asm-generic/futex.h>
|
||||
|
||||
#endif
|
|
@ -1,52 +0,0 @@
|
|||
#ifndef _H8300_GPIO_H
|
||||
#define _H8300_GPIO_H
|
||||
|
||||
#define H8300_GPIO_P1 0
|
||||
#define H8300_GPIO_P2 1
|
||||
#define H8300_GPIO_P3 2
|
||||
#define H8300_GPIO_P4 3
|
||||
#define H8300_GPIO_P5 4
|
||||
#define H8300_GPIO_P6 5
|
||||
#define H8300_GPIO_P7 6
|
||||
#define H8300_GPIO_P8 7
|
||||
#define H8300_GPIO_P9 8
|
||||
#define H8300_GPIO_PA 9
|
||||
#define H8300_GPIO_PB 10
|
||||
#define H8300_GPIO_PC 11
|
||||
#define H8300_GPIO_PD 12
|
||||
#define H8300_GPIO_PE 13
|
||||
#define H8300_GPIO_PF 14
|
||||
#define H8300_GPIO_PG 15
|
||||
#define H8300_GPIO_PH 16
|
||||
|
||||
#define H8300_GPIO_B7 0x80
|
||||
#define H8300_GPIO_B6 0x40
|
||||
#define H8300_GPIO_B5 0x20
|
||||
#define H8300_GPIO_B4 0x10
|
||||
#define H8300_GPIO_B3 0x08
|
||||
#define H8300_GPIO_B2 0x04
|
||||
#define H8300_GPIO_B1 0x02
|
||||
#define H8300_GPIO_B0 0x01
|
||||
|
||||
#define H8300_GPIO_INPUT 0
|
||||
#define H8300_GPIO_OUTPUT 1
|
||||
|
||||
#define H8300_GPIO_RESERVE(port, bits) \
|
||||
h8300_reserved_gpio(port, bits)
|
||||
|
||||
#define H8300_GPIO_FREE(port, bits) \
|
||||
h8300_free_gpio(port, bits)
|
||||
|
||||
#define H8300_GPIO_DDR(port, bit, dir) \
|
||||
h8300_set_gpio_dir(((port) << 8) | (bit), dir)
|
||||
|
||||
#define H8300_GPIO_GETDIR(port, bit) \
|
||||
h8300_get_gpio_dir(((port) << 8) | (bit))
|
||||
|
||||
extern int h8300_reserved_gpio(int port, int bits);
|
||||
extern int h8300_free_gpio(int port, int bits);
|
||||
extern int h8300_set_gpio_dir(int port_bit, int dir);
|
||||
extern int h8300_get_gpio_dir(int port_bit);
|
||||
extern int h8300_init_gpio(void);
|
||||
|
||||
#endif
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __H8300_HARDIRQ_H
|
||||
#define __H8300_HARDIRQ_H
|
||||
|
||||
#include <asm/irq.h>
|
||||
|
||||
#define HARDIRQ_BITS 8
|
||||
|
||||
/*
|
||||
* The hardirq mask has to be large enough to have
|
||||
* space for potentially all IRQ sources in the system
|
||||
* nesting on a single CPU:
|
||||
*/
|
||||
#if (1 << HARDIRQ_BITS) < NR_IRQS
|
||||
# error HARDIRQ_BITS is too low!
|
||||
#endif
|
||||
|
||||
#include <asm-generic/hardirq.h>
|
||||
|
||||
#endif
|
|
@ -1 +0,0 @@
|
|||
/* Do Nothing */
|
|
@ -1,358 +0,0 @@
|
|||
#ifndef _H8300_IO_H
|
||||
#define _H8300_IO_H
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/virtconvert.h>
|
||||
|
||||
#if defined(CONFIG_H83007) || defined(CONFIG_H83068)
|
||||
#include <asm/regs306x.h>
|
||||
#elif defined(CONFIG_H8S2678)
|
||||
#include <asm/regs267x.h>
|
||||
#else
|
||||
#error UNKNOWN CPU TYPE
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* These are for ISA/PCI shared memory _only_ and should never be used
|
||||
* on any other type of memory, including Zorro memory. They are meant to
|
||||
* access the bus in the bus byte order which is little-endian!.
|
||||
*
|
||||
* readX/writeX() are used to access memory mapped devices. On some
|
||||
* architectures the memory mapped IO stuff needs to be accessed
|
||||
* differently. On the m68k architecture, we just read/write the
|
||||
* memory location directly.
|
||||
*/
|
||||
/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
|
||||
* two accesses to memory, which may be undesirable for some devices.
|
||||
*/
|
||||
|
||||
/*
|
||||
* swap functions are sometimes needed to interface little-endian hardware
|
||||
*/
|
||||
|
||||
static inline unsigned short _swapw(volatile unsigned short v)
|
||||
{
|
||||
#ifndef H8300_IO_NOSWAP
|
||||
unsigned short r;
|
||||
__asm__("xor.b %w0,%x0\n\t"
|
||||
"xor.b %x0,%w0\n\t"
|
||||
"xor.b %w0,%x0"
|
||||
:"=r"(r)
|
||||
:"0"(v));
|
||||
return r;
|
||||
#else
|
||||
return v;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned long _swapl(volatile unsigned long v)
|
||||
{
|
||||
#ifndef H8300_IO_NOSWAP
|
||||
unsigned long r;
|
||||
__asm__("xor.b %w0,%x0\n\t"
|
||||
"xor.b %x0,%w0\n\t"
|
||||
"xor.b %w0,%x0\n\t"
|
||||
"xor.w %e0,%f0\n\t"
|
||||
"xor.w %f0,%e0\n\t"
|
||||
"xor.w %e0,%f0\n\t"
|
||||
"xor.b %w0,%x0\n\t"
|
||||
"xor.b %x0,%w0\n\t"
|
||||
"xor.b %w0,%x0"
|
||||
:"=r"(r)
|
||||
:"0"(v));
|
||||
return r;
|
||||
#else
|
||||
return v;
|
||||
#endif
|
||||
}
|
||||
|
||||
#define readb(addr) \
|
||||
({ unsigned char __v = \
|
||||
*(volatile unsigned char *)((unsigned long)(addr) & 0x00ffffff); \
|
||||
__v; })
|
||||
#define readw(addr) \
|
||||
({ unsigned short __v = \
|
||||
*(volatile unsigned short *)((unsigned long)(addr) & 0x00ffffff); \
|
||||
__v; })
|
||||
#define readl(addr) \
|
||||
({ unsigned long __v = \
|
||||
*(volatile unsigned long *)((unsigned long)(addr) & 0x00ffffff); \
|
||||
__v; })
|
||||
|
||||
#define writeb(b,addr) (void)((*(volatile unsigned char *) \
|
||||
((unsigned long)(addr) & 0x00ffffff)) = (b))
|
||||
#define writew(b,addr) (void)((*(volatile unsigned short *) \
|
||||
((unsigned long)(addr) & 0x00ffffff)) = (b))
|
||||
#define writel(b,addr) (void)((*(volatile unsigned long *) \
|
||||
((unsigned long)(addr) & 0x00ffffff)) = (b))
|
||||
#define readb_relaxed(addr) readb(addr)
|
||||
#define readw_relaxed(addr) readw(addr)
|
||||
#define readl_relaxed(addr) readl(addr)
|
||||
|
||||
#define __raw_readb readb
|
||||
#define __raw_readw readw
|
||||
#define __raw_readl readl
|
||||
#define __raw_writeb writeb
|
||||
#define __raw_writew writew
|
||||
#define __raw_writel writel
|
||||
|
||||
static inline int h8300_buswidth(unsigned int addr)
|
||||
{
|
||||
return (*(volatile unsigned char *)ABWCR & (1 << ((addr >> 21) & 7))) == 0;
|
||||
}
|
||||
|
||||
static inline void io_outsb(unsigned int addr, const void *buf, int len)
|
||||
{
|
||||
volatile unsigned char *ap_b = (volatile unsigned char *) addr;
|
||||
volatile unsigned short *ap_w = (volatile unsigned short *) addr;
|
||||
unsigned char *bp = (unsigned char *) buf;
|
||||
|
||||
if(h8300_buswidth(addr) && (addr & 1)) {
|
||||
while (len--)
|
||||
*ap_w = *bp++;
|
||||
} else {
|
||||
while (len--)
|
||||
*ap_b = *bp++;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void io_outsw(unsigned int addr, const void *buf, int len)
|
||||
{
|
||||
volatile unsigned short *ap = (volatile unsigned short *) addr;
|
||||
unsigned short *bp = (unsigned short *) buf;
|
||||
while (len--)
|
||||
*ap = _swapw(*bp++);
|
||||
}
|
||||
|
||||
static inline void io_outsl(unsigned int addr, const void *buf, int len)
|
||||
{
|
||||
volatile unsigned long *ap = (volatile unsigned long *) addr;
|
||||
unsigned long *bp = (unsigned long *) buf;
|
||||
while (len--)
|
||||
*ap = _swapl(*bp++);
|
||||
}
|
||||
|
||||
static inline void io_outsw_noswap(unsigned int addr, const void *buf, int len)
|
||||
{
|
||||
volatile unsigned short *ap = (volatile unsigned short *) addr;
|
||||
unsigned short *bp = (unsigned short *) buf;
|
||||
while (len--)
|
||||
*ap = *bp++;
|
||||
}
|
||||
|
||||
static inline void io_outsl_noswap(unsigned int addr, const void *buf, int len)
|
||||
{
|
||||
volatile unsigned long *ap = (volatile unsigned long *) addr;
|
||||
unsigned long *bp = (unsigned long *) buf;
|
||||
while (len--)
|
||||
*ap = *bp++;
|
||||
}
|
||||
|
||||
static inline void io_insb(unsigned int addr, void *buf, int len)
|
||||
{
|
||||
volatile unsigned char *ap_b;
|
||||
volatile unsigned short *ap_w;
|
||||
unsigned char *bp = (unsigned char *) buf;
|
||||
|
||||
if(h8300_buswidth(addr)) {
|
||||
ap_w = (volatile unsigned short *)(addr & ~1);
|
||||
while (len--)
|
||||
*bp++ = *ap_w & 0xff;
|
||||
} else {
|
||||
ap_b = (volatile unsigned char *)addr;
|
||||
while (len--)
|
||||
*bp++ = *ap_b;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void io_insw(unsigned int addr, void *buf, int len)
|
||||
{
|
||||
volatile unsigned short *ap = (volatile unsigned short *) addr;
|
||||
unsigned short *bp = (unsigned short *) buf;
|
||||
while (len--)
|
||||
*bp++ = _swapw(*ap);
|
||||
}
|
||||
|
||||
static inline void io_insl(unsigned int addr, void *buf, int len)
|
||||
{
|
||||
volatile unsigned long *ap = (volatile unsigned long *) addr;
|
||||
unsigned long *bp = (unsigned long *) buf;
|
||||
while (len--)
|
||||
*bp++ = _swapl(*ap);
|
||||
}
|
||||
|
||||
static inline void io_insw_noswap(unsigned int addr, void *buf, int len)
|
||||
{
|
||||
volatile unsigned short *ap = (volatile unsigned short *) addr;
|
||||
unsigned short *bp = (unsigned short *) buf;
|
||||
while (len--)
|
||||
*bp++ = *ap;
|
||||
}
|
||||
|
||||
static inline void io_insl_noswap(unsigned int addr, void *buf, int len)
|
||||
{
|
||||
volatile unsigned long *ap = (volatile unsigned long *) addr;
|
||||
unsigned long *bp = (unsigned long *) buf;
|
||||
while (len--)
|
||||
*bp++ = *ap;
|
||||
}
|
||||
|
||||
/*
|
||||
* make the short names macros so specific devices
|
||||
* can override them as required
|
||||
*/
|
||||
|
||||
#define memset_io(a,b,c) memset((void *)(a),(b),(c))
|
||||
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
|
||||
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
|
||||
|
||||
#define mmiowb()
|
||||
|
||||
#define inb(addr) ((h8300_buswidth(addr))?readw((addr) & ~1) & 0xff:readb(addr))
|
||||
#define inw(addr) _swapw(readw(addr))
|
||||
#define inl(addr) _swapl(readl(addr))
|
||||
#define outb(x,addr) ((void)((h8300_buswidth(addr) && \
|
||||
((addr) & 1))?writew(x,(addr) & ~1):writeb(x,addr)))
|
||||
#define outw(x,addr) ((void) writew(_swapw(x),addr))
|
||||
#define outl(x,addr) ((void) writel(_swapl(x),addr))
|
||||
|
||||
#define inb_p(addr) inb(addr)
|
||||
#define inw_p(addr) inw(addr)
|
||||
#define inl_p(addr) inl(addr)
|
||||
#define outb_p(x,addr) outb(x,addr)
|
||||
#define outw_p(x,addr) outw(x,addr)
|
||||
#define outl_p(x,addr) outl(x,addr)
|
||||
|
||||
#define outsb(a,b,l) io_outsb(a,b,l)
|
||||
#define outsw(a,b,l) io_outsw(a,b,l)
|
||||
#define outsl(a,b,l) io_outsl(a,b,l)
|
||||
|
||||
#define insb(a,b,l) io_insb(a,b,l)
|
||||
#define insw(a,b,l) io_insw(a,b,l)
|
||||
#define insl(a,b,l) io_insl(a,b,l)
|
||||
|
||||
#define IO_SPACE_LIMIT 0xffffff
|
||||
|
||||
|
||||
/* Values for nocacheflag and cmode */
|
||||
#define IOMAP_FULL_CACHING 0
|
||||
#define IOMAP_NOCACHE_SER 1
|
||||
#define IOMAP_NOCACHE_NONSER 2
|
||||
#define IOMAP_WRITETHROUGH 3
|
||||
|
||||
extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag);
|
||||
extern void __iounmap(void *addr, unsigned long size);
|
||||
|
||||
static inline void *ioremap(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
|
||||
}
|
||||
static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
|
||||
}
|
||||
static inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_WRITETHROUGH);
|
||||
}
|
||||
static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_FULL_CACHING);
|
||||
}
|
||||
|
||||
extern void iounmap(void *addr);
|
||||
|
||||
/* H8/300 internal I/O functions */
|
||||
static __inline__ unsigned char ctrl_inb(unsigned long addr)
|
||||
{
|
||||
return *(volatile unsigned char*)addr;
|
||||
}
|
||||
|
||||
static __inline__ unsigned short ctrl_inw(unsigned long addr)
|
||||
{
|
||||
return *(volatile unsigned short*)addr;
|
||||
}
|
||||
|
||||
static __inline__ unsigned long ctrl_inl(unsigned long addr)
|
||||
{
|
||||
return *(volatile unsigned long*)addr;
|
||||
}
|
||||
|
||||
static __inline__ void ctrl_outb(unsigned char b, unsigned long addr)
|
||||
{
|
||||
*(volatile unsigned char*)addr = b;
|
||||
}
|
||||
|
||||
static __inline__ void ctrl_outw(unsigned short b, unsigned long addr)
|
||||
{
|
||||
*(volatile unsigned short*)addr = b;
|
||||
}
|
||||
|
||||
static __inline__ void ctrl_outl(unsigned long b, unsigned long addr)
|
||||
{
|
||||
*(volatile unsigned long*)addr = b;
|
||||
}
|
||||
|
||||
static __inline__ void ctrl_bclr(int b, unsigned long addr)
|
||||
{
|
||||
if (__builtin_constant_p(b))
|
||||
switch (b) {
|
||||
case 0: __asm__("bclr #0,@%0"::"r"(addr)); break;
|
||||
case 1: __asm__("bclr #1,@%0"::"r"(addr)); break;
|
||||
case 2: __asm__("bclr #2,@%0"::"r"(addr)); break;
|
||||
case 3: __asm__("bclr #3,@%0"::"r"(addr)); break;
|
||||
case 4: __asm__("bclr #4,@%0"::"r"(addr)); break;
|
||||
case 5: __asm__("bclr #5,@%0"::"r"(addr)); break;
|
||||
case 6: __asm__("bclr #6,@%0"::"r"(addr)); break;
|
||||
case 7: __asm__("bclr #7,@%0"::"r"(addr)); break;
|
||||
}
|
||||
else
|
||||
__asm__("bclr %w0,@%1"::"r"(b), "r"(addr));
|
||||
}
|
||||
|
||||
static __inline__ void ctrl_bset(int b, unsigned long addr)
|
||||
{
|
||||
if (__builtin_constant_p(b))
|
||||
switch (b) {
|
||||
case 0: __asm__("bset #0,@%0"::"r"(addr)); break;
|
||||
case 1: __asm__("bset #1,@%0"::"r"(addr)); break;
|
||||
case 2: __asm__("bset #2,@%0"::"r"(addr)); break;
|
||||
case 3: __asm__("bset #3,@%0"::"r"(addr)); break;
|
||||
case 4: __asm__("bset #4,@%0"::"r"(addr)); break;
|
||||
case 5: __asm__("bset #5,@%0"::"r"(addr)); break;
|
||||
case 6: __asm__("bset #6,@%0"::"r"(addr)); break;
|
||||
case 7: __asm__("bset #7,@%0"::"r"(addr)); break;
|
||||
}
|
||||
else
|
||||
__asm__("bset %w0,@%1"::"r"(b), "r"(addr));
|
||||
}
|
||||
|
||||
/* Pages to physical address... */
|
||||
#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
|
||||
#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
|
||||
|
||||
/*
|
||||
* Macros used for converting between virtual and physical mappings.
|
||||
*/
|
||||
#define phys_to_virt(vaddr) ((void *) (vaddr))
|
||||
#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
|
||||
|
||||
#define virt_to_bus virt_to_phys
|
||||
#define bus_to_virt phys_to_virt
|
||||
|
||||
/*
|
||||
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
||||
* access
|
||||
*/
|
||||
#define xlate_dev_mem_ptr(p) __va(p)
|
||||
|
||||
/*
|
||||
* Convert a virtual cached pointer to an uncached pointer
|
||||
*/
|
||||
#define xlate_dev_kmem_ptr(p) p
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _H8300_IO_H */
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef _H8300_IRQ_H_
|
||||
#define _H8300_IRQ_H_
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
#if defined(CONFIG_CPU_H8300H)
|
||||
#define NR_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 EXT_IRQS 5
|
||||
#define IER_REGS *(volatile unsigned char *)IER
|
||||
#endif
|
||||
#if defined(CONFIG_CPU_H8S)
|
||||
#define NR_IRQS 128
|
||||
#define EXT_IRQ0 16
|
||||
#define EXT_IRQ1 17
|
||||
#define EXT_IRQ2 18
|
||||
#define EXT_IRQ3 19
|
||||
#define EXT_IRQ4 20
|
||||
#define EXT_IRQ5 21
|
||||
#define EXT_IRQ6 22
|
||||
#define EXT_IRQ7 23
|
||||
#define EXT_IRQ8 24
|
||||
#define EXT_IRQ9 25
|
||||
#define EXT_IRQ10 26
|
||||
#define EXT_IRQ11 27
|
||||
#define EXT_IRQ12 28
|
||||
#define EXT_IRQ13 29
|
||||
#define EXT_IRQ14 30
|
||||
#define EXT_IRQ15 31
|
||||
#define EXT_IRQS 15
|
||||
|
||||
#define IER_REGS *(volatile unsigned short *)IER
|
||||
#endif
|
||||
|
||||
static __inline__ int irq_canonicalize(int irq)
|
||||
{
|
||||
return irq;
|
||||
}
|
||||
|
||||
typedef void (*h8300_vector)(void);
|
||||
|
||||
#endif /* _H8300_IRQ_H_ */
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/irq_regs.h>
|
|
@ -1,43 +0,0 @@
|
|||
#ifndef _H8300_IRQFLAGS_H
|
||||
#define _H8300_IRQFLAGS_H
|
||||
|
||||
static inline unsigned long arch_local_save_flags(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
asm volatile ("stc ccr,%w0" : "=r" (flags));
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_disable(void)
|
||||
{
|
||||
asm volatile ("orc #0x80,ccr" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_enable(void)
|
||||
{
|
||||
asm volatile ("andc #0x7f,ccr" : : : "memory");
|
||||
}
|
||||
|
||||
static inline unsigned long arch_local_irq_save(void)
|
||||
{
|
||||
unsigned long flags = arch_local_save_flags();
|
||||
arch_local_irq_disable();
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
asm volatile ("ldc %w0,ccr" : : "r" (flags) : "memory");
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled_flags(unsigned long flags)
|
||||
{
|
||||
return (flags & 0x80) == 0x80;
|
||||
}
|
||||
|
||||
static inline bool arch_irqs_disabled(void)
|
||||
{
|
||||
return arch_irqs_disabled_flags(arch_local_save_flags());
|
||||
}
|
||||
|
||||
#endif /* _H8300_IRQFLAGS_H */
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/kdebug.h>
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _ASM_H8300_KMAP_TYPES_H
|
||||
#define _ASM_H8300_KMAP_TYPES_H
|
||||
|
||||
#include <asm-generic/kmap_types.h>
|
||||
|
||||
#endif
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_LOCAL_H_
|
||||
#define _H8300_LOCAL_H_
|
||||
|
||||
#include <asm-generic/local.h>
|
||||
|
||||
#endif
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/local64.h>
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
* Machine dependent access functions for RTC registers.
|
||||
*/
|
||||
#ifndef _H8300_MC146818RTC_H
|
||||
#define _H8300_MC146818RTC_H
|
||||
|
||||
/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
|
||||
|
||||
#endif /* _H8300_MC146818RTC_H */
|
|
@ -1,32 +0,0 @@
|
|||
#ifndef __H8300_MMU_CONTEXT_H
|
||||
#define __H8300_MMU_CONTEXT_H
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgalloc.h>
|
||||
#include <asm-generic/mm_hooks.h>
|
||||
|
||||
static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int
|
||||
init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
||||
{
|
||||
// mm->context = virt_to_phys(mm->pgd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
#define destroy_context(mm) do { } while(0)
|
||||
#define deactivate_mm(tsk,mm) do { } while(0)
|
||||
|
||||
static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void activate_mm(struct mm_struct *prev_mm,
|
||||
struct mm_struct *next_mm)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
* Pull in the generic implementation for the mutex fastpath.
|
||||
*
|
||||
* TODO: implement optimized primitives instead, or leave the generic
|
||||
* implementation in place, or pick the atomic_xchg() based generic
|
||||
* implementation. (see asm-generic/mutex-xchg.h for details)
|
||||
*/
|
||||
|
||||
#include <asm-generic/mutex-dec.h>
|
|
@ -1,78 +0,0 @@
|
|||
#ifndef _H8300_PAGE_H
|
||||
#define _H8300_PAGE_H
|
||||
|
||||
/* PAGE_SHIFT determines the page size */
|
||||
|
||||
#define PAGE_SHIFT (12)
|
||||
#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
||||
#define PAGE_MASK (~(PAGE_SIZE-1))
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
|
||||
#define free_user_page(page, addr) free_page(addr)
|
||||
|
||||
#define clear_page(page) memset((page), 0, PAGE_SIZE)
|
||||
#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE)
|
||||
|
||||
#define clear_user_page(page, vaddr, pg) clear_page(page)
|
||||
#define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
|
||||
|
||||
#define __alloc_zeroed_user_highpage(movableflags, vma, vaddr) \
|
||||
alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO | movableflags, vma, vaddr)
|
||||
#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
|
||||
|
||||
/*
|
||||
* These are used to make use of C type-checking..
|
||||
*/
|
||||
typedef struct { unsigned long pte; } pte_t;
|
||||
typedef struct { unsigned long pmd[16]; } pmd_t;
|
||||
typedef struct { unsigned long pgd; } pgd_t;
|
||||
typedef struct { unsigned long pgprot; } pgprot_t;
|
||||
typedef struct page *pgtable_t;
|
||||
|
||||
#define pte_val(x) ((x).pte)
|
||||
#define pmd_val(x) ((&x)->pmd[0])
|
||||
#define pgd_val(x) ((x).pgd)
|
||||
#define pgprot_val(x) ((x).pgprot)
|
||||
|
||||
#define __pte(x) ((pte_t) { (x) } )
|
||||
#define __pmd(x) ((pmd_t) { (x) } )
|
||||
#define __pgd(x) ((pgd_t) { (x) } )
|
||||
#define __pgprot(x) ((pgprot_t) { (x) } )
|
||||
|
||||
extern unsigned long memory_start;
|
||||
extern unsigned long memory_end;
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#include <asm/page_offset.h>
|
||||
|
||||
#define PAGE_OFFSET (PAGE_OFFSET_RAW)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define __pa(vaddr) virt_to_phys(vaddr)
|
||||
#define __va(paddr) phys_to_virt((unsigned long)paddr)
|
||||
|
||||
#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
|
||||
|
||||
#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)
|
||||
#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT))
|
||||
#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET)
|
||||
#define pfn_valid(page) (page < max_mapnr)
|
||||
|
||||
#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
|
||||
|
||||
#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
|
||||
((void *)(kaddr) < (void *)memory_end))
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#include <asm-generic/memory_model.h>
|
||||
#include <asm-generic/getorder.h>
|
||||
|
||||
#endif /* _H8300_PAGE_H */
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
#define PAGE_OFFSET_RAW 0x00000000
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef _H8300_PARAM_H
|
||||
#define _H8300_PARAM_H
|
||||
|
||||
#include <uapi/asm/param.h>
|
||||
|
||||
#define HZ CONFIG_HZ
|
||||
#define USER_HZ HZ
|
||||
#define CLOCKS_PER_SEC (USER_HZ)
|
||||
#endif /* _H8300_PARAM_H */
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef _ASM_H8300_PCI_H
|
||||
#define _ASM_H8300_PCI_H
|
||||
|
||||
/*
|
||||
* asm-h8300/pci.h - H8/300 specific PCI declarations.
|
||||
*
|
||||
* Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
*/
|
||||
|
||||
#define pcibios_assign_all_busses() 0
|
||||
|
||||
static inline void pcibios_penalize_isa_irq(int irq, int active)
|
||||
{
|
||||
/* We don't do dynamic PCI IRQ allocation */
|
||||
}
|
||||
|
||||
#define PCI_DMA_BUS_IS_PHYS (1)
|
||||
|
||||
#endif /* _ASM_H8300_PCI_H */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __ARCH_H8300_PERCPU__
|
||||
#define __ARCH_H8300_PERCPU__
|
||||
|
||||
#include <asm-generic/percpu.h>
|
||||
|
||||
#endif /* __ARCH_H8300_PERCPU__ */
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef _H8300_PGALLOC_H
|
||||
#define _H8300_PGALLOC_H
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
||||
#define check_pgt_cache() do { } while (0)
|
||||
|
||||
#endif /* _H8300_PGALLOC_H */
|
|
@ -1,73 +0,0 @@
|
|||
#ifndef _H8300_PGTABLE_H
|
||||
#define _H8300_PGTABLE_H
|
||||
|
||||
#include <asm-generic/4level-fixup.h>
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define pgd_present(pgd) (1) /* pages are always present on NO_MM */
|
||||
#define pgd_none(pgd) (0)
|
||||
#define pgd_bad(pgd) (0)
|
||||
#define pgd_clear(pgdp)
|
||||
#define kern_addr_valid(addr) (1)
|
||||
#define pmd_offset(a, b) ((void *)0)
|
||||
#define pmd_none(pmd) (1)
|
||||
#define pgd_offset_k(adrdress) ((pgd_t *)0)
|
||||
#define pte_offset_kernel(dir, address) ((pte_t *)0)
|
||||
|
||||
#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */
|
||||
#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */
|
||||
#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
|
||||
#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
|
||||
#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
|
||||
|
||||
extern void paging_init(void);
|
||||
#define swapper_pg_dir ((pgd_t *) 0)
|
||||
|
||||
#define __swp_type(x) (0)
|
||||
#define __swp_offset(x) (0)
|
||||
#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) })
|
||||
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
|
||||
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
|
||||
|
||||
static inline int pte_file(pte_t pte) { return 0; }
|
||||
|
||||
/*
|
||||
* ZERO_PAGE is a global shared page that is always zero: used
|
||||
* for zero-mapped memory areas etc..
|
||||
*/
|
||||
#define ZERO_PAGE(vaddr) (virt_to_page(0))
|
||||
|
||||
/*
|
||||
* These would be in other places but having them here reduces the diffs.
|
||||
*/
|
||||
extern unsigned int kobjsize(const void *objp);
|
||||
extern int is_in_rom(unsigned long);
|
||||
|
||||
/*
|
||||
* No page table caches to initialise
|
||||
*/
|
||||
#define pgtable_cache_init() do { } while (0)
|
||||
|
||||
/*
|
||||
* All 32bit addresses are effectively valid for vmalloc...
|
||||
* Sort of meaningless for non-VM targets.
|
||||
*/
|
||||
#define VMALLOC_START 0
|
||||
#define VMALLOC_END 0xffffffff
|
||||
|
||||
/*
|
||||
* All 32bit addresses are effectively valid for vmalloc...
|
||||
* Sort of meaningless for non-VM targets.
|
||||
*/
|
||||
#define VMALLOC_START 0
|
||||
#define VMALLOC_END 0xffffffff
|
||||
|
||||
#define arch_enter_lazy_cpu_mode() do {} while (0)
|
||||
|
||||
#include <asm-generic/pgtable.h>
|
||||
|
||||
#endif /* _H8300_PGTABLE_H */
|
|
@ -1,139 +0,0 @@
|
|||
/*
|
||||
* include/asm-h8300/processor.h
|
||||
*
|
||||
* Copyright (C) 2002 Yoshinori Sato
|
||||
*
|
||||
* Based on: linux/asm-m68nommu/processor.h
|
||||
*
|
||||
* Copyright (C) 1995 Hamish Macdonald
|
||||
*/
|
||||
|
||||
#ifndef __ASM_H8300_PROCESSOR_H
|
||||
#define __ASM_H8300_PROCESSOR_H
|
||||
|
||||
/*
|
||||
* Default implementation of macro that returns current
|
||||
* instruction pointer ("program counter").
|
||||
*/
|
||||
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/current.h>
|
||||
|
||||
static inline unsigned long rdusp(void) {
|
||||
extern unsigned int sw_usp;
|
||||
return(sw_usp);
|
||||
}
|
||||
|
||||
static inline void wrusp(unsigned long usp) {
|
||||
extern unsigned int sw_usp;
|
||||
sw_usp = usp;
|
||||
}
|
||||
|
||||
/*
|
||||
* User space process size: 3.75GB. This is hardcoded into a few places,
|
||||
* so don't change it unless you know what you are doing.
|
||||
*/
|
||||
#define TASK_SIZE (0xFFFFFFFFUL)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define STACK_TOP TASK_SIZE
|
||||
#define STACK_TOP_MAX STACK_TOP
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This decides where the kernel will search for a free chunk of vm
|
||||
* space during mmap's. We won't be using it
|
||||
*/
|
||||
#define TASK_UNMAPPED_BASE 0
|
||||
|
||||
struct thread_struct {
|
||||
unsigned long ksp; /* kernel stack pointer */
|
||||
unsigned long usp; /* user stack pointer */
|
||||
unsigned long ccr; /* saved status register */
|
||||
unsigned long esp0; /* points to SR of stack frame */
|
||||
struct {
|
||||
unsigned short *addr;
|
||||
unsigned short inst;
|
||||
} breakinfo;
|
||||
};
|
||||
|
||||
#define INIT_THREAD { \
|
||||
.ksp = sizeof(init_stack) + (unsigned long)init_stack, \
|
||||
.usp = 0, \
|
||||
.ccr = PS_S, \
|
||||
.esp0 = 0, \
|
||||
.breakinfo = { \
|
||||
.addr = (unsigned short *)-1, \
|
||||
.inst = 0 \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
* Do necessary setup to start up a newly executed thread.
|
||||
*
|
||||
* pass the data segment into user programs if it exists,
|
||||
* it can't hurt anything as far as I can tell
|
||||
*/
|
||||
#if defined(__H8300H__)
|
||||
#define start_thread(_regs, _pc, _usp) \
|
||||
do { \
|
||||
(_regs)->pc = (_pc); \
|
||||
(_regs)->ccr = 0x00; /* clear all flags */ \
|
||||
(_regs)->er5 = current->mm->start_data; /* GOT base */ \
|
||||
wrusp((unsigned long)(_usp) - sizeof(unsigned long)*3); \
|
||||
} while(0)
|
||||
#endif
|
||||
#if defined(__H8300S__)
|
||||
#define start_thread(_regs, _pc, _usp) \
|
||||
do { \
|
||||
(_regs)->pc = (_pc); \
|
||||
(_regs)->ccr = 0x00; /* clear kernel flag */ \
|
||||
(_regs)->exr = 0x78; /* enable all interrupts */ \
|
||||
(_regs)->er5 = current->mm->start_data; /* GOT base */ \
|
||||
/* 14 = space for retaddr(4), vector(4), er0(4) and ext(2) on stack */ \
|
||||
wrusp(((unsigned long)(_usp)) - 14); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/* Forward declaration, a strange C thing */
|
||||
struct task_struct;
|
||||
|
||||
/* Free all resources held by a thread. */
|
||||
static inline void release_thread(struct task_struct *dead_task)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Free current thread data structures etc..
|
||||
*/
|
||||
static inline void exit_thread(void)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Return saved PC of a blocked thread.
|
||||
*/
|
||||
unsigned long thread_saved_pc(struct task_struct *tsk);
|
||||
unsigned long get_wchan(struct task_struct *p);
|
||||
|
||||
#define KSTK_EIP(tsk) \
|
||||
({ \
|
||||
unsigned long eip = 0; \
|
||||
if ((tsk)->thread.esp0 > PAGE_SIZE && \
|
||||
MAP_NR((tsk)->thread.esp0) < max_mapnr) \
|
||||
eip = ((struct pt_regs *) (tsk)->thread.esp0)->pc; \
|
||||
eip; })
|
||||
#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
|
||||
|
||||
#define cpu_relax() barrier()
|
||||
|
||||
#define HARD_RESET_NOW() ({ \
|
||||
local_irq_disable(); \
|
||||
asm("jmp @@0"); \
|
||||
})
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef _H8300_PTRACE_H
|
||||
#define _H8300_PTRACE_H
|
||||
|
||||
#include <uapi/asm/ptrace.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#if defined(CONFIG_CPU_H8S)
|
||||
#endif
|
||||
#ifndef PS_S
|
||||
#define PS_S (0x10)
|
||||
#endif
|
||||
|
||||
#if defined(__H8300H__)
|
||||
#define H8300_REGS_NO 11
|
||||
#endif
|
||||
#if defined(__H8300S__)
|
||||
#define H8300_REGS_NO 12
|
||||
#endif
|
||||
|
||||
/* Find the stack offset for a register, relative to thread.esp0. */
|
||||
#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
|
||||
|
||||
#define arch_has_single_step() (1)
|
||||
|
||||
#define user_mode(regs) (!((regs)->ccr & PS_S))
|
||||
#define instruction_pointer(regs) ((regs)->pc)
|
||||
#define profile_pc(regs) instruction_pointer(regs)
|
||||
#define current_pt_regs() ((struct pt_regs *) \
|
||||
(THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
|
||||
#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
|
||||
#define current_user_stack_pointer() rdusp()
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _H8300_PTRACE_H */
|
|
@ -1,336 +0,0 @@
|
|||
/* internal Peripherals Register address define */
|
||||
/* CPU: H8/306x */
|
||||
|
||||
#if !defined(__REGS_H8S267x__)
|
||||
#define __REGS_H8S267x__
|
||||
|
||||
#if defined(__KERNEL__)
|
||||
|
||||
#define DASTCR 0xFEE01A
|
||||
#define DADR0 0xFFFFA4
|
||||
#define DADR1 0xFFFFA5
|
||||
#define DACR01 0xFFFFA6
|
||||
#define DADR2 0xFFFFA8
|
||||
#define DADR3 0xFFFFA9
|
||||
#define DACR23 0xFFFFAA
|
||||
|
||||
#define ADDRA 0xFFFF90
|
||||
#define ADDRAH 0xFFFF90
|
||||
#define ADDRAL 0xFFFF91
|
||||
#define ADDRB 0xFFFF92
|
||||
#define ADDRBH 0xFFFF92
|
||||
#define ADDRBL 0xFFFF93
|
||||
#define ADDRC 0xFFFF94
|
||||
#define ADDRCH 0xFFFF94
|
||||
#define ADDRCL 0xFFFF95
|
||||
#define ADDRD 0xFFFF96
|
||||
#define ADDRDH 0xFFFF96
|
||||
#define ADDRDL 0xFFFF97
|
||||
#define ADDRE 0xFFFF98
|
||||
#define ADDREH 0xFFFF98
|
||||
#define ADDREL 0xFFFF99
|
||||
#define ADDRF 0xFFFF9A
|
||||
#define ADDRFH 0xFFFF9A
|
||||
#define ADDRFL 0xFFFF9B
|
||||
#define ADDRG 0xFFFF9C
|
||||
#define ADDRGH 0xFFFF9C
|
||||
#define ADDRGL 0xFFFF9D
|
||||
#define ADDRH 0xFFFF9E
|
||||
#define ADDRHH 0xFFFF9E
|
||||
#define ADDRHL 0xFFFF9F
|
||||
|
||||
#define ADCSR 0xFFFFA0
|
||||
#define ADCR 0xFFFFA1
|
||||
|
||||
#define ABWCR 0xFFFEC0
|
||||
#define ASTCR 0xFFFEC1
|
||||
#define WTCRAH 0xFFFEC2
|
||||
#define WTCRAL 0xFFFEC3
|
||||
#define WTCRBH 0xFFFEC4
|
||||
#define WTCRBL 0xFFFEC5
|
||||
#define RDNCR 0xFFFEC6
|
||||
#define CSACRH 0xFFFEC8
|
||||
#define CSACRL 0xFFFEC9
|
||||
#define BROMCRH 0xFFFECA
|
||||
#define BROMCRL 0xFFFECB
|
||||
#define BCR 0xFFFECC
|
||||
#define DRAMCR 0xFFFED0
|
||||
#define DRACCR 0xFFFED2
|
||||
#define REFCR 0xFFFED4
|
||||
#define RTCNT 0xFFFED6
|
||||
#define RTCOR 0xFFFED7
|
||||
|
||||
#define MAR0AH 0xFFFEE0
|
||||
#define MAR0AL 0xFFFEE2
|
||||
#define IOAR0A 0xFFFEE4
|
||||
#define ETCR0A 0xFFFEE6
|
||||
#define MAR0BH 0xFFFEE8
|
||||
#define MAR0BL 0xFFFEEA
|
||||
#define IOAR0B 0xFFFEEC
|
||||
#define ETCR0B 0xFFFEEE
|
||||
#define MAR1AH 0xFFFEF0
|
||||
#define MAR1AL 0xFFFEF2
|
||||
#define IOAR1A 0xFFFEF4
|
||||
#define ETCR1A 0xFFFEF6
|
||||
#define MAR1BH 0xFFFEF8
|
||||
#define MAR1BL 0xFFFEFA
|
||||
#define IOAR1B 0xFFFEFC
|
||||
#define ETCR1B 0xFFFEFE
|
||||
#define DMAWER 0xFFFF20
|
||||
#define DMATCR 0xFFFF21
|
||||
#define DMACR0A 0xFFFF22
|
||||
#define DMACR0B 0xFFFF23
|
||||
#define DMACR1A 0xFFFF24
|
||||
#define DMACR1B 0xFFFF25
|
||||
#define DMABCRH 0xFFFF26
|
||||
#define DMABCRL 0xFFFF27
|
||||
|
||||
#define EDSAR0 0xFFFDC0
|
||||
#define EDDAR0 0xFFFDC4
|
||||
#define EDTCR0 0xFFFDC8
|
||||
#define EDMDR0 0xFFFDCC
|
||||
#define EDMDR0H 0xFFFDCC
|
||||
#define EDMDR0L 0xFFFDCD
|
||||
#define EDACR0 0xFFFDCE
|
||||
#define EDSAR1 0xFFFDD0
|
||||
#define EDDAR1 0xFFFDD4
|
||||
#define EDTCR1 0xFFFDD8
|
||||
#define EDMDR1 0xFFFDDC
|
||||
#define EDMDR1H 0xFFFDDC
|
||||
#define EDMDR1L 0xFFFDDD
|
||||
#define EDACR1 0xFFFDDE
|
||||
#define EDSAR2 0xFFFDE0
|
||||
#define EDDAR2 0xFFFDE4
|
||||
#define EDTCR2 0xFFFDE8
|
||||
#define EDMDR2 0xFFFDEC
|
||||
#define EDMDR2H 0xFFFDEC
|
||||
#define EDMDR2L 0xFFFDED
|
||||
#define EDACR2 0xFFFDEE
|
||||
#define EDSAR3 0xFFFDF0
|
||||
#define EDDAR3 0xFFFDF4
|
||||
#define EDTCR3 0xFFFDF8
|
||||
#define EDMDR3 0xFFFDFC
|
||||
#define EDMDR3H 0xFFFDFC
|
||||
#define EDMDR3L 0xFFFDFD
|
||||
#define EDACR3 0xFFFDFE
|
||||
|
||||
#define IPRA 0xFFFE00
|
||||
#define IPRB 0xFFFE02
|
||||
#define IPRC 0xFFFE04
|
||||
#define IPRD 0xFFFE06
|
||||
#define IPRE 0xFFFE08
|
||||
#define IPRF 0xFFFE0A
|
||||
#define IPRG 0xFFFE0C
|
||||
#define IPRH 0xFFFE0E
|
||||
#define IPRI 0xFFFE10
|
||||
#define IPRJ 0xFFFE12
|
||||
#define IPRK 0xFFFE14
|
||||
#define ITSR 0xFFFE16
|
||||
#define SSIER 0xFFFE18
|
||||
#define ISCRH 0xFFFE1A
|
||||
#define ISCRL 0xFFFE1C
|
||||
|
||||
#define INTCR 0xFFFF31
|
||||
#define IER 0xFFFF32
|
||||
#define IERH 0xFFFF32
|
||||
#define IERL 0xFFFF33
|
||||
#define ISR 0xFFFF34
|
||||
#define ISRH 0xFFFF34
|
||||
#define ISRL 0xFFFF35
|
||||
|
||||
#define P1DDR 0xFFFE20
|
||||
#define P2DDR 0xFFFE21
|
||||
#define P3DDR 0xFFFE22
|
||||
#define P4DDR 0xFFFE23
|
||||
#define P5DDR 0xFFFE24
|
||||
#define P6DDR 0xFFFE25
|
||||
#define P7DDR 0xFFFE26
|
||||
#define P8DDR 0xFFFE27
|
||||
#define P9DDR 0xFFFE28
|
||||
#define PADDR 0xFFFE29
|
||||
#define PBDDR 0xFFFE2A
|
||||
#define PCDDR 0xFFFE2B
|
||||
#define PDDDR 0xFFFE2C
|
||||
#define PEDDR 0xFFFE2D
|
||||
#define PFDDR 0xFFFE2E
|
||||
#define PGDDR 0xFFFE2F
|
||||
#define PHDDR 0xFFFF74
|
||||
|
||||
#define PFCR0 0xFFFE32
|
||||
#define PFCR1 0xFFFE33
|
||||
#define PFCR2 0xFFFE34
|
||||
|
||||
#define PAPCR 0xFFFE36
|
||||
#define PBPCR 0xFFFE37
|
||||
#define PCPCR 0xFFFE38
|
||||
#define PDPCR 0xFFFE39
|
||||
#define PEPCR 0xFFFE3A
|
||||
|
||||
#define P3ODR 0xFFFE3C
|
||||
#define PAODR 0xFFFE3D
|
||||
|
||||
#define P1DR 0xFFFF60
|
||||
#define P2DR 0xFFFF61
|
||||
#define P3DR 0xFFFF62
|
||||
#define P4DR 0xFFFF63
|
||||
#define P5DR 0xFFFF64
|
||||
#define P6DR 0xFFFF65
|
||||
#define P7DR 0xFFFF66
|
||||
#define P8DR 0xFFFF67
|
||||
#define P9DR 0xFFFF68
|
||||
#define PADR 0xFFFF69
|
||||
#define PBDR 0xFFFF6A
|
||||
#define PCDR 0xFFFF6B
|
||||
#define PDDR 0xFFFF6C
|
||||
#define PEDR 0xFFFF6D
|
||||
#define PFDR 0xFFFF6E
|
||||
#define PGDR 0xFFFF6F
|
||||
#define PHDR 0xFFFF72
|
||||
|
||||
#define PORT1 0xFFFF50
|
||||
#define PORT2 0xFFFF51
|
||||
#define PORT3 0xFFFF52
|
||||
#define PORT4 0xFFFF53
|
||||
#define PORT5 0xFFFF54
|
||||
#define PORT6 0xFFFF55
|
||||
#define PORT7 0xFFFF56
|
||||
#define PORT8 0xFFFF57
|
||||
#define PORT9 0xFFFF58
|
||||
#define PORTA 0xFFFF59
|
||||
#define PORTB 0xFFFF5A
|
||||
#define PORTC 0xFFFF5B
|
||||
#define PORTD 0xFFFF5C
|
||||
#define PORTE 0xFFFF5D
|
||||
#define PORTF 0xFFFF5E
|
||||
#define PORTG 0xFFFF5F
|
||||
#define PORTH 0xFFFF70
|
||||
|
||||
#define PCR 0xFFFF46
|
||||
#define PMR 0xFFFF47
|
||||
#define NDERH 0xFFFF48
|
||||
#define NDERL 0xFFFF49
|
||||
#define PODRH 0xFFFF4A
|
||||
#define PODRL 0xFFFF4B
|
||||
#define NDRH1 0xFFFF4C
|
||||
#define NDRL1 0xFFFF4D
|
||||
#define NDRH2 0xFFFF4E
|
||||
#define NDRL2 0xFFFF4F
|
||||
|
||||
#define SMR0 0xFFFF78
|
||||
#define BRR0 0xFFFF79
|
||||
#define SCR0 0xFFFF7A
|
||||
#define TDR0 0xFFFF7B
|
||||
#define SSR0 0xFFFF7C
|
||||
#define RDR0 0xFFFF7D
|
||||
#define SCMR0 0xFFFF7E
|
||||
#define SMR1 0xFFFF80
|
||||
#define BRR1 0xFFFF81
|
||||
#define SCR1 0xFFFF82
|
||||
#define TDR1 0xFFFF83
|
||||
#define SSR1 0xFFFF84
|
||||
#define RDR1 0xFFFF85
|
||||
#define SCMR1 0xFFFF86
|
||||
#define SMR2 0xFFFF88
|
||||
#define BRR2 0xFFFF89
|
||||
#define SCR2 0xFFFF8A
|
||||
#define TDR2 0xFFFF8B
|
||||
#define SSR2 0xFFFF8C
|
||||
#define RDR2 0xFFFF8D
|
||||
#define SCMR2 0xFFFF8E
|
||||
|
||||
#define IRCR0 0xFFFE1E
|
||||
#define SEMR 0xFFFDA8
|
||||
|
||||
#define MDCR 0xFFFF3E
|
||||
#define SYSCR 0xFFFF3D
|
||||
#define MSTPCRH 0xFFFF40
|
||||
#define MSTPCRL 0xFFFF41
|
||||
#define FLMCR1 0xFFFFC8
|
||||
#define FLMCR2 0xFFFFC9
|
||||
#define EBR1 0xFFFFCA
|
||||
#define EBR2 0xFFFFCB
|
||||
#define CTGARC_RAMCR 0xFFFECE
|
||||
#define SBYCR 0xFFFF3A
|
||||
#define SCKCR 0xFFFF3B
|
||||
#define PLLCR 0xFFFF45
|
||||
|
||||
#define TSTR 0xFFFFC0
|
||||
#define TSNC 0XFFFFC1
|
||||
|
||||
#define TCR0 0xFFFFD0
|
||||
#define TMDR0 0xFFFFD1
|
||||
#define TIORH0 0xFFFFD2
|
||||
#define TIORL0 0xFFFFD3
|
||||
#define TIER0 0xFFFFD4
|
||||
#define TSR0 0xFFFFD5
|
||||
#define TCNT0 0xFFFFD6
|
||||
#define GRA0 0xFFFFD8
|
||||
#define GRB0 0xFFFFDA
|
||||
#define GRC0 0xFFFFDC
|
||||
#define GRD0 0xFFFFDE
|
||||
#define TCR1 0xFFFFE0
|
||||
#define TMDR1 0xFFFFE1
|
||||
#define TIORH1 0xFFFFE2
|
||||
#define TIORL1 0xFFFFE3
|
||||
#define TIER1 0xFFFFE4
|
||||
#define TSR1 0xFFFFE5
|
||||
#define TCNT1 0xFFFFE6
|
||||
#define GRA1 0xFFFFE8
|
||||
#define GRB1 0xFFFFEA
|
||||
#define TCR2 0xFFFFF0
|
||||
#define TMDR2 0xFFFFF1
|
||||
#define TIORH2 0xFFFFF2
|
||||
#define TIORL2 0xFFFFF3
|
||||
#define TIER2 0xFFFFF4
|
||||
#define TSR2 0xFFFFF5
|
||||
#define TCNT2 0xFFFFF6
|
||||
#define GRA2 0xFFFFF8
|
||||
#define GRB2 0xFFFFFA
|
||||
#define TCR3 0xFFFE80
|
||||
#define TMDR3 0xFFFE81
|
||||
#define TIORH3 0xFFFE82
|
||||
#define TIORL3 0xFFFE83
|
||||
#define TIER3 0xFFFE84
|
||||
#define TSR3 0xFFFE85
|
||||
#define TCNT3 0xFFFE86
|
||||
#define GRA3 0xFFFE88
|
||||
#define GRB3 0xFFFE8A
|
||||
#define GRC3 0xFFFE8C
|
||||
#define GRD3 0xFFFE8E
|
||||
#define TCR4 0xFFFE90
|
||||
#define TMDR4 0xFFFE91
|
||||
#define TIORH4 0xFFFE92
|
||||
#define TIORL4 0xFFFE93
|
||||
#define TIER4 0xFFFE94
|
||||
#define TSR4 0xFFFE95
|
||||
#define TCNT4 0xFFFE96
|
||||
#define GRA4 0xFFFE98
|
||||
#define GRB4 0xFFFE9A
|
||||
#define TCR5 0xFFFEA0
|
||||
#define TMDR5 0xFFFEA1
|
||||
#define TIORH5 0xFFFEA2
|
||||
#define TIORL5 0xFFFEA3
|
||||
#define TIER5 0xFFFEA4
|
||||
#define TSR5 0xFFFEA5
|
||||
#define TCNT5 0xFFFEA6
|
||||
#define GRA5 0xFFFEA8
|
||||
#define GRB5 0xFFFEAA
|
||||
|
||||
#define _8TCR0 0xFFFFB0
|
||||
#define _8TCR1 0xFFFFB1
|
||||
#define _8TCSR0 0xFFFFB2
|
||||
#define _8TCSR1 0xFFFFB3
|
||||
#define _8TCORA0 0xFFFFB4
|
||||
#define _8TCORA1 0xFFFFB5
|
||||
#define _8TCORB0 0xFFFFB6
|
||||
#define _8TCORB1 0xFFFFB7
|
||||
#define _8TCNT0 0xFFFFB8
|
||||
#define _8TCNT1 0xFFFFB9
|
||||
|
||||
#define TCSR 0xFFFFBC
|
||||
#define TCNT 0xFFFFBD
|
||||
#define RSTCSRW 0xFFFFBE
|
||||
#define RSTCSRR 0xFFFFBF
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __REGS_H8S267x__ */
|
|
@ -1,212 +0,0 @@
|
|||
/* internal Peripherals Register address define */
|
||||
/* CPU: H8/306x */
|
||||
|
||||
#if !defined(__REGS_H8306x__)
|
||||
#define __REGS_H8306x__
|
||||
|
||||
#if defined(__KERNEL__)
|
||||
|
||||
#define DASTCR 0xFEE01A
|
||||
#define DADR0 0xFEE09C
|
||||
#define DADR1 0xFEE09D
|
||||
#define DACR 0xFEE09E
|
||||
|
||||
#define ADDRAH 0xFFFFE0
|
||||
#define ADDRAL 0xFFFFE1
|
||||
#define ADDRBH 0xFFFFE2
|
||||
#define ADDRBL 0xFFFFE3
|
||||
#define ADDRCH 0xFFFFE4
|
||||
#define ADDRCL 0xFFFFE5
|
||||
#define ADDRDH 0xFFFFE6
|
||||
#define ADDRDL 0xFFFFE7
|
||||
#define ADCSR 0xFFFFE8
|
||||
#define ADCR 0xFFFFE9
|
||||
|
||||
#define BRCR 0xFEE013
|
||||
#define ADRCR 0xFEE01E
|
||||
#define CSCR 0xFEE01F
|
||||
#define ABWCR 0xFEE020
|
||||
#define ASTCR 0xFEE021
|
||||
#define WCRH 0xFEE022
|
||||
#define WCRL 0xFEE023
|
||||
#define BCR 0xFEE024
|
||||
#define DRCRA 0xFEE026
|
||||
#define DRCRB 0xFEE027
|
||||
#define RTMCSR 0xFEE028
|
||||
#define RTCNT 0xFEE029
|
||||
#define RTCOR 0xFEE02A
|
||||
|
||||
#define MAR0AR 0xFFFF20
|
||||
#define MAR0AE 0xFFFF21
|
||||
#define MAR0AH 0xFFFF22
|
||||
#define MAR0AL 0xFFFF23
|
||||
#define ETCR0AL 0xFFFF24
|
||||
#define ETCR0AH 0xFFFF25
|
||||
#define IOAR0A 0xFFFF26
|
||||
#define DTCR0A 0xFFFF27
|
||||
#define MAR0BR 0xFFFF28
|
||||
#define MAR0BE 0xFFFF29
|
||||
#define MAR0BH 0xFFFF2A
|
||||
#define MAR0BL 0xFFFF2B
|
||||
#define ETCR0BL 0xFFFF2C
|
||||
#define ETCR0BH 0xFFFF2D
|
||||
#define IOAR0B 0xFFFF2E
|
||||
#define DTCR0B 0xFFFF2F
|
||||
#define MAR1AR 0xFFFF30
|
||||
#define MAR1AE 0xFFFF31
|
||||
#define MAR1AH 0xFFFF32
|
||||
#define MAR1AL 0xFFFF33
|
||||
#define ETCR1AL 0xFFFF34
|
||||
#define ETCR1AH 0xFFFF35
|
||||
#define IOAR1A 0xFFFF36
|
||||
#define DTCR1A 0xFFFF37
|
||||
#define MAR1BR 0xFFFF38
|
||||
#define MAR1BE 0xFFFF39
|
||||
#define MAR1BH 0xFFFF3A
|
||||
#define MAR1BL 0xFFFF3B
|
||||
#define ETCR1BL 0xFFFF3C
|
||||
#define ETCR1BH 0xFFFF3D
|
||||
#define IOAR1B 0xFFFF3E
|
||||
#define DTCR1B 0xFFFF3F
|
||||
|
||||
#define ISCR 0xFEE014
|
||||
#define IER 0xFEE015
|
||||
#define ISR 0xFEE016
|
||||
#define IPRA 0xFEE018
|
||||
#define IPRB 0xFEE019
|
||||
|
||||
#define P1DDR 0xFEE000
|
||||
#define P2DDR 0xFEE001
|
||||
#define P3DDR 0xFEE002
|
||||
#define P4DDR 0xFEE003
|
||||
#define P5DDR 0xFEE004
|
||||
#define P6DDR 0xFEE005
|
||||
/*#define P7DDR 0xFEE006*/
|
||||
#define P8DDR 0xFEE007
|
||||
#define P9DDR 0xFEE008
|
||||
#define PADDR 0xFEE009
|
||||
#define PBDDR 0xFEE00A
|
||||
|
||||
#define P1DR 0xFFFFD0
|
||||
#define P2DR 0xFFFFD1
|
||||
#define P3DR 0xFFFFD2
|
||||
#define P4DR 0xFFFFD3
|
||||
#define P5DR 0xFFFFD4
|
||||
#define P6DR 0xFFFFD5
|
||||
/*#define P7DR 0xFFFFD6*/
|
||||
#define P8DR 0xFFFFD7
|
||||
#define P9DR 0xFFFFD8
|
||||
#define PADR 0xFFFFD9
|
||||
#define PBDR 0xFFFFDA
|
||||
|
||||
#define P2CR 0xFEE03C
|
||||
#define P4CR 0xFEE03E
|
||||
#define P5CR 0xFEE03F
|
||||
|
||||
#define SMR0 0xFFFFB0
|
||||
#define BRR0 0xFFFFB1
|
||||
#define SCR0 0xFFFFB2
|
||||
#define TDR0 0xFFFFB3
|
||||
#define SSR0 0xFFFFB4
|
||||
#define RDR0 0xFFFFB5
|
||||
#define SCMR0 0xFFFFB6
|
||||
#define SMR1 0xFFFFB8
|
||||
#define BRR1 0xFFFFB9
|
||||
#define SCR1 0xFFFFBA
|
||||
#define TDR1 0xFFFFBB
|
||||
#define SSR1 0xFFFFBC
|
||||
#define RDR1 0xFFFFBD
|
||||
#define SCMR1 0xFFFFBE
|
||||
#define SMR2 0xFFFFC0
|
||||
#define BRR2 0xFFFFC1
|
||||
#define SCR2 0xFFFFC2
|
||||
#define TDR2 0xFFFFC3
|
||||
#define SSR2 0xFFFFC4
|
||||
#define RDR2 0xFFFFC5
|
||||
#define SCMR2 0xFFFFC6
|
||||
|
||||
#define MDCR 0xFEE011
|
||||
#define SYSCR 0xFEE012
|
||||
#define DIVCR 0xFEE01B
|
||||
#define MSTCRH 0xFEE01C
|
||||
#define MSTCRL 0xFEE01D
|
||||
#define FLMCR1 0xFEE030
|
||||
#define FLMCR2 0xFEE031
|
||||
#define EBR1 0xFEE032
|
||||
#define EBR2 0xFEE033
|
||||
#define RAMCR 0xFEE077
|
||||
|
||||
#define TSTR 0xFFFF60
|
||||
#define TSNC 0XFFFF61
|
||||
#define TMDR 0xFFFF62
|
||||
#define TOLR 0xFFFF63
|
||||
#define TISRA 0xFFFF64
|
||||
#define TISRB 0xFFFF65
|
||||
#define TISRC 0xFFFF66
|
||||
#define TCR0 0xFFFF68
|
||||
#define TIOR0 0xFFFF69
|
||||
#define TCNT0H 0xFFFF6A
|
||||
#define TCNT0L 0xFFFF6B
|
||||
#define GRA0H 0xFFFF6C
|
||||
#define GRA0L 0xFFFF6D
|
||||
#define GRB0H 0xFFFF6E
|
||||
#define GRB0L 0xFFFF6F
|
||||
#define TCR1 0xFFFF70
|
||||
#define TIOR1 0xFFFF71
|
||||
#define TCNT1H 0xFFFF72
|
||||
#define TCNT1L 0xFFFF73
|
||||
#define GRA1H 0xFFFF74
|
||||
#define GRA1L 0xFFFF75
|
||||
#define GRB1H 0xFFFF76
|
||||
#define GRB1L 0xFFFF77
|
||||
#define TCR3 0xFFFF78
|
||||
#define TIOR3 0xFFFF79
|
||||
#define TCNT3H 0xFFFF7A
|
||||
#define TCNT3L 0xFFFF7B
|
||||
#define GRA3H 0xFFFF7C
|
||||
#define GRA3L 0xFFFF7D
|
||||
#define GRB3H 0xFFFF7E
|
||||
#define GRB3L 0xFFFF7F
|
||||
|
||||
#define _8TCR0 0xFFFF80
|
||||
#define _8TCR1 0xFFFF81
|
||||
#define _8TCSR0 0xFFFF82
|
||||
#define _8TCSR1 0xFFFF83
|
||||
#define TCORA0 0xFFFF84
|
||||
#define TCORA1 0xFFFF85
|
||||
#define TCORB0 0xFFFF86
|
||||
#define TCORB1 0xFFFF87
|
||||
#define _8TCNT0 0xFFFF88
|
||||
#define _8TCNT1 0xFFFF89
|
||||
|
||||
#define _8TCR2 0xFFFF90
|
||||
#define _8TCR3 0xFFFF91
|
||||
#define _8TCSR2 0xFFFF92
|
||||
#define _8TCSR3 0xFFFF93
|
||||
#define TCORA2 0xFFFF94
|
||||
#define TCORA3 0xFFFF95
|
||||
#define TCORB2 0xFFFF96
|
||||
#define TCORB3 0xFFFF97
|
||||
#define _8TCNT2 0xFFFF98
|
||||
#define _8TCNT3 0xFFFF99
|
||||
|
||||
#define TCSR 0xFFFF8C
|
||||
#define TCNT 0xFFFF8D
|
||||
#define RSTCSR 0xFFFF8F
|
||||
|
||||
#define TPMR 0xFFFFA0
|
||||
#define TPCR 0xFFFFA1
|
||||
#define NDERB 0xFFFFA2
|
||||
#define NDERA 0xFFFFA3
|
||||
#define NDRB1 0xFFFFA4
|
||||
#define NDRA1 0xFFFFA5
|
||||
#define NDRB2 0xFFFFA6
|
||||
#define NDRA2 0xFFFFA7
|
||||
|
||||
#define TCSR 0xFFFF8C
|
||||
#define TCNT 0xFFFF8D
|
||||
#define RSTCSRW 0xFFFF8E
|
||||
#define RSTCSRR 0xFFFF8F
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __REGS_H8306x__ */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_SCATTERLIST_H
|
||||
#define _H8300_SCATTERLIST_H
|
||||
|
||||
#include <asm-generic/scatterlist.h>
|
||||
|
||||
#endif /* !(_H8300_SCATTERLIST_H) */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_SECTIONS_H_
|
||||
#define _H8300_SECTIONS_H_
|
||||
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
#endif
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef _H8300_SEGMENT_H
|
||||
#define _H8300_SEGMENT_H
|
||||
|
||||
/* define constants */
|
||||
#define USER_DATA (1)
|
||||
#ifndef __USER_DS
|
||||
#define __USER_DS (USER_DATA)
|
||||
#endif
|
||||
#define USER_PROGRAM (2)
|
||||
#define SUPER_DATA (3)
|
||||
#ifndef __KERNEL_DS
|
||||
#define __KERNEL_DS (SUPER_DATA)
|
||||
#endif
|
||||
#define SUPER_PROGRAM (4)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
typedef struct {
|
||||
unsigned long seg;
|
||||
} mm_segment_t;
|
||||
|
||||
#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
|
||||
#define USER_DS MAKE_MM_SEG(__USER_DS)
|
||||
#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
|
||||
|
||||
/*
|
||||
* Get/set the SFC/DFC registers for MOVES instructions
|
||||
*/
|
||||
|
||||
static inline mm_segment_t get_fs(void)
|
||||
{
|
||||
return USER_DS;
|
||||
}
|
||||
|
||||
static inline mm_segment_t get_ds(void)
|
||||
{
|
||||
/* return the supervisor data space code */
|
||||
return KERNEL_DS;
|
||||
}
|
||||
|
||||
static inline void set_fs(mm_segment_t val)
|
||||
{
|
||||
}
|
||||
|
||||
#define segment_eq(a,b) ((a).seg == (b).seg)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _H8300_SEGMENT_H */
|
|
@ -1,29 +0,0 @@
|
|||
/* eCos HAL interface header */
|
||||
|
||||
#ifndef SH_BIOS_H
|
||||
#define SH_BIOS_H
|
||||
|
||||
#define HAL_IF_VECTOR_TABLE 0xfffe20
|
||||
#define CALL_IF_SET_CONSOLE_COMM 13
|
||||
#define QUERY_CURRENT -1
|
||||
#define MANGLER -3
|
||||
|
||||
/* Checking for GDB stub active */
|
||||
/* suggestion Jonathan Larmour */
|
||||
static int sh_bios_in_gdb_mode(void)
|
||||
{
|
||||
static int gdb_active = -1;
|
||||
if (gdb_active == -1) {
|
||||
int (*set_console_comm)(int);
|
||||
set_console_comm = ((void **)HAL_IF_VECTOR_TABLE)[CALL_IF_SET_CONSOLE_COMM];
|
||||
gdb_active = (set_console_comm(QUERY_CURRENT) == MANGLER);
|
||||
}
|
||||
return gdb_active;
|
||||
}
|
||||
|
||||
static void sh_bios_gdb_detach(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,31 +0,0 @@
|
|||
#ifndef _H8300_SHM_H
|
||||
#define _H8300_SHM_H
|
||||
|
||||
|
||||
/* format of page table entries that correspond to shared memory pages
|
||||
currently out in swap space (see also mm/swap.c):
|
||||
bits 0-1 (PAGE_PRESENT) is = 0
|
||||
bits 8..2 (SWP_TYPE) are = SHM_SWP_TYPE
|
||||
bits 31..9 are used like this:
|
||||
bits 15..9 (SHM_ID) the id of the shared memory segment
|
||||
bits 30..16 (SHM_IDX) the index of the page within the shared memory segment
|
||||
(actually only bits 25..16 get used since SHMMAX is so low)
|
||||
bit 31 (SHM_READ_ONLY) flag whether the page belongs to a read-only attach
|
||||
*/
|
||||
/* on the m68k both bits 0 and 1 must be zero */
|
||||
/* format on the sun3 is similar, but bits 30, 31 are set to zero and all
|
||||
others are reduced by 2. --m */
|
||||
|
||||
#ifndef CONFIG_SUN3
|
||||
#define SHM_ID_SHIFT 9
|
||||
#else
|
||||
#define SHM_ID_SHIFT 7
|
||||
#endif
|
||||
#define _SHM_ID_BITS 7
|
||||
#define SHM_ID_MASK ((1<<_SHM_ID_BITS)-1)
|
||||
|
||||
#define SHM_IDX_SHIFT (SHM_ID_SHIFT+_SHM_ID_BITS)
|
||||
#define _SHM_IDX_BITS 15
|
||||
#define SHM_IDX_MASK ((1<<_SHM_IDX_BITS)-1)
|
||||
|
||||
#endif /* _H8300_SHM_H */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_SHMPARAM_H
|
||||
#define _H8300_SHMPARAM_H
|
||||
|
||||
#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
|
||||
|
||||
#endif /* _H8300_SHMPARAM_H */
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef _H8300_SIGNAL_H
|
||||
#define _H8300_SIGNAL_H
|
||||
|
||||
#include <uapi/asm/signal.h>
|
||||
|
||||
/* Most things should be clean enough to redefine this at will, if care
|
||||
is taken to make libc match. */
|
||||
|
||||
#define _NSIG 64
|
||||
#define _NSIG_BPW 32
|
||||
#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
|
||||
|
||||
typedef unsigned long old_sigset_t; /* at least 32 bits */
|
||||
|
||||
typedef struct {
|
||||
unsigned long sig[_NSIG_WORDS];
|
||||
} sigset_t;
|
||||
|
||||
#define __ARCH_HAS_SA_RESTORER
|
||||
|
||||
#include <asm/sigcontext.h>
|
||||
#undef __HAVE_ARCH_SIG_BITOPS
|
||||
|
||||
#endif /* _H8300_SIGNAL_H */
|
|
@ -1 +0,0 @@
|
|||
/* nothing required here yet */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __H8300_SPINLOCK_H
|
||||
#define __H8300_SPINLOCK_H
|
||||
|
||||
#error "H8/300 doesn't do SMP yet"
|
||||
|
||||
#endif
|
|
@ -1,44 +0,0 @@
|
|||
#ifndef _H8300_STRING_H_
|
||||
#define _H8300_STRING_H_
|
||||
|
||||
#ifdef __KERNEL__ /* only set these up for kernel code */
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
extern void * memset(void * s, int c, size_t count);
|
||||
|
||||
#define __HAVE_ARCH_MEMCPY
|
||||
extern void * memcpy(void *d, const void *s, size_t count);
|
||||
|
||||
#else /* KERNEL */
|
||||
|
||||
/*
|
||||
* let user libraries deal with these,
|
||||
* IMHO the kernel has no place defining these functions for user apps
|
||||
*/
|
||||
|
||||
#define __HAVE_ARCH_STRCPY 1
|
||||
#define __HAVE_ARCH_STRNCPY 1
|
||||
#define __HAVE_ARCH_STRCAT 1
|
||||
#define __HAVE_ARCH_STRNCAT 1
|
||||
#define __HAVE_ARCH_STRCMP 1
|
||||
#define __HAVE_ARCH_STRNCMP 1
|
||||
#define __HAVE_ARCH_STRNICMP 1
|
||||
#define __HAVE_ARCH_STRCHR 1
|
||||
#define __HAVE_ARCH_STRRCHR 1
|
||||
#define __HAVE_ARCH_STRSTR 1
|
||||
#define __HAVE_ARCH_STRLEN 1
|
||||
#define __HAVE_ARCH_STRNLEN 1
|
||||
#define __HAVE_ARCH_MEMSET 1
|
||||
#define __HAVE_ARCH_MEMCPY 1
|
||||
#define __HAVE_ARCH_MEMMOVE 1
|
||||
#define __HAVE_ARCH_MEMSCAN 1
|
||||
#define __HAVE_ARCH_MEMCMP 1
|
||||
#define __HAVE_ARCH_MEMCHR 1
|
||||
#define __HAVE_ARCH_STRTOK 1
|
||||
|
||||
#endif /* KERNEL */
|
||||
|
||||
#endif /* _M68K_STRING_H_ */
|
|
@ -1,50 +0,0 @@
|
|||
#ifndef _H8300_SWITCH_TO_H
|
||||
#define _H8300_SWITCH_TO_H
|
||||
|
||||
/*
|
||||
* switch_to(n) should switch tasks to task ptr, first checking that
|
||||
* ptr isn't the current task, in which case it does nothing. This
|
||||
* also clears the TS-flag if the task we switched to has used the
|
||||
* math co-processor latest.
|
||||
*/
|
||||
/*
|
||||
* switch_to() saves the extra registers, that are not saved
|
||||
* automatically by SAVE_SWITCH_STACK in resume(), ie. d0-d5 and
|
||||
* a0-a1. Some of these are used by schedule() and its predecessors
|
||||
* and so we might get see unexpected behaviors when a task returns
|
||||
* with unexpected register values.
|
||||
*
|
||||
* syscall stores these registers itself and none of them are used
|
||||
* by syscall after the function in the syscall has been called.
|
||||
*
|
||||
* Beware that resume now expects *next to be in d1 and the offset of
|
||||
* tss to be in a1. This saves a few instructions as we no longer have
|
||||
* to push them onto the stack and read them back right after.
|
||||
*
|
||||
* 02/17/96 - Jes Sorensen (jds@kom.auc.dk)
|
||||
*
|
||||
* Changed 96/09/19 by Andreas Schwab
|
||||
* pass prev in a0, next in a1, offset of tss in d1, and whether
|
||||
* the mm structures are shared in d2 (to avoid atc flushing).
|
||||
*
|
||||
* H8/300 Porting 2002/09/04 Yoshinori Sato
|
||||
*/
|
||||
|
||||
asmlinkage void resume(void);
|
||||
#define switch_to(prev,next,last) { \
|
||||
void *_last; \
|
||||
__asm__ __volatile__( \
|
||||
"mov.l %1, er0\n\t" \
|
||||
"mov.l %2, er1\n\t" \
|
||||
"mov.l %3, er2\n\t" \
|
||||
"jsr @_resume\n\t" \
|
||||
"mov.l er2,%0\n\t" \
|
||||
: "=r" (_last) \
|
||||
: "r" (&(prev->thread)), \
|
||||
"r" (&(next->thread)), \
|
||||
"g" (prev) \
|
||||
: "cc", "er0", "er1", "er2", "er3"); \
|
||||
(last) = _last; \
|
||||
}
|
||||
|
||||
#endif /* _H8300_SWITCH_TO_H */
|
|
@ -1,4 +0,0 @@
|
|||
extern int platform_timer_setup(void (*timer_int)(int, void *, struct pt_regs *));
|
||||
extern void platform_timer_eoi(void);
|
||||
extern void platform_gettod(unsigned int *year, unsigned int *mon, unsigned int *day,
|
||||
unsigned int *hour, unsigned int *min, unsigned int *sec);
|
|
@ -1,50 +0,0 @@
|
|||
#ifndef _H8300_TERMIOS_H
|
||||
#define _H8300_TERMIOS_H
|
||||
|
||||
#include <uapi/asm/termios.h>
|
||||
|
||||
/* intr=^C quit=^| erase=del kill=^U
|
||||
eof=^D vtime=\0 vmin=\1 sxtc=\0
|
||||
start=^Q stop=^S susp=^Z eol=\0
|
||||
reprint=^R discard=^U werase=^W lnext=^V
|
||||
eol2=\0
|
||||
*/
|
||||
#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
|
||||
|
||||
/*
|
||||
* Translate a "termio" structure into a "termios". Ugh.
|
||||
*/
|
||||
#define user_termio_to_kernel_termios(termios, termio) \
|
||||
({ \
|
||||
unsigned short tmp; \
|
||||
get_user(tmp, &(termio)->c_iflag); \
|
||||
(termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
|
||||
get_user(tmp, &(termio)->c_oflag); \
|
||||
(termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
|
||||
get_user(tmp, &(termio)->c_cflag); \
|
||||
(termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
|
||||
get_user(tmp, &(termio)->c_lflag); \
|
||||
(termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
|
||||
get_user((termios)->c_line, &(termio)->c_line); \
|
||||
copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
|
||||
})
|
||||
|
||||
/*
|
||||
* Translate a "termios" structure into a "termio". Ugh.
|
||||
*/
|
||||
#define kernel_termios_to_user_termio(termio, termios) \
|
||||
({ \
|
||||
put_user((termios)->c_iflag, &(termio)->c_iflag); \
|
||||
put_user((termios)->c_oflag, &(termio)->c_oflag); \
|
||||
put_user((termios)->c_cflag, &(termio)->c_cflag); \
|
||||
put_user((termios)->c_lflag, &(termio)->c_lflag); \
|
||||
put_user((termios)->c_line, &(termio)->c_line); \
|
||||
copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
|
||||
})
|
||||
|
||||
#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
|
||||
#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
|
||||
#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
|
||||
#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
|
||||
|
||||
#endif /* _H8300_TERMIOS_H */
|
|
@ -1,103 +0,0 @@
|
|||
/* thread_info.h: h8300 low-level thread information
|
||||
* adapted from the i386 and PPC versions by Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
*
|
||||
* Copyright (C) 2002 David Howells (dhowells@redhat.com)
|
||||
* - Incorporating suggestions made by Linus Torvalds and Dave Miller
|
||||
*/
|
||||
|
||||
#ifndef _ASM_THREAD_INFO_H
|
||||
#define _ASM_THREAD_INFO_H
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/*
|
||||
* low level task data.
|
||||
* If you change this, change the TI_* offsets below to match.
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
int cpu; /* cpu we're on */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
struct restart_block restart_block;
|
||||
};
|
||||
|
||||
/*
|
||||
* macros/functions for gaining access to the thread information structure
|
||||
*/
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
.restart_block = { \
|
||||
.fn = do_no_restart_syscall, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define init_thread_info (init_thread_union.thread_info)
|
||||
#define init_stack (init_thread_union.stack)
|
||||
|
||||
|
||||
/*
|
||||
* Size of kernel stack for each process. This must be a power of 2...
|
||||
*/
|
||||
#define THREAD_SIZE_ORDER 1
|
||||
#define THREAD_SIZE 8192 /* 2 pages */
|
||||
|
||||
|
||||
/* how to get the thread information struct from C */
|
||||
static inline struct thread_info *current_thread_info(void)
|
||||
{
|
||||
struct thread_info *ti;
|
||||
__asm__(
|
||||
"mov.l sp, %0 \n\t"
|
||||
"and.l %1, %0"
|
||||
: "=&r"(ti)
|
||||
: "i" (~(THREAD_SIZE-1))
|
||||
);
|
||||
return ti;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* Offsets in thread_info structure, used in assembly code
|
||||
*/
|
||||
#define TI_TASK 0
|
||||
#define TI_EXECDOMAIN 4
|
||||
#define TI_FLAGS 8
|
||||
#define TI_CPU 12
|
||||
#define TI_PRE_COUNT 16
|
||||
|
||||
#define PREEMPT_ACTIVE 0x4000000
|
||||
|
||||
/*
|
||||
* thread information flag bit numbers
|
||||
*/
|
||||
#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
||||
#define TIF_SIGPENDING 1 /* signal pending */
|
||||
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
|
||||
#define TIF_MEMDIE 4 /* is terminating due to OOM killer */
|
||||
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
|
||||
#define TIF_NOTIFY_RESUME 6 /* callback before returning to user */
|
||||
|
||||
/* as above, but as bit values */
|
||||
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
|
||||
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
|
||||
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
|
||||
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
|
||||
|
||||
#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \
|
||||
_TIF_NOTIFY_RESUME)
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_THREAD_INFO_H */
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef __H8300_TIMER_H
|
||||
#define __H8300_TIMER_H
|
||||
|
||||
void h8300_timer_tick(void);
|
||||
void h8300_timer_setup(void);
|
||||
void h8300_gettod(unsigned int *year, unsigned int *mon, unsigned int *day,
|
||||
unsigned int *hour, unsigned int *min, unsigned int *sec);
|
||||
|
||||
#define TIMER_FREQ (CONFIG_CPU_CLOCK*10000) /* Timer input freq. */
|
||||
|
||||
#define calc_param(cnt, div, rate, limit) \
|
||||
do { \
|
||||
cnt = TIMER_FREQ / HZ; \
|
||||
for (div = 0; div < ARRAY_SIZE(divide_rate); div++) { \
|
||||
if (rate[div] == 0) \
|
||||
continue; \
|
||||
if ((cnt / rate[div]) > limit) \
|
||||
break; \
|
||||
} \
|
||||
if (div == ARRAY_SIZE(divide_rate)) \
|
||||
panic("Timer counter overflow"); \
|
||||
cnt /= divide_rate[div]; \
|
||||
} while(0)
|
||||
|
||||
#endif
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* linux/include/asm-h8300/timex.h
|
||||
*
|
||||
* H8/300 architecture timex specifications
|
||||
*/
|
||||
#ifndef _ASM_H8300_TIMEX_H
|
||||
#define _ASM_H8300_TIMEX_H
|
||||
|
||||
#define CLOCK_TICK_RATE (CONFIG_CPU_CLOCK*1000/8192) /* Timer input freq. */
|
||||
|
||||
typedef unsigned long cycles_t;
|
||||
extern short h8300_timer_count;
|
||||
|
||||
static inline cycles_t get_cycles(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef __H8300_TLB_H__
|
||||
#define __H8300_TLB_H__
|
||||
|
||||
#define tlb_flush(tlb) do { } while(0)
|
||||
|
||||
#include <asm-generic/tlb.h>
|
||||
|
||||
#endif
|
|
@ -1,55 +0,0 @@
|
|||
#ifndef _H8300_TLBFLUSH_H
|
||||
#define _H8300_TLBFLUSH_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 Lineo, David McCullough <davidm@uclinux.org>
|
||||
* Copyright (C) 2000-2002, Greg Ungerer <gerg@snapgear.com>
|
||||
*/
|
||||
|
||||
#include <asm/setup.h>
|
||||
|
||||
/*
|
||||
* flush all user-space atc entries.
|
||||
*/
|
||||
static inline void __flush_tlb(void)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void __flush_tlb_one(unsigned long addr)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
#define flush_tlb() __flush_tlb()
|
||||
|
||||
/*
|
||||
* flush all atc entries (both kernel and user-space entries).
|
||||
*/
|
||||
static inline void flush_tlb_all(void)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void flush_tlb_mm(struct mm_struct *mm)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void flush_tlb_range(struct mm_struct *mm,
|
||||
unsigned long start, unsigned long end)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
static inline void flush_tlb_kernel_page(unsigned long addr)
|
||||
{
|
||||
BUG();
|
||||
}
|
||||
|
||||
#endif /* _H8300_TLBFLUSH_H */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _ASM_H8300_TOPOLOGY_H
|
||||
#define _ASM_H8300_TOPOLOGY_H
|
||||
|
||||
#include <asm-generic/topology.h>
|
||||
|
||||
#endif /* _ASM_H8300_TOPOLOGY_H */
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* linux/include/asm-h8300/traps.h
|
||||
*
|
||||
* Copyright (C) 2003 Yoshinori Sato <ysato@users.sourceforge.jp>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _H8300_TRAPS_H
|
||||
#define _H8300_TRAPS_H
|
||||
|
||||
extern void system_call(void);
|
||||
extern void interrupt_entry(void);
|
||||
extern void trace_break(void);
|
||||
|
||||
#define JMP_OP 0x5a000000
|
||||
#define JSR_OP 0x5e000000
|
||||
#define VECTOR(address) ((JMP_OP)|((unsigned long)address))
|
||||
#define REDIRECT(address) ((JSR_OP)|((unsigned long)address))
|
||||
|
||||
#define TRACE_VEC 5
|
||||
|
||||
#define TRAP0_VEC 8
|
||||
#define TRAP1_VEC 9
|
||||
#define TRAP2_VEC 10
|
||||
#define TRAP3_VEC 11
|
||||
|
||||
#if defined(__H8300H__)
|
||||
#define NR_TRAPS 12
|
||||
#endif
|
||||
#if defined(__H8300S__)
|
||||
#define NR_TRAPS 16
|
||||
#endif
|
||||
|
||||
#endif /* _H8300_TRAPS_H */
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef _H8300_TYPES_H
|
||||
#define _H8300_TYPES_H
|
||||
|
||||
#include <uapi/asm/types.h>
|
||||
|
||||
|
||||
#define BITS_PER_LONG 32
|
||||
|
||||
#endif /* _H8300_TYPES_H */
|
|
@ -1,163 +0,0 @@
|
|||
#ifndef __H8300_UACCESS_H
|
||||
#define __H8300_UACCESS_H
|
||||
|
||||
/*
|
||||
* User space memory access functions
|
||||
*/
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
|
||||
#define VERIFY_READ 0
|
||||
#define VERIFY_WRITE 1
|
||||
|
||||
/* We let the MMU do all checking */
|
||||
#define access_ok(type, addr, size) __access_ok((unsigned long)addr,size)
|
||||
static inline int __access_ok(unsigned long addr, unsigned long size)
|
||||
{
|
||||
#define RANGE_CHECK_OK(addr, size, lower, upper) \
|
||||
(((addr) >= (lower)) && (((addr) + (size)) < (upper)))
|
||||
|
||||
extern unsigned long _ramend;
|
||||
return(RANGE_CHECK_OK(addr, size, 0L, (unsigned long)&_ramend));
|
||||
}
|
||||
|
||||
/*
|
||||
* The exception table consists of pairs of addresses: the first is the
|
||||
* address of an instruction that is allowed to fault, and the second is
|
||||
* the address at which the program should continue. No registers are
|
||||
* modified, so it is entirely up to the continuation code to figure out
|
||||
* what to do.
|
||||
*
|
||||
* All the routines below use bits of fixup code that are out of line
|
||||
* with the main instruction path. This means when everything is well,
|
||||
* we don't even have to jump over them. Further, they do not intrude
|
||||
* on our cache or tlb entries.
|
||||
*/
|
||||
|
||||
struct exception_table_entry
|
||||
{
|
||||
unsigned long insn, fixup;
|
||||
};
|
||||
|
||||
/* Returns 0 if exception not found and fixup otherwise. */
|
||||
extern unsigned long search_exception_table(unsigned long);
|
||||
|
||||
|
||||
/*
|
||||
* These are the main single-value transfer routines. They automatically
|
||||
* use the right size if we just have the right pointer type.
|
||||
*/
|
||||
|
||||
#define put_user(x, ptr) \
|
||||
({ \
|
||||
int __pu_err = 0; \
|
||||
typeof(*(ptr)) __pu_val = (x); \
|
||||
switch (sizeof (*(ptr))) { \
|
||||
case 1: \
|
||||
case 2: \
|
||||
case 4: \
|
||||
*(ptr) = (__pu_val); \
|
||||
break; \
|
||||
case 8: \
|
||||
memcpy(ptr, &__pu_val, sizeof (*(ptr))); \
|
||||
break; \
|
||||
default: \
|
||||
__pu_err = __put_user_bad(); \
|
||||
break; \
|
||||
} \
|
||||
__pu_err; \
|
||||
})
|
||||
#define __put_user(x, ptr) put_user(x, ptr)
|
||||
|
||||
extern int __put_user_bad(void);
|
||||
|
||||
/*
|
||||
* Tell gcc we read from memory instead of writing: this is because
|
||||
* we do not write to any memory gcc knows about, so there are no
|
||||
* aliasing issues.
|
||||
*/
|
||||
|
||||
#define __ptr(x) ((unsigned long *)(x))
|
||||
|
||||
/*
|
||||
* Tell gcc we read from memory instead of writing: this is because
|
||||
* we do not write to any memory gcc knows about, so there are no
|
||||
* aliasing issues.
|
||||
*/
|
||||
|
||||
#define get_user(x, ptr) \
|
||||
({ \
|
||||
int __gu_err = 0; \
|
||||
typeof(*(ptr)) __gu_val = *ptr; \
|
||||
switch (sizeof(*(ptr))) { \
|
||||
case 1: \
|
||||
case 2: \
|
||||
case 4: \
|
||||
case 8: \
|
||||
break; \
|
||||
default: \
|
||||
__gu_err = __get_user_bad(); \
|
||||
break; \
|
||||
} \
|
||||
(x) = __gu_val; \
|
||||
__gu_err; \
|
||||
})
|
||||
#define __get_user(x, ptr) get_user(x, ptr)
|
||||
|
||||
extern int __get_user_bad(void);
|
||||
|
||||
#define copy_from_user(to, from, n) (memcpy(to, from, n), 0)
|
||||
#define copy_to_user(to, from, n) (memcpy(to, from, n), 0)
|
||||
|
||||
#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
|
||||
#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
|
||||
#define __copy_to_user_inatomic __copy_to_user
|
||||
#define __copy_from_user_inatomic __copy_from_user
|
||||
|
||||
#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; })
|
||||
|
||||
#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; })
|
||||
|
||||
/*
|
||||
* Copy a null terminated string from userspace.
|
||||
*/
|
||||
|
||||
static inline long
|
||||
strncpy_from_user(char *dst, const char *src, long count)
|
||||
{
|
||||
char *tmp;
|
||||
strncpy(dst, src, count);
|
||||
for (tmp = dst; *tmp && count > 0; tmp++, count--)
|
||||
;
|
||||
return(tmp - dst); /* DAVIDM should we count a NUL ? check getname */
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the size of a string (including the ending 0)
|
||||
*
|
||||
* Return 0 on exception, a value greater than N if too long
|
||||
*/
|
||||
static inline long strnlen_user(const char *src, long n)
|
||||
{
|
||||
return(strlen(src) + 1); /* DAVIDM make safer */
|
||||
}
|
||||
|
||||
#define strlen_user(str) strnlen_user(str, 32767)
|
||||
|
||||
/*
|
||||
* Zero Userspace
|
||||
*/
|
||||
|
||||
static inline unsigned long
|
||||
clear_user(void *to, unsigned long n)
|
||||
{
|
||||
memset(to, 0, n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define __clear_user clear_user
|
||||
|
||||
#endif /* _H8300_UACCESS_H */
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef _H8300_UCONTEXT_H
|
||||
#define _H8300_UCONTEXT_H
|
||||
|
||||
struct ucontext {
|
||||
unsigned long uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
struct sigcontext uc_mcontext;
|
||||
sigset_t uc_sigmask; /* mask last for extensibility */
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef _ASM_H8300_UNALIGNED_H
|
||||
#define _ASM_H8300_UNALIGNED_H
|
||||
|
||||
#include <linux/unaligned/be_memmove.h>
|
||||
#include <linux/unaligned/le_byteshift.h>
|
||||
#include <linux/unaligned/generic.h>
|
||||
|
||||
#define get_unaligned __get_unaligned_be
|
||||
#define put_unaligned __put_unaligned_be
|
||||
|
||||
#endif /* _ASM_H8300_UNALIGNED_H */
|
|
@ -1,36 +0,0 @@
|
|||
#ifndef _ASM_H8300_UNISTD_H_
|
||||
#define _ASM_H8300_UNISTD_H_
|
||||
|
||||
#include <uapi/asm/unistd.h>
|
||||
|
||||
|
||||
#define NR_syscalls 321
|
||||
|
||||
#define __ARCH_WANT_OLD_READDIR
|
||||
#define __ARCH_WANT_OLD_STAT
|
||||
#define __ARCH_WANT_STAT64
|
||||
#define __ARCH_WANT_SYS_ALARM
|
||||
#define __ARCH_WANT_SYS_GETHOSTNAME
|
||||
#define __ARCH_WANT_SYS_IPC
|
||||
#define __ARCH_WANT_SYS_PAUSE
|
||||
#define __ARCH_WANT_SYS_SGETMASK
|
||||
#define __ARCH_WANT_SYS_SIGNAL
|
||||
#define __ARCH_WANT_SYS_TIME
|
||||
#define __ARCH_WANT_SYS_UTIME
|
||||
#define __ARCH_WANT_SYS_WAITPID
|
||||
#define __ARCH_WANT_SYS_SOCKETCALL
|
||||
#define __ARCH_WANT_SYS_FADVISE64
|
||||
#define __ARCH_WANT_SYS_GETPGRP
|
||||
#define __ARCH_WANT_SYS_LLSEEK
|
||||
#define __ARCH_WANT_SYS_NICE
|
||||
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
|
||||
#define __ARCH_WANT_SYS_OLD_MMAP
|
||||
#define __ARCH_WANT_SYS_OLD_SELECT
|
||||
#define __ARCH_WANT_SYS_OLDUMOUNT
|
||||
#define __ARCH_WANT_SYS_SIGPENDING
|
||||
#define __ARCH_WANT_SYS_SIGPROCMASK
|
||||
#define __ARCH_WANT_SYS_FORK
|
||||
#define __ARCH_WANT_SYS_VFORK
|
||||
#define __ARCH_WANT_SYS_CLONE
|
||||
|
||||
#endif /* _ASM_H8300_UNISTD_H_ */
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef _H8300_USER_H
|
||||
#define _H8300_USER_H
|
||||
|
||||
#include <asm/page.h>
|
||||
|
||||
/* Core file format: The core file is written in such a way that gdb
|
||||
can understand it and provide useful information to the user (under
|
||||
linux we use the 'trad-core' bfd). There are quite a number of
|
||||
obstacles to being able to view the contents of the floating point
|
||||
registers, and until these are solved you will not be able to view the
|
||||
contents of them. Actually, you can read in the core file and look at
|
||||
the contents of the user struct to find out what the floating point
|
||||
registers contain.
|
||||
The actual file contents are as follows:
|
||||
UPAGE: 1 page consisting of a user struct that tells gdb what is present
|
||||
in the file. Directly after this is a copy of the task_struct, which
|
||||
is currently not used by gdb, but it may come in useful at some point.
|
||||
All of the registers are stored as part of the upage. The upage should
|
||||
always be only one page.
|
||||
DATA: The data area is stored. We use current->end_text to
|
||||
current->brk to pick up all of the user variables, plus any memory
|
||||
that may have been malloced. No attempt is made to determine if a page
|
||||
is demand-zero or if a page is totally unused, we just cover the entire
|
||||
range. All of the addresses are rounded in such a way that an integral
|
||||
number of pages is written.
|
||||
STACK: We need the stack information in order to get a meaningful
|
||||
backtrace. We need to write the data from (esp) to
|
||||
current->start_stack, so we round each of these off in order to be able
|
||||
to write an integer number of pages.
|
||||
The minimum core file size is 3 pages, or 12288 bytes.
|
||||
*/
|
||||
|
||||
/* This is the old layout of "struct pt_regs" as of Linux 1.x, and
|
||||
is still the layout used by user (the new pt_regs doesn't have
|
||||
all registers). */
|
||||
struct user_regs_struct {
|
||||
long er1,er2,er3,er4,er5,er6;
|
||||
long er0;
|
||||
long usp;
|
||||
long orig_er0;
|
||||
short ccr;
|
||||
long pc;
|
||||
};
|
||||
|
||||
|
||||
/* When the kernel dumps core, it starts by dumping the user struct -
|
||||
this will be used by gdb to figure out where the data and stack segments
|
||||
are within the file, and what virtual addresses to use. */
|
||||
struct user{
|
||||
/* We start with the registers, to mimic the way that "memory" is returned
|
||||
from the ptrace(3,...) function. */
|
||||
struct user_regs_struct regs; /* Where the registers are actually stored */
|
||||
/* ptrace does not yet supply these. Someday.... */
|
||||
/* The rest of this junk is to help gdb figure out what goes where */
|
||||
unsigned long int u_tsize; /* Text segment size (pages). */
|
||||
unsigned long int u_dsize; /* Data segment size (pages). */
|
||||
unsigned long int u_ssize; /* Stack segment size (pages). */
|
||||
unsigned long start_code; /* Starting virtual address of text. */
|
||||
unsigned long start_stack; /* Starting virtual address of stack area.
|
||||
This is actually the bottom of the stack,
|
||||
the top of the stack is always found in the
|
||||
esp register. */
|
||||
long int signal; /* Signal that caused the core dump. */
|
||||
int reserved; /* No longer used */
|
||||
unsigned long u_ar0; /* Used by gdb to help find the values for */
|
||||
/* the registers. */
|
||||
unsigned long magic; /* To uniquely identify a core file */
|
||||
char u_comm[32]; /* User command that was responsible */
|
||||
};
|
||||
#define NBPG PAGE_SIZE
|
||||
#define UPAGES 1
|
||||
#define HOST_TEXT_START_ADDR (u.start_code)
|
||||
#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
|
||||
|
||||
#endif
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef __H8300_VIRT_CONVERT__
|
||||
#define __H8300_VIRT_CONVERT__
|
||||
|
||||
/*
|
||||
* Macros used for converting between virtual and physical mappings.
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#define phys_to_virt(vaddr) ((void *) (vaddr))
|
||||
#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
|
||||
|
||||
#define virt_to_bus virt_to_phys
|
||||
#define bus_to_virt phys_to_virt
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,34 +0,0 @@
|
|||
# UAPI Header export list
|
||||
include include/uapi/asm-generic/Kbuild.asm
|
||||
|
||||
header-y += auxvec.h
|
||||
header-y += bitsperlong.h
|
||||
header-y += byteorder.h
|
||||
header-y += errno.h
|
||||
header-y += fcntl.h
|
||||
header-y += ioctl.h
|
||||
header-y += ioctls.h
|
||||
header-y += ipcbuf.h
|
||||
header-y += kvm_para.h
|
||||
header-y += mman.h
|
||||
header-y += msgbuf.h
|
||||
header-y += param.h
|
||||
header-y += poll.h
|
||||
header-y += posix_types.h
|
||||
header-y += ptrace.h
|
||||
header-y += resource.h
|
||||
header-y += sembuf.h
|
||||
header-y += setup.h
|
||||
header-y += shmbuf.h
|
||||
header-y += sigcontext.h
|
||||
header-y += siginfo.h
|
||||
header-y += signal.h
|
||||
header-y += socket.h
|
||||
header-y += sockios.h
|
||||
header-y += stat.h
|
||||
header-y += statfs.h
|
||||
header-y += swab.h
|
||||
header-y += termbits.h
|
||||
header-y += termios.h
|
||||
header-y += types.h
|
||||
header-y += unistd.h
|
|
@ -1,4 +0,0 @@
|
|||
#ifndef __ASMH8300_AUXVEC_H
|
||||
#define __ASMH8300_AUXVEC_H
|
||||
|
||||
#endif
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/bitsperlong.h>
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_BYTEORDER_H
|
||||
#define _H8300_BYTEORDER_H
|
||||
|
||||
#include <linux/byteorder/big_endian.h>
|
||||
|
||||
#endif /* _H8300_BYTEORDER_H */
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _H8300_ERRNO_H
|
||||
#define _H8300_ERRNO_H
|
||||
|
||||
#include <asm-generic/errno.h>
|
||||
|
||||
#endif /* _H8300_ERRNO_H */
|
|
@ -1,11 +0,0 @@
|
|||
#ifndef _H8300_FCNTL_H
|
||||
#define _H8300_FCNTL_H
|
||||
|
||||
#define O_DIRECTORY 040000 /* must be a directory */
|
||||
#define O_NOFOLLOW 0100000 /* don't follow links */
|
||||
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
|
||||
#define O_LARGEFILE 0400000
|
||||
|
||||
#include <asm-generic/fcntl.h>
|
||||
|
||||
#endif /* _H8300_FCNTL_H */
|
|
@ -1 +0,0 @@
|
|||
#include <asm-generic/ioctl.h>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue