Skip to content

Commit

Permalink
score: update files according to review comments
Browse files Browse the repository at this point in the history
modified:   arch/score/include/asm/cacheflush.h
	modified:   arch/score/include/asm/delay.h
	modified:   arch/score/include/asm/errno.h
	modified:   arch/score/include/asm/pgtable-bits.h
	modified:   arch/score/include/asm/pgtable.h
	modified:   arch/score/include/asm/ptrace.h
	modified:   arch/score/include/asm/unistd.h
	modified:   arch/score/kernel/entry.S
	modified:   arch/score/kernel/process.c
	modified:   arch/score/kernel/ptrace.c
	modified:   arch/score/kernel/signal.c
	modified:   arch/score/kernel/sys_score.c
	modified:   arch/score/kernel/traps.c
	modified:   arch/score/mm/cache.c

Signed-off-by: Chen Liqin <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
Chen Liqin authored and arndb committed Jun 19, 2009
1 parent 6bcf673 commit 0402c91
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 250 deletions.
18 changes: 8 additions & 10 deletions arch/score/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
/* Keep includes the same across arches. */
#include <linux/mm.h>

extern void (*flush_cache_all)(void);
extern void (*flush_cache_mm)(struct mm_struct *mm);
extern void (*flush_cache_range)(struct vm_area_struct *vma,
extern void flush_cache_all(void);
extern void flush_cache_mm(struct mm_struct *mm);
extern void flush_cache_range(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
extern void (*flush_cache_page)(struct vm_area_struct *vma,
extern void flush_cache_page(struct vm_area_struct *vma,
unsigned long page, unsigned long pfn);
extern void (*flush_cache_sigtramp)(unsigned long addr);
extern void (*flush_icache_all)(void);
extern void (*flush_icache_range)(unsigned long start, unsigned long end);
extern void (*flush_data_cache_page)(unsigned long addr);

extern void s7_flush_cache_all(void);
extern void flush_cache_sigtramp(unsigned long addr);
extern void flush_icache_all(void);
extern void flush_icache_range(unsigned long start, unsigned long end);
extern void flush_dcache_range(unsigned long start, unsigned long end);

#define flush_cache_dup_mm(mm) do {} while (0)
#define flush_dcache_page(page) do {} while (0)
Expand Down
11 changes: 8 additions & 3 deletions arch/score/include/asm/delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@

static inline void __delay(unsigned long loops)
{
/* 3 cycles per loop. */
__asm__ __volatile__ (
"1:\tsubi\t%0,1\n\t"
"1:\tsubi\t%0, 3\n\t"
"cmpz.c\t%0\n\t"
"bne\t1b\n\t"
"ble\t1b\n\t"
: "=r" (loops)
: "0" (loops));
}

static inline void __udelay(unsigned long usecs)
{
__delay(usecs);
unsigned long loops_per_usec;

loops_per_usec = (loops_per_jiffy * HZ) / 1000000;

__delay(usecs * loops_per_usec);
}

#define udelay(usecs) __udelay(usecs)
Expand Down
1 change: 0 additions & 1 deletion arch/score/include/asm/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
#define _ASM_SCORE_ERRNO_H

#include <asm-generic/errno.h>
#define EMAXERRNO 1024

#endif /* _ASM_SCORE_ERRNO_H */
2 changes: 2 additions & 0 deletions arch/score/include/asm/pgtable-bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#define _CACHE_MASK (1<<3)
#define _PAGE_BUFFERABLE (1<<4) /*Fallow Spec. */

#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
#define _PAGE_CHG_MASK \
(PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_CACHE)

Expand Down
59 changes: 34 additions & 25 deletions arch/score/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,6 @@ 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 __P000 __pgprot(0)
#define __P001 __pgprot(0)
#define __P010 __pgprot(0)
#define __P011 __pgprot(0)
#define __P100 __pgprot(0)
#define __P101 __pgprot(0)
#define __P110 __pgprot(0)
#define __P111 __pgprot(0)

#define __S000 __pgprot(0)
#define __S001 __pgprot(0)
#define __S010 __pgprot(0)
#define __S011 __pgprot(0)
#define __S100 __pgprot(0)
#define __S101 __pgprot(0)
#define __S110 __pgprot(0)
#define __S111 __pgprot(0)

#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
Expand All @@ -136,10 +118,15 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \
remap_pfn_range(vma, vaddr, pfn, size, prot)

#define pgd_present(pgd) (1) /* pages are always present on non MMU */
/*
* The "pgd_xxx()" functions here are trivial for a folded two-level
* setup: the pgd is never bad, and a pmd always exists (as it's folded
* into the pgd entry)
*/
#define pgd_present(pgd) (1)
#define pgd_none(pgd) (0)
#define pgd_bad(pgd) (0)
#define pgd_clear(pgdp)
#define pgd_clear(pgdp) do { } while (0)

#define kern_addr_valid(addr) (1)
#define pmd_offset(a, b) ((void *) 0)
Expand All @@ -150,11 +137,33 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; }

#define pud_offset(pgd, address) ((pud_t *) pgd)

#define PAGE_NONE __pgprot(0) /* these mean nothing to non MMU */
#define PAGE_SHARED __pgprot(0) /* these mean nothing to non MMU */
#define PAGE_COPY __pgprot(0) /* these mean nothing to non MMU */
#define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */
#define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */
#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CACHE)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
_PAGE_CACHE)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHE)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHE)
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
_PAGE_GLOBAL | _PAGE_CACHE)
#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
__WRITEABLE | _PAGE_GLOBAL & ~_PAGE_CACHE)

