cpufunc.h (92880) | cpufunc.h (93264) |
---|---|
1/*- 2 * Copyright (c) 1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/powerpc/include/cpufunc.h 92880 2002-03-21 13:07:31Z benno $ | 26 * $FreeBSD: head/sys/powerpc/include/cpufunc.h 93264 2002-03-27 05:39:23Z dillon $ |
27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> 35 36#include <machine/psl.h> 37 | 27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> 35 36#include <machine/psl.h> 37 |
38#define CRITICAL_FORK (mfmsr() | PSL_EE | PSL_RI) | 38struct thread; |
39 40#ifdef __GNUC__ 41 42static __inline void 43breakpoint(void) 44{ 45 46 return; --- 56 unchanged lines hidden (view full) --- 103 104static __inline void 105intr_restore(register_t msr) 106{ 107 108 mtmsr(msr); 109} 110 | 39 40#ifdef __GNUC__ 41 42static __inline void 43breakpoint(void) 44{ 45 46 return; --- 56 unchanged lines hidden (view full) --- 103 104static __inline void 105intr_restore(register_t msr) 106{ 107 108 mtmsr(msr); 109} 110 |
111static __inline critical_t 112cpu_critical_enter(void) 113{ 114 u_int msr; 115 critical_t crit; 116 117 msr = mfmsr(); 118 crit = (critical_t)msr; 119 msr &= ~(PSL_EE | PSL_RI); 120 mtmsr(msr); 121 122 return (crit); 123} 124 | |
125static __inline void 126restore_intr(unsigned int msr) 127{ 128 129 mtmsr(msr); 130} 131 132static __inline void | 111static __inline void 112restore_intr(unsigned int msr) 113{ 114 115 mtmsr(msr); 116} 117 118static __inline void |
133cpu_critical_exit(critical_t msr) 134{ 135 136 mtmsr(msr); 137} 138 139static __inline void | |
140powerpc_mb(void) 141{ 142 143 __asm __volatile("eieio; sync" : : : "memory"); 144} 145 146static __inline struct pcpu * 147powerpc_get_pcpup(void) 148{ 149 struct pcpu *ret; 150 151 __asm ("mfsprg %0, 0" : "=r"(ret)); 152 153 return(ret); 154} 155 | 119powerpc_mb(void) 120{ 121 122 __asm __volatile("eieio; sync" : : : "memory"); 123} 124 125static __inline struct pcpu * 126powerpc_get_pcpup(void) 127{ 128 struct pcpu *ret; 129 130 __asm ("mfsprg %0, 0" : "=r"(ret)); 131 132 return(ret); 133} 134 |
135void cpu_critical_enter(void); 136void cpu_critical_exit(void); 137void cpu_critical_fork_exit(void); 138void cpu_thread_link(struct thread *td); 139 140 |
|
156#endif /* _KERNEL */ 157 158#endif /* !_MACHINE_CPUFUNC_H_ */ | 141#endif /* _KERNEL */ 142 143#endif /* !_MACHINE_CPUFUNC_H_ */ |