h8300: system call entry table
Subsystems (10)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/16 h8300: Assembly headers
create mode 100644 arch/h8300/include/asm/Kbuild create mode 100644 arch/h8300/include/asm/asm-offsets.h create mode 100644 arch/h8300/include/asm/atomic.h create mode 100644 arch/h8300/include/asm/bitops.h create mode 100644 arch/h8300/include/asm/bootparams.h create mode 100644 arch/h8300/include/asm/bug.h create mode 100644 arch/h8300/include/asm/bugs.h create mode 100644 arch/h8300/include/asm/cache.h create mode 100644 arch/h8300/include/asm/cacheflush.h create mode 100644 arch/h8300/include/asm/checksum.h create mode 100644 arch/h8300/include/asm/clk.h create mode 100644 arch/h8300/include/asm/cmpxchg.h create mode 100644 arch/h8300/include/asm/cputime.h create mode 100644 arch/h8300/include/asm/delay.h create mode 100644 arch/h8300/include/asm/device.h create mode 100644 arch/h8300/include/asm/dma.h create mode 100644 arch/h8300/include/asm/elf.h create mode 100644 arch/h8300/include/asm/emergency-restart.h create mode 100644 arch/h8300/include/asm/flat.h create mode 100644 arch/h8300/include/asm/hw_irq.h create mode 100644 arch/h8300/include/asm/io.h create mode 100644 arch/h8300/include/asm/irq.h create mode 100644 arch/h8300/include/asm/irqflags.h create mode 100644 arch/h8300/include/asm/mc146818rtc.h create mode 100644 arch/h8300/include/asm/mutex.h create mode 100644 arch/h8300/include/asm/page.h create mode 100644 arch/h8300/include/asm/page_offset.h create mode 100644 arch/h8300/include/asm/pci.h create mode 100644 arch/h8300/include/asm/pgtable.h create mode 100644 arch/h8300/include/asm/processor.h create mode 100644 arch/h8300/include/asm/ptrace.h create mode 100644 arch/h8300/include/asm/segment.h create mode 100644 arch/h8300/include/asm/sh_bios.h create mode 100644 arch/h8300/include/asm/signal.h create mode 100644 arch/h8300/include/asm/smp.h create mode 100644 arch/h8300/include/asm/spinlock.h create mode 100644 arch/h8300/include/asm/string.h create mode 100644 arch/h8300/include/asm/switch_to.h create mode 100644 arch/h8300/include/asm/thread_info.h create mode 100644 arch/h8300/include/asm/timer.h create mode 100644 arch/h8300/include/asm/timex.h create mode 100644 arch/h8300/include/asm/tlb.h create mode 100644 arch/h8300/include/asm/topology.h create mode 100644 arch/h8300/include/asm/traps.h create mode 100644 arch/h8300/include/asm/uaccess.h create mode 100644 arch/h8300/include/asm/unaligned.h create mode 100644 arch/h8300/include/asm/unistd.h create mode 100644 arch/h8300/include/asm/user.h
arch/h8300/include/asm/Kbuild new file +62 -0
@@ -0,0 +1,62 @@ +generic-y += barrier.h +generic-y += bitsperlong.h +generic-y += bugs.h +generic-y += cacheflush.h +generic-y += clkdev.h +generic-y += cputime.h +generic-y += current.h +generic-y += div64.h +generic-y += dma.h +generic-y += emergency-restart.h +generic-y += errno.h +generic-y += exec.h +generic-y += fcntl.h +generic-y += ftrace.h +generic-y += hardirq.h +generic-y += hash.h +generic-y += hw_irq.h +generic-y += ioctl.h +generic-y += ioctls.h +generic-y += ipcbuf.h +generic-y += irq_regs.h +generic-y += irq_work.h +generic-y += kdebug.h +generic-y += kmap_types.h +generic-y += kvm_para.h +generic-y += linkage.h +generic-y += local.h +generic-y += local64.h +generic-y += mcs_spinlock.h +generic-y += mman.h +generic-y += mmu.h +generic-y += mmu_context.h +generic-y += module.h +generic-y += msgbuf.h +generic-y += param.h +generic-y += parport.h +generic-y += percpu.h +generic-y += pgalloc.h +generic-y += poll.h +generic-y += posix_types.h +generic-y += preempt.h +generic-y += resource.h +generic-y += scatterlist.h +generic-y += sections.h +generic-y += sembuf.h +generic-y += serial.h +generic-y += setup.h +generic-y += shmbuf.h +generic-y += shmparam.h +generic-y += siginfo.h +generic-y += sizes.h +generic-y += socket.h +generic-y += sockios.h +generic-y += stat.h +generic-y += statfs.h +generic-y += termbits.h +generic-y += termios.h +generic-y += tlbflush.h +generic-y += trace_clock.h +generic-y += types.h +generic-y += ucontext.h +generic-y += xor.h
arch/h8300/include/asm/asm-offsets.h new file +1 -0
@@ -0,0 +1 @@ +#include <generated/asm-offsets.h>
arch/h8300/include/asm/atomic.h new file +196 -0
196 lines not on this page · raw message
arch/h8300/include/asm/bitops.h new file +185 -0
185 lines not on this page · raw message
arch/h8300/include/asm/bootparams.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +H8/300 kernel boot parameters +*/ + +#ifndef __ASM_H8300_BOOTPARAMS__ +#define __ASM_H8300_BOOTPARAMS__ + +struct bootparams { +short size; +unsigned char gpio_ddr[24 ]; +unsigned char gpio_use[24 ]; +unsigned int clock_freq; +unsigned int ram_end; +unsigned char *command_line; +} __packed__aligned(2) ; + +#endif
arch/h8300/include/asm/bug.h new file +12 -0
@@ -0,0 +1,12 @@ +#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
arch/h8300/include/asm/bugs.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/bugs.h>
arch/h8300/include/asm/cache.h new file +13 -0
@@ -0,0 +1,13 @@ +#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
arch/h8300/include/asm/cacheflush.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/cacheflush.h>
arch/h8300/include/asm/checksum.h new file +102 -0
102 lines not on this page · raw message
arch/h8300/include/asm/clk.h new file +10 -0
@@ -0,0 +1,10 @@ +#ifndef __H8300_CLK_H +#define __H8300_CLK_H + +struct clk { +struct clk *parent; +unsigned long rate; +unsigned long flags; +}; + +#endif
arch/h8300/include/asm/cmpxchg.h new file +65 -0
65 lines not on this page · raw message
arch/h8300/include/asm/cputime.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef __H8300_CPUTIME_H +#define __H8300_CPUTIME_H + +#include <asm-generic/cputime.h> + +#endif /* __H8300_CPUTIME_H */
arch/h8300/include/asm/delay.h new file +38 -0
@@ -0,0 +1,38 @@ +#ifndef _H8300_DELAY_H +#define _H8300_DELAY_H + +#include <asm/param.h> + +/* +* Copyright (C) 2002 Yoshinori Sato <[email protected]> +* +* 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 */
arch/h8300/include/asm/device.h new file +7 -0
@@ -0,0 +1,7 @@ +/* +* Arch specific extensions to struct device +* +* This file is released under the GPLv2 +*/ +#include <asm-generic/device.h> +
arch/h8300/include/asm/dma.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/dma.h>
arch/h8300/include/asm/elf.h new file +101 -0
101 lines not on this page · raw message
arch/h8300/include/asm/emergency-restart.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASM_EMERGENCY_RESTART_H +#define _ASM_EMERGENCY_RESTART_H + +#include <asm-generic/emergency-restart.h> + +#endif /* _ASM_EMERGENCY_RESTART_H */
arch/h8300/include/asm/flat.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* arch/h8300/asm/include/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 ([email protected]) +*/ + +#define flat_get_relocate_addr (rel) (rel & ~0x00000001) +#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__ */
arch/h8300/include/asm/hw_irq.h new file +1 -0
@@ -0,0 +1 @@ +/* Do Nothing */
arch/h8300/include/asm/io.h new file +355 -0
355 lines not on this page · raw message
arch/h8300/include/asm/irq.h new file +26 -0
@@ -0,0 +1,26 @@ +#ifndef _H8300_IRQ_H_ +#define _H8300_IRQ_H_ + +#include <linux/irqchip.h> + +#if defined(CONFIG_CPU_H8300H ) +#define NR_IRQS 64 +#define IRQ_CHIP h8300h_irq_chip +#define EXT_IRQ0 12 +#define EXT_IRQS 6 +#elif defined(CONFIG_CPU_H8S ) +#define NR_IRQS 128 +#define IRQ_CHIP h8s_irq_chip +#define EXT_IRQ0 16 +#define EXT_IRQS 16 +#endif + +static __inline__int irq_canonicalize (int irq) +{ +return irq; +} + +void h8300_init_ipr (void ); +extern struct irq_chip h8300h_irq_chip; +extern struct irq_chip h8s_irq_chip; +#endif /* _H8300_IRQ_H_ */
arch/h8300/include/asm/irqflags.h new file +92 -0
92 lines not on this page · raw message
arch/h8300/include/asm/mc146818rtc.h new file +9 -0
@@ -0,0 +1,9 @@ +/* +* 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 */
arch/h8300/include/asm/mutex.h new file +9 -0
@@ -0,0 +1,9 @@ +/* +* 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>
arch/h8300/include/asm/page.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef _H8300_PAGE_H +#define _H8300_PAGE_H + +#include <asm-generic/page.h> +#include <linux/types.h> + +#define MAP_NR (addr) (((uintptr_t)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) + +#endif
arch/h8300/include/asm/page_offset.h new file +3 -0
@@ -0,0 +1,3 @@ + +#define PAGE_OFFSET_RAW 0x00000000 +
arch/h8300/include/asm/pci.h new file +19 -0
@@ -0,0 +1,19 @@ +#ifndef _ASM_H8300_PCI_H +#define _ASM_H8300_PCI_H + +/* +* asm-h8300/pci.h - H8/300 specific PCI declarations. +* +* Yoshinori Sato <[email protected]> +*/ + +#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 */
arch/h8300/include/asm/pgtable.h new file +47 -0
47 lines not on this page · raw message
arch/h8300/include/asm/processor.h new file +144 -0
144 lines not on this page · raw message
arch/h8300/include/asm/ptrace.h new file +34 -0
@@ -0,0 +1,34 @@ +#ifndef _H8300_PTRACE_H +#define _H8300_PTRACE_H + +#include <uapi/asm/ptrace.h> + +#ifndef __ASSEMBLY__ +#ifndef PS_S +#define PS_S (0x10) +#endif + +#if defined(CONFIG_CPU_H8300H ) +#define H8300_REGS_NO 11 +#endif +#if defined(CONFIG_CPU_H8S ) +#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() +#define task_pt_regs (task) \ + ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1) + +#endif /* __ASSEMBLY__ */ +#endif /* _H8300_PTRACE_H */
arch/h8300/include/asm/segment.h new file +49 -0
49 lines not on this page · raw message
arch/h8300/include/asm/sh_bios.h new file +33 -0
@@ -0,0 +1,33 @@ +/* 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
arch/h8300/include/asm/signal.h new file +24 -0
@@ -0,0 +1,24 @@ +#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 */
arch/h8300/include/asm/smp.h new file +1 -0
@@ -0,0 +1 @@ +/* nothing required here yet */
arch/h8300/include/asm/spinlock.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef __H8300_SPINLOCK_H +#define __H8300_SPINLOCK_H + +#error "H8/300 doesn't do SMP yet" + +#endif
arch/h8300/include/asm/string.h new file +17 -0
@@ -0,0 +1,17 @@ +#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); + +#endif /* KERNEL */ + +#endif
arch/h8300/include/asm/switch_to.h new file +51 -0
51 lines not on this page · raw message
arch/h8300/include/asm/thread_info.h new file +100 -0
100 lines not on this page · raw message
arch/h8300/include/asm/timer.h new file +31 -0
@@ -0,0 +1,31 @@ +#ifndef __H8300_TIMER_H +#define __H8300_TIMER_H + +unsigned long get_cpu_clock (void ); + +#define H8300_TIMER_FREQ get_cpu_clock()/* Timer input freq. */ + +#define H8300_TMR8_CLKSRC 0 +#define H8300_TMR8_CLKEVTDEV 1 + +#define H8300_TMR8_DIV_8 0 +#define H8300_TMR8_DIV_64 1 +#define H8300_TMR8_DIV_8192 2 + +struct h8300_timer8_config { +int mode; +int div; +int rating; +}; + +struct h8300_timer16_config { +int rating; +__u8 enb; +__u8 imfa; +__u8 imiea; +}; + +struct h8300_tpu_config { +int rating; +}; +#endif
arch/h8300/include/asm/timex.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* 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
arch/h8300/include/asm/tlb.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef __H8300_TLB_H__ +#define __H8300_TLB_H__ + +#define tlb_flush (tlb) do { } while (0) + +#include <asm-generic/tlb.h> + +#endif
arch/h8300/include/asm/topology.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _ASM_H8300_TOPOLOGY_H +#define _ASM_H8300_TOPOLOGY_H + +#include <asm-generic/topology.h> + +#endif /* _ASM_H8300_TOPOLOGY_H */
arch/h8300/include/asm/traps.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* linux/include/asm-h8300/traps.h +* +* Copyright (C) 2003 Yoshinori Sato <[email protected]> +* +* 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 ); +extern void _nmi (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 + +#endif /* _H8300_TRAPS_H */
arch/h8300/include/asm/uaccess.h new file +145 -0
145 lines not on this page · raw message
arch/h8300/include/asm/unaligned.h new file +11 -0
@@ -0,0 +1,11 @@ +#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 */
arch/h8300/include/asm/unistd.h new file +26 -0
@@ -0,0 +1,26 @@ +#ifndef _ASM_H8300_UNISTD_H_ +#define _ASM_H8300_UNISTD_H_ + +#include <uapi/asm/unistd.h> + +#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_SIGPENDING +#define __ARCH_WANT_SYS_SIGPROCMASK +#define __ARCH_WANT_SYS_VFORK +#define __ARCH_WANT_SYS_CLONE + +#endif /* _ASM_H8300_UNISTD_H_ */
arch/h8300/include/asm/user.h new file +74 -0
74 lines not on this page · raw message
Signature · 1 line
2.1.3
Re: [PATCH 01/16] h8300: Assembly headers
arch/h8300/include/asm/cache.h line 8
Quoted 11 lines · Yoshinori Sato
arch/h8300/include/asm/cache.h new file +8
-0@@ -0,0 +1,13 @@ +#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 */
Please drop the above comment.
Quoted 16 lines
arch/h8300/include/asm/cache.h new file +5
-0+ +#define __cacheline_aligned +#define ____cacheline_aligned + +#endif arch/h8300/include/asm/io.h new file +7
-0@@ -0,0 +1,355 @@ +#ifndef _H8300_IO_H +#define _H8300_IO_H + +#ifdef __KERNEL__ + +/* +* These are for ISA/PCI shared memory _only_ and should never be used
arch/h8300/include/asm/io.h line 17
Quoted 10 lines
arch/h8300/include/asm/io.h new file +10
-0+* 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.
I doubt all of the above is relevant for h8300.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 01/16] h8300: Assembly headers
At Wed, 21 Jan 2015 12:02:14 +0100,
Quoted 16 lines · Geert Uytterhoeven
arch/h8300/include/asm/cache.h line 8
Quoted 11 lines · Yoshinori Sato
arch/h8300/include/asm/cache.h new file +8
-0@@ -0,0 +1,13 @@ +#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 */ Please drop the above comment.
OK.
fix V2 patch.
Quoted 40 lines
Quoted 17 lines
arch/h8300/include/asm/cache.h new file +5
-0+ +#define __cacheline_aligned +#define ____cacheline_aligned + +#endif arch/h8300/include/asm/io.h new file +7
-0@@ -0,0 +1,355 @@ +#ifndef _H8300_IO_H +#define _H8300_IO_H + +#ifdef __KERNEL__ + +/* +* These are for ISA/PCI shared memory _only_ and should never be used arch/h8300/include/asm/io.h line 17
Quoted 10 lines
arch/h8300/include/asm/io.h new file +10
-0+* 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. I doubt all of the above is relevant for h8300.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Signature · 2 lines
Yoshinori Sato <[email protected]>
PATCH 2/16 h8300: UAPI headers
In reply to a message not in the archivecreate mode 100644 arch/h8300/include/uapi/asm/Kbuild create mode 100644 arch/h8300/include/uapi/asm/auxvec.h create mode 100644 arch/h8300/include/uapi/asm/byteorder.h create mode 100644 arch/h8300/include/uapi/asm/ptrace.h create mode 100644 arch/h8300/include/uapi/asm/sigcontext.h create mode 100644 arch/h8300/include/uapi/asm/signal.h create mode 100644 arch/h8300/include/uapi/asm/swab.h create mode 100644 arch/h8300/include/uapi/asm/unistd.h
arch/h8300/include/uapi/asm/Kbuild new file +27 -0
@@ -0,0 +1,27 @@ +# UAPI Header export list +include include/uapi/asm-generic/Kbuild.asm + +header-y += bitsperlong.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 += resource.h +header-y += sembuf.h +header-y += setup.h +header-y += shmbuf.h +header-y += siginfo.h +header-y += socket.h +header-y += sockios.h +header-y += stat.h +header-y += statfs.h +header-y += termbits.h +header-y += termios.h +header-y += types.h
arch/h8300/include/uapi/asm/auxvec.h new file +4 -0
@@ -0,0 +1,4 @@ +#ifndef __ASMH8300_AUXVEC_H +#define __ASMH8300_AUXVEC_H + +#endif
arch/h8300/include/uapi/asm/byteorder.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef _H8300_BYTEORDER_H +#define _H8300_BYTEORDER_H + +#include <linux/byteorder/big_endian.h> + +#endif /* _H8300_BYTEORDER_H */
arch/h8300/include/uapi/asm/ptrace.h new file +44 -0
44 lines not on this page · raw message
arch/h8300/include/uapi/asm/sigcontext.h new file +18 -0
@@ -0,0 +1,18 @@ +#ifndef _ASM_H8300_SIGCONTEXT_H +#define _ASM_H8300_SIGCONTEXT_H + +struct sigcontext { +unsigned long sc_mask;/* old sigmask */ +unsigned long sc_usp;/* old user stack pointer */ +unsigned long sc_er0; +unsigned long sc_er1; +unsigned long sc_er2; +unsigned long sc_er3; +unsigned long sc_er4; +unsigned long sc_er5; +unsigned long sc_er6; +unsigned short sc_ccr; +unsigned long sc_pc; +}; + +#endif
arch/h8300/include/uapi/asm/signal.h new file +115 -0
115 lines not on this page · raw message
arch/h8300/include/uapi/asm/swab.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/swab.h>
arch/h8300/include/uapi/asm/unistd.h new file +370 -0
370 lines not on this page · raw message
Signature · 1 line
2.1.3
Arnd Bergmann
maintainerRe: [PATCH 02/16] h8300: UAPI headers
Quoted 10 lines · On Wednesday 21 January 2015 13:23:57 Yoshinori Sato wrote:
Signed-off-by Yoshinori Sato <[email protected]>create mode 100644 arch/h8300/include/uapi/asm/Kbuild create mode 100644 arch/h8300/include/uapi/asm/auxvec.h create mode 100644 arch/h8300/include/uapi/asm/byteorder.h create mode 100644 arch/h8300/include/uapi/asm/ptrace.h create mode 100644 arch/h8300/include/uapi/asm/sigcontext.h create mode 100644 arch/h8300/include/uapi/asm/signal.h create mode 100644 arch/h8300/include/uapi/asm/swab.h create mode 100644 arch/h8300/include/uapi/asm/unistd.h
In the introductory mail, you mention that you have a new toolchain. I assume this implies that all existing user space binaries are incompatible with new kernels. If so, I would like to ask you to use the generic ABI where possible. In particular, using asm-generic/unistd.h to get the default system call table that is now shared across all new architectures, but asm-generic/signal.h also looks like it could be used here and asm-generic/swab.h might work but depends on performance considerations.
Arnd
Re: [PATCH 02/16] h8300: UAPI headers
At Wed, 21 Jan 2015 09:46:58 +0100,
Quoted 13 lines · Arnd Bergmann
Quoted 10 lines · On Wednesday 21 January 2015 13:23:57 Yoshinori Sato wrote:
Signed-off-by Yoshinori Sato <[email protected]>create mode 100644 arch/h8300/include/uapi/asm/Kbuild create mode 100644 arch/h8300/include/uapi/asm/auxvec.h create mode 100644 arch/h8300/include/uapi/asm/byteorder.h create mode 100644 arch/h8300/include/uapi/asm/ptrace.h create mode 100644 arch/h8300/include/uapi/asm/sigcontext.h create mode 100644 arch/h8300/include/uapi/asm/signal.h create mode 100644 arch/h8300/include/uapi/asm/swab.h create mode 100644 arch/h8300/include/uapi/asm/unistd.h
Quoted 10 lines
In the introductory mail, you mention that you have a new toolchain. I assume this implies that all existing user space binaries are incompatible with new kernels. If so, I would like to ask you to use the generic ABI where possible. In particular, using
asm-generic/unistd.hto get the default system call table that is now shared across all new architectures, butasm-generic/signal.halso looks like it could be used here andasm-generic/swab.hmight work but depends on performance considerations.
Hmm...
I think old ABI compatibility is not needed. Because toolchain not have compatibility.
unistd.h is agree.signal.h and swab.h is considered.
Quoted 5 lines
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Yoshinori Sato <[email protected]>
PATCH 3/16 h8300: defconfigs
In reply to a message not in the archivecreate mode 100644 arch/h8300/configs/h8300h-sim_defconfig create mode 100644 arch/h8300/configs/h8s-sim_defconfig
arch/h8300/configs/h8300h-sim_defconfig new file +603 -0
@@ -0,0 +1,603 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/h8300 3.19.0-rc3 Kernel Configuration +# +CONFIG_H8300=y +# CONFIG_MMU is not set +# CONFIG_SWAP is not set +CONFIG_ZONE_DMA=y +# CONFIG_FPU is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_TIME_LOW_RES=y +CONFIG_NO_IOPORT=y +CONFIG_NO_DMA=y +CONFIG_ISA=y +# CONFIG_PCI is not set +CONFIG_HZ=100 +CONFIG_NR_CPUS=1 +CONFIG_NO_IOPORT_MAP=y +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_IRQ_WORK=y + +# +# General setup +# +CONFIG_BROKEN_ON_SMP=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_CROSS_COMPILE="" +# CONFIG_COMPILE_TEST is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_DEFAULT_HOSTNAME="(none)" +# CONFIG_SYSVIPC is not set +# CONFIG_FHANDLE is not set +# CONFIG_USELIB is not set + +# +# IRQ subsystem +# +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y + +# +# Timers subsystem +# +CONFIG_HZ_PERIODIC=y +# CONFIG_NO_HZ_IDLE is not set +# CONFIG_NO_HZ is not set +# CONFIG_HIGH_RES_TIMERS is not set + +# +# CPU/Task time and stats accounting +# +CONFIG_TICK_CPU_ACCOUNTING=y +# CONFIG_BSD_PROCESS_ACCT is not set + +# +# RCU Subsystem +# +CONFIG_TINY_RCU=y +# CONFIG_TASKS_RCU is not set +# CONFIG_RCU_STALL_COMMON is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_BUILD_BIN2C is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=17 +# CONFIG_CGROUPS is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_RELAY is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="/home/ysato/rootfs" +CONFIG_INITRAMFS_ROOT_UID=0 +CONFIG_INITRAMFS_ROOT_GID=0 +# CONFIG_RD_GZIP is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_XZ is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_INIT_FALLBACK is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_HAVE_UID16=y +CONFIG_EXPERT=y +# CONFIG_UID16 is not set +# CONFIG_SGETMASK_SYSCALL is not set +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_KALLSYMS is not set +CONFIG_PRINTK=y +CONFIG_BUG=y +# 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_BPF_SYSCALL is not set +# CONFIG_AIO is not set +# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_EMBEDDED=y + +# +# Kernel Performance Events And Counters +# +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_COMPAT_BRK is not set +# CONFIG_SLAB is not set +# CONFIG_SLUB is not set +CONFIG_SLOB=y +# CONFIG_MMAP_ALLOW_UNINITIALIZED is not set +# CONFIG_PROFILING is not set +# CONFIG_UPROBES is not set +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_CLK=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +# CONFIG_CC_STACKPROTECTOR is not set +CONFIG_MODULES_USE_ELF_RELA=y + +# +# GCOV-based kernel profiling +# +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set +CONFIG_BASE_SMALL=1 +# CONFIG_MODULES is not set +# CONFIG_BLOCK is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +CONFIG_INLINE_READ_UNLOCK=y +CONFIG_INLINE_READ_UNLOCK_IRQ=y +CONFIG_INLINE_WRITE_UNLOCK=y +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_FREEZER is not set + +# +# Processor type and features +# +# CONFIG_H8300_AE3068 is not set +# CONFIG_H8300_H8MAX is not set +# CONFIG_H8300_KANEBEBE is not set +CONFIG_H8300H_SIM=y +# CONFIG_H8S_EDOSK2674 is not set +# CONFIG_H8S_SIM is not set +CONFIG_H83069=y +# CONFIG_H8S2678 is not set +CONFIG_CPU_CLOCK=20000000 +# CONFIG_RAMKERNEL is not set +CONFIG_ROMKERNEL=y +CONFIG_CPU_H8300H=y +CONFIG_ROMSIZE=0x200000 +CONFIG_RAMBASE=0x400000 +CONFIG_RAMSIZE=0x200000 +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=1 +CONFIG_VIRT_TO_BUS=y +CONFIG_NOMMU_INITIAL_TRIM_EXCESS=1 +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_CLEANCACHE is not set +# CONFIG_ZPOOL is not set +# CONFIG_ZBUD is not set + +# +# Executable file formats +# +# CONFIG_BINFMT_SCRIPT is not set +CONFIG_BINFMT_FLAT=y +# CONFIG_BINFMT_ZFLAT is not set +# CONFIG_BINFMT_SHARED_FLAT is not set +# CONFIG_HAVE_AOUT is not set +# CONFIG_BINFMT_MISC is not set +# CONFIG_COREDUMP is not set +# CONFIG_NET is not set + +# +# Device Drivers +# + +# +# Generic Driver Options +# +# CONFIG_UEVENT_HELPER is not set +# CONFIG_DEVTMPFS is not set +# CONFIG_STANDALONE is not set +# CONFIG_PREVENT_FIRMWARE_BUILD is not set +# CONFIG_FW_LOADER is not set +# CONFIG_ALLOW_DEV_COREDUMP is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_SYS_HYPERVISOR is not set +CONFIG_GENERIC_CPU_DEVICES=y +# CONFIG_DMA_SHARED_BUFFER is not set + +# +# Bus devices +# +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +# CONFIG_PNP is not set + +# +# Misc devices +# +# CONFIG_DUMMY_IRQ is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_SRAM is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_93CX6 is not set + +# +# Texas Instruments shared transport line discipline +# + +# +# Altera FPGA firmware download module +# + +# +# Intel MIC Bus Driver +# + +# +# Intel MIC Host Driver +# + +# +# Intel MIC Card Driver +# +# CONFIG_ECHO is not set +# CONFIG_CXL_BASE is not set +CONFIG_HAVE_IDE=y + +# +# SCSI device support +# +CONFIG_SCSI_MOD=y +# CONFIG_SCSI_DMA is not set + +# +# Input device support +# +# CONFIG_INPUT is not set + +# +# Hardware I/O ports +# +# CONFIG_SERIO is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_TTY=y +# CONFIG_VT is not set +# CONFIG_UNIX98_PTYS is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_TRACE_SINK is not set +# CONFIG_DEVKMEM is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_SH_SCI=y +CONFIG_SERIAL_SH_SCI_NR_UARTS=2 +CONFIG_SERIAL_SH_SCI_CONSOLE=y +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_TTY_PRINTK is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_HW_RANDOM is not set +# CONFIG_RTC is not set +# CONFIG_GEN_RTC is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set + +# +# PCMCIA character devices +# +# CONFIG_TCG_TPM is not set +CONFIG_DEVPORT=y + +# +# I2C support +# +# CONFIG_I2C is not set +# CONFIG_SPI is not set +# CONFIG_SPMI is not set +# CONFIG_HSI is not set + +# +# PPS support +# +# CONFIG_PPS is not set + +# +# PPS generators support +# + +# +# PTP clock support +# + +# +# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_POWER_AVS is not set +# CONFIG_HWMON is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_CROS_EC is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# + +# +# Direct Rendering Manager +# + +# +# Frame buffer Devices +# +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +# CONFIG_VGASTATE is not set +# CONFIG_SOUND is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_SUPPORT is not set +# CONFIG_UWB is not set +# CONFIG_MMC is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_RTC_CLASS is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_VIRT_DRIVERS is not set + +# +# Virtio drivers +# +# CONFIG_VIRTIO_MMIO is not set + +# +# Microsoft Hyper-V guest support +# +# CONFIG_STAGING is not set + +# +# SOC (System On Chip) specific Drivers +# +# CONFIG_SOC_TI is not set +CONFIG_CLKDEV_LOOKUP=y + +# +# Hardware Spinlock drivers +# + +# +# Clock Source drivers +# +# CONFIG_ATMEL_PIT is not set +# CONFIG_SH_TIMER_CMT is not set +# CONFIG_SH_TIMER_MTU2 is not set +# CONFIG_SH_TIMER_TMU is not set +# CONFIG_EM_TIMER_STI is not set +# CONFIG_MAILBOX is not set +# CONFIG_IOMMU_SUPPORT is not set + +# +# Remoteproc drivers +# + +# +# Rpmsg drivers +# + +# +# SOC (System On Chip) specific Drivers +# +# CONFIG_PM_DEVFREQ is not set +# CONFIG_EXTCON is not set +# CONFIG_MEMORY is not set +# CONFIG_IIO is not set +# CONFIG_PWM is not set +# CONFIG_IPACK_BUS is not set +# CONFIG_RESET_CONTROLLER is not set +# CONFIG_FMC is not set + +# +# PHY Subsystem +# +# CONFIG_GENERIC_PHY is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_POWERCAP is not set +# CONFIG_MCB is not set + +# +# Android +# +# CONFIG_ANDROID is not set + +# +# File systems +# +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_FILE_LOCKING is not set +# CONFIG_FSNOTIFY is not set +# CONFIG_DNOTIFY is not set +# CONFIG_INOTIFY_USER is not set +# CONFIG_FANOTIFY is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set +# CONFIG_OVERLAY_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# Pseudo filesystems +# +# CONFIG_PROC_FS is not set +# CONFIG_KERNFS is not set +# CONFIG_SYSFS is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +# CONFIG_MISC_FILESYSTEMS is not set +# CONFIG_NLS is not set + +# +# Kernel hacking +# + +# +# printk and dmesg options +# +# CONFIG_PRINTK_TIME is not set +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_BOOT_PRINTK_DELAY is not set + +# +# Compile-time checks and compiler options +# +# CONFIG_DEBUG_INFO is not set +# CONFIG_ENABLE_WARN_DEPRECATED is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_FRAME_WARN=1024 +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_DEBUG_KERNEL=y + +# +# Memory Debugging +# +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_NOMMU_REGIONS is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_SHIRQ is not set + +# +# Debug Lockups and Hangs +# +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_PANIC_ON_OOPS is not set +CONFIG_PANIC_ON_OOPS_VALUE=0 +CONFIG_PANIC_TIMEOUT=0 +# CONFIG_SCHED_STACK_END_CHECK is not set + +# +# Lock Debugging (spinlocks, mutexes, etc...) +# +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_PI_LIST is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_CREDENTIALS is not set + +# +# RCU Debugging +# +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_TORTURE_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +# CONFIG_RCU_TRACE is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +# CONFIG_FAULT_INJECTION is not set + +# +# Runtime Testing +# +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +# CONFIG_RBTREE_TEST is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_SAMPLES is not set +# CONFIG_FULLDEBUG is not set +# CONFIG_HIGHPROFILE is not set +# CONFIG_NO_KERNEL_MSG is not set +# CONFIG_EARLY_PRINTK is not set +# CONFIG_SYSCALL_PRINT is not set +# CONFIG_DEFAULT_CMDLINE is not set +# CONFIG_BLKDEV_RESERVE is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +# CONFIG_SECURITYFS is not set +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_SECURITY="" +# CONFIG_CRYPTO is not set +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_GENERIC_IO=y +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +# CONFIG_CRC32 is not set +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +# CONFIG_CRC8 is not set +# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set +# CONFIG_RANDOM32_SELFTEST is not set +# CONFIG_XZ_DEC is not set +# CONFIG_XZ_DEC_BCJ is not set +CONFIG_HAS_IOMEM=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +# CONFIG_AVERAGE is not set +# CONFIG_CORDIC is not set +# CONFIG_DDR is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set
arch/h8300/configs/h8s-sim_defconfig new file +601 -0
601 lines not on this page · raw message
Signature · 1 line
2.1.3
Arnd Bergmann
maintainerRe: [PATCH 03/16] h8300: defconfigs
arch/h8300/configs/h8300h-sim_defconfig line 4
Quoted 8 lines · On Wednesday 21 January 2015 13:24:20 Yoshinori Sato wrote:
arch/h8300/configs/h8300h-sim_defconfig new file +4
-0@@ -0,0 +1,603 @@ +# +# Automatically generated file; DO NOT EDIT. +# Linux/h8300 3.19.0-rc3 Kernel Configuration +#
Please use 'make savedefconfig' to generate smaller files.
Arnd
PATCH 4/16 h8300: Memory management
In reply to a message not in the archivecreate mode 100644 arch/h8300/mm/Makefile create mode 100644 arch/h8300/mm/fault.c create mode 100644 arch/h8300/mm/init.c create mode 100644 arch/h8300/mm/kmap.c create mode 100644 arch/h8300/mm/memory.c
arch/h8300/mm/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for the linux m68k-specific parts of the memory manager. +# + +obj-y := init.o fault.o memory.o kmap.o
arch/h8300/mm/fault.c new file +58 -0
58 lines not on this page · raw message
arch/h8300/mm/init.c new file +153 -0
153 lines not on this page · raw message
arch/h8300/mm/kmap.c new file +58 -0
58 lines not on this page · raw message
arch/h8300/mm/memory.c new file +54 -0
54 lines not on this page · raw message
Signature · 1 line
2.1.3
Re: [PATCH 04/16] h8300: Memory management
arch/h8300/mm/Makefile line 2
Quoted 5 lines · Yoshinori Sato
arch/h8300/mm/Makefile new file +2
-0@@ -0,0 +1,5 @@ +# +# Makefile for the linux m68k-specific parts of the memory manager.
H8/300
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 04/16] h8300: Memory management
At Wed, 21 Jan 2015 11:57:45 +0100,
Quoted 11 lines · Geert Uytterhoeven
arch/h8300/mm/Makefile line 2
Quoted 5 lines · Yoshinori Sato
arch/h8300/mm/Makefile new file +2
-0@@ -0,0 +1,5 @@ +# +# Makefile for the linux m68k-specific parts of the memory manager.H8/300
Ouch.
Thanks. I'll fix V2 patch.
Quoted 10 lines
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Signature · 2 lines
Yoshinori Sato <[email protected]>
PATCH 5/16 h8300: Target depend (hw define) part
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/cpu/h83069/Makefile create mode 100644 arch/h8300/kernel/cpu/h83069/setup.c create mode 100644 arch/h8300/kernel/cpu/h8s2678/Makefile create mode 100644 arch/h8300/kernel/cpu/h8s2678/setup.c
arch/h8300/kernel/cpu/h83069/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y = setup.o
arch/h8300/kernel/cpu/h83069/setup.c new file +202 -0
202 lines not on this page · raw message
arch/h8300/kernel/cpu/h8s2678/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y = setup.o
arch/h8300/kernel/cpu/h8s2678/setup.c new file +161 -0
161 lines not on this page · raw message
Signature · 1 line
2.1.3
PATCH 6/16 drivers: Add h8300
In reply to a message not in the archivedrivers/tty/serial/Kconfig +1 -1
@@ -747,7 +747,7 @@ config SERIAL_IP22_ZILOG_CONSOLE config SERIAL_SH_SCI tristate "SuperH SCI(F) serial port support" - depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST + depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST || H8300 select SERIAL_CORE config SERIAL_SH_SCI_NR_UARTS
drivers/video/console/Kconfig +1 -1
@@ -9,7 +9,7 @@ config VGA_CONSOLE depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \ !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \ (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \ - !ARM64 + !ARM64 && !H8300 default y help Saying Y here will allow you to use Linux in text mode through a
Signature · 1 line
2.1.3
Re: [PATCH 06/16] drivers: Add h8300
drivers/video/console/Kconfig config VGA_CONSOLE · line 12
Quoted 8 lines · Yoshinori Sato
drivers/video/console/Kconfig +1
-1@@ -9,7 +9,7 @@ config VGA_CONSOLE depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \ !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \ (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \ - !ARM64 + !ARM64 && !H8300
We desperately need ARCH_MIGHT_HAVE_VGA_CONSOLE, to be selected by architectures that need it.
Yes, the onus is on the submitter who (re)introduces a new anti-dependency ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 06/16] drivers: Add h8300
At Wed, 21 Jan 2015 12:03:46 +0100,
Quoted 15 lines · Geert Uytterhoeven
drivers/video/console/Kconfig config VGA_CONSOLE · line 12
Quoted 8 lines · Yoshinori Sato
drivers/video/console/Kconfig +1
-1@@ -9,7 +9,7 @@ config VGA_CONSOLE depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \ !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \ (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \ - !ARM64 + !ARM64 && !H8300We desperately need
ARCH_MIGHT_HAVE_VGA_CONSOLE, to be selected by architectures that need it.
Quoted 1 line
Yes, the onus is on the submitter who (re)introduces a new anti-dependency ;-)
OK.
I will fix V2 patch.
Quoted 14 lines
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Yoshinori Sato <[email protected]>
PATCH 7/16 Add ELF machine
In reply to a message not in the archiveinclude/uapi/linux/elf-em.h +1 -0
@@ -25,6 +25,7 @@#define EM_ARM 40/* ARM 32 bit */ #define EM_SH 42/* SuperH */ #define EM_SPARCV9 43/* SPARC v9 64-bit */ +#define EM_H8_300 46/* Renesas H8/300 */ #define EM_IA_64 50/* HP/Intel IA-64 */ #define EM_X86_64 62/* AMD x86-64 */ #define EM_S390 22/* IBM S/390 */
Signature · 1 line
2.1.3
PATCH 8/16 h8300: Build scripts
In reply to a message not in the archivecreate mode 100644 arch/h8300/Kconfig create mode 100644 arch/h8300/Kconfig.cpu create mode 100644 arch/h8300/Kconfig.debug create mode 100644 arch/h8300/Makefile
arch/h8300/Kconfig new file +121 -0
@@ -0,0 +1,121 @@ +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 ARCH_WANT_FRAME_POINTER + select GENERIC_CPU_DEVICES + select MODULES_USE_ELF_RELA + select GENERIC_CLOCKEVENTS + select CLKDEV_LOOKUP + +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 + +config NR_CPUS + int + default 1 + +config NO_IOPORT_MAP + def_bool y + +source "init/Kconfig" + +source "kernel/Kconfig.freezer" + +source "arch/h8300/Kconfig.cpu" + +menu "Kernel Features" + +source "kernel/Kconfig.preempt" + +source "mm/Kconfig" + +endmenu + +menu "Executable file formats" + +source "fs/Kconfig.binfmt" + +endmenu + +source "net/Kconfig" + +source "drivers/Kconfig" + +source "fs/Kconfig" + +source "arch/h8300/Kconfig.debug" + +source "security/Kconfig" + +source "crypto/Kconfig" + +source "lib/Kconfig"
arch/h8300/Kconfig.cpu new file +132 -0
132 lines not on this page · raw message
arch/h8300/Kconfig.debug new file +65 -0
65 lines not on this page · raw message
arch/h8300/Makefile new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
2.1.3
PATCH 9/16 h8300: kernel startup
In reply to a message not in the archivecreate mode 100644 arch/h8300/boot/Makefile create mode 100644 arch/h8300/boot/compressed/Makefile create mode 100644 arch/h8300/boot/compressed/head.S create mode 100644 arch/h8300/boot/compressed/misc.c create mode 100644 arch/h8300/boot/compressed/vmlinux.lds create mode 100644 arch/h8300/boot/compressed/vmlinux.scr create mode 100644 arch/h8300/kernel/head_ram.S create mode 100644 arch/h8300/kernel/head_rom.S
arch/h8300/boot/Makefile new file +27 -0
@@ -0,0 +1,27 @@ +# 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 + +UIMAGE_LOADADDR = $(CONFIG_RAMBASE) +UIMAGE_ENTRYADDR = $(shell /bin/bash -c 'printf "0x%08x" \ + $$[$(CONFIG_RAMBASE) + $(CONFIG_OFFSET)]') + +$(obj)/vmlinux.srec $(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + +$(obj)/zImage: $(obj)/compressed/vmlinux FORCE + $(call if_changed,objcopy) + +$(obj)/compressed/vmlinux: FORCE + $(Q)$(MAKE) $(build)=$(obj)/compressed $@ + +$(obj)/uImage.bin: $(obj)/vmlinux.bin + $(call if_changed,uimage,none) + +CLEAN_FILES += arch/$(ARCH)/vmlinux.bin arch/$(ARCH)/vmlinux.srec arch/$(ARCH)/uImage.bin +
arch/h8300/boot/compressed/Makefile new file +37 -0
@@ -0,0 +1,37 @@ +# +# 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 + +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)))) + +LIBGCC := $(shell $(CROSS-COMPILE)$(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) +LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds + +$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) 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-linux -T +OBJCOPYFLAGS := -O binary + +$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE + $(call if_changed,ld)
arch/h8300/boot/compressed/head.S new file +48 -0
48 lines not on this page · raw message
arch/h8300/boot/compressed/misc.c new file +74 -0
74 lines not on this page · raw message
arch/h8300/boot/compressed/vmlinux.lds new file +32 -0
@@ -0,0 +1,32 @@ +SECTIONS +{ + .text : + { + __stext = . ; + __text = .; + *(.text..startup) + *(.text) + __etext = . ; + } + + .rodata : + { + *(.rodata) + } + .data : + + { + __sdata = . ; + ___data_start = . ; + *(.data.*) + } + .bss : + { + . = ALIGN(0x4) ; + __sbss = . ; + *(.bss*) + . = ALIGN(0x4) ; + __ebss = . ; + __end = . ; + } +}
arch/h8300/boot/compressed/vmlinux.scr new file +9 -0
@@ -0,0 +1,9 @@ +SECTIONS +{ + .data : { + input_len = .; + LONG(input_data_end - input_data) input_data = .; + *(.data) + input_data_end = .; + } +}
arch/h8300/kernel/head_ram.S new file +60 -0
60 lines not on this page · raw message
arch/h8300/kernel/head_rom.S new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
2.1.3
PATCH 10/16 h8300: Exception and Interrupt handler
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/entry.S create mode 100644 arch/h8300/kernel/irq.c create mode 100644 arch/h8300/kernel/irq_h.c create mode 100644 arch/h8300/kernel/irq_s.c create mode 100644 arch/h8300/kernel/traps.c
arch/h8300/kernel/entry.S new file +412 -0
@@ -0,0 +1,412 @@ +/* -*- mode: asm -*- + * + * linux/arch/h8300/platform/h8300h/entry.S + * + * Yoshinori Sato <[email protected]> + * David McCullough <[email protected]> + * + */ + +/* + * entry.S + * include exception/interrupt gateway + * system call entry + */ + +#include <linux/sys.h> +#include <asm/unistd.h> +#include <asm/setup.h> +#include <asm/segment.h> +#include <asm/linkage.h> +#include <asm/asm-offsets.h> +#include <asm/thread_info.h> +#include <asm/errno.h> + +#if defined(CONFIG_CPU_H8300H) +#define USERRET 8 +INTERRUPTS = 64 + .h8300h + .macro SHLL2 reg + shll.l \reg + shll.l \reg + .endm + .macro SHLR2 reg + shlr.l \reg + shlr.l \reg + .endm + .macro SAVEREGS + mov.l er0,@-sp + mov.l er1,@-sp + mov.l er2,@-sp + mov.l er3,@-sp + .endm + .macro RESTOREREGS + mov.l @sp+,er3 + mov.l @sp+,er2 + .endm + .macro SAVEEXR + .endm + .macro RESTOREEXR + .endm +#endif +#if defined(CONFIG_CPU_H8S) +#define USERRET 10 +#define USEREXR 8 +INTERRUPTS = 128 + .h8300s + .macro SHLL2 reg + shll.l #2,\reg + .endm + .macro SHLR2 reg + shlr.l #2,\reg + .endm + .macro SAVEREGS + stm.l er0-er3,@-sp + .endm + .macro RESTOREREGS + ldm.l @sp+,er2-er3 + .endm + .macro SAVEEXR + mov.w @(USEREXR:16,er0),r1 + mov.w r1,@(LEXR-LER3:16,sp) /* copy EXR */ + .endm + .macro RESTOREEXR + mov.w @(LEXR-LER1:16,sp),r1 /* restore EXR */ + mov.b r1l,r1h + mov.w r1,@(USEREXR:16,er0) + .endm +#endif + + +/* CPU context save/restore macros. */ + + .macro SAVE_ALL + mov.l er0,@-sp + stc ccr,r0l /* check kernel mode */ + btst #4,r0l + bne 5f + + /* user mode */ + mov.l sp,@_sw_usp + mov.l @sp,er0 /* restore saved er0 */ + orc #0x10,ccr /* switch kernel stack */ + mov.l @_sw_ksp,sp + sub.l #(LRET-LORIG),sp /* allocate LORIG - LRET */ + SAVEREGS + mov.l @_sw_usp,er0 + mov.l @(USERRET:16,er0),er1 /* copy the RET addr */ + mov.l er1,@(LRET-LER3:16,sp) + SAVEEXR + + mov.l @(LORIG-LER3:16,sp),er0 + mov.l er0,@(LER0-LER3:16,sp) /* copy ER0 */ + mov.w e1,r1 /* e1 highbyte = ccr */ + and #0xef,r1h /* mask mode? flag */ + bra 6f +5: + /* kernel mode */ + mov.l @sp,er0 /* restore saved er0 */ + subs #2,sp /* set dummy ccr */ + SAVEREGS + mov.w @(LRET-LER3:16,sp),r1 /* copy old ccr */ +6: + mov.b r1h,r1l + mov.b #0,r1h + mov.w r1,@(LCCR-LER3:16,sp) /* set ccr */ + mov.l er6,@-sp /* syscall arg #6 */ + mov.l er5,@-sp /* syscall arg #5 */ + mov.l er4,@-sp /* syscall arg #4 */ + .endm /* r1 = ccr */ + + .macro RESTORE_ALL + mov.l @sp+,er4 + mov.l @sp+,er5 + mov.l @sp+,er6 + RESTOREREGS + mov.w @(LCCR-LER1:16,sp),r0 /* check kernel mode */ + btst #4,r0l + bne 7f + + orc #0xc0,ccr + mov.l @_sw_usp,er0 + mov.l @(LER0-LER1:16,sp),er1 /* restore ER0 */ + mov.l er1,@er0 + RESTOREEXR + mov.w @(LCCR-LER1:16,sp),r1 /* restore the RET addr */ + mov.b r1l,r1h + mov.b @(LRET+1-LER1:16,sp),r1l + mov.w r1,e1 + mov.w @(LRET+2-LER1:16,sp),r1 + mov.l er1,@(USERRET:16,er0) + + mov.l @sp+,er1 + add.l #(LRET-LER1),sp /* remove LORIG - LRET */ + mov.l sp,@_sw_ksp + andc #0xef,ccr /* switch to user mode */ + mov.l er0,sp + bra 8f +7: + mov.l @sp+,er1 + adds #4,sp + adds #2,sp +8: + mov.l @sp+,er0 + adds #4,sp /* remove the sw created LVEC */ + rte + .endm + +.globl _system_call +.globl ret_from_exception +.globl ret_from_fork +.globl ret_from_kernel_thread +.globl ret_from_interrupt +.globl _interrupt_redirect_table +.globl _sw_ksp,_sw_usp +.globl _resume +.globl _interrupt_entry +.globl _trace_break +.globl _nmi + +#if defined(CONFIG_ROMKERNEL) + .section .int_redirect,"ax" +_interrupt_redirect_table: +#if defined(CONFIG_CPU_H8300H) + .rept 7 + .long 0 + .endr +#endif +#if defined(CONFIG_CPU_H8S) + .rept 5 + .long 0 + .endr + jmp @_trace_break + .long 0 +#endif + + jsr @_interrupt_entry /* NMI */ + jmp @_system_call /* TRAPA #0 (System call) */ + .long 0 + .long 0 + jmp @_trace_break /* TRAPA #3 (breakpoint) */ + .rept INTERRUPTS-12 + jsr @_interrupt_entry + .endr +#endif +#if defined(CONFIG_RAMKERNEL) +.globl _interrupt_redirect_table + .section .bss +_interrupt_redirect_table: + .space 4 +#endif + + .section .text + .align 2 +_interrupt_entry: + SAVE_ALL + mov.l sp,er0 + add.l #LVEC,er0 + btst #4,r1l + bne 1f + /* user LVEC */ + mov.l @_sw_usp,er0 + adds #4,er0 +1: + mov.l @er0,er0 /* LVEC address */ +#if defined(CONFIG_ROMKERNEL) + sub.l #_interrupt_redirect_table,er0 +#endif +#if defined(CONFIG_RAMKERNEL) + mov.l @_interrupt_redirect_table,er1 + sub.l er1,er0 +#endif + SHLR2 er0 + dec.l #1,er0 + mov.l sp,er1 + subs #4,er1 /* adjust ret_pc */ +#if defined(CONFIG_CPU_H8S) + orc #7,exr +#endif + jsr @do_IRQ + jmp @ret_from_interrupt + +_system_call: + subs #4,sp /* dummy LVEC */ + SAVE_ALL + andc #0xbf,ccr + mov.l er0,er4 + + /* save top of frame */ + mov.l sp,er0 + jsr @set_esp0 + mov.l sp,er2 + and.w #0xe000,r2 + mov.b @((TI_FLAGS+3-(TIF_SYSCALL_TRACE >> 3)):16,er2),r2l + btst #(TIF_SYSCALL_TRACE & 7),r2l + beq 1f + jsr @do_syscall_trace +1: + cmp.l #__NR_syscalls,er4 + bcc badsys + SHLL2 er4 + mov.l #_sys_call_table,er0 + add.l er4,er0 + mov.l @er0,er4 + beq ret_from_exception:16 + mov.l @(LER1:16,sp),er0 + mov.l @(LER2:16,sp),er1 + mov.l @(LER3:16,sp),er2 + jsr @er4 + mov.l er0,@(LER0:16,sp) /* save the return value */ + mov.l sp,er2 + and.w #0xe000,r2 + mov.b @((TI_FLAGS+3-(TIF_SYSCALL_TRACE >> 3)):16,er2),r2l + btst #(TIF_SYSCALL_TRACE & 7),r2l + beq 2f + jsr @do_syscall_trace +2: + orc #0xc0,ccr + bra resume_userspace + +badsys: + mov.l #-ENOSYS,er0 + mov.l er0,@(LER0:16,sp) + bra resume_userspace + +#if !defined(CONFIG_PREEMPT) +#define resume_kernel restore_all +#endif + +ret_from_exception: +#if defined(CONFIG_PREEMPT) + orc #0xc0,ccr +#endif +ret_from_interrupt: + mov.b @(LCCR+1:16,sp),r0l + btst #4,r0l +#if defined(CONFIG_PREEMPT) + bne resume_kernel:16 /* return from kernel */ +#else + bne restore_all:16 /* return from kernel */ +#endif +resume_userspace: + andc #0xbf,ccr + mov.l sp,er4 + and.w #0xe000,r4 /* er4 <- current thread info */ + mov.l @(TI_FLAGS:16,er4),er1 + and.l #_TIF_WORK_MASK,er1 + beq restore_all:8 +work_pending: + btst #TIF_NEED_RESCHED,r1l + bne work_resched:8 + /* work notifysig */ + mov.l sp,er0 + subs #4,er0 /* er0: pt_regs */ + jsr @do_notify_resume + bra restore_all:8 +work_resched: + mov.l sp,er0 + jsr @set_esp0 + jsr @schedule + bra resume_userspace:8 +restore_all: + RESTORE_ALL /* Does RTE */ + +#if defined(CONFIG_PREEMPT) +resume_kernel: + mov.l @(TI_PRE_COUNT:16,er4),er0 + bne restore_all:8 +need_resched: + mov.l @(TI_FLAGS:16,er4),er0 + btst #TIF_NEED_RESCHED,r0l + beq restore_all:8 + mov.b @(LCCR+1:16,sp),r0l /* Interrupt Enabled? */ + bmi restore_all:8 + mov.l sp,er0 + jsr @set_esp0 + jsr @preempt_schedule_irq + bra need_resched:8 +#endif + +ret_from_fork: + mov.l er2,er0 + jsr @schedule_tail + jmp @ret_from_exception + +ret_from_kernel_thread: + mov.l er2,er0 + jsr @schedule_tail + mov.l @(LER4:16,sp),er0 + mov.l @(LER5:16,sp),er1 + jsr @er1 + jmp @ret_from_exception + +_resume: + /* + * Beware - when entering resume, offset of tss is in d1, + * prev (the current task) is in a0, next (the new task) + * is in a1 and d2.b is non-zero if the mm structure is + * shared between the tasks, so don't change these + * registers until their contents are no longer needed. + */ + + /* save sr */ + sub.w r3,r3 + stc ccr,r3l + mov.w r3,@(THREAD_CCR+2:16,er0) + + /* disable interrupts */ + orc #0xc0,ccr + mov.l @_sw_usp,er3 + mov.l er3,@(THREAD_USP:16,er0) + mov.l sp,@(THREAD_KSP:16,er0) + + /* Skip address space switching if they are the same. */ + /* FIXME: what did we hack out of here, this does nothing! */ + + mov.l @(THREAD_USP:16,er1),er0 + mov.l er0,@_sw_usp + mov.l @(THREAD_KSP:16,er1),sp + + /* restore status register */ + mov.w @(THREAD_CCR+2:16,er1),r3 + + ldc r3l,ccr + rts + +_trace_break: + subs #4,sp + SAVE_ALL + sub.l er1,er1 + dec.l #1,er1 + mov.l er1,@(LORIG,sp) + mov.l sp,er0 + jsr @set_esp0 + mov.l @_sw_usp,er0 + mov.l @er0,er1 + mov.w @(-2:16,er1),r2 + cmp.w #0x5730,r2 + beq 1f + subs #2,er1 + mov.l er1,@er0 +1: + and.w #0xff,e1 + mov.l er1,er0 + jsr @trace_trap + jmp @ret_from_exception + +_nmi: + subs #4, sp + mov.l er0, @-sp + mov.l @_interrupt_redirect_table, er0 + add.l #8*4, er0 + mov.l er0, @(4,sp) + mov.l @sp+, er0 + jmp @_interrupt_entry + + .section .bss +_sw_ksp: + .space 4 +_sw_usp: + .space 4 + + .end
arch/h8300/kernel/irq.c new file +106 -0
106 lines not on this page · raw message
arch/h8300/kernel/irq_h.c new file +62 -0
62 lines not on this page · raw message
arch/h8300/kernel/irq_s.c new file +71 -0
71 lines not on this page · raw message
arch/h8300/kernel/traps.c new file +166 -0
166 lines not on this page · raw message
Signature · 1 line
2.1.3
PATCH 11/16 h8300: Libraries
In reply to a message not in the archivecreate mode 100644 arch/h8300/lib/Makefile create mode 100644 arch/h8300/lib/abs.S create mode 100644 arch/h8300/lib/checksum.c create mode 100644 arch/h8300/lib/memcpy.S create mode 100644 arch/h8300/lib/memset.S create mode 100644 arch/h8300/lib/strncpy.S
arch/h8300/lib/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for H8/300-specific library files.. +# + +lib-y = checksum.o memcpy.o memset.o abs.o strncpy.o
arch/h8300/lib/abs.S new file +20 -0
@@ -0,0 +1,20 @@ +;;; abs.S + +#include <asm/linkage.h> + +#if defined(CONFIG_CPU_H8300H) + .h8300h +#endif +#if defined(CONFIG_CPU_H8S) + .h8300s +#endif + .text +.global _abs + +;;; int abs(int n) +_abs: + mov.l er0,er0 + bpl 1f + neg.l er0 +1: + rts
arch/h8300/lib/checksum.c new file +167 -0
167 lines not on this page · raw message
arch/h8300/lib/memcpy.S new file +85 -0
85 lines not on this page · raw message
arch/h8300/lib/memset.S new file +69 -0
69 lines not on this page · raw message
arch/h8300/lib/strncpy.S new file +34 -0
@@ -0,0 +1,34 @@ +;;; strncpy.S + +#include <asm/linkage.h> + + .text +.global strncpy_from_user + +;;; long strncpy_from_user(void *to, void *from, size_t n) +strncpy_from_user: + mov.l er2,er2 + bne 1f + sub.l er0,er0 + rts +1: + mov.l er4,@-sp + sub.l er3,er3 +2: + mov.b @er1+,r4l + mov.b r4l,@er0 + adds #1,er0 + beq 3f + inc.l #1,er3 + dec.l #1,er2 + bne 2b +3: + dec.l #1,er2 +4: + mov.b r4l,@er0 + adds #1,er0 + dec.l #1,er2 + bne 4b + mov.l er3,er0 + mov.l @sp+,er4 + rts
Signature · 1 line
2.1.3
PATCH 12/16 h8300: clocksource
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/timer/Makefile create mode 100644 arch/h8300/kernel/timer/timer16.c create mode 100644 arch/h8300/kernel/timer/timer8.c create mode 100644 arch/h8300/kernel/timer/tpu.c
arch/h8300/kernel/timer/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# h8300 internal timer handler + +obj-y := timer8.o +obj-$(CONFIG_H83069) += timer16.o +obj-$(CONFIG_H8S2678) += tpu.o
arch/h8300/kernel/timer/timer16.c new file +335 -0
335 lines not on this page · raw message
arch/h8300/kernel/timer/timer8.c new file +400 -0
400 lines not on this page · raw message
arch/h8300/kernel/timer/tpu.c new file +205 -0
205 lines not on this page · raw message
Signature · 1 line
2.1.3
Arnd Bergmann
maintainerRe: [PATCH 12/16] h8300: clocksource
Quoted 6 lines · On Wednesday 21 January 2015 13:31:24 Yoshinori Sato wrote:
Signed-off-by Yoshinori Sato <[email protected]>create mode 100644 arch/h8300/kernel/timer/Makefile create mode 100644 arch/h8300/kernel/timer/timer16.c create mode 100644 arch/h8300/kernel/timer/timer8.c create mode 100644 arch/h8300/kernel/timer/tpu.c
How about moving these to drivers/clocksource?
I think it will be fine either way, but most clocksource implementations are there now.
Arnd
Re: [PATCH 12/16] h8300: clocksource
At Wed, 21 Jan 2015 09:49:01 +0100,
Quoted 9 lines · Arnd Bergmann
Quoted 6 lines · On Wednesday 21 January 2015 13:31:24 Yoshinori Sato wrote:
Signed-off-by Yoshinori Sato <[email protected]>create mode 100644 arch/h8300/kernel/timer/Makefile create mode 100644 arch/h8300/kernel/timer/timer16.c create mode 100644 arch/h8300/kernel/timer/timer8.c create mode 100644 arch/h8300/kernel/timer/tpu.c
Quoted 4 lines
How about moving these to
drivers/clocksource?I think it will be fine either way, but most clocksource implementations are there now.
OK.
I will move it.
Quoted 2 lines
Arnd
Signature · 2 lines
Yoshinori Sato <[email protected]>
PATCH 13/16 h8300: ptrace helper
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/ptrace.c create mode 100644 arch/h8300/kernel/ptrace_h.c create mode 100644 arch/h8300/kernel/ptrace_s.c
arch/h8300/kernel/ptrace.c new file +170 -0
@@ -0,0 +1,170 @@ +/* +* linux/arch/h8300/kernel/ptrace.c +* +* Yoshinori Sato <[email protected]> +* +* Based on: +* linux/arch/m68k/kernel/ptrace.c +* +* Copyright (C) 1994 by Hamish Macdonald +* Taken from linux/kernel/ptrace.c and modified for M680x0. +* linux/kernel/ptrace.c is by Ross Biro 1/23/92, edited by Linus Torvalds +* +* This file is subject to the terms and conditions of the GNU General +* Public License. See the file COPYING in the main directory of +* this archive for more details. +*/ + +#include <linux/kernel.h> +#include <linux/sched.h> +#include <linux/mm.h> +#include <linux/smp.h> +#include <linux/errno.h> +#include <linux/ptrace.h> +#include <linux/user.h> +#include <linux/signal.h> + +#include <asm/uaccess.h> +#include <asm/page.h> +#include <asm/pgtable.h> +#include <asm/processor.h> +#include <asm/signal.h> + +/* cpu depend functions */ +extern long h8300_get_reg (struct task_struct *task,int regno); +extern int h8300_put_reg (struct task_struct *task,int regno, +unsigned long data); + + +extern void user_disable_single_step (struct task_struct *child); + +/* +* does not yet catch signals sent when the child dies. +* in exit.c or in signal.c. +*/ + +void ptrace_disable (struct task_struct *child) +{ +user_disable_single_step (child); +} + +long arch_ptrace (struct task_struct *child,long request, +unsigned long addr,unsigned long data) +{ +int ret; +int regno = addr >>2 ; +unsigned long __user *datap = (unsigned long __user *) data; + +switch (request) { +/* read the word at location addr in the USER area. */ +case PTRACE_PEEKUSR : { +unsigned long tmp =0 ; + +if ((addr &3 ) || addr >=sizeof (struct user )) { + ret = -EIO ; +break ; + } + + ret =0 ;/* Default return condition */ + +if (regno <H8300_REGS_NO ) + tmp =h8300_get_reg (child, regno); +else { +switch (regno) { +case 49 : + tmp = child->mm->start_code; +break ; +case 50 : + tmp = child->mm->start_data; +break ; +case 51 : + tmp = child->mm->end_code; +break ; +case 52 : + tmp = child->mm->end_data; +break ; +default : + ret = -EIO ; + } + } +if (!ret) + ret =put_user (tmp, datap); +break ; + } + +/* when I and D space are separate, this will have to be fixed. */ +case PTRACE_POKEUSR :/* write the word at location addr +in the USER area */ +if ((addr &3 ) || addr >=sizeof (struct user )) { + ret = -EIO ; +break ; + } + +if (regno ==PT_ORIG_ER0 ) { + ret = -EIO ; +break ; + } +if (regno <H8300_REGS_NO ) { + ret =h8300_put_reg (child, regno, data); +break ; + } + ret = -EIO ; +break ; + +case PTRACE_GETREGS : {/* Get all gp regs from the child. */ +int i; +unsigned long tmp; + +for (i =0 ; i <H8300_REGS_NO ; i++) { + tmp =h8300_get_reg (child, i); +if (put_user (tmp, datap)) { + ret = -EFAULT ; +break ; + } + datap++; + } + ret =0 ; +break ; + } + +case PTRACE_SETREGS : {/* Set all gp regs in the child. */ +int i; +unsigned long tmp; + +for (i =0 ; i <H8300_REGS_NO ; i++) { +if (get_user (tmp, datap)) { + ret = -EFAULT ; +break ; + } +h8300_put_reg (child, i, tmp); + datap++; + } + ret =0 ; +break ; + } + +default : + ret =ptrace_request (child, request, addr, data); +break ; + } +return ret; +} + +asmlinkage void do_syscall_trace(void) +{ +if (!test_thread_flag (TIF_SYSCALL_TRACE )) +return ; +if (!(current->ptrace &PT_PTRACED )) +return ; +ptrace_notify (SIGTRAP | ((current->ptrace &PT_TRACESYSGOOD ) + ?0x80 :0 )); +/* +* this isn't the same as continuing with a signal, but it will do +* for normal use. strace only continues with a signal if the +* stopping signal is not SIGTRAP. -brl +*/ +if (current->exit_code) { +send_sig (current->exit_code, current,1 ); + current->exit_code =0 ; + } +}
arch/h8300/kernel/ptrace_h.c new file +307 -0
307 lines not on this page · raw message
arch/h8300/kernel/ptrace_s.c new file +90 -0
90 lines not on this page · raw message
Signature · 1 line
2.1.3
Arnd Bergmann
maintainerRe: [PATCH 13/16] h8300: ptrace helper
Quoted 10 lines · On Wednesday 21 January 2015 13:31:47 Yoshinori Sato wrote:
arch/h8300/kernel/ptrace.c new file +10
-0+long arch_ptrace (struct task_struct *child,long request, +unsigned long addr,unsigned long data) +{ +int ret; +int regno = addr >>2 ; +unsigned long __user *datap = (unsigned long __user *) data; + +switch (request) { +/* read the word at location addr in the USER area. */ +case PTRACE_PEEKUSR : {
...
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_POKEUSR :/* write the word at location addr
...
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_GETREGS : {/* Get all gp regs from the child. */
...
arch/h8300/kernel/ptrace.c line 130
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_SETREGS : {/* Set all gp regs in the child. */
For modern architecture implementations, we now use 'regset' to abstract these, and simplify the arch_ptrace interface to a single ptrace_request call. See openrisc or arm64 as examples.
Arnd
Re: [PATCH 13/16] h8300: ptrace helper
At Wed, 21 Jan 2015 09:51:34 +0100,
Quoted 16 lines · Arnd Bergmann
Quoted 10 lines · On Wednesday 21 January 2015 13:31:47 Yoshinori Sato wrote:
arch/h8300/kernel/ptrace.c new file +10
-0+long arch_ptrace (struct task_struct *child,long request, +unsigned long addr,unsigned long data) +{ +int ret; +int regno = addr >>2 ; +unsigned long __user *datap = (unsigned long __user *) data; + +switch (request) { +/* read the word at location addr in the USER area. */ +case PTRACE_PEEKUSR : {...
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_POKEUSR :/* write the word at location addr ...
Quoted 8 lines
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_GETREGS : {/* Get all gp regs from the child. */ ...
arch/h8300/kernel/ptrace.c line 130
Quoted 1 line
arch/h8300/kernel/ptrace.c new file +1
-0+case PTRACE_SETREGS : {/* Set all gp regs in the child. */ For modern architecture implementations, we now use 'regset' to abstract these, and simplify the
arch_ptraceinterface to a singleptrace_requestcall. See openrisc or arm64 as examples.
Yes. This files use old implementation.
I will rewrite V2 patch.
Quoted 5 lines
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 14/16 h8300: signal handler
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/signal.c
arch/h8300/kernel/signal.c new file +330 -0
@@ -0,0 +1,330 @@ +/* +* linux/arch/h8300/kernel/signal.c +* +* Copyright (C) 1991, 1992 Linus Torvalds +* +* This file is subject to the terms and conditions of the GNU General Public +* License. See the file COPYING in the main directory of this archive +* for more details. +*/ + +/* +* uClinux H8/300 support by Yoshinori Sato <[email protected]> +* and David McCullough <[email protected]> +* +* Based on +* Linux/m68k by Hamish Macdonald +*/ + +/* +* ++roman (07/09/96): implemented signal stacks (specially for tosemu on +* Atari :-) Current limitation: Only one sigstack can be active at one time. +* If a second signal with SA_ONSTACK set arrives while working on a sigstack, +* SA_ONSTACK is ignored. This behaviour avoids lots of trouble with nested +* signal handlers! +*/ + +#include <linux/sched.h> +#include <linux/mm.h> +#include <linux/kernel.h> +#include <linux/signal.h> +#include <linux/syscalls.h> +#include <linux/errno.h> +#include <linux/wait.h> +#include <linux/ptrace.h> +#include <linux/unistd.h> +#include <linux/stddef.h> +#include <linux/highuid.h> +#include <linux/personality.h> +#include <linux/tty.h> +#include <linux/binfmts.h> +#include <linux/tracehook.h> + +#include <asm/setup.h> +#include <asm/uaccess.h> +#include <asm/pgtable.h> +#include <asm/traps.h> +#include <asm/ucontext.h> + +/* +* Do a signal return; undo the signal stack. +* +* Keep the return code on the stack quadword aligned! +* That makes the cache flush below easier. +*/ + +struct rt_sigframe { +long dummy_er0; +long dummy_vector; +#if defined(CONFIG_CPU_H8S ) +short dummy_exr; +#endif +long dummy_pc; +char *pretcode; +struct siginfo *pinfo; +void *puc; +unsigned char retcode[8 ]; +struct siginfo info; +struct ucontext uc; +int sig; +} __packed__aligned(2) ; + +static inline int +restore_sigcontext (struct sigcontext *usc,int *pd0) +{ +struct pt_regs *regs =current_pt_regs (); +int err =0 ; +unsigned int ccr; +unsigned int usp; +unsigned int er0; + +/* Always make any pending restarted system calls return -EINTR */ +current_thread_info ()->restart_block.fn = do_no_restart_syscall; + +#define COPY (r) err |= __get_user(regs->r, &usc->sc_##r)/* restore passed registers */ +COPY (er1); +COPY (er2); +COPY (er3); +COPY (er5); +COPY (pc); + ccr = regs->ccr &0x10 ; +COPY (ccr); +#undef COPY + regs->ccr &=0xef ; + regs->ccr |= ccr; + regs->orig_er0 =-1 ;/* disable syscall checks */ + err |=__get_user (usp, &usc->sc_usp); +wrusp (usp); + + err |=__get_user (er0, &usc->sc_er0); + *pd0 = er0; +return err; +} + +asmlinkage int sys_rt_sigreturn(void) +{ +unsigned long usp =rdusp (); +struct rt_sigframe *frame = (struct rt_sigframe *)(usp -4 ); +sigset_t set; +int er0; + +if (!access_ok (VERIFY_READ , frame,sizeof (*frame))) + goto badframe; +if (__copy_from_user (&set, &frame->uc.uc_sigmask,sizeof (set))) + goto badframe; + +set_current_blocked (&set); + +if (restore_sigcontext (&frame->uc.uc_mcontext, &er0)) + goto badframe; + +if (restore_altstack (&frame->uc.uc_stack)) + goto badframe; + +return er0; + +badframe: +force_sig (SIGSEGV , current); +return 0 ; +} + +static int setup_sigcontext (struct sigcontext __user *sc,struct pt_regs *regs, +unsigned long mask) +{ +int err =0 ; + + err |=__put_user (regs->er0, &sc->sc_er0); + err |=__put_user (regs->er1, &sc->sc_er1); + err |=__put_user (regs->er2, &sc->sc_er2); + err |=__put_user (regs->er3, &sc->sc_er3); + err |=__put_user (regs->er4, &sc->sc_er4); + err |=__put_user (regs->er5, &sc->sc_er5); + err |=__put_user (regs->er6, &sc->sc_er6); + err |=__put_user (rdusp (), &sc->sc_usp); + err |=__put_user (regs->pc, &sc->sc_pc); + err |=__put_user (regs->ccr, &sc->sc_ccr); + err |=__put_user (mask, &sc->sc_mask); + +return err; +} + +static inline void * +get_sigframe (struct k_sigaction *ka,struct pt_regs *regs,size_t frame_size) +{ +unsigned long usp; + +/* Default to using normal stack. */ + usp =rdusp (); + +/* This is the X/Open sanctioned signal stack switching. */ +if (ka->sa.sa_flags &SA_ONSTACK ) { +if (!sas_ss_flags (usp)) + usp = current->sas_ss_sp + current->sas_ss_size; + } +return (void *)((usp - frame_size) &-8UL ); +} + +static int setup_rt_frame (struct ksignal *ksig,sigset_t *set, +struct pt_regs *regs) +{ +struct rt_sigframe *frame; +int err =0 ; +int usig; +int sig = ksig->sig; +unsigned char *ret; + + frame =get_sigframe (&ksig->ka, regs,sizeof (*frame)); + +if (!access_ok (VERIFY_WRITE , frame,sizeof (*frame))) + goto give_sigsegv; + + usig =current_thread_info ()->exec_domain + &¤t_thread_info ()->exec_domain->signal_invmap + && sig <32 + ?current_thread_info ()->exec_domain->signal_invmap[sig] + : sig; + + err |=__put_user (usig, &frame->sig); +if (err) + goto give_sigsegv; + + err |=__put_user (&frame->info, &frame->pinfo); + err |=__put_user (&frame->uc, &frame->puc); + err |=copy_siginfo_to_user (&frame->info, &ksig->info); +if (err) + goto give_sigsegv; + +/* Create the ucontext. */ + err |=__put_user (0 , &frame->uc.uc_flags); + err |=__put_user (0 , &frame->uc.uc_link); + err |=__save_altstack (&frame->uc.uc_stack,rdusp ()); + err |=setup_sigcontext (&frame->uc.uc_mcontext, regs, set->sig[0 ]); + err |=copy_to_user (&frame->uc.uc_sigmask, set,sizeof (*set)); +if (err) + goto give_sigsegv; + +/* Set up to return from userspace. */ + ret = frame->retcode; +if (ksig->ka.sa.sa_flags &SA_RESTORER ) + ret = (unsigned char *)(ksig->ka.sa.sa_restorer); +else { +/* sub.l er0,er0; mov.b #__NR_rt_sigreturn,r0l; trapa #0 */ + err |=__put_user (0x1a80f800 + (__NR_rt_sigreturn &0xff ), + (unsigned long *)(frame->retcode +0 )); + err |=__put_user (0x5700 , + (unsigned short *)(frame->retcode +4 )); + } + err |=__put_user (ret, &frame->pretcode); + +if (err) + goto give_sigsegv; + +/* Set up registers for signal handler */ +wrusp ((unsigned long ) frame); + regs->pc = (unsigned long ) ksig->ka.sa.sa_handler; + regs->er0 = (current_thread_info ()->exec_domain + &¤t_thread_info ()->exec_domain->signal_invmap + && sig <32 + ?current_thread_info ()->exec_domain->signal_invmap[sig] + : sig); + regs->er1 = (unsigned long )&(frame->info); + regs->er2 = (unsigned long )&frame->uc; + regs->er5 = current->mm->start_data;/* GOT base */ + +return 0 ; + +give_sigsegv: +force_sigsegv (sig, current); +return -EFAULT ; +} + +static void +handle_restart (struct pt_regs *regs,struct k_sigaction *ka) +{ +switch (regs->er0) { +case -ERESTARTNOHAND : +if (!ka) + goto do_restart; + regs->er0 = -EINTR ; +break ; +case -ERESTART_RESTARTBLOCK : +if (!ka) { + regs->er0 = __NR_restart_syscall; + regs->pc -=2 ; + }else + regs->er0 = -EINTR ; +break ; +case -ERESTARTSYS : +if (!(ka->sa.sa_flags &SA_RESTART )) { + regs->er0 = -EINTR ; +break ; + } +/* fallthrough */ +case -ERESTARTNOINTR : +do_restart: + regs->er0 = regs->orig_er0; + regs->pc -=2 ; +break ; + } +} + +/* +* OK, we're invoking a handler +*/ +static void +handle_signal (struct ksignal *ksig,struct pt_regs *regs) +{ +sigset_t *oldset =sigmask_to_save (); +int ret; +/* are we from a system call? */ +if (regs->orig_er0 >=0 ) +handle_restart (regs, &ksig->ka); + + ret =setup_rt_frame (ksig, oldset, regs); + +signal_setup_done (ret, ksig,0 ); +} + +/* +* Note that 'init' is a special process: it doesn't get signals it doesn't +* want to handle. Thus you cannot kill init even with a SIGKILL even by +* mistake. +*/ +static void do_signal (struct pt_regs *regs) +{ +struct ksignal ksig; + +/* +* We want the common case to go fast, which +* is why we may in certain cases get here from +* kernel mode. Just return without doing anything +* if so. +*/ +if ((regs->ccr &0x10 )) +return ; + + current->thread.esp0 = (unsigned long ) regs; + +if (get_signal (&ksig)) { +/* Whee! Actually deliver the signal. */ +handle_signal (&ksig, regs); +return ; + } +/* Did we come from a system call? */ +if (regs->orig_er0 >=0 ) +handle_restart (regs,NULL ); + +/* If there's no signal to deliver, we just restore the saved mask. */ +restore_saved_sigmask (); +} + +asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) +{ +if (thread_info_flags & _TIF_SIGPENDING) +do_signal (regs); + +if (thread_info_flags & _TIF_NOTIFY_RESUME) { +clear_thread_flag (TIF_NOTIFY_RESUME ); +tracehook_notify_resume (regs); + } +}
Signature · 1 line
2.1.3
PATCH 15/16 h8300: system call entry table
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/syscalls.S
arch/h8300/kernel/syscalls.S new file +380 -0
@@ -0,0 +1,380 @@ +/* Systemcall Entry Table */ +#include <linux/sys.h> +#include <asm/linkage.h> +#include <asm/unistd.h> + + .global _sys_call_table + +#define CALL(x) .long x + +.globl _sys_call_table + +#if defined(CONFIG_CPU_H8300H) + .h8300h +#endif +#if defined(CONFIG_CPU_H8S) + .h8300s +#endif + .section .text + .align 2 +_sys_call_table: + CALL(sys_ni_syscall) /* 0 - old "setup()" system call*/ + CALL(sys_exit) + CALL(sys_ni_syscall) /* fork */ + CALL(sys_read) + CALL(sys_write) + CALL(sys_open) /* 5 */ + CALL(sys_close) + CALL(sys_waitpid) + CALL(sys_creat) + CALL(sys_link) + CALL(sys_unlink) /* 10 */ + CALL(sys_execve) + CALL(sys_chdir) + CALL(sys_time) + CALL(sys_mknod) + CALL(sys_chmod) /* 15 */ + CALL(sys_chown16) + CALL(sys_ni_syscall) /* old break syscall holder */ + CALL(sys_ni_syscall) /* stat */ + CALL(sys_lseek) + CALL(sys_getpid) /* 20 */ + CALL(sys_mount) + CALL(sys_ni_syscall) /* oldmount */ + CALL(sys_setuid16) + CALL(sys_getuid16) + CALL(sys_stime) /* 25 */ + CALL(sys_ptrace) + CALL(sys_alarm) + CALL(sys_ni_syscall) /* fstat */ + CALL(sys_pause) + CALL(sys_utime) /* 30 */ + CALL(sys_ni_syscall) /* old stty syscall holder */ + CALL(sys_ni_syscall) /* old gtty syscall holder */ + CALL(sys_access) + CALL(sys_nice) + CALL(sys_ni_syscall) /* 35 old ftime syscall holder */ + CALL(sys_sync) + CALL(sys_kill) + CALL(sys_rename) + CALL(sys_mkdir) + CALL(sys_rmdir) /* 40 */ + CALL(sys_dup) + CALL(sys_pipe) + CALL(sys_times) + CALL(sys_ni_syscall) /* old prof syscall holder */ + CALL(sys_brk) /* 45 */ + CALL(sys_setgid16) + CALL(sys_getgid16) + CALL(sys_signal) + CALL(sys_geteuid16) + CALL(sys_getegid16) /* 50 */ + CALL(sys_acct) + CALL(sys_umount) /* recycled never used phys() */ + CALL(sys_ni_syscall) /* old lock syscall holder */ + CALL(sys_ioctl) + CALL(sys_fcntl) /* 55 */ + CALL(sys_ni_syscall) /* old mpx syscall holder */ + CALL(sys_setpgid) + CALL(sys_ni_syscall) /* old ulimit syscall holder */ + CALL(sys_ni_syscall) + CALL(sys_umask) /* 60 */ + CALL(sys_chroot) + CALL(sys_ustat) + CALL(sys_dup2) + CALL(sys_getppid) + CALL(sys_getpgrp) /* 65 */ + CALL(sys_setsid) + CALL(sys_ni_syscall) + CALL(sys_sgetmask) + CALL(sys_ssetmask) + CALL(sys_setreuid16) /* 70 */ + CALL(sys_setregid16) + CALL(sys_ni_syscall) + CALL(sys_sigpending) + CALL(sys_sethostname) + CALL(sys_setrlimit) /* 75 */ + CALL(sys_ni_syscall) /* old_getrlimit */ + CALL(sys_getrusage) + CALL(sys_gettimeofday) + CALL(sys_settimeofday) + CALL(sys_getgroups16) /* 80 */ + CALL(sys_setgroups16) + CALL(sys_ni_syscall) /* old_select */ + CALL(sys_symlink) + CALL(sys_ni_syscall) /* lstat */ + CALL(sys_readlink) /* 85 */ + CALL(sys_uselib) + CALL(sys_swapon) + CALL(sys_reboot) + CALL(sys_ni_syscall) /* old_readdir */ + CALL(sys_ni_syscall) /* 90 old_mmap */ + CALL(sys_munmap) + CALL(sys_truncate) + CALL(sys_ftruncate) + CALL(sys_fchmod) + CALL(sys_fchown16) /* 95 */ + CALL(sys_getpriority) + CALL(sys_setpriority) + CALL(sys_ni_syscall) /* old profil syscall holder */ + CALL(sys_statfs) + CALL(sys_fstatfs) /* 100 */ + CALL(sys_ni_syscall) /* ioperm for i386 */ + CALL(sys_socketcall) + CALL(sys_syslog) + CALL(sys_setitimer) + CALL(sys_getitimer) /* 105 */ + CALL(sys_newstat) + CALL(sys_newlstat) + CALL(sys_newfstat) + CALL(sys_ni_syscall) + CALL(sys_ni_syscall) /* iopl for i386 */ /* 110 */ + CALL(sys_vhangup) + CALL(sys_ni_syscall) /* obsolete idle() syscall */ + CALL(sys_ni_syscall) /* vm86old for i386 */ + CALL(sys_wait4) + CALL(sys_swapoff) /* 115 */ + CALL(sys_sysinfo) + CALL(sys_ipc) + CALL(sys_fsync) + CALL(sys_ni_syscall) /* sigreturn */ + CALL(sys_clone) /* 120 */ + CALL(sys_setdomainname) + CALL(sys_newuname) + CALL(sys_cacheflush) /* modify_ldt for i386 */ + CALL(sys_adjtimex) + CALL(sys_ni_syscall) /* 125 sys_mprotect */ + CALL(sys_sigprocmask) + CALL(sys_ni_syscall) /* sys_create_module */ + CALL(sys_init_module) + CALL(sys_delete_module) + CALL(sys_ni_syscall) /* 130 sys_get_kernel_syms */ + CALL(sys_quotactl) + CALL(sys_getpgid) + CALL(sys_fchdir) + CALL(sys_bdflush) + CALL(sys_sysfs) /* 135 */ + CALL(sys_personality) + CALL(sys_ni_syscall) /* for afs_syscall */ + CALL(sys_setfsuid16) + CALL(sys_setfsgid16) + CALL(sys_llseek) /* 140 */ + CALL(sys_getdents) + CALL(sys_select) + CALL(sys_flock) + CALL(sys_ni_syscall) /* sys_msync */ + CALL(sys_readv) /* 145 */ + CALL(sys_writev) + CALL(sys_getsid) + CALL(sys_fdatasync) + CALL(sys_sysctl) + CALL(sys_ni_syscall) /* 150 sys_mlock */ + CALL(sys_ni_syscall) /* sys_munlock */ + CALL(sys_ni_syscall) /* sys_mlockall */ + CALL(sys_ni_syscall) /* sys_munlockall */ + CALL(sys_sched_setparam) + CALL(sys_sched_getparam) /* 155 */ + CALL(sys_sched_setscheduler) + CALL(sys_sched_getscheduler) + CALL(sys_sched_yield) + CALL(sys_sched_get_priority_max) + CALL(sys_sched_get_priority_min) /* 160 */ + CALL(sys_sched_rr_get_interval) + CALL(sys_nanosleep) + CALL(sys_ni_syscall) /* sys_mremap */ + CALL(sys_setresuid16) + CALL(sys_getresuid16) /* 165 */ + CALL(sys_ni_syscall) /* for vm86 */ + CALL(sys_ni_syscall) /* sys_query_module */ + CALL(sys_poll) + CALL(sys_ni_syscall) /* old nfsservctl */ + CALL(sys_setresgid16) /* 170 */ + CALL(sys_getresgid16) + CALL(sys_prctl) + CALL(sys_rt_sigreturn) + CALL(sys_rt_sigaction) + CALL(sys_rt_sigprocmask) /* 175 */ + CALL(sys_rt_sigpending) + CALL(sys_rt_sigtimedwait) + CALL(sys_rt_sigqueueinfo) + CALL(sys_rt_sigsuspend) + CALL(sys_pread64) /* 180 */ + CALL(sys_pwrite64) + CALL(sys_lchown16); + CALL(sys_getcwd) + CALL(sys_capget) + CALL(sys_capset) /* 185 */ + CALL(sys_sigaltstack) + CALL(sys_sendfile) + CALL(sys_ni_syscall) /* streams1 */ + CALL(sys_ni_syscall) /* streams2 */ + CALL(sys_vfork) /* 190 */ + CALL(sys_getrlimit) + CALL(sys_mmap_pgoff) + CALL(sys_truncate64) + CALL(sys_ftruncate64) + CALL(sys_stat64) /* 195 */ + CALL(sys_lstat64) + CALL(sys_fstat64) + CALL(sys_chown) + CALL(sys_getuid) + CALL(sys_getgid) /* 200 */ + CALL(sys_geteuid) + CALL(sys_getegid) + CALL(sys_setreuid) + CALL(sys_setregid) + CALL(sys_getgroups) /* 205 */ + CALL(sys_setgroups) + CALL(sys_fchown) + CALL(sys_setresuid) + CALL(sys_getresuid) + CALL(sys_setresgid) /* 210 */ + CALL(sys_getresgid) + CALL(sys_lchown) + CALL(sys_setuid) + CALL(sys_setgid) + CALL(sys_setfsuid) /* 215 */ + CALL(sys_setfsgid) + CALL(sys_pivot_root) + CALL(sys_ni_syscall) + CALL(sys_ni_syscall) + CALL(sys_getdents64) /* 220 */ + CALL(sys_fcntl64) + CALL(sys_ni_syscall) /* reserved TUX */ + CALL(sys_ni_syscall) /* reserved Security */ + CALL(sys_gettid) + CALL(sys_readahead) /* 225 */ + CALL(sys_setxattr) + CALL(sys_lsetxattr) + CALL(sys_fsetxattr) + CALL(sys_getxattr) + CALL(sys_lgetxattr) /* 230 */ + CALL(sys_fgetxattr) + CALL(sys_listxattr) + CALL(sys_llistxattr) + CALL(sys_flistxattr) + CALL(sys_removexattr) /* 235 */ + CALL(sys_lremovexattr) + CALL(sys_fremovexattr) + CALL(sys_tkill) + CALL(sys_sendfile64) + CALL(sys_futex) /* 240 */ + CALL(sys_sched_setaffinity) + CALL(sys_sched_getaffinity) + CALL(sys_ni_syscall) + CALL(sys_ni_syscall) + CALL(sys_io_setup) /* 245 */ + CALL(sys_io_destroy) + CALL(sys_io_getevents) + CALL(sys_io_submit) + CALL(sys_io_cancel) + CALL(sys_fadvise64) /* 250 */ + CALL(sys_ni_syscall) + CALL(sys_exit_group) + CALL(sys_lookup_dcookie) + CALL(sys_epoll_create) + CALL(sys_epoll_ctl) /* 255 */ + CALL(sys_epoll_wait) + CALL(sys_ni_syscall) /* sys_remap_file_pages */ + CALL(sys_set_tid_address) + CALL(sys_timer_create) + CALL(sys_timer_settime) /* 260 */ + CALL(sys_timer_gettime) + CALL(sys_timer_getoverrun) + CALL(sys_timer_delete) + CALL(sys_clock_settime) + CALL(sys_clock_gettime) /* 265 */ + CALL(sys_clock_getres) + CALL(sys_clock_nanosleep) + CALL(sys_statfs64) + CALL(sys_fstatfs64) + CALL(sys_tgkill) /* 270 */ + CALL(sys_utimes) + CALL(sys_fadvise64_64) + CALL(sys_ni_syscall) /* sys_vserver */ + CALL(sys_ni_syscall) + CALL(sys_get_mempolicy) /* 275 */ + CALL(sys_set_mempolicy) + CALL(sys_mq_open) + CALL(sys_mq_unlink) + CALL(sys_mq_timedsend) + CALL(sys_mq_timedreceive) /* 280 */ + CALL(sys_mq_notify) + CALL(sys_mq_getsetattr) + CALL(sys_waitid) + CALL(sys_ni_syscall) /* sys_kexec_load */ + CALL(sys_add_key) /* 285 */ + CALL(sys_request_key) + CALL(sys_keyctl) + CALL(sys_ioprio_set) + CALL(sys_ioprio_get) /* 290 */ + CALL(sys_inotify_init) + CALL(sys_inotify_add_watch) + CALL(sys_inotify_rm_watch) + CALL(sys_migrate_pages) + CALL(sys_openat) /* 295 */ + CALL(sys_mkdirat) + CALL(sys_mknodat) + CALL(sys_fchownat) + CALL(sys_futimesat) + CALL(sys_fstatat64) /* 300 */ + CALL(sys_unlinkat) + CALL(sys_renameat) + CALL(sys_linkat) + CALL(sys_symlinkat) + CALL(sys_readlinkat) /* 305 */ + CALL(sys_fchmodat) + CALL(sys_faccessat) + CALL(sys_ni_syscall) /* sys_pselect6 */ + CALL(sys_ni_syscall) /* sys_ppoll */ + CALL(sys_unshare) /* 310 */ + CALL(sys_set_robust_list) + CALL(sys_get_robust_list) + CALL(sys_splice) + CALL(sys_sync_file_range) + CALL(sys_tee) /* 315 */ + CALL(sys_vmsplice) + CALL(sys_ni_syscall) /* sys_move_pages */ + CALL(sys_getcpu) + CALL(sys_ni_syscall) /* sys_epoll_pwait */ + CALL(sys_utimensat) /* 320 */ + CALL(sys_signalfd) + CALL(sys_timerfd_create) + CALL(sys_eventfd) + CALL(sys_fallocate) + CALL(sys_timerfd_settime) /* 325 */ + CALL(sys_timerfd_gettime) + CALL(sys_signalfd4) + CALL(sys_eventfd2) + CALL(sys_epoll_create1) + CALL(sys_dup3) /* 330 */ + CALL(sys_pipe2) + CALL(sys_inotify_init1) + CALL(sys_preadv) + CALL(sys_pwritev) + CALL(sys_rt_tgsigqueueinfo) /* 335 */ + CALL(sys_perf_event_open) + CALL(sys_fanotify_init) + CALL(sys_fanotify_mark) + CALL(sys_prlimit64) + CALL(sys_name_to_handle_at) /* 340 */ + CALL(sys_open_by_handle_at) + CALL(sys_clock_adjtime) + CALL(sys_syncfs) + CALL(sys_sendmmsg) + CALL(sys_recvmmsg) /* 345 */ + CALL(sys_setns) + CALL(sys_process_vm_readv) + CALL(sys_process_vm_writev) + CALL(sys_kcmp) + CALL(sys_finit_module) /* 350 */ + CALL(sys_sched_setattr) + CALL(sys_sched_getattr) + CALL(sys_renameat2) + CALL(seccomp) + CALL(getrandom) /* 355 */ + CALL(memfd_create) + CALL(bpf) + CALL(execveat) + + .end
Signature · 1 line
2.1.3
PATCH 16/16 h8300: misc functions
In reply to a message not in the archivecreate mode 100644 arch/h8300/kernel/Makefile create mode 100644 arch/h8300/kernel/asm-offsets.c create mode 100644 arch/h8300/kernel/clk.c create mode 100644 arch/h8300/kernel/h8300_ksyms.c create mode 100644 arch/h8300/kernel/module.c create mode 100644 arch/h8300/kernel/process.c create mode 100644 arch/h8300/kernel/setup.c create mode 100644 arch/h8300/kernel/sim-console.c create mode 100644 arch/h8300/kernel/sys_h8300.c create mode 100644 arch/h8300/kernel/vmlinux.lds.S
arch/h8300/kernel/Makefile new file +23 -0
@@ -0,0 +1,23 @@ +# +# Makefile for the linux kernel. +# + +extra-y := vmlinux.lds + +obj-y := process.o traps.o ptrace.o \ + sys_h8300.o time.o signal.o \ + setup.o syscalls.o irq.o \ + entry.o clk.o timer/ + +obj-$(CONFIG_ROMKERNEL) += head_rom.o +obj-$(CONFIG_RAMKERNEL) += head_ram.o +obj-$(CONFIG_CPU_H8300H) += ptrace_h.o irq_h.o +obj-$(CONFIG_CPU_H8S) += ptrace_s.o irq_s.o + +obj-$(CONFIG_MODULES) += module.o h8300_ksyms.o +obj-$(CONFIG_H8300H_SIM) += sim-console.o +obj-$(CONFIG_H8S_SIM) += sim-console.o + +obj-$(CONFIG_H83069) += cpu/h83069/ +obj-$(CONFIG_H8S2678) += cpu/h8s2678/ +
arch/h8300/kernel/asm-offsets.c new file +59 -0
59 lines not on this page · raw message
arch/h8300/kernel/clk.c new file +52 -0
52 lines not on this page · raw message
arch/h8300/kernel/h8300_ksyms.c new file +64 -0
64 lines not on this page · raw message
arch/h8300/kernel/module.c new file +75 -0
75 lines not on this page · raw message
arch/h8300/kernel/process.c new file +154 -0
154 lines not on this page · raw message
arch/h8300/kernel/setup.c new file +172 -0
172 lines not on this page · raw message
arch/h8300/kernel/sim-console.c new file +79 -0
79 lines not on this page · raw message
arch/h8300/kernel/sys_h8300.c new file +22 -0
@@ -0,0 +1,22 @@ +/* +* linux/arch/h8300/kernel/sys_h8300.c +* +* This file contains various random system calls that +* have a non-standard calling sequence on the H8/300 +* platform. +*/ + +#include <asm/setup.h> +#include <asm/uaccess.h> + +/* sys_cacheflush -- no support. */ +asmlinkage int +sys_cacheflush (unsigned long addr,int scope,int cache,unsigned long len) +{ +return -EINVAL ; +} + +asmlinkage int sys_getpagesize(void) +{ +return PAGE_SIZE ; +}
arch/h8300/kernel/vmlinux.lds.S new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
2.1.3
Arnd Bergmann
maintainerRe: [PATCH 16/16] h8300: misc functions
Quoted 6 lines · On Wednesday 21 January 2015 13:32:48 Yoshinori Sato wrote:
arch/h8300/kernel/clk.c new file +6
-0+unsigned long clk_get_rate (struct clk *clk) +{ +return clk->parent->rate; +} +EXPORT_SYMBOL (clk_get_rate) +
arch/h8300/kernel/clk.c line 28
Quoted 10 lines
arch/h8300/kernel/clk.c new file +10
-0+int clk_enable (struct clk *clk) +{ +return 0 ; +} +EXPORT_SYMBOL (clk_enable) + +void clk_disable(struct clk *clk) +{ +} +EXPORT_SYMBOL (clk_disable)
If you are not too size constrained, you could consider using the common clk implementation from drivers/clk/.
Quoted 13 lines
arch/h8300/kernel/clk.c new file +13
-0+static struct clk master_clk; + +static struct clk peripheral_clk = { + .parent = &master_clk, +}; + +static struct clk_lookup lookups[] = { + { + .con_id ="master_clk" , + .clk = &master_clk, + }, + { + .con_id ="peripheral_clk" ,
arch/h8300/kernel/clk.c line 52
Quoted 10 lines
arch/h8300/kernel/clk.c new file +10
-0+ .clk = &peripheral_clk, + }, +}; + +int __init h8300_clk_init (unsigned long hz) +{ + master_clk.rate = hz; +clkdev_add_table (lookups,ARRAY_SIZE (lookups)); +return 0 ; +}
Usually, we try to avoid global clock signal names to be requested by drivers. Instead you should list the clock input name for each device along with the device name, to allow drivers to be use the same string for the clock signal independent of how a device is wired.
This would automatically work with dt.
Quoted 5 lines
arch/h8300/kernel/h8300_ksyms.c new file +5
-0+EXPORT_SYMBOL (__gcc_bcmp); +EXPORT_SYMBOL (__ashldi3); +EXPORT_SYMBOL (__ashrdi3); +EXPORT_SYMBOL (__cmpdi2); +EXPORT_SYMBOL (__divdi3);
arch/h8300/kernel/h8300_ksyms.c line 61
Quoted 10 lines
arch/h8300/kernel/h8300_ksyms.c new file +10
-0+EXPORT_SYMBOL (__divsi3); +EXPORT_SYMBOL (__lshrdi3); +EXPORT_SYMBOL (__moddi3); +EXPORT_SYMBOL (__modsi3); +EXPORT_SYMBOL (__muldi3); +EXPORT_SYMBOL (__mulsi3); +EXPORT_SYMBOL (__negdi2); +EXPORT_SYMBOL (__ucmpdi2); +EXPORT_SYMBOL (__udivdi3); +EXPORT_SYMBOL (__udivmoddi4);
We don't normally use the __udivdi3/__udivmoddi4 functions from libgcc, instead Linux drivers are required to use the do_div() or div64() interfaces to do an expensive 64-bit division, to avoid accidentally doing an expensive computation that can be reduced to a cheaper 32-bit division. You can probably just drop these two symbols and still use libgcc, though that would not catch the built-in (non-loadable module) users.
An alternative would be to copy the implementation of the other functions from libgcc source into the kernel and just export the symbols you actually need. This also gives you better control over which implementation is used, to avoid a toolchain dependency in the kernel. Most architectures take this approach.
Quoted 8 lines
arch/h8300/kernel/module.c new file +2
-0@@ -0,0 +1,75 @@ +#include <linux/moduleloader.h> +#include <linux/elf.h>
arch/h8300/kernel/module.c line 12
Quoted 10 lines
arch/h8300/kernel/module.c new file +10
-0+#include <linux/vmalloc.h> +#include <linux/fs.h> +#include <linux/string.h> +#include <linux/kernel.h> + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(fmt...) +#endif
You can use the existing pr_debug() to the same effect.
Quoted 18 lines
arch/h8300/kernel/sys_h8300.c new file +12
-0@@ -0,0 +1,22 @@ +/* +* linux/arch/h8300/kernel/sys_h8300.c +* +* This file contains various random system calls that +* have a non-standard calling sequence on the H8/300 +* platform. +*/ + +#include <asm/setup.h> +#include <asm/uaccess.h> + +/* sys_cacheflush -- no support. */
arch/h8300/kernel/sys_h8300.c line 22
Quoted 10 lines
arch/h8300/kernel/sys_h8300.c new file +10
-0+asmlinkage int +sys_cacheflush (unsigned long addr,int scope,int cache,unsigned long len) +{ +return -EINVAL ; +} + +asmlinkage int sys_getpagesize(void) +{ +return PAGE_SIZE ; +}
I think you can just drop these.
Arnd
Re: [PATCH 16/16] h8300: misc functions
At Wed, 21 Jan 2015 10:01:59 +0100,
Quoted 43 lines · Arnd Bergmann
Quoted 6 lines · On Wednesday 21 January 2015 13:32:48 Yoshinori Sato wrote:
arch/h8300/kernel/clk.c new file +6
-0+unsigned long clk_get_rate (struct clk *clk) +{ +return clk->parent->rate; +} +EXPORT_SYMBOL (clk_get_rate) +arch/h8300/kernel/clk.c line 28
Quoted 10 lines
arch/h8300/kernel/clk.c new file +10
-0+int clk_enable (struct clk *clk) +{ +return 0 ; +} +EXPORT_SYMBOL (clk_enable) + +void clk_disable(struct clk *clk) +{ +} +EXPORT_SYMBOL (clk_disable)If you are not too size constrained, you could consider using the common clk implementation from
drivers/clk/.Quoted 20 lines
arch/h8300/kernel/clk.c new file +20
-0+static struct clk master_clk; + +static struct clk peripheral_clk = { + .parent = &master_clk, +}; + +static struct clk_lookup lookups[] = { + { + .con_id ="master_clk" , + .clk = &master_clk, + }, + { + .con_id ="peripheral_clk" , + .clk = &peripheral_clk, + }, +}; + +int __init h8300_clk_init (unsigned long hz) +{ + master_clk.rate = hz;
Quoted 8 lines
arch/h8300/kernel/clk.c line 52
Quoted 3 lines
arch/h8300/kernel/clk.c new file +3
-0+clkdev_add_table (lookups,ARRAY_SIZE (lookups)); +return 0 ; +}Usually, we try to avoid global clock signal names to be requested by drivers. Instead you should list the clock input name for each device along with the device name, to allow drivers to be use the same string for the clock signal independent of how a device is wired.
OK.
Quoted 26 lines
This would automatically work with dt.
Quoted 5 lines
arch/h8300/kernel/h8300_ksyms.c new file +5
-0+EXPORT_SYMBOL (__gcc_bcmp); +EXPORT_SYMBOL (__ashldi3); +EXPORT_SYMBOL (__ashrdi3); +EXPORT_SYMBOL (__cmpdi2); +EXPORT_SYMBOL (__divdi3);arch/h8300/kernel/h8300_ksyms.c line 61
Quoted 10 lines
arch/h8300/kernel/h8300_ksyms.c new file +10
-0+EXPORT_SYMBOL (__divsi3); +EXPORT_SYMBOL (__lshrdi3); +EXPORT_SYMBOL (__moddi3); +EXPORT_SYMBOL (__modsi3); +EXPORT_SYMBOL (__muldi3); +EXPORT_SYMBOL (__mulsi3); +EXPORT_SYMBOL (__negdi2); +EXPORT_SYMBOL (__ucmpdi2); +EXPORT_SYMBOL (__udivdi3); +EXPORT_SYMBOL (__udivmoddi4);We don't normally use the __udivdi3/__udivmoddi4 functions from libgcc, instead Linux drivers are required to use the
do_div()ordiv64()interfaces to do an expensive 64-bit division, to avoid accidentally doing an expensive computation that can be reduced to a cheaper 32-bit division. You can probably just drop these two symbols and still use libgcc, though that would not catch the built-in (non-loadable module) users.
Quoted 5 lines
An alternative would be to copy the implementation of the other functions from libgcc source into the kernel and just export the symbols you actually need. This also gives you better control over which implementation is used, to avoid a toolchain dependency in the kernel. Most architectures take this approach.
OK.
I will fix V2 patch.
Quoted 52 lines
Quoted 8 lines
arch/h8300/kernel/module.c new file +2
-0@@ -0,0 +1,75 @@ +#include <linux/moduleloader.h> +#include <linux/elf.h> arch/h8300/kernel/module.c line 12
Quoted 10 lines
arch/h8300/kernel/module.c new file +10
-0+#include <linux/vmalloc.h> +#include <linux/fs.h> +#include <linux/string.h> +#include <linux/kernel.h> + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(fmt...) +#endif You can use the existing
pr_debug()to the same effect.Quoted 18 lines
arch/h8300/kernel/sys_h8300.c new file +12
-0@@ -0,0 +1,22 @@ +/* +* linux/arch/h8300/kernel/sys_h8300.c +* +* This file contains various random system calls that +* have a non-standard calling sequence on the H8/300 +* platform. +*/ + +#include <asm/setup.h> +#include <asm/uaccess.h> + +/* sys_cacheflush -- no support. */ arch/h8300/kernel/sys_h8300.c line 22
Quoted 10 lines
arch/h8300/kernel/sys_h8300.c new file +10
-0+asmlinkage int +sys_cacheflush (unsigned long addr,int scope,int cache,unsigned long len) +{ +return -EINVAL ; +} + +asmlinkage int sys_getpagesize(void) +{ +return PAGE_SIZE ; +}I think you can just drop these.
Quoted 1 line
Arnd
OK
I will fix V2 patch.
Signature · 2 lines
Yoshinori Sato <[email protected]>