S+core architecture (arch/score) support
Subsystems (3)
Hi Linus,
We had setup a git server at gitserver.sunplusct.com, This repository contains Linux support for S+core CPU. it's base on Linux 2.6.31-rc7 and Arnd asm-generic repository.
please pull:
git pull git://gitserver.sunplusct.com/linux-2.6-score.git for-linus
toolchain for linux/score could be download at:
http://www.sunplusct.com/linux-score-patch.html
Changes in v4:
Sending pull request again.
Changes in v3:
With the help of Arnd and Roland.
Changes in v2:
Christoph Hellwig and Arnd review it.
Thanks,
Liqin
-----
score: add maintainers for score architecture
score: create mm/ files extable.c fault.c
score: create mm/ files init.c cache.c
score: create mm/ files Makefile pgtable.c and tlb files
score: create lib/ files ashrdi3.c ashldi3.c lshrdi3.c checksum.S checksum_copy.c
score: create lib/ files Makefile libgcc.h cmpdi2.c ucmpdi2.c string.S
score: create kernel/ files ptrace.c signal.c
score: create kernel/ files module.c process.c
score: create kernel/ files irq.c time.c traps.c
score: create kernel/ files sys_call_table.c sys_score.c
score: create kernel/ files asm-offsets.c init_task.c setup.c
score: create kernel/ files Makefile head.S entry.S vmlinux.lds.S
score: create head files linkage.h local.h module.h socket.h sockios.h unaligned.h
score: create head files fixmap.h param.h resource.h setup.h sections.h segment.h string.h system.h
score: create head files ipcbuf.h msgbuf.h sembuf.h shmparam.h shmbuf.h
score: create head files futex.h ftrace.h mutex.h ptarce.h
score: create head files pci.h processor.h thread_info.h topology.h
score: create head files current.h device.h percpu.h scatterlist.h scoreregs.h
score: create head files sigcontext.h siginfo.h signal.h
score: create head files syscalls.h uaccess.h ucontext.h unistd.h user.h
score: create head files page.h pgalloc.h pgtable-bits.h pgtable.h
score: create head files mman.h mmu.h mmu_context.h
score: create head files hardirq.h hw_irq.h irq.h irqflags.h irq_regs.h
score: create head files dma.h dma-mapping.h io.h ioctl.h ioctls.h
score: create head files fcntl.h poll.h stat.h statfs.h termbits.h termios.h
score: create head files cputime.h delay.h timex.h
score: create head files cache.h cacheflush.h tlb.h tlbflush.h
score: create head files emergency-restart.h kdebug.h kmap_types.h posix_types.h swab.h types.h
score: create head files atomic.h auxvec.h bitops.h bitsperlong.h byteorder.h div64.h elf.h
score: create head files Kbuild asmmacro.h bug.h bugs.h checksum.h errno.h
score: defconfig file
score: Makefile and boot/Makefile for score
score: Kconfig and Kconfig.debug for score
MAINTAINERS | 8 + arch/score/Kconfig | 141 ++++++ arch/score/Kconfig.debug | 36 ++ arch/score/Makefile | 43 ++ arch/score/boot/Makefile | 15 + arch/score/configs/spct6600_defconfig | 717 ++++++++++++++++++++++++++++ arch/score/include/asm/Kbuild | 3 + arch/score/include/asm/asmmacro.h | 161 +++++++ arch/score/include/asm/atomic.h | 6 + arch/score/include/asm/auxvec.h | 4 + arch/score/include/asm/bitops.h | 16 + arch/score/include/asm/bitsperlong.h | 6 + arch/score/include/asm/bug.h | 6 + arch/score/include/asm/bugs.h | 6 + arch/score/include/asm/byteorder.h | 6 + arch/score/include/asm/cache.h | 7 + arch/score/include/asm/cacheflush.h | 45 ++ arch/score/include/asm/checksum.h | 235 +++++++++ arch/score/include/asm/cputime.h | 6 + arch/score/include/asm/current.h | 6 + arch/score/include/asm/delay.h | 26 + arch/score/include/asm/device.h | 6 + arch/score/include/asm/div64.h | 6 + arch/score/include/asm/dma-mapping.h | 6 + arch/score/include/asm/dma.h | 8 + arch/score/include/asm/elf.h | 103 ++++ arch/score/include/asm/emergency-restart.h | 6 + arch/score/include/asm/errno.h | 6 + arch/score/include/asm/fcntl.h | 6 + arch/score/include/asm/fixmap.h | 82 ++++ arch/score/include/asm/ftrace.h | 4 + arch/score/include/asm/futex.h | 6 + arch/score/include/asm/hardirq.h | 6 + arch/score/include/asm/hw_irq.h | 4 + arch/score/include/asm/io.h | 9 + arch/score/include/asm/ioctl.h | 6 + arch/score/include/asm/ioctls.h | 6 + arch/score/include/asm/ipcbuf.h | 6 + arch/score/include/asm/irq.h | 25 + arch/score/include/asm/irq_regs.h | 11 + arch/score/include/asm/irqflags.h | 109 +++++ arch/score/include/asm/kdebug.h | 6 + arch/score/include/asm/kmap_types.h | 6 + arch/score/include/asm/linkage.h | 7 + arch/score/include/asm/local.h | 6 + arch/score/include/asm/mman.h | 6 + arch/score/include/asm/mmu.h | 6 + arch/score/include/asm/mmu_context.h | 113 +++++ arch/score/include/asm/module.h | 39 ++ arch/score/include/asm/msgbuf.h | 6 + arch/score/include/asm/mutex.h | 6 + arch/score/include/asm/page.h | 92 ++++ arch/score/include/asm/param.h | 6 + arch/score/include/asm/pci.h | 4 + arch/score/include/asm/percpu.h | 6 + arch/score/include/asm/pgalloc.h | 83 ++++ arch/score/include/asm/pgtable-bits.h | 25 + arch/score/include/asm/pgtable.h | 287 +++++++++++ arch/score/include/asm/poll.h | 6 + arch/score/include/asm/posix_types.h | 6 + arch/score/include/asm/processor.h | 106 ++++ arch/score/include/asm/ptrace.h | 97 ++++ arch/score/include/asm/resource.h | 6 + arch/score/include/asm/scatterlist.h | 6 + arch/score/include/asm/scoreregs.h | 51 ++ arch/score/include/asm/sections.h | 6 + arch/score/include/asm/segment.h | 21 + arch/score/include/asm/sembuf.h | 6 + arch/score/include/asm/setup.h | 41 ++ arch/score/include/asm/shmbuf.h | 6 + arch/score/include/asm/shmparam.h | 6 + arch/score/include/asm/sigcontext.h | 22 + arch/score/include/asm/siginfo.h | 6 + arch/score/include/asm/signal.h | 6 + arch/score/include/asm/socket.h | 6 + arch/score/include/asm/sockios.h | 6 + arch/score/include/asm/stat.h | 6 + arch/score/include/asm/statfs.h | 6 + arch/score/include/asm/string.h | 8 + arch/score/include/asm/swab.h | 6 + arch/score/include/asm/syscalls.h | 11 + arch/score/include/asm/system.h | 90 ++++ arch/score/include/asm/termbits.h | 6 + arch/score/include/asm/termios.h | 6 + arch/score/include/asm/thread_info.h | 103 ++++ arch/score/include/asm/timex.h | 8 + arch/score/include/asm/tlb.h | 17 + arch/score/include/asm/tlbflush.h | 142 ++++++ arch/score/include/asm/topology.h | 6 + arch/score/include/asm/types.h | 6 + arch/score/include/asm/uaccess.h | 27 + arch/score/include/asm/ucontext.h | 1 + arch/score/include/asm/unaligned.h | 6 + arch/score/include/asm/unistd.h | 8 + arch/score/include/asm/user.h | 21 + arch/score/kernel/Makefile | 11 + arch/score/kernel/asm-offsets.c | 216 +++++++++ arch/score/kernel/entry.S | 501 +++++++++++++++++++ arch/score/kernel/head.S | 70 +++ arch/score/kernel/init_task.c | 47 ++ arch/score/kernel/irq.c | 148 ++++++ arch/score/kernel/module.c | 165 +++++++ arch/score/kernel/process.c | 168 +++++++ arch/score/kernel/ptrace.c | 382 +++++++++++++++ arch/score/kernel/setup.c | 159 ++++++ arch/score/kernel/signal.c | 361 ++++++++++++++ arch/score/kernel/sys_call_table.c | 12 + arch/score/kernel/sys_score.c | 131 +++++ arch/score/kernel/time.c | 99 ++++ arch/score/kernel/traps.c | 349 ++++++++++++++ arch/score/kernel/vmlinux.lds.S | 148 ++++++ arch/score/lib/Makefile | 8 + arch/score/lib/ashldi3.c | 46 ++ arch/score/lib/ashrdi3.c | 48 ++ arch/score/lib/checksum.S | 255 ++++++++++ arch/score/lib/checksum_copy.c | 52 ++ arch/score/lib/cmpdi2.c | 44 ++ arch/score/lib/libgcc.h | 37 ++ arch/score/lib/lshrdi3.c | 47 ++ arch/score/lib/string.S | 184 +++++++ arch/score/lib/ucmpdi2.c | 38 ++ arch/score/mm/Makefile | 6 + arch/score/mm/cache.c | 257 ++++++++++ arch/score/mm/extable.c | 38 ++ arch/score/mm/fault.c | 235 +++++++++ arch/score/mm/init.c | 161 +++++++ arch/score/mm/pgtable.c | 52 ++ arch/score/mm/tlb-miss.S | 199 ++++++++ arch/score/mm/tlb-score.c | 251 ++++++++++ 129 files changed, 8443 insertions(+), 0 deletions(-) create mode 100644 arch/score/Kconfig create mode 100644 arch/score/Kconfig.debug create mode 100644 arch/score/Makefile create mode 100644 arch/score/boot/Makefile create mode 100644 arch/score/configs/spct6600_defconfig create mode 100644 arch/score/include/asm/Kbuild create mode 100644 arch/score/include/asm/asmmacro.h create mode 100644 arch/score/include/asm/atomic.h create mode 100644 arch/score/include/asm/auxvec.h create mode 100644 arch/score/include/asm/bitops.h create mode 100644 arch/score/include/asm/bitsperlong.h create mode 100644 arch/score/include/asm/bug.h create mode 100644 arch/score/include/asm/bugs.h create mode 100644 arch/score/include/asm/byteorder.h create mode 100644 arch/score/include/asm/cache.h create mode 100644 arch/score/include/asm/cacheflush.h create mode 100644 arch/score/include/asm/checksum.h create mode 100644 arch/score/include/asm/cputime.h create mode 100644 arch/score/include/asm/current.h create mode 100644 arch/score/include/asm/delay.h create mode 100644 arch/score/include/asm/device.h create mode 100644 arch/score/include/asm/div64.h create mode 100644 arch/score/include/asm/dma-mapping.h create mode 100644 arch/score/include/asm/dma.h create mode 100644 arch/score/include/asm/elf.h create mode 100644 arch/score/include/asm/emergency-restart.h create mode 100644 arch/score/include/asm/errno.h create mode 100644 arch/score/include/asm/fcntl.h create mode 100644 arch/score/include/asm/fixmap.h create mode 100644 arch/score/include/asm/ftrace.h create mode 100644 arch/score/include/asm/futex.h create mode 100644 arch/score/include/asm/hardirq.h create mode 100644 arch/score/include/asm/hw_irq.h create mode 100644 arch/score/include/asm/io.h create mode 100644 arch/score/include/asm/ioctl.h create mode 100644 arch/score/include/asm/ioctls.h create mode 100644 arch/score/include/asm/ipcbuf.h create mode 100644 arch/score/include/asm/irq.h create mode 100644 arch/score/include/asm/irq_regs.h create mode 100644 arch/score/include/asm/irqflags.h create mode 100644 arch/score/include/asm/kdebug.h create mode 100644 arch/score/include/asm/kmap_types.h create mode 100644 arch/score/include/asm/linkage.h create mode 100644 arch/score/include/asm/local.h create mode 100644 arch/score/include/asm/mman.h create mode 100644 arch/score/include/asm/mmu.h create mode 100644 arch/score/include/asm/mmu_context.h create mode 100644 arch/score/include/asm/module.h create mode 100644 arch/score/include/asm/msgbuf.h create mode 100644 arch/score/include/asm/mutex.h create mode 100644 arch/score/include/asm/page.h create mode 100644 arch/score/include/asm/param.h create mode 100644 arch/score/include/asm/pci.h create mode 100644 arch/score/include/asm/percpu.h create mode 100644 arch/score/include/asm/pgalloc.h create mode 100644 arch/score/include/asm/pgtable-bits.h create mode 100644 arch/score/include/asm/pgtable.h create mode 100644 arch/score/include/asm/poll.h create mode 100644 arch/score/include/asm/posix_types.h create mode 100644 arch/score/include/asm/processor.h create mode 100644 arch/score/include/asm/ptrace.h create mode 100644 arch/score/include/asm/resource.h create mode 100644 arch/score/include/asm/scatterlist.h create mode 100644 arch/score/include/asm/scoreregs.h create mode 100644 arch/score/include/asm/sections.h create mode 100644 arch/score/include/asm/segment.h create mode 100644 arch/score/include/asm/sembuf.h create mode 100644 arch/score/include/asm/setup.h create mode 100644 arch/score/include/asm/shmbuf.h create mode 100644 arch/score/include/asm/shmparam.h create mode 100644 arch/score/include/asm/sigcontext.h create mode 100644 arch/score/include/asm/siginfo.h create mode 100644 arch/score/include/asm/signal.h create mode 100644 arch/score/include/asm/socket.h create mode 100644 arch/score/include/asm/sockios.h create mode 100644 arch/score/include/asm/stat.h create mode 100644 arch/score/include/asm/statfs.h create mode 100644 arch/score/include/asm/string.h create mode 100644 arch/score/include/asm/swab.h create mode 100644 arch/score/include/asm/syscalls.h create mode 100644 arch/score/include/asm/system.h create mode 100644 arch/score/include/asm/termbits.h create mode 100644 arch/score/include/asm/termios.h create mode 100644 arch/score/include/asm/thread_info.h create mode 100644 arch/score/include/asm/timex.h create mode 100644 arch/score/include/asm/tlb.h create mode 100644 arch/score/include/asm/tlbflush.h create mode 100644 arch/score/include/asm/topology.h create mode 100644 arch/score/include/asm/types.h create mode 100644 arch/score/include/asm/uaccess.h create mode 100644 arch/score/include/asm/ucontext.h create mode 100644 arch/score/include/asm/unaligned.h create mode 100644 arch/score/include/asm/unistd.h create mode 100644 arch/score/include/asm/user.h create mode 100644 arch/score/kernel/Makefile create mode 100644 arch/score/kernel/asm-offsets.c create mode 100644 arch/score/kernel/entry.S create mode 100644 arch/score/kernel/head.S create mode 100644 arch/score/kernel/init_task.c create mode 100644 arch/score/kernel/irq.c create mode 100644 arch/score/kernel/module.c create mode 100644 arch/score/kernel/process.c create mode 100644 arch/score/kernel/ptrace.c create mode 100644 arch/score/kernel/setup.c create mode 100644 arch/score/kernel/signal.c create mode 100644 arch/score/kernel/sys_call_table.c create mode 100644 arch/score/kernel/sys_score.c create mode 100644 arch/score/kernel/time.c create mode 100644 arch/score/kernel/traps.c create mode 100644 arch/score/kernel/vmlinux.lds.S create mode 100644 arch/score/lib/Makefile create mode 100644 arch/score/lib/ashldi3.c create mode 100644 arch/score/lib/ashrdi3.c create mode 100644 arch/score/lib/checksum.S create mode 100644 arch/score/lib/checksum_copy.c create mode 100644 arch/score/lib/cmpdi2.c create mode 100644 arch/score/lib/libgcc.h create mode 100644 arch/score/lib/lshrdi3.c create mode 100644 arch/score/lib/string.S create mode 100644 arch/score/lib/ucmpdi2.c create mode 100644 arch/score/mm/Makefile create mode 100644 arch/score/mm/cache.c create mode 100644 arch/score/mm/extable.c create mode 100644 arch/score/mm/fault.c create mode 100644 arch/score/mm/init.c create mode 100644 arch/score/mm/pgtable.c create mode 100644 arch/score/mm/tlb-miss.S create mode 100644 arch/score/mm/tlb-score.c
Arnd Bergmann
maintainerQuoted 5 lines · Chen Liqin (Gmail)
Hi Linus,
We had setup a git server at gitserver.sunplusct.com, This repository contains Linux support for S+core CPU. it's base on Linux 2.6.31-rc7 and Arnd asm-generic repository.
Hi Liqin,
Great to hear that you have finally managed to set up your own git repository!
This is a good time to send out the code for review, but it's not the time for a merge request, because we are still fixing bugs in 2.6.31. Please send a merge request again shortly after Linus has released 2.6.31 and has opened the 2.6.32 merge window.
Similarly, the split of your patches is good for review, but it is useless to have 33 commits in your changelog with just the file names listed in the history text.
What is missing OTOH is a description of changes you made since the last version you posted, which would be needed to help people that have already reviewed your code before. Also, you have dropped the descriptions of changes that I contributed, committing the changed files as your own. If you see a need to do that next time, please ask before you do it, or find a way to keep the original commit logs.
For what it's worth, I've done a diff between your last version in my tree and the version in your for-linus branch, in case people want to see the changes, see below.
What is the status of the port now? Do you have a working glibc and LTP test results, or are do you still need to fix more bugs that got introduced in the 2.6.30 port?
If you have a glibc port with the asm-generic version of the user ABI, that would be nice to share, because other ports that are converting to it (NIOS2 will be next, there might be more that I'm not aware of) need to do the same.
Arnd <><
--- Kconfig.debug | 3 Makefile | 2 include/asm/elf.h | 18 +- include/asm/irq.h | 12 - include/asm/irq_regs.h | 7 include/asm/irqflags.h | 2 include/asm/linkage.h | 3 include/asm/page.h | 4 include/asm/pgalloc.h | 2 include/asm/pgtable.h | 31 ++-- include/asm/ptrace.h | 8 - include/asm/setup.h | 3 include/asm/syscalls.h | 6 include/asm/uaccess.h | 4 include/asm/ucontext.h | 1 include/asm/unistd.h | 1 include/asm/user.h | 17 ++ kernel/Makefile | 3 kernel/entry.S | 47 ------ kernel/init_task.c | 2 kernel/irq.c | 33 +++- kernel/module.c | 13 - kernel/process.c | 3 kernel/ptrace.c | 213 ++++++++++++---------------- kernel/setup.c | 32 ++-- kernel/signal.c | 38 ++-- kernel/sys_call_table.c | 12 + kernel/sys_score.c | 37 +--- kernel/time.c | 2 lib/string.S | 12 - mm/init.c | 38 +--- mm/pgtable.c | 10 - 32 files changed, 292 insertions(+), 327 deletions(-)
arch/score/Kconfig.debug +1 -2
@@ -1,8 +1,7 @@ menu "Kernel hacking" config TRACE_IRQFLAGS_SUPPORT - bool - default y + def_bool y source "lib/Kconfig.debug"
arch/score/Makefile +1 -1
@@ -12,7 +12,7 @@ CROSS_COMPILE := score-linux- # # CPU-dependent compiler/assembler options for optimization. # -cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ +cflags-y += -g -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ -D__linux__ -ffunction-sections -ffreestanding #
arch/score/include/asm/elf.h +11 -7
@@ -1,9 +1,8 @@#ifndef _ASM_SCORE_ELF_H#define _ASM_SCORE_ELF_H -/* ELF register definitions */ -#define ELF_NGREG 45 -#define ELF_NFPREG 33 +#include <linux/ptrace.h> +#define EM_SCORE7 135/* Relocation types. */
@@ -30,11 +29,15 @@#define R_SCORE_IMM30 20#define R_SCORE_IMM32 21 -typedef unsigned long elf_greg_t ; -typedef elf_greg_t elf_gregset_t [ELF_NGREG ]; +/* ELF register definitions */ +typedef unsigned long elf_greg_t ; + +#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) +typedef elf_greg_t elf_gregset_t [ELF_NGREG ]; -typedef double elf_fpreg_t ; -typedef elf_fpreg_t elf_fpregset_t [ELF_NFPREG ]; +/* Score does not have fp regs. */ +typedef double elf_fpreg_t ; +typedef elf_fpreg_t elf_fpregset_t ;#define elf_check_arch (x) ((x)->e_machine == EM_SCORE7)
@@ -57,6 +60,7 @@ do { \struct task_struct ;struct pt_regs ; +#define CORE_DUMP_USE_REGSET #define USE_ELF_CORE_DUMP #define ELF_EXEC_PAGESIZE PAGE_SIZE
arch/score/include/asm/irq.h +2 -10
@@ -18,16 +18,8 @@#define irq_canonicalize (irq) (irq) -#define P_INT_PNDL 0x95F50000 -#define P_INT_PNDH 0x95F50004 -#define P_INT_PRIORITY_M 0x95F50008 -#define P_INT_PRIORITY_SG0 0x95F50010 -#define P_INT_PRIORITY_SG1 0x95F50014 -#define P_INT_PRIORITY_SG2 0x95F50018 -#define P_INT_PRIORITY_SG3 0x95F5001C -#define P_INT_MASKL 0x95F50020 -#define P_INT_MASKH 0x95F50024 -#define IRQ_TIMER (7)/* Timer IRQ number of SPCT6600 */ +extern void interrupt_exception_vector (void ); +#endif /* _ASM_SCORE_IRQ_H */
arch/score/include/asm/irq_regs.h +6 -1
@@ -1,6 +1,11 @@#ifndef _ASM_SCORE_IRQ_REGS_H#define _ASM_SCORE_IRQ_REGS_H -#include <asm-generic/irq_regs.h> +#include <linux/thread_info.h> + +static inline struct pt_regs *get_irq_regs (void ) +{ +return current_thread_info ()->regs; +}#endif /* _ASM_SCORE_IRQ_REGS_H */
arch/score/include/asm/irqflags.h +0 -2
@@ -17,8 +17,6 @@ "nop;" \ "nop;" \ "nop;" \ - "ldi r9, 0x1;" \ - "and %0, %0, r9;" \ : "=r" (x) \: \ : " r8", " r9" \
arch/score/include/asm/linkage.h +3 -0
@@ -1,4 +1,7 @@#ifndef _ASM_SCORE_LINKAGE_H#define _ASM_SCORE_LINKAGE_H +#define __ALIGN .align 2 +#define __ALIGN_STR ".align 2" +#endif /* _ASM_SCORE_LINKAGE_H */
arch/score/include/asm/page.h +2 -2
@@ -57,8 +57,8 @@ extern unsigned long max_low_pfn;extern unsigned long min_low_pfn;extern unsigned long max_pfn; -#define __pa (vaddr) ((unsigned long) (vaddr)) -#define __va (paddr) ((void *) (paddr)) +#define __pa (x) ((unsigned long)(x) - PAGE_OFFSET) +#define __va (x) ((void *)((unsigned long) (x) + PAGE_OFFSET))#define phys_to_pfn (phys) (PFN_DOWN(phys))#define pfn_to_phys (pfn) (PFN_PHYS(pfn))
arch/score/include/asm/pgalloc.h +1 -1
@@ -72,7 +72,7 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte)__free_pages (pte,PTE_ORDER ); } -#define __pte_free_tlb (tlb, pte) \ +#define __pte_free_tlb (tlb, pte, buf) \ do { \ pgtable_page_dtor(pte); \ tlb_remove_page((tlb), pte); \
arch/score/include/asm/pgtable.h +21 -10
@@ -106,7 +106,8 @@ static inline void pmd_clear(pmd_t *pmdp) ((swp_entry_t) { pte_val(pte)})#define __swp_entry_to_pte (x) ((pte_t) {(x).val}) -#define pmd_page (pmd) virt_to_page(__va(pmd_val(pmd))) +#define pmd_phys (pmd) __pa((void *)pmd_val(pmd)) +#define pmd_page (pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))#define mk_pte (page, prot) pfn_pte(page_to_pfn(page), prot)static inline pte_t pte_mkspecial (pte_t pte) {return pte; }
@@ -129,14 +130,11 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }#define pgd_clear (pgdp) do { } while (0)#define kern_addr_valid (addr) (1) -#define pmd_offset (a, b) ((void *) 0)#define pmd_page_vaddr (pmd) pmd_val(pmd)#define pte_none (pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))#define pte_present (pte) (pte_val(pte) & _PAGE_PRESENT) -#define pud_offset (pgd, address) ((pud_t *) pgd) -#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CACHE)#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ _PAGE_CACHE)
@@ -165,15 +163,27 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }#define __S110 PAGE_SHARED#define __S111 PAGE_SHARED -#define pgprot_noncached (x) (x) +#define pgprot_noncached pgprot_noncached + +static inline pgprot_t pgprot_noncached (pgprot_t _prot) +{ +unsigned long prot =pgprot_val (_prot); + + prot = (prot & ~_CACHE_MASK); + +return __pgprot (prot); +} -#define __swp_type (x) (0) -#define __swp_offset (x) (0) -#define __swp_entry (typ, off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) +#define __swp_type (x) ((x).val & 0x1f) +#define __swp_offset (x) ((x).val >> 11) +#define __swp_entry (type, offset) ((swp_entry_t){(type) | ((offset) << 11)}) -#define ZERO_PAGE (vaddr) ({ BUG(); NULL; }) +extern unsigned long empty_zero_page; +extern unsigned long zero_page_mask; -#define swapper_pg_dir ((pgd_t *) NULL) +#define ZERO_PAGE (vaddr) \ + (virt_to_page((void *)(empty_zero_page + \ + (((unsigned long)(vaddr)) & zero_page_mask))))#define pgtable_cache_init () do {} while (0)
@@ -248,6 +258,7 @@ static inline pte_t pte_mkyoung(pte_t pte)#define pte_present (pte) (pte_val(pte) & _PAGE_PRESENT)extern unsigned long pgd_current; +extern pgd_t swapper_pg_dir[PTRS_PER_PGD ];extern void paging_init (void );static inline pte_t pte_modify (pte_t pte,pgprot_t newprot)
arch/score/include/asm/ptrace.h +5 -3
@@ -51,9 +51,11 @@* system call/exception. As usual the registers k0/k1 aren't being saved. */ struct pt_regs { -unsigned long pad0[6 ]; +unsigned long pad0[6 ];/* stack arguments */ unsigned long orig_r4;unsigned long orig_r7; +long is_syscall; +unsigned long regs[32 ];unsigned long cel;
@@ -68,12 +70,12 @@ struct pt_regs {unsigned long cp0_psr;unsigned long cp0_ecr;unsigned long cp0_condition; - -long is_syscall; };#ifdef __KERNEL__ +struct task_struct ; +/* * Does the process account for user or for system time? */
arch/score/include/asm/setup.h +2 -1
@@ -2,7 +2,8 @@#define _ASM_SCORE_SETUP_H#define COMMAND_LINE_SIZE 256 -#define MEM_SIZE 0x2000000 +#define MEMORY_START 0 +#define MEMORY_SIZE 0x2000000#ifdef __KERNEL__
arch/score/include/asm/syscalls.h +4 -2
@@ -1,8 +1,10 @@#ifndef _ASM_SCORE_SYSCALLS_H#define _ASM_SCORE_SYSCALLS_H -asmlinkage long sys_clone (int flags,unsigned long stack,struct pt_regs *regs); -#define sys_clone sys_clone +asmlinkage long score_clone (struct pt_regs *regs); +asmlinkage long score_execve (struct pt_regs *regs); +asmlinkage long score_sigaltstack (struct pt_regs *regs); +asmlinkage long score_rt_sigreturn (struct pt_regs *regs);#include <asm-generic/syscalls.h>
arch/score/include/asm/uaccess.h +2 -2
@@ -13,9 +13,9 @@ extern int fixup_exception(struct pt_regs *regs);#ifndef __ASSEMBLY__#define __range_ok (addr, size) \ - ((((unsigned long)(addr) >= 0x80000000) \ + ((((unsigned long __force)(addr) >= 0x80000000) \ || ((unsigned long)(size) > 0x80000000) \ - || (((unsigned long)(addr) + (unsigned long)(size)) > 0x80000000))) + || (((unsigned long __force)(addr) + (unsigned long)(size)) > 0x80000000)))#define __access_ok (addr, size) \ (__range_ok((addr), (size)) == 0)
arch/score/include/asm/ucontext.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/ucontext.h>
arch/score/include/asm/unistd.h +0 -1
@@ -2,7 +2,6 @@#define _ASM_SCORE_UNISTD_H#define __ARCH_HAVE_MMU -#define __ARCH_WANT_IPC_PARSE_VERSION#include <asm-generic/unistd.h>
arch/score/include/asm/user.h +17 -0
@@ -1,4 +1,21 @@#ifndef _ASM_SCORE_USER_H#define _ASM_SCORE_USER_H +struct user_regs_struct { +unsigned long regs[32 ]; + +unsigned long cel; +unsigned long ceh; + +unsigned long sr0;/* cnt */ +unsigned long sr1;/* lcr */ +unsigned long sr2;/* scr */ + +unsigned long cp0_epc; +unsigned long cp0_ema; +unsigned long cp0_psr; +unsigned long cp0_ecr; +unsigned long cp0_condition; +}; +#endif /* _ASM_SCORE_USER_H */
arch/score/kernel/Makefile +2 -1
@@ -5,6 +5,7 @@ extra-y := head.o vmlinux.lds obj-y += entry.o init_task.o irq.o process.o ptrace.o \ - setup.o signal.o sys_score.o time.o traps.o + setup.o signal.o sys_score.o time.o traps.o \ + sys_call_table.o obj-$(CONFIG_MODULES) += module.o
arch/score/kernel/entry.S +3 -44
72 lines not on this page · raw message
arch/score/kernel/init_task.c +0 -2
@@ -26,8 +26,6 @@static struct signal_struct init_signals =INIT_SIGNALS (init_signals);static struct sighand_struct init_sighand =INIT_SIGHAND (init_sighand); -struct mm_struct init_mm =INIT_MM (init_mm); -EXPORT_SYMBOL (init_mm);/* * Initial thread structure.
arch/score/kernel/irq.c +23 -10
@@ -29,6 +29,19 @@#include <asm/io.h> +/* the interrupt controller is hardcoded at this address */ +#define SCORE_PIC ((u32 __iomem __force *)0x95F50000) + +#define INT_PNDL 0 +#define INT_PNDH 1 +#define INT_PRIORITY_M 2 +#define INT_PRIORITY_SG0 4 +#define INT_PRIORITY_SG1 5 +#define INT_PRIORITY_SG2 6 +#define INT_PRIORITY_SG3 7 +#define INT_MASKL 8 +#define INT_MASKH 9 +/* * handles all normal device IRQs */
@@ -44,11 +57,11 @@ static void score_mask(unsigned int irq_nr)unsigned int irq_source =63 - irq_nr;if (irq_source <32 ) -__raw_writel ((__raw_readl ((void *)P_INT_MASKL ) | \ - (1 << irq_source)), (void *)P_INT_MASKL ); +__raw_writel ((__raw_readl (SCORE_PIC +INT_MASKL ) | \ + (1 << irq_source)),SCORE_PIC +INT_MASKL );else -__raw_writel ((__raw_readl ((void *)P_INT_MASKH ) | \ - (1 << (irq_source -32 ))), (void *)P_INT_MASKH ); +__raw_writel ((__raw_readl (SCORE_PIC +INT_MASKH ) | \ + (1 << (irq_source -32 ))),SCORE_PIC +INT_MASKH ); }static void score_unmask (unsigned int irq_nr)
@@ -56,11 +69,11 @@ static void score_unmask(unsigned int irq_nr)unsigned int irq_source =63 - irq_nr;if (irq_source <32 ) -__raw_writel ((__raw_readl ((void *)P_INT_MASKL ) & \ - ~(1 << irq_source)), (void *)P_INT_MASKL ); +__raw_writel ((__raw_readl (SCORE_PIC +INT_MASKL ) & \ + ~(1 << irq_source)),SCORE_PIC +INT_MASKL );else -__raw_writel ((__raw_readl ((void *)P_INT_MASKH ) & \ - ~(1 << (irq_source -32 ))), (void *)P_INT_MASKH ); +__raw_writel ((__raw_readl (SCORE_PIC +INT_MASKH ) & \ + ~(1 << (irq_source -32 ))),SCORE_PIC +INT_MASKH ); }struct irq_chip score_irq_chip = {
@@ -88,8 +101,8 @@ void __init init_IRQ(void)memcpy ((void *)target_addr, \ interrupt_exception_vector,IRQ_VECTOR_SIZE ); -__raw_writel (0xffffffff , (void *)P_INT_MASKL ); -__raw_writel (0xffffffff , (void *)P_INT_MASKH ); +__raw_writel (0xffffffff ,SCORE_PIC +INT_MASKL ); +__raw_writel (0xffffffff ,SCORE_PIC +INT_MASKH ); __asm__ __volatile__( "mtcr %0, cr3\n\t"
arch/score/kernel/module.c +7 -6
@@ -23,6 +23,7 @@* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <linux/moduleloader.h> #include <linux/module.h> #include <linux/vmalloc.h>
@@ -56,17 +57,17 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,for (i =0 ; i < relsec->sh_size /sizeof (Elf32_Rel); i++, rel++) {unsigned long loc;Elf32_Sym *sym; -s32 offset; +s32 r_offset; - offset =ELF32_R_SYM (rel->r_info); -if ((offset <0 ) || - (offset > (symsec->sh_size /sizeof (Elf32_Sym)))) { + r_offset =ELF32_R_SYM (rel->r_info); +if ((r_offset <0 ) || + (r_offset > (symsec->sh_size /sizeof (Elf32_Sym)))) {printk (KERN_ERR "%s: bad relocation, section %d reloc %d\n" , me->name, relindex, i);return -ENOEXEC ; } - sym = ((Elf32_Sym *)symsec->sh_addr) + offset; + sym = ((Elf32_Sym *)symsec->sh_addr) + r_offset;if ((rel->r_offset <0 ) || (rel->r_offset > dstsec->sh_size -sizeof (u32))) {
@@ -151,7 +152,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,/* Given an address, look for it in the module exception tables. */ const struct exception_table_entry *search_module_dbetables (unsigned long addr) { -return 0 ; +return NULL ; }/* Put in dbe list if necessary. */
arch/score/kernel/process.c +3 -0
@@ -24,6 +24,9 @@*/ #include <linux/module.h> +#include <linux/reboot.h> +#include <linux/elfcore.h> +#include <linux/pm.h> void (*pm_power_off)(void );EXPORT_SYMBOL (pm_power_off);
arch/score/kernel/ptrace.c +98 -115
242 lines not on this page · raw message
arch/score/kernel/setup.c +17 -15
@@ -26,10 +26,12 @@#include <linux/bootmem.h> #include <linux/initrd.h> #include <linux/ioport.h> +#include <linux/mm.h> #include <linux/seq_file.h> #include <linux/screen_info.h> #include <asm-generic/sections.h> +#include <asm/setup.h> struct screen_info screen_info;unsigned long kernelsp;
@@ -40,25 +42,25 @@ static struct resource data_resource = { .name = "Kernel data",};static void __init bootmem_init (void ) { -unsigned long reserved_end, bootmap_size; +unsigned long start_pfn, bootmap_size;unsigned long size = initrd_end - initrd_start; - reserved_end = (unsigned long )_end; + start_pfn =PFN_UP (__pa (&_end)); - min_low_pfn =0 ; - max_low_pfn =MEM_SIZE /PAGE_SIZE ; + min_low_pfn =PFN_UP (MEMORY_START ); + max_low_pfn =PFN_UP (MEMORY_START +MEMORY_SIZE );/* Initialize the boot-time allocator with low memory only. */ - bootmap_size =init_bootmem_node (NODE_DATA (0 ), reserved_end, + bootmap_size =init_bootmem_node (NODE_DATA (0 ), start_pfn, min_low_pfn, max_low_pfn);add_active_range (0 , min_low_pfn, max_low_pfn); -free_bootmem (PFN_PHYS (reserved_end), - (max_low_pfn - reserved_end) <<PAGE_SHIFT ); -memory_present (0 , reserved_end, max_low_pfn); +free_bootmem (PFN_PHYS (start_pfn), + (max_low_pfn - start_pfn) <<PAGE_SHIFT ); +memory_present (0 , start_pfn, max_low_pfn);/* Reserve space for the bootmem bitmap. */ -reserve_bootmem (PFN_PHYS (reserved_end), bootmap_size,BOOTMEM_DEFAULT ); +reserve_bootmem (PFN_PHYS (start_pfn), bootmap_size,BOOTMEM_DEFAULT );if (size ==0 ) {printk (KERN_INFO "Initrd not found or empty" );
@@ -87,15 +89,15 @@ static void __init resource_init(void) {struct resource *res; - code_resource.start = (unsigned long )_text; - code_resource.end = (unsigned long )_etext -1 ; - data_resource.start = (unsigned long )_etext; - data_resource.end = (unsigned long )_edata -1 ; + code_resource.start =__pa (&_text); + code_resource.end =__pa (&_etext) -1 ; + data_resource.start =__pa (&_etext); + data_resource.end =__pa (&_edata) -1 ; res =alloc_bootmem (sizeof (struct resource )); res->name ="System RAM" ; - res->start =0 ; - res->end =MEM_SIZE -1 ; + res->start =MEMORY_START ; + res->end =MEMORY_START +MEMORY_SIZE -1 ; res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ;request_resource (&iomem_resource, res);
arch/score/kernel/signal.c +22 -16
@@ -27,7 +27,9 @@#include <linux/signal.h> #include <linux/unistd.h> #include <linux/uaccess.h> -#include <asm-generic/ucontext.h> + +#include <asm/syscalls.h> +#include <asm/ucontext.h> #include <asm/cacheflush.h>
@@ -40,7 +42,7 @@ struct rt_sigframe {struct ucontext rs_uc; }; -int setup_sigcontext (struct pt_regs *regs,struct sigcontext __user *sc) +static int setup_sigcontext (struct pt_regs *regs,struct sigcontext __user *sc) {int err =0 ;unsigned long reg;
@@ -74,7 +76,7 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)return err; } -int restore_sigcontext (struct pt_regs *regs,struct sigcontext __user *sc) +static int restore_sigcontext (struct pt_regs *regs,struct sigcontext __user *sc) {int err =0 ;u32 reg;
@@ -116,8 +118,8 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)/* * Determine which stack to use.. */ -void __user *get_sigframe (struct k_sigaction *ka,struct pt_regs *regs, -size_t frame_size) +static void __user *get_sigframe (struct k_sigaction *ka, +struct pt_regs *regs,size_t frame_size) {unsigned long sp;
@@ -129,19 +131,21 @@ void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,if ((ka->sa.sa_flags &SA_ONSTACK ) && (!on_sig_stack (sp))) sp = current->sas_ss_sp + current->sas_ss_size; -return (void *)((sp - frame_size) & ~7 ); +return (void __user *)((sp - frame_size) & ~7 ); } -int score_sigaltstack (struct pt_regs *regs) +asmlinkage long +score_sigaltstack (struct pt_regs *regs) { -const stack_t *uss = (const stack_t *) regs->regs[4 ]; -stack_t *uoss = (stack_t *) regs->regs[5 ]; +const stack_t __user *uss = (const stack_t __user *) regs->regs[4 ]; +stack_t __user *uoss = (stack_t __user *) regs->regs[5 ];unsigned long usp = regs->regs[0 ];return do_sigaltstack (uss, uoss, usp); } -void score_rt_sigreturn (struct pt_regs *regs) +asmlinkage long +score_rt_sigreturn (struct pt_regs *regs) {struct rt_sigframe __user *frame;sigset_t set;
@@ -181,12 +185,14 @@ void score_rt_sigreturn(struct pt_regs *regs) badframe:force_sig (SIGSEGV , current); + +return 0 ; } -int setup_rt_frame (struct k_sigaction *ka,struct pt_regs *regs, +static int setup_rt_frame (struct k_sigaction *ka,struct pt_regs *regs,int signr,sigset_t *set,siginfo_t *info) { -struct rt_sigframe *frame; +struct rt_sigframe __user *frame;int err =0 ; frame =get_sigframe (ka, regs,sizeof (*frame));
@@ -206,8 +212,8 @@ int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, err |=copy_siginfo_to_user (&frame->rs_info, info); err |=__put_user (0 , &frame->rs_uc.uc_flags); - err |=__put_user (0 , &frame->rs_uc.uc_link); - err |=__put_user ((void *)current->sas_ss_sp, + err |=__put_user (NULL , &frame->rs_uc.uc_link); + err |=__put_user ((void __user *)current->sas_ss_sp, &frame->rs_uc.uc_stack.ss_sp); err |=__put_user (sas_ss_flags (regs->regs[0 ]), &frame->rs_uc.uc_stack.ss_flags);
@@ -236,7 +242,7 @@ give_sigsegv:return -EFAULT ; } -int handle_signal (unsigned long sig,siginfo_t *info, +static int handle_signal (unsigned long sig,siginfo_t *info,struct k_sigaction *ka,sigset_t *oldset,struct pt_regs *regs) {int ret;
@@ -276,7 +282,7 @@ int handle_signal(unsigned long sig, siginfo_t *info,return ret; } -void do_signal (struct pt_regs *regs) +static void do_signal (struct pt_regs *regs) {struct k_sigaction ka;sigset_t *oldset;
arch/score/kernel/sys_call_table.c new file +12 -0
@@ -0,0 +1,12 @@ +#include <linux/syscalls.h> +#include <linux/signal.h> +#include <linux/unistd.h> + +#include <asm/syscalls.h> + +#undef __SYSCALL +#define __SYSCALL (nr, call) [nr] = (call), + +void *sys_call_table[__NR_syscalls] = { +#include <asm/unistd.h> +};
arch/score/kernel/sys_score.c +11 -26
@@ -28,11 +28,10 @@#include <linux/mman.h> #include <linux/module.h> #include <linux/unistd.h> +#include <linux/syscalls.h> +#include <asm/syscalls.h> -unsigned long shm_align_mask =PAGE_SIZE -1 ; -EXPORT_SYMBOL (shm_align_mask); - -asmlinkage unsigned long +asmlinkage long sys_mmap2 (unsigned long addr,unsigned long len,unsigned long prot,unsigned long flags,unsigned long fd,unsigned long pgoff) {
@@ -64,7 +63,8 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,* Clone a task - this clones the calling program thread. * This is called indirectly via a small wrapper */ -int score_clone (struct pt_regs *regs) +asmlinkage long +score_clone (struct pt_regs *regs) {unsigned long clone_flags;unsigned long newsp;
@@ -75,14 +75,7 @@ int score_clone(struct pt_regs *regs)if (!newsp) newsp = regs->regs[0 ]; parent_tidptr = (int __user *)regs->regs[6 ]; - - child_tidptr =NULL ; -if (clone_flags & (CLONE_CHILD_SETTID |CLONE_CHILD_CLEARTID )) { -int __user *__user *usp = (int __user *__user *)regs->regs[0 ]; - -if (get_user (child_tidptr, &usp[4 ])) -return -EFAULT ; - } + child_tidptr = (int __user *)regs->regs[8 ];return do_fork (clone_flags, newsp, regs,0 , parent_tidptr, child_tidptr);
@@ -92,33 +85,25 @@ int score_clone(struct pt_regs *regs)* sys_execve() executes a new program. * This is called indirectly via a small wrapper */ -int score_execve (struct pt_regs *regs) +asmlinkage long +score_execve (struct pt_regs *regs) {int error;char *filename; - filename =getname ((char *) (long ) regs->regs[4 ]); + filename =getname ((char __user *)regs->regs[4 ]); error =PTR_ERR (filename);if (IS_ERR (filename))return error; - error =do_execve (filename, (char **) (long ) regs->regs[5 ], - (char **) (long ) regs->regs[6 ], regs); + error =do_execve (filename, (char __user *__user *)regs->regs[5 ], + (char __user *__user *) regs->regs[6 ], regs);putname (filename);return error; }/* -* If we ever come here the user sp is bad. Zap the process right away. -* Due to the bad stack signaling wouldn't work. -*/ -void bad_stack (void ) -{ -do_exit (SIGSEGV ); -} - -/* * Do a system call from kernel instead of calling sys_execve so we * end up with proper pt_regs. */
arch/score/kernel/time.c +1 -1
@@ -28,7 +28,7 @@#include <asm/scoreregs.h> -irqreturn_t timer_interrupt (int irq,void *dev_id) +static irqreturn_t timer_interrupt (int irq,void *dev_id) {struct clock_event_device *evdev = dev_id;
arch/score/lib/string.S +0 -12
@@ -182,15 +182,3 @@ ENTRY(__clear_user) 99: .word 0b, 99b .previous - - .align 2 -ENTRY(__put_user_unknown) - .set volatile - ldi r4, -EFAULT - br r3 - - .align 2 -ENTRY(__get_user_unknown) - ldi r5, 0 - ldi r4, -EFAULT - br r3
arch/score/mm/init.c +13 -25
@@ -32,44 +32,30 @@#include <linux/pagemap.h> #include <linux/proc_fs.h> #include <linux/sched.h> -#include <asm-generic/sections.h> +#include <linux/initrd.h> +#include <asm/sections.h> #include <asm/tlb.h> DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); -/* -* We have up to 8 empty zeroed pages so we can map one of the right colour -* when needed. -*/ -unsigned long zero_page_mask;unsigned long empty_zero_page;EXPORT_SYMBOL_GPL (empty_zero_page);static struct kcore_list kcore_mem, kcore_vmalloc; -unsigned long setup_zero_pages (void ) +static unsigned long setup_zero_page (void ) { -unsigned int order =0 ; -unsigned long size;struct page *page; - empty_zero_page =__get_free_pages (GFP_KERNEL | __GFP_ZERO, order); + empty_zero_page =__get_free_pages (GFP_KERNEL | __GFP_ZERO,0 );if (!empty_zero_page)panic ("Oh boy, that early out of memory?" ); page =virt_to_page ((void *) empty_zero_page); -split_page (page, order); -while (page <virt_to_page ((void *) (empty_zero_page + - (PAGE_SIZE << order)))) { -SetPageReserved (page); - page++; - } - - size =PAGE_SIZE << order; - zero_page_mask = (size -1 ) &PAGE_MASK ; +SetPageReserved (page); -return 1UL << order; +return 1UL ; }#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -100,7 +86,7 @@ void __init mem_init(void) max_mapnr = max_low_pfn; high_memory = (void *)__va (max_low_pfn <<PAGE_SHIFT ); totalram_pages +=free_all_bootmem (); - totalram_pages -=setup_zero_pages ();/* Setup zeroed pages. */ + totalram_pages -=setup_zero_page ();/* Setup zeroed pages. */ reservedpages =0 ;for (tmp =0 ; tmp < max_low_pfn; tmp++)
@@ -129,7 +115,7 @@ void __init mem_init(void) }#endif /* !CONFIG_NEED_MULTIPLE_NODES */ -void free_init_pages (const char *what,unsigned long begin,unsigned long end) +static void free_init_pages (const char *what,unsigned long begin,unsigned long end) {unsigned long pfn;
@@ -150,15 +136,16 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end)void free_initrd_mem (unsigned long start,unsigned long end) {free_init_pages ("initrd memory" , -virt_to_phys ((void *) start), -virt_to_phys ((void *) end)); +virt_to_phys ((void *) start), +virt_to_phys ((void *) end)); }#endif void __init_refok free_initmem(void) {free_init_pages ("unused kernel memory" , - (unsigned long )__init_begin, (unsigned long )__init_end); +__pa (&__init_begin), +__pa (&__init_end)); }unsigned long pgd_current;
@@ -170,4 +157,5 @@ unsigned long pgd_current;* are constants. So we use the variants from asm-offset.h until that gcc * will officially be retired. */ +pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PTE_ORDER); pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
arch/score/mm/pgtable.c +1 -9
@@ -47,14 +47,6 @@ void pgd_init(unsigned long page)void __init pagetable_init (void ) { -unsigned long vaddr; -pgd_t *pgd_base; -/* Initialize the entire pgd. */ -pgd_init ((unsigned long ) swapper_pg_dir); -pgd_init ((unsigned long ) swapper_pg_dir - +sizeof (pgd_t) *USER_PTRS_PER_PGD ); - - pgd_base = swapper_pg_dir; - vaddr =__fix_to_virt (__end_of_fixed_addresses -1 ) &PMD_MASK ; +pgd_init ((unsigned long )swapper_pg_dir); }
Quoted 7 lines · Arnd Bergmann
On Wednesday 26 August 2009, Chen Liqin (Gmail) wrote:
Hi Liqin,
Similarly, the split of your patches is good for review, but it is useless to have 33 commits in your changelog with just the file names listed in the history text.
I will remove these changelog from repository.
Quoted 8 lines
What is missing OTOH is a description of changes you made since the last version you posted, which would be needed to help people that have already reviewed your code before. Also, you have dropped the descriptions of changes that I contributed, committing the changed files as your own. If you see a need to do that next time, please ask before you do it, or find a way to keep the original commit logs.
How can I add old commit logs to our repository?
Or add people's contribute to the log?
Quoted 3 lines
What is the status of the port now? Do you have a working glibc and LTP test results, or are do you still need to fix more bugs that got introduced in the 2.6.30 port?
In fact, we still need define __ARCH_WANT_SYSCALL_NO_AT, __ARCH_WANT_SYSCALL_NO_FLAGS, __ARCH_WANT_SYSCALL_OFF_T, __ARCH_WANT_SYSCALL_DEPRECATED
to make linux/score running, glibc and applictions need old syscall API.
And now it's really have some problems
in syscall interface part.
But if we use our old syscall interface replace the new one, score platform will run well.
I am a little confused, whether or not I should commit score code use new or old syscall part?
Best Regards
Liqin
Arnd Bergmann
maintainerQuoted 3 lines · Chen Liqin
Quoted 1 line · Arnd Bergmann
I will remove these changelog from repository.
ok.
Quoted 10 lines
Quoted 7 lines
What is missing OTOH is a description of changes you made since the last version you posted, which would be needed to help people that have already reviewed your code before. Also, you have dropped the descriptions of changes that I contributed, committing the changed files as your own. If you see a need to do that next time, please ask before you do it, or find a way to keep the original commit logs.
How can I add old commit logs to our repository?
Or add people's contribute to the log?
If you got a patch, use 'git am -s' to add that patch with it's original changelog and signoff, plus your own signoff to the git tree.
If something is already part of a git repository, the best way is to use git to merge that tree with your own, using 'git pull'. That will leave all the change history intact. It would be good to start with the git tree in the way that is in my repository, merge that with 2.6.31-rc6, and add your changes on top of that, with proper change descriptions.
Quoted 4 lines
Quoted 3 lines
What is the status of the port now? Do you have a working glibc and LTP test results, or are do you still need to fix more bugs that got introduced in the 2.6.30 port?
Quoted 9 lines
In fact, we still need define
__ARCH_WANT_SYSCALL_NO_AT,__ARCH_WANT_SYSCALL_NO_FLAGS,__ARCH_WANT_SYSCALL_OFF_T,__ARCH_WANT_SYSCALL_DEPRECATED
to make linux/score running, glibc and applictions need old syscall API.
And now it's really have some problems
in syscall interface part.
ok.
Quoted 4 lines
But if we use our old syscall interface replace the new one, score platform will run well.
I am a little confused, whether or not I should commit score code use new or old syscall part?
I understand your problem here, and I think it would be good to have second opinion from someone else here. The four #defines you mention are roughly in reverse order of importance.
I think you really need to remove __ARCH_WANT_SYSCALL_DEPRECATED and get that working. Please tell us if some system call is giving you problems and we can find a solution together.
Removing __ARCH_WANT_SYSCALL_OFF_T should not be too hard, because glibc uses the loff_t versions by default anyway. I have not tried it though, so it may be more complicated than I thought.
Now, removing __ARCH_WANT_SYSCALL_NO_AT and __ARCH_WANT_SYSCALL_NO_FLAGS is a lot of work that I think we need to do, but I understand that you might not want to touch all the common glibc code that is involved. Ulrich Drepper recommended that new architectures should not have these, and I believe that is the correct way forward. You are unfortunate because glibc is not at all prepared for that. Nobody else is using the generic system call table right now, so I think that if you can't find a way to work without __ARCH_WANT_SYSCALL_NO_AT and __ARCH_WANT_SYSCALL_NO_FLAGS, we should integrate them into the main set of syscalls.
Arnd <><
Arnd Bergmann <[email protected]> 写于 2009-08-27 22:00:37:
Quoted 5 lines
I understand your problem here, and I think it would be good to have second opinion from someone else here. The four #defines you mention are roughly in reverse order of importance.
Quoted 8 lines
I think you really need to remove
__ARCH_WANT_SYSCALL_DEPRECATEDand get that working. Please tell us if some system call is giving you problems and we can find a solution together.Removing
__ARCH_WANT_SYSCALL_OFF_Tshould not be too hard, because glibc uses theloff_tversions by default anyway. I have not tried it though, so it may be more complicated than I thought.
in __ARCH_WANT_SYSCALL_DEPRECATED, asm-generic/unistd.h haven't define __NR_ipc and __NR__llseek which used in glibc.
Now we have maintained 3 sets of syscall API code use for glibc. 1: Old syscall interface, which linux/score system work well. 2: New syscall interface, define all 4 macro __ARCH_WANT_SYSCALL_XXX,
linux/score system work now, but we still debug the glibc code.
3: New syscall interface, without define __ARCH_WANT_SYSCALL_DEPRECATED
and __ARCH_WANT_SYSCALL_OFF_T, linux/score system couldn't work. because glibc have many place need to fix.
Liqin
Arnd Bergmann
maintainerQuoted 11 lines · On Monday 31 August 2009 07:48:33 [email protected] wrote:
Arnd Bergmann <[email protected]> 写于 2009-08-27 22:00:37:
Quoted 9 lines
I understand your problem here, and I think it would be good to have second opinion from someone else here. The four #defines you mention are roughly in reverse order of importance.
I think you really need to remove
__ARCH_WANT_SYSCALL_DEPRECATEDand get that working. Please tell us if some system call is giving you problems and we can find a solution together.
Quoted 8 lines
Quoted 4 lines
Removing
__ARCH_WANT_SYSCALL_OFF_Tshould not be too hard, because glibc uses theloff_tversions by default anyway. I have not tried it though, so it may be more complicated than I thought.in
__ARCH_WANT_SYSCALL_DEPRECATED,asm-generic/unistd.hhaven't define__NR_ipcand__NR__llseekwhich used in glibc.
__NR_ipc definitely should not be defined, it is a multiplexer for other system calls that have their own number, e.g. msgctl and semop. Look at e.g. how parisc does it in glibc.
I'm not sure what the problem with __NR_llseek could be, AFAICT it is defined in asm-generic/unistd.h because you take the default __BITSPERLONG=32 definition. You should however not see __NR_lseek, which is used only on 64 bit systems these days.
Quoted 2 lines
Now we have maintained 3 sets of syscall API code use for glibc. 1: Old syscall interface, which linux/score system work well.
Yes, and I guess this will continue to work, but it will never work with upstream kernels.
Quoted 5 lines
2: New syscall interface, define all 4 macro
__ARCH_WANT_SYSCALL_XXX,
linux/score system work now, but we still debug the glibc code.
3: New syscall interface, without define__ARCH_WANT_SYSCALL_DEPRECATED
and__ARCH_WANT_SYSCALL_OFF_T, linux/score system couldn't work. because glibc have many place need to fix.
Do you have a patch against the glibc git tree for score so I can look at what needs to be done? None of the changes should be specific to score after all, ideally it should all work without any glibc changes, though I realize that we are not there yet.
Arnd <><
Arnd Bergmann <[email protected]> 写于 2009-08-31 17:56:33:
Quoted 7 lines · On Monday 31 August 2009 07:48:33 [email protected] wrote:
Quoted 1 line
Arnd Bergmann <[email protected]> 写于 2009-08-27 22:00:37:
__NR_ipcdefinitely should not be defined, it is a multiplexer for other system calls that have their own number, e.g. msgctl and semop. Look at e.g. how parisc does it in glibc.
Ok, we do it as parisc does
Quoted 6 lines
Do you have a patch against the glibc git tree for score so I can look at what needs to be done? None of the changes should be specific to score after all, ideally it should all work without any glibc changes, though I realize that we are not there yet.
I will send the patch to you soon.
liqin