summaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-11 04:02:40 +0000
commite47f00743fc4776491344f2c618cc8dc2c23bcbc (patch)
tree13e03a113a82a184c51c19c209867cfd3a59b3b9 /include/asm-sh
parentb2ad5f821b1381492d792ca10b1eb7a107b48f14 (diff)
Merge with Linux 2.4.0.
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/bugs.h4
-rw-r--r--include/asm-sh/delay.h44
-rw-r--r--include/asm-sh/mmu_context.h1
-rw-r--r--include/asm-sh/param.h4
-rw-r--r--include/asm-sh/pgtable-2level.h8
-rw-r--r--include/asm-sh/pgtable.h55
-rw-r--r--include/asm-sh/processor.h10
-rw-r--r--include/asm-sh/ptrace.h5
-rw-r--r--include/asm-sh/rtc.h12
-rw-r--r--include/asm-sh/siginfo.h2
-rw-r--r--include/asm-sh/timex.h2
-rw-r--r--include/asm-sh/uaccess.h4
12 files changed, 84 insertions, 67 deletions
diff --git a/include/asm-sh/bugs.h b/include/asm-sh/bugs.h
index ed5c57692..5fdb1c6ad 100644
--- a/include/asm-sh/bugs.h
+++ b/include/asm-sh/bugs.h
@@ -16,10 +16,10 @@
static void __init check_bugs(void)
{
- extern unsigned long loops_per_sec;
+ extern unsigned long loops_per_jiffy;
char *p= &system_utsname.machine[2]; /* "sh" */
- cpu_data->loops_per_sec = loops_per_sec;
+ cpu_data->loops_per_jiffy = loops_per_jiffy;
switch (cpu_data->type) {
case CPU_SH7708:
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
index 38e5a48c0..2c1fb7b92 100644
--- a/include/asm-sh/delay.h
+++ b/include/asm-sh/delay.h
@@ -2,41 +2,19 @@
#define __ASM_SH_DELAY_H
/*
- * Copyright (C) 1999 Kaz Kojima
+ * Copyright (C) 1993 Linus Torvalds
+ *
+ * Delay routines calling functions in arch/sh/lib/delay.c
*/
+
+extern void __bad_udelay(void);
-#include <linux/config.h>
+extern void __udelay(unsigned long usecs);
+extern void __const_udelay(unsigned long usecs);
+extern void __delay(unsigned long loops);
-extern __inline__ void __delay(unsigned long loops)
-{
- __asm__ __volatile__(
- "tst %0, %0\n\t"
- "1:\t"
- "bf/s 1b\n\t"
- " dt %0"
- : "=r" (loops)
- : "0" (loops)
- : "t");
-}
-
-extern __inline__ void __udelay(unsigned long usecs, unsigned long lps)
-{
- usecs *= 0x000010c6; /* 2**32 / 1000000 */
- __asm__("dmulu.l %0, %2\n\t"
- "sts $mach, %0"
- : "=r" (usecs)
- : "0" (usecs), "r" (lps)
- : "macl", "mach");
- __delay(usecs);
-}
-
-
-#ifdef CONFIG_SMP
-#define __udelay_val cpu_data[smp_processor_id()].udelay_val
-#else
-#define __udelay_val (current_cpu_data.loops_per_sec)
-#endif
-
-#define udelay(usecs) __udelay((usecs),__udelay_val)
+#define udelay(n) (__builtin_constant_p(n) ? \
+ ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c6ul)) : \
+ __udelay(n))
#endif /* __ASM_SH_DELAY_H */
diff --git a/include/asm-sh/mmu_context.h b/include/asm-sh/mmu_context.h
index 268754e71..3a1f034c2 100644
--- a/include/asm-sh/mmu_context.h
+++ b/include/asm-sh/mmu_context.h
@@ -104,6 +104,7 @@ extern __inline__ void destroy_context(struct mm_struct *mm)
#define MMU_PTEL 0xFF000004 /* Page table entry register LOW */
#define MMU_TTB 0xFF000008 /* Translation table base register */
#define MMU_TEA 0xFF00000C /* TLB Exception Address */
+#define MMU_PTEA 0xFF000034 /* Page table entry assistance register */
#define MMUCR 0xFF000010 /* MMU Control Register */
diff --git a/include/asm-sh/param.h b/include/asm-sh/param.h
index bc1879c96..fc134a5bc 100644
--- a/include/asm-sh/param.h
+++ b/include/asm-sh/param.h
@@ -20,4 +20,8 @@
#define MAXHOSTNAMELEN 64 /* max length of hostname */
+#ifdef __KERNEL__
+#define CLOCKS_PER_SEC HZ /* frequency at which times() counts */
+#endif
+
#endif /* __ASM_SH_PARAM_H */
diff --git a/include/asm-sh/pgtable-2level.h b/include/asm-sh/pgtable-2level.h
index 8fc2666e7..5a11978af 100644
--- a/include/asm-sh/pgtable-2level.h
+++ b/include/asm-sh/pgtable-2level.h
@@ -29,9 +29,9 @@
* setup: the pgd is never bad, and a pmd always exists (as it's folded
* into the pgd entry)
*/
-extern inline int pgd_none(pgd_t pgd) { return 0; }
-extern inline int pgd_bad(pgd_t pgd) { return 0; }
-extern inline int pgd_present(pgd_t pgd) { return 1; }
+static inline int pgd_none(pgd_t pgd) { return 0; }
+static inline int pgd_bad(pgd_t pgd) { return 0; }
+static inline int pgd_present(pgd_t pgd) { return 1; }
#define pgd_clear(xp) do { } while (0)
/*
@@ -50,7 +50,7 @@ extern inline int pgd_present(pgd_t pgd) { return 1; }
#define pgd_page(pgd) \
((unsigned long) __va(pgd_val(pgd) & PAGE_MASK))
-extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
+static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
{
return (pmd_t *) dir;
}
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h
index 2246e5c0d..b1a6f9461 100644
--- a/include/asm-sh/pgtable.h
+++ b/include/asm-sh/pgtable.h
@@ -105,8 +105,23 @@ extern unsigned long empty_zero_page[1024];
#define _PAGE_ACCESSED 0x400 /* software: page referenced */
#define _PAGE_U0_SHARED 0x800 /* software: page is shared in user space */
+
+/* software: moves to PTEA.TC (Timing Control) */
+#define _PAGE_PCC_AREA5 0x00000000 /* use BSC registers for area5 */
+#define _PAGE_PCC_AREA6 0x80000000 /* use BSC registers for area6 */
+
+/* software: moves to PTEA.SA[2:0] (Space Attributes) */
+#define _PAGE_PCC_IODYN 0x00000001 /* IO space, dynamically sized bus */
+#define _PAGE_PCC_IO8 0x20000000 /* IO space, 8 bit bus */
+#define _PAGE_PCC_IO16 0x20000001 /* IO space, 16 bit bus */
+#define _PAGE_PCC_COM8 0x40000000 /* Common Memory space, 8 bit bus */
+#define _PAGE_PCC_COM16 0x40000001 /* Common Memory space, 16 bit bus */
+#define _PAGE_PCC_ATR8 0x60000000 /* Attribute Memory space, 8 bit bus */
+#define _PAGE_PCC_ATR16 0x60000001 /* Attribute Memory space, 6 bit bus */
+
+
/* Mask which drop software flags */
-#define _PAGE_FLAGS_HARDWARE_MASK 0x1ffff1ff
+#define _PAGE_FLAGS_HARDWARE_MASK 0x1ffff1fe
/* Hardware flags: SZ=1 (4k-byte) */
#define _PAGE_FLAGS_HARD 0x00000010
@@ -126,6 +141,8 @@ extern unsigned long empty_zero_page[1024];
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_CACHABLE | _PAGE_ACCESSED | _PAGE_FLAGS_HARD)
#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_CACHABLE | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_HW_SHARED | _PAGE_FLAGS_HARD)
+#define PAGE_KERNEL_PCC(slot, type) \
+ __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_FLAGS_HARD | (slot ? _PAGE_PCC_AREA5 : _PAGE_PCC_AREA6) | (type))
/*
* As i386 and MIPS, SuperH can't do page protection for execute, and
@@ -178,23 +195,23 @@ extern void __handle_bad_pmd_kernel(pmd_t * pmd);
* The following only work if pte_present() is true.
* Undefined behaviour if not..
*/
-extern inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
-extern inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
-extern inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; }
-extern inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; }
-extern inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_RW; }
-extern inline int pte_shared(pte_t pte){ return pte_val(pte) & _PAGE_SHARED; }
-
-extern inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
-extern inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
-extern inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
-extern inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
-extern inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
-extern inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
-extern inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
-extern inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
-extern inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
-extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
+static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
+static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
+static inline int pte_dirty(pte_t pte){ return pte_val(pte) & _PAGE_DIRTY; }
+static inline int pte_young(pte_t pte){ return pte_val(pte) & _PAGE_ACCESSED; }
+static inline int pte_write(pte_t pte){ return pte_val(pte) & _PAGE_RW; }
+static inline int pte_shared(pte_t pte){ return pte_val(pte) & _PAGE_SHARED; }
+
+static inline pte_t pte_rdprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
+static inline pte_t pte_exprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
+static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
+static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
+static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
+static inline pte_t pte_mkread(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
+static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
+static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
+static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
+static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
/*
* Conversion functions: convert a page and protection to a page entry,
@@ -215,7 +232,7 @@ extern inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) |
#define mk_pte_phys(physpage, pgprot) \
({ pte_t __pte; set_pte(&__pte, __pte(physpage + pgprot_val(pgprot))); __pte; })
-extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
{ set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; }
#define page_pte(page) page_pte_prot(page, __pgprot(0))
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 8c4ba40d8..3259acb23 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -29,7 +29,7 @@ enum cpu_type {
struct sh_cpuinfo {
enum cpu_type type;
- unsigned long loops_per_sec;
+ unsigned long loops_per_jiffy;
char hard_math;
@@ -164,9 +164,9 @@ extern __inline__ void release_fpu(void)
unsigned long __dummy;
/* Set FD flag in SR */
- __asm__ __volatile__("stc $sr, %0\n\t"
+ __asm__ __volatile__("stc sr, %0\n\t"
"or %1, %0\n\t"
- "ldc %0, $sr"
+ "ldc %0, sr"
: "=&r" (__dummy)
: "r" (SR_FD));
}
@@ -176,9 +176,9 @@ extern __inline__ void grab_fpu(void)
unsigned long __dummy;
/* Clear out FD flag in SR */
- __asm__ __volatile__("stc $sr, %0\n\t"
+ __asm__ __volatile__("stc sr, %0\n\t"
"and %1, %0\n\t"
- "ldc %0, $sr"
+ "ldc %0, sr"
: "=&r" (__dummy)
: "r" (~SR_FD));
}
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h
index e716331ee..081adbfb3 100644
--- a/include/asm-sh/ptrace.h
+++ b/include/asm-sh/ptrace.h
@@ -42,6 +42,11 @@
#define REG_XDREG14 47
#define REG_FPSCR 48
+#define PTRACE_SETOPTIONS 21
+
+/* options set using PTRACE_SETOPTIONS */
+#define PTRACE_O_TRACESYSGOOD 0x00000001
+
/*
* This struct defines the way the registers are stored on the
* kernel stack during a system call or other kernel entry.
diff --git a/include/asm-sh/rtc.h b/include/asm-sh/rtc.h
new file mode 100644
index 000000000..3321bc7e8
--- /dev/null
+++ b/include/asm-sh/rtc.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_RTC_H
+#define _ASM_RTC_H
+
+#include <asm/machvec.h>
+
+#define rtc_gettimeofday sh_mv.mv_rtc_gettimeofday
+#define rtc_settimeofday sh_mv.mv_rtc_settimeofday
+
+extern void sh_rtc_gettimeofday(struct timeval *tv);
+extern int sh_rtc_settimeofday(const struct timeval *tv);
+
+#endif /* _ASM_RTC_H */
diff --git a/include/asm-sh/siginfo.h b/include/asm-sh/siginfo.h
index aa4354a45..aa6a1c46f 100644
--- a/include/asm-sh/siginfo.h
+++ b/include/asm-sh/siginfo.h
@@ -216,7 +216,7 @@ typedef struct sigevent {
#ifdef __KERNEL__
#include <linux/string.h>
-extern inline void copy_siginfo(siginfo_t *to, siginfo_t *from)
+static inline void copy_siginfo(siginfo_t *to, siginfo_t *from)
{
if (from->si_code < 0)
memcpy(to, from, sizeof(siginfo_t));
diff --git a/include/asm-sh/timex.h b/include/asm-sh/timex.h
index 2351c2f0b..72a0cd593 100644
--- a/include/asm-sh/timex.h
+++ b/include/asm-sh/timex.h
@@ -6,7 +6,7 @@
#ifndef __ASM_SH_TIMEX_H
#define __ASM_SH_TIMEX_H
-#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
+#define CLOCK_TICK_RATE (current_cpu_data.module_clock/4) /* Underlying HZ */
#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */
#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
(1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
diff --git a/include/asm-sh/uaccess.h b/include/asm-sh/uaccess.h
index 4fe09b005..947fd12c8 100644
--- a/include/asm-sh/uaccess.h
+++ b/include/asm-sh/uaccess.h
@@ -56,7 +56,7 @@
#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
#define __access_ok(addr,size) (__range_ok(addr,size) == 0)
-extern inline int verify_area(int type, const void * addr, unsigned long size)
+static inline int verify_area(int type, const void * addr, unsigned long size)
{
return access_ok(type,addr,size) ? 0 : -EFAULT;
}
@@ -66,7 +66,7 @@ extern inline int verify_area(int type, const void * addr, unsigned long size)
* They automatically use the right size if we just have the right
* pointer type ...
*
- * As MIPS uses the same address space for kernel and user data, we
+ * As SuperH uses the same address space for kernel and user data, we
* can just do these as direct assignments.
*
* Careful to not