2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Access to VGA videoram
|
|
|
|
*
|
|
|
|
* (c) 1998 Martin Mares <mj@ucw.cz>
|
|
|
|
*/
|
|
|
|
|
2008-10-23 05:26:29 +00:00
|
|
|
#ifndef _ASM_X86_VGA_H
|
|
|
|
#define _ASM_X86_VGA_H
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2017-07-17 21:10:26 +00:00
|
|
|
#include <asm/set_memory.h>
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* On the PC, we can just recalculate addresses and then
|
|
|
|
* access the videoram directly without any black magic.
|
2017-07-17 21:10:26 +00:00
|
|
|
* To support memory encryption however, we need to access
|
|
|
|
* the videoram as decrypted memory.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
|
2017-07-17 21:10:26 +00:00
|
|
|
#define VGA_MAP_MEM(x, s) \
|
|
|
|
({ \
|
|
|
|
unsigned long start = (unsigned long)phys_to_virt(x); \
|
|
|
|
\
|
|
|
|
if (IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT)) \
|
|
|
|
set_memory_decrypted(start, (s) >> PAGE_SHIFT); \
|
|
|
|
\
|
|
|
|
start; \
|
|
|
|
})
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define vga_readb(x) (*(x))
|
2008-03-23 08:03:57 +00:00
|
|
|
#define vga_writeb(x, y) (*(y) = (x))
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-10-23 05:26:29 +00:00
|
|
|
#endif /* _ASM_X86_VGA_H */
|