#define __P000 PAGE_NONE
#define __P001 PAGE_READONLY
#define __P010 PAGE_COPY
#define __P011 PAGE_COPY
#define __P100 PAGE_READONLY
#define __P101 PAGE_READONLY
#define __P110 PAGE_COPY
#define __P111 PAGE_COPY

#define __S000 PAGE_NONE
#define __S001 PAGE_READONLY
#define __S010 PAGE_SHARED
#define __S011 PAGE_SHARED
#define __S100 PAGE_READONLY
#define __S101 PAGE_READONLY
#define __S110 PAGE_SHARED
#define __S111 PAGE_SHARED

#define pgprot_noncached(x) (x)

Expand Down
18 changes: 13 additions & 5 deletions arch/score/include/asm/ptrace.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef _ASM_SCORE_PTRACE_H
#define _ASM_SCORE_PTRACE_H

#define PTRACE_GETREGS 12
#define PTRACE_SETREGS 13

#define PC 32
#define CONDITION 33
#define ECR 34
Expand Down Expand Up @@ -76,12 +79,17 @@ struct pt_regs {
*/
#define user_mode(regs) ((regs->cp0_psr & 8) == 8)

#define instruction_pointer(regs) (0)
#define profile_pc(regs) instruction_pointer(regs)
#define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs)

extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
extern void do_syscall_trace(struct pt_regs *regs, int entryexit);
extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *);
extern void clear_single_step(struct task_struct *);
#endif
extern int read_tsk_short(struct task_struct *, unsigned long,
unsigned short *);

#define arch_has_single_step() (1)
extern void user_enable_single_step(struct task_struct *);
extern void user_disable_single_step(struct task_struct *);
#endif /* __KERNEL__ */

#endif /* _ASM_SCORE_PTRACE_H */
3 changes: 2 additions & 1 deletion arch/score/include/asm/unistd.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef _ASM_SCORE_UNISTD_H
#if !defined(_ASM_SCORE_UNISTD_H) || defined(__SYSCALL)
#define _ASM_SCORE_UNISTD_H

#define __ARCH_HAVE_MMU
#define __ARCH_WANT_IPC_PARSE_VERSION

#include <asm-generic/unistd.h>

Expand Down
6 changes: 3 additions & 3 deletions arch/score/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <linux/errno.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/linkage.h>

Expand Down Expand Up @@ -434,7 +434,7 @@ stack_done:
sw r8, [r0, PT_R7]
b 2f
1:
cmpi.c r4, -EMAXERRNO-1 # -EMAXERRNO - 1=-1134
cmpi.c r4, -MAX_ERRNO - 1
ble 2f
ldi r8, 0x1;
sw r8, [r0, PT_R7]
Expand Down Expand Up @@ -466,7 +466,7 @@ syscall_trace_entry:
lw r7, [r0, PT_R7]
brl r8

li r8, -EMAXERRNO - 1 # error?
li r8, -MAX_ERRNO - 1
sw r8, [r0, PT_R7] # set error flag

neg r4, r4 # error
Expand Down
2 changes: 1 addition & 1 deletion arch/score/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void __noreturn cpu_idle(void)
}
}

asmlinkage void ret_from_fork(void);
void ret_from_fork(void);

void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long sp)
{
Expand Down
Loading

0 comments on commit 0402c91

Please sign in to comment.