Root/target/linux/ubicom32/files/arch/ubicom32/include/asm/vga.h

1/*
2 * arch/ubicom32/include/asm/vga.h
3 * Ubicom32 low level VGA/frame buffer definitions.
4 *
5 * (C) Copyright 2009, Ubicom, Inc.
6 * (c) 1998 Martin Mares <mj@ucw.cz>
7 *
8 * This file is part of the Ubicom32 Linux Kernel Port.
9 *
10 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
11 * it and/or modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation, either version 2 of the
13 * License, or (at your option) any later version.
14 *
15 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 * the GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with the Ubicom32 Linux Kernel Port. If not,
22 * see <http://www.gnu.org/licenses/>.
23 *
24 * Ubicom32 implementation derived from (with many thanks):
25 * arch/m68knommu
26 * arch/blackfin
27 * arch/parisc
28 */
29
30#ifndef _ASM_UBICOM32_VGA_H
31#define _ASM_UBICOM32_VGA_H
32
33#include <asm/byteorder.h>
34
35/*
36 * On the PC, we can just recalculate addresses and then
37 * access the videoram directly without any black magic.
38 */
39
40#define VGA_MAP_MEM(x, s) (0xb0000000L + (unsigned long)(x))
41
42#define vga_readb(x) (*(x))
43#define vga_writeb(x, y) (*(y) = (x))
44
45#define VT_BUF_HAVE_RW
46/*
47 * These are only needed for supporting VGA or MDA text mode, which use little
48 * endian byte ordering.
49 * In other cases, we can optimize by using native byte ordering and
50 * <linux/vt_buffer.h> has already done the right job for us.
51 */
52
53#undef scr_writew
54#undef scr_readw
55
56static inline void scr_writew(u16 val, volatile u16 *addr)
57{
58    *addr = cpu_to_le16(val);
59}
60
61static inline u16 scr_readw(volatile const u16 *addr)
62{
63    return le16_to_cpu(*addr);
64}
65
66#define scr_memcpyw(d, s, c) memcpy(d, s, c)
67#define scr_memmovew(d, s, c) memmove(d, s, c)
68#define VT_BUF_HAVE_MEMCPYW
69#define VT_BUF_HAVE_MEMMOVEW
70
71#endif /* _ASM_UBICOM32_VGA_H */
72

Archive Download this file



interactive