Deleted Added
full compact
fbreg.h (237223) fbreg.h (239670)
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/fb/fbreg.h 237223 2012-06-18 07:54:10Z phk $
26 * $FreeBSD: head/sys/dev/fb/fbreg.h 239670 2012-08-25 08:09:37Z rwatson $
27 */
28
29#ifndef _DEV_FB_FBREG_H_
30#define _DEV_FB_FBREG_H_
31
32#ifdef _KERNEL
33
34#define V_MAX_ADAPTERS 8 /* XXX */

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

87#define readw(a) ofwfb_readw((u_int16_t *)(a))
88#define writew(a, v) ofwfb_writew((u_int16_t *)(a), (v))
89void ofwfb_bcopy(const void *s, void *d, size_t c);
90void ofwfb_bzero(void *d, size_t c);
91void ofwfb_fillw(int pat, void *base, size_t cnt);
92u_int16_t ofwfb_readw(u_int16_t *addr);
93void ofwfb_writew(u_int16_t *addr, u_int16_t val);
94
27 */
28
29#ifndef _DEV_FB_FBREG_H_
30#define _DEV_FB_FBREG_H_
31
32#ifdef _KERNEL
33
34#define V_MAX_ADAPTERS 8 /* XXX */

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

87#define readw(a) ofwfb_readw((u_int16_t *)(a))
88#define writew(a, v) ofwfb_writew((u_int16_t *)(a), (v))
89void ofwfb_bcopy(const void *s, void *d, size_t c);
90void ofwfb_bzero(void *d, size_t c);
91void ofwfb_fillw(int pat, void *base, size_t cnt);
92u_int16_t ofwfb_readw(u_int16_t *addr);
93void ofwfb_writew(u_int16_t *addr, u_int16_t val);
94
95#elif defined(__mips__)
96
97/*
98 * Use amd64/i386-like settings under the assumption that MIPS-based display
99 * drivers will have to add a level of indirection between a syscons-managed
100 * frame buffer and the actual video hardware. We are forced to do this
101 * because syscons doesn't carry around required busspace handles and tags to
102 * use here. This is only really a problem for true VGA devices hooked up to
103 * MIPS, as others will be performing a translation anyway.
104 */
105#define bcopy_io(s, d, c) memcpy((void *)(d), (void *)(s), (c))
106#define bcopy_toio(s, d, c) memcpy((void *)(d), (void *)(s), (c))
107#define bcopy_fromio(s, d, c) memcpy((void *)(d), (void *)(s), (c))
108#define bzero_io(d, c) memset((void *)(d), 0, (c))
109#define fill_io(p, d, c) memset((void *)(d), (p), (c))
110static __inline void
111fillw(int val, uint16_t *buf, size_t size)
112{
113 while (size--)
114 *buf++ = val;
115}
116#define fillw_io(p, d, c) fillw((p), (void *)(d), (c))
117
95#else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */
96#define bcopy_io(s, d, c) memcpy_io((d), (s), (c))
97#define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c))
98#define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c))
99#define bzero_io(d, c) memset_io((d), 0, (c))
100#define fill_io(p, d, c) memset_io((d), (p), (c))
101#define fillw(p, d, c) memsetw((d), (p), (c))
102#define fillw_io(p, d, c) memsetw_io((d), (p), (c))

--- 233 unchanged lines hidden ---
118#else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */
119#define bcopy_io(s, d, c) memcpy_io((d), (s), (c))
120#define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c))
121#define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c))
122#define bzero_io(d, c) memset_io((d), 0, (c))
123#define fill_io(p, d, c) memset_io((d), (p), (c))
124#define fillw(p, d, c) memsetw((d), (p), (c))
125#define fillw_io(p, d, c) memsetw_io((d), (p), (c))

--- 233 unchanged lines hidden ---