mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Clean up video routines
git-svn-id: svn://coreboot.org/openbios/openbios-devel@343 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -231,8 +231,9 @@
|
||||
</object>
|
||||
<external-object source="libqemu.a"/>
|
||||
<external-object source="libbootstrap.a"/>
|
||||
<external-object source="libmodules.a"/>
|
||||
<external-object source="libdrivers.a"/>
|
||||
<!-- Needs to be after drivers to avoid missing symbols -->
|
||||
<external-object source="libmodules.a"/>
|
||||
<external-object source="liblibc.a"/>
|
||||
<external-object source="libfs.a"/>
|
||||
<external-object source="libgcc.a"/>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "libc/diskio.h"
|
||||
#include "ofmem.h"
|
||||
#include "qemu/qemu.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_CONSOLE
|
||||
|
||||
@@ -125,14 +126,6 @@ static void serial_cls(void)
|
||||
}
|
||||
#endif // CONFIG_DEBUG_CONSOLE_SERIAL
|
||||
|
||||
typedef struct osi_fb_info {
|
||||
unsigned long mphys;
|
||||
int rb, w, h, depth;
|
||||
} osi_fb_info_t;
|
||||
|
||||
#include "../../../modules/video.c"
|
||||
#include "../../../modules/console.c"
|
||||
|
||||
/* ******************************************************************
|
||||
* common functions, implementing simple concurrent console
|
||||
* ****************************************************************** */
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "openbios/kernel.h"
|
||||
#include "openbios/drivers.h"
|
||||
#include "openbios.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG_CONSOLE
|
||||
|
||||
@@ -24,15 +25,7 @@
|
||||
#define DAC_SIZE 16
|
||||
|
||||
unsigned char *vmem;
|
||||
static volatile uint32_t *dac;
|
||||
|
||||
typedef struct osi_fb_info {
|
||||
unsigned long mphys;
|
||||
int rb, w, h, depth;
|
||||
} osi_fb_info_t;
|
||||
|
||||
#include "../../modules/video.c"
|
||||
#include "../../modules/console.c"
|
||||
volatile uint32_t *dac;
|
||||
|
||||
static void video_putchar(int c)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "sys_info.h"
|
||||
#include "openbios.h"
|
||||
#include "boot.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
int qemu_machine_type;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "libc/vsprintf.h"
|
||||
#define NO_QEMU_PROTOS
|
||||
#include "openbios/fw_cfg.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
#define BIOS_CFG_CMD 0x510
|
||||
#define BIOS_CFG_DATA 0x511
|
||||
|
||||
@@ -13,18 +13,6 @@
|
||||
|
||||
#include "openbios/config.h"
|
||||
|
||||
/* modules/video.c */
|
||||
int video_get_res(int *w, int *h);
|
||||
void draw_pixel(int x, int y, int colind);
|
||||
void set_color(int ind, ulong color);
|
||||
void video_scroll(int height);
|
||||
void init_video(unsigned long fb, int width, int height, int depth, int rb);
|
||||
|
||||
/* modules/console.c */
|
||||
int console_draw_str(const char *str);
|
||||
void console_close(void);
|
||||
void cls(void);
|
||||
|
||||
#ifdef CONFIG_DRIVER_PCI
|
||||
/* drivers/pci.c */
|
||||
int ob_pci_init(void);
|
||||
|
||||
@@ -15,4 +15,19 @@ void vga_vbe_set_mode(int width, int height, int depth);
|
||||
void vga_vbe_init(const char *path, uint32_t fb, uint32_t fb_size,
|
||||
unsigned long rom, uint32_t rom_size);
|
||||
|
||||
/* modules/video.c */
|
||||
int video_get_res(int *w, int *h);
|
||||
void draw_pixel(int x, int y, int colind);
|
||||
void set_color(int ind, unsigned long color);
|
||||
void video_scroll(int height);
|
||||
void init_video(unsigned long fb, int width, int height, int depth, int rb);
|
||||
|
||||
/* modules/console_common.c */
|
||||
int console_draw_str(const char *str);
|
||||
int console_init(void);
|
||||
void console_close(void);
|
||||
void cls(void);
|
||||
|
||||
extern volatile uint32_t *dac;
|
||||
|
||||
#endif /* VIDEO_SUBR_H */
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
<object source="bindings.c"/>
|
||||
<object source="client.c"/>
|
||||
<object source="ipchecksum.c"/>
|
||||
<object source="video.c"/>
|
||||
<object source="console_common.c"/>
|
||||
<object source="elfnote.c" condition="X86"/>
|
||||
<object source="elfnote.c" condition="AMD64"/>
|
||||
<object source="elfnote.c" condition="SPARC32"/>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "openbios/config.h"
|
||||
#include "openbios/bindings.h"
|
||||
#include "openbios/fontdata.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
#if !defined(fontdata)
|
||||
#if defined(CONFIG_FONT_8X8)
|
||||
@@ -125,7 +126,7 @@ refresh( void )
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
int
|
||||
console_init( void )
|
||||
{
|
||||
if( video_get_res(&cons.physw,&cons.physh) < 0 )
|
||||
@@ -21,6 +21,11 @@
|
||||
#include "openbios/drivers.h"
|
||||
#include "video_subr.h"
|
||||
|
||||
typedef struct osi_fb_info {
|
||||
unsigned long mphys;
|
||||
int rb, w, h, depth;
|
||||
} osi_fb_info_t;
|
||||
|
||||
static struct {
|
||||
int has_video;
|
||||
osi_fb_info_t fb;
|
||||
|
||||
Reference in New Issue
Block a user