Deleted Added
full compact
cpufunc.h (83836) cpufunc.h (84581)
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 83836 2001-09-22 19:51:18Z dfr $
26 * $FreeBSD: head/sys/ia64/include/cpufunc.h 84581 2001-10-06 09:31:43Z marcel $
27 */
28
29#ifndef _MACHINE_CPUFUNC_H_
30#define _MACHINE_CPUFUNC_H_
31
32#ifdef _KERNEL
33
34#include <sys/types.h>

--- 15 unchanged lines hidden (view full) ---

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 *
27 */
28
29#ifndef _MACHINE_CPUFUNC_H_
30#define _MACHINE_CPUFUNC_H_
31
32#ifdef _KERNEL
33
34#include <sys/types.h>

--- 15 unchanged lines hidden (view full) ---

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)
58ia64_memory_address(u_int64_t addr)
59{
59{
60 return (volatile void *) IA64_PHYS_TO_RR6(addr);;
60 return (volatile void *) IA64_PHYS_TO_RR6(addr);
61}
62
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();

--- 149 unchanged lines hidden (view full) ---

218{
219 volatile u_int32_t *p = ia64_memory_address(addr);
220 *p = data;
221 ia64_mf_a();
222 ia64_mf();
223}
224
225static __inline void
61}
62
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();

--- 149 unchanged lines hidden (view full) ---

218{
219 volatile u_int32_t *p = ia64_memory_address(addr);
220 *p = data;
221 ia64_mf_a();
222 ia64_mf();
223}
224
225static __inline void
226memcpy_fromio(u_int8_t *addr, size_t ofs, size_t count)
227{
228 volatile u_int8_t *p = ia64_memory_address(ofs);
229 while (count--)
230 *addr++ = *p++;
231}
232
233static __inline void
234memcpy_io(size_t dst, size_t src, size_t count)
235{
236 volatile u_int8_t *dp = ia64_memory_address(dst);
237 volatile u_int8_t *sp = ia64_memory_address(src);
238 while (count--)
239 *dp++ = *sp++;
240}
241
242static __inline void
243memcpy_toio(size_t ofs, u_int8_t *addr, size_t count)
244{
245 volatile u_int8_t *p = ia64_memory_address(ofs);
246 while (count--)
247 *p++ = *addr++;
248}
249
250static __inline void
251memset_io(size_t ofs, u_int8_t value, size_t count)
252{
253 volatile u_int8_t *p = ia64_memory_address(ofs);
254 while (count--)
255 *p++ = value;
256}
257
258static __inline void
259memsetw(u_int16_t *addr, int val, size_t size)
260{
261 while (size--)
262 *addr++ = val;
263}
264
265static __inline void
266memsetw_io(size_t ofs, u_int16_t value, size_t count)
267{
268 volatile u_int16_t *p = ia64_memory_address(ofs);
269 while (count--)
270 *p++ = value;
271}
272
273static __inline void
226disable_intr(void)
227{
228 __asm __volatile ("rsm psr.i;;");
229}
230
231static __inline void
232enable_intr(void)
233{

--- 22 unchanged lines hidden ---
274disable_intr(void)
275{
276 __asm __volatile ("rsm psr.i;;");
277}
278
279static __inline void
280enable_intr(void)
281{

--- 22 unchanged lines hidden ---