cpufunc.h (83511) | cpufunc.h (83836) |
---|---|
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/ia64/include/cpufunc.h 83511 2001-09-15 12:30:56Z dfr $ | 26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 83836 2001-09-22 19:51:18Z dfr $ |
27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 14 unchanged lines hidden (view full) --- 49static __inline volatile void * 50ia64_port_address(u_int port) 51{ 52 return (volatile void *)(ia64_port_base 53 | ((port >> 2) << 12) 54 | (port & ((1 << 12) - 1))); 55} 56 | 27 */ 28 29#ifndef _MACHINE_CPUFUNC_H_ 30#define _MACHINE_CPUFUNC_H_ 31 32#ifdef _KERNEL 33 34#include <sys/types.h> --- 14 unchanged lines hidden (view full) --- 49static __inline volatile void * 50ia64_port_address(u_int port) 51{ 52 return (volatile void *)(ia64_port_base 53 | ((port >> 2) << 12) 54 | (port & ((1 << 12) - 1))); 55} 56 |
57static __inline volatile void * 58ia64_memory_address(u_int addr) 59{ 60 return (volatile void *) IA64_PHYS_TO_RR6(addr);; 61} 62 |
|
57static __inline u_int8_t 58inb(u_int port) 59{ 60 volatile u_int8_t *p = ia64_port_address(port); 61 u_int8_t v = *p; 62 ia64_mf_a(); 63 ia64_mf(); 64 return v; --- 92 unchanged lines hidden (view full) --- 157 const u_int32_t *p = addr; 158 while (count--) 159 outl(port, *p++); 160} 161 162static __inline u_int8_t 163readb(u_int addr) 164{ | 63static __inline u_int8_t 64inb(u_int port) 65{ 66 volatile u_int8_t *p = ia64_port_address(port); 67 u_int8_t v = *p; 68 ia64_mf_a(); 69 ia64_mf(); 70 return v; --- 92 unchanged lines hidden (view full) --- 163 const u_int32_t *p = addr; 164 while (count--) 165 outl(port, *p++); 166} 167 168static __inline u_int8_t 169readb(u_int addr) 170{ |
165 return 0; /* TODO: implement this */ | 171 volatile u_int8_t *p = ia64_memory_address(addr); 172 u_int8_t v = *p; 173 ia64_mf_a(); 174 ia64_mf(); 175 return v; |
166} 167 168static __inline u_int16_t 169readw(u_int addr) 170{ | 176} 177 178static __inline u_int16_t 179readw(u_int addr) 180{ |
171 return 0; /* TODO: implement this */ | 181 volatile u_int16_t *p = ia64_memory_address(addr); 182 u_int16_t v = *p; 183 ia64_mf_a(); 184 ia64_mf(); 185 return v; |
172} 173 174static __inline u_int32_t 175readl(u_int addr) 176{ | 186} 187 188static __inline u_int32_t 189readl(u_int addr) 190{ |
177 return 0; /* TODO: implement this */ | 191 volatile u_int32_t *p = ia64_memory_address(addr); 192 u_int32_t v = *p; 193 ia64_mf_a(); 194 ia64_mf(); 195 return v; |
178} 179 180static __inline void 181writeb(u_int addr, u_int8_t data) 182{ | 196} 197 198static __inline void 199writeb(u_int addr, u_int8_t data) 200{ |
183 return; /* TODO: implement this */ | 201 volatile u_int8_t *p = ia64_memory_address(addr); 202 *p = data; 203 ia64_mf_a(); 204 ia64_mf(); |
184} 185 186static __inline void 187writew(u_int addr, u_int16_t data) 188{ | 205} 206 207static __inline void 208writew(u_int addr, u_int16_t data) 209{ |
189 return; /* TODO: implement this */ | 210 volatile u_int16_t *p = ia64_memory_address(addr); 211 *p = data; 212 ia64_mf_a(); 213 ia64_mf(); |
190} 191 192static __inline void 193writel(u_int addr, u_int32_t data) 194{ | 214} 215 216static __inline void 217writel(u_int addr, u_int32_t data) 218{ |
195 return; /* TODO: implement this */ | 219 volatile u_int32_t *p = ia64_memory_address(addr); 220 *p = data; 221 ia64_mf_a(); 222 ia64_mf(); |
196} 197 198static __inline void 199disable_intr(void) 200{ 201 __asm __volatile ("rsm psr.i;;"); 202} 203 --- 25 unchanged lines hidden --- | 223} 224 225static __inline void 226disable_intr(void) 227{ 228 __asm __volatile ("rsm psr.i;;"); 229} 230 --- 25 unchanged lines hidden --- |