OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-arm/] [cpu-single.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
/*
2
 *  linux/include/asm-arm/cpu-single.h
3
 *
4
 *  Copyright (C) 2000 Russell King
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License version 2 as
8
 * published by the Free Software Foundation.
9
 */
10
/*
11
 * Single CPU
12
 */
13
#ifdef __STDC__
14
#define __cpu_fn(name,x)        cpu_##name##x
15
#else
16
#define __cpu_fn(name,x)        cpu_/**/name/**/x
17
#endif
18
#define cpu_fn(name,x)          __cpu_fn(name,x)
19
 
20
/*
21
 * If we are supporting multiple CPUs, then we must use a table of
22
 * function pointers for this lot.  Otherwise, we can optimise the
23
 * table away.
24
 */
25
#define cpu_data_abort                  cpu_fn(CPU_NAME,_data_abort)
26
#define cpu_check_bugs                  cpu_fn(CPU_NAME,_check_bugs)
27
#define cpu_proc_init                   cpu_fn(CPU_NAME,_proc_init)
28
#define cpu_proc_fin                    cpu_fn(CPU_NAME,_proc_fin)
29
#define cpu_reset                       cpu_fn(CPU_NAME,_reset)
30
#define cpu_do_idle                     cpu_fn(CPU_NAME,_do_idle)
31
 
32
#define cpu_cache_clean_invalidate_all  cpu_fn(CPU_NAME,_cache_clean_invalidate_all)
33
#define cpu_cache_clean_invalidate_range cpu_fn(CPU_NAME,_cache_clean_invalidate_range)
34
#define cpu_flush_ram_page              cpu_fn(CPU_NAME,_flush_ram_page)
35
 
36
#define cpu_dcache_invalidate_range     cpu_fn(CPU_NAME,_dcache_invalidate_range)
37
#define cpu_dcache_clean_range          cpu_fn(CPU_NAME,_dcache_clean_range)
38
#define cpu_dcache_clean_page           cpu_fn(CPU_NAME,_dcache_clean_page)
39
#define cpu_dcache_clean_entry          cpu_fn(CPU_NAME,_dcache_clean_entry)
40
 
41
#define cpu_icache_invalidate_range     cpu_fn(CPU_NAME,_icache_invalidate_range)
42
#define cpu_icache_invalidate_page      cpu_fn(CPU_NAME,_icache_invalidate_page)
43
 
44
#define cpu_tlb_invalidate_all          cpu_fn(CPU_NAME,_tlb_invalidate_all)
45
#define cpu_tlb_invalidate_range        cpu_fn(CPU_NAME,_tlb_invalidate_range)
46
#define cpu_tlb_invalidate_page         cpu_fn(CPU_NAME,_tlb_invalidate_page)
47
 
48
#define cpu_set_pgd                     cpu_fn(CPU_NAME,_set_pgd)
49
#define cpu_set_pmd                     cpu_fn(CPU_NAME,_set_pmd)
50
#define cpu_set_pte                     cpu_fn(CPU_NAME,_set_pte)
51
 
52
#ifndef __ASSEMBLY__
53
 
54
#include <asm/memory.h>
55
#include <asm/page.h>
56
 
57
/* forward declare task_struct */
58
struct task_struct;
59
 
60
/* declare all the functions as extern */
61
extern void cpu_data_abort(unsigned long pc);
62
extern void cpu_check_bugs(void);
63
extern void cpu_proc_init(void);
64
extern void cpu_proc_fin(void);
65
extern int cpu_do_idle(void);
66
 
67
extern void cpu_cache_clean_invalidate_all(void);
68
extern void cpu_cache_clean_invalidate_range(unsigned long address, unsigned long end, int flags);
69
extern void cpu_flush_ram_page(void *virt_page);
70
 
71
extern void cpu_dcache_invalidate_range(unsigned long start, unsigned long end);
72
extern void cpu_dcache_clean_range(unsigned long start, unsigned long end);
73
extern void cpu_dcache_clean_page(void *virt_page);
74
extern void cpu_dcache_clean_entry(unsigned long address);
75
 
76
extern void cpu_icache_invalidate_range(unsigned long start, unsigned long end);
77
extern void cpu_icache_invalidate_page(void *virt_page);
78
 
79
extern void cpu_tlb_invalidate_all(void);
80
extern void cpu_tlb_invalidate_range(unsigned long address, unsigned long end);
81
extern void cpu_tlb_invalidate_page(unsigned long address, int flags);
82
 
83
extern void cpu_set_pgd(unsigned long pgd_phys);
84
extern void cpu_set_pmd(pmd_t *pmdp, pmd_t pmd);
85
extern void cpu_set_pte(pte_t *ptep, pte_t pte);
86
extern volatile void cpu_reset(unsigned long addr);
87
 
88
#define cpu_switch_mm(pgd,tsk) cpu_set_pgd(__virt_to_phys((unsigned long)(pgd)))
89
 
90
#define cpu_get_pgd()   \
91
        ({                                              \
92
                unsigned long pg;                       \
93
                __asm__("mrc p15, 0, %0, c2, c0, 0"     \
94
                         : "=r" (pg));                  \
95
                pg &= ~0x3fff;                          \
96
                (pgd_t *)phys_to_virt(pg);              \
97
        })
98
 
99
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.