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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sparc64/] [smp.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
/* smp.h: Sparc64 specific SMP stuff.
2
 *
3
 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
4
 */
5
 
6
#ifndef _SPARC64_SMP_H
7
#define _SPARC64_SMP_H
8
 
9
#include <linux/config.h>
10
#include <linux/threads.h>
11
#include <linux/cache.h>
12
#include <asm/asi.h>
13
#include <asm/starfire.h>
14
#include <asm/spitfire.h>
15
 
16
#ifndef __ASSEMBLY__
17
/* PROM provided per-processor information we need
18
 * to start them all up.
19
 */
20
 
21
struct prom_cpuinfo {
22
        int prom_node;
23
        int mid;
24
};
25
 
26
extern int linux_num_cpus;      /* number of CPUs probed  */
27
extern struct prom_cpuinfo linux_cpus[64];
28
 
29
#endif /* !(__ASSEMBLY__) */
30
 
31
#ifdef CONFIG_SMP
32
 
33
#ifndef __ASSEMBLY__
34
 
35
/* Per processor Sparc parameters we need. */
36
 
37
/* Keep this a multiple of 64-bytes for cache reasons. */
38
typedef struct {
39
        /* Dcache line 1 */
40
        unsigned int    __pad0;         /* bh_count moved to irq_stat for consistency. KAO */
41
        unsigned int    multiplier;
42
        unsigned int    counter;
43
        unsigned int    idle_volume;
44
        unsigned long   clock_tick;     /* %tick's per second */
45
        unsigned long   udelay_val;
46
 
47
        /* Dcache line 2 */
48
        unsigned int    pgcache_size;
49
        unsigned int    pgdcache_size;
50
        unsigned long   *pte_cache[2];
51
        unsigned long   *pgd_cache;
52
 
53
        /* Dcache lines 3 and 4 */
54
        unsigned int    irq_worklists[16];
55
} ____cacheline_aligned cpuinfo_sparc;
56
 
57
extern cpuinfo_sparc cpu_data[NR_CPUS];
58
 
59
/*
60
 *      Private routines/data
61
 */
62
 
63
extern unsigned char boot_cpu_id;
64
extern unsigned long cpu_present_map;
65
#define cpu_online_map cpu_present_map
66
 
67
/*
68
 *      General functions that each host system must provide.
69
 */
70
 
71
extern void smp_callin(void);
72
extern void smp_boot_cpus(void);
73
extern void smp_store_cpu_info(int id);
74
 
75
extern __volatile__ int __cpu_number_map[NR_CPUS];
76
extern __volatile__ int __cpu_logical_map[NR_CPUS];
77
 
78
extern __inline__ int cpu_logical_map(int cpu)
79
{
80
        return __cpu_logical_map[cpu];
81
}
82
extern __inline__ int cpu_number_map(int cpu)
83
{
84
        return __cpu_number_map[cpu];
85
}
86
 
87
extern __inline__ int hard_smp_processor_id(void)
88
{
89
        if (tlb_type == cheetah || tlb_type == cheetah_plus) {
90
                unsigned long cfg, ver;
91
                __asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
92
                if ((ver >> 32) == 0x003e0016) {
93
                        __asm__ __volatile__("ldxa [%%g0] %1, %0"
94
                                             : "=r" (cfg)
95
                                             : "i" (ASI_JBUS_CONFIG));
96
                        return ((cfg >> 17) & 0x1f);
97
                } else {
98
                        __asm__ __volatile__("ldxa [%%g0] %1, %0"
99
                                             : "=r" (cfg)
100
                                             : "i" (ASI_SAFARI_CONFIG));
101
                        return ((cfg >> 17) & 0x3ff);
102
                }
103
        } else if (this_is_starfire != 0) {
104
                return starfire_hard_smp_processor_id();
105
        } else {
106
                unsigned long upaconfig;
107
                __asm__ __volatile__("ldxa      [%%g0] %1, %0"
108
                                     : "=r" (upaconfig)
109
                                     : "i" (ASI_UPA_CONFIG));
110
                return ((upaconfig >> 17) & 0x1f);
111
        }
112
}
113
 
114
#define smp_processor_id() (current->processor)
115
 
116
/* This needn't do anything as we do not sleep the cpu
117
 * inside of the idler task, so an interrupt is not needed
118
 * to get a clean fast response.
119
 *
120
 * Addendum: We do want it to do something for the signal
121
 *           delivery case, we detect that by just seeing
122
 *           if we are trying to send this to an idler or not.
123
 */
124
extern __inline__ void smp_send_reschedule(int cpu)
125
{
126
        extern void smp_receive_signal(int);
127
        if(cpu_data[cpu].idle_volume == 0)
128
                smp_receive_signal(cpu);
129
}
130
 
131
/* This is a nop as well because we capture all other cpus
132
 * anyways when making the PROM active.
133
 */
134
extern __inline__ void smp_send_stop(void) { }
135
 
136
#endif /* !(__ASSEMBLY__) */
137
 
138
#define PROC_CHANGE_PENALTY     20
139
 
140
#endif /* !(CONFIG_SMP) */
141
 
142
#define NO_PROC_ID              0xFF
143
 
144
#endif /* !(_SPARC64_SMP_H) */

powered by: WebSVN 2.1.0

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