Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0402c91a authored by Chen Liqin's avatar Chen Liqin Committed by Arnd Bergmann
Browse files

score: update files according to review comments



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: default avatarChen Liqin <liqin.chen@sunplusct.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 6bcf6737
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -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)
+8 −3
Original line number Diff line number Diff line
@@ -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)
+0 −1
Original line number Diff line number Diff line
@@ -2,6 +2,5 @@
#define _ASM_SCORE_ERRNO_H

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

#endif /* _ASM_SCORE_ERRNO_H */
+2 −0
Original line number Diff line number Diff line
@@ -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)

+34 −25
Original line number Diff line number Diff line
@@ -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; }
@@ -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)
@@ -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)

Loading