mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Fix Sparse warnings
git-svn-id: svn://coreboot.org/openbios/openbios-devel@296 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -22,6 +22,7 @@ int linux_load(struct sys_info *info, const char *file, const char *cmdline);
|
||||
int fcode_load(const char *filename);
|
||||
|
||||
// context.c
|
||||
extern struct context *__context;
|
||||
uint64_t start_elf(uint64_t entry_point, uint64_t param);
|
||||
|
||||
// boot.c
|
||||
@@ -33,5 +34,8 @@ extern uint64_t cmdline_size;
|
||||
extern char boot_device;
|
||||
void boot(void);
|
||||
|
||||
// sys_info.c
|
||||
extern unsigned int qemu_mem_size;
|
||||
|
||||
// console.c
|
||||
void ob_su_init(uint64_t base, uint64_t offset, int intr);
|
||||
|
||||
@@ -44,7 +44,7 @@ static unsigned char intdict[256 * 1024];
|
||||
#define NVRAM_OB_START (sizeof(ohwcfg_v3_t) + sizeof(struct sparc_arch_cfg))
|
||||
#define NVRAM_OB_SIZE ((NVRAM_IDPROM - NVRAM_OB_START) & ~15)
|
||||
|
||||
ohwcfg_v3_t nv_info;
|
||||
static ohwcfg_v3_t nv_info;
|
||||
|
||||
#define OBIO_CMDLINE_MAX 256
|
||||
static char obio_cmdline[OBIO_CMDLINE_MAX];
|
||||
@@ -105,7 +105,7 @@ spitfire_translate(unsigned long virt, unsigned long *p_phys,
|
||||
|
||||
for (i = 0; i < 64; i++) {
|
||||
data = spitfire_get_dtlb_data(i);
|
||||
if (data & 0x8000000000000000) { // Valid entry?
|
||||
if (data & 0x8000000000000000ULL) { // Valid entry?
|
||||
switch ((data >> 61) & 3) {
|
||||
default:
|
||||
case 0x0: // 8k
|
||||
@@ -127,7 +127,7 @@ spitfire_translate(unsigned long virt, unsigned long *p_phys,
|
||||
}
|
||||
tag = spitfire_get_dtlb_tag(i);
|
||||
if ((virt & mask) == (tag & mask)) {
|
||||
phys = data & mask & 0x000001fffffff000;
|
||||
phys = data & mask & 0x000001fffffff000ULL;
|
||||
phys |= virt & ~mask;
|
||||
*p_phys = phys;
|
||||
*p_data = data & 0xfff;
|
||||
|
||||
@@ -156,7 +156,6 @@ DECLARE_UNNAMED_NODE(ob_cuda, INSTALL_OPEN, sizeof(int));
|
||||
static void
|
||||
ob_cuda_initialize (int *idx)
|
||||
{
|
||||
extern phandle_t pic_handle;
|
||||
phandle_t ph=get_cur_dev();
|
||||
int props[2];
|
||||
|
||||
|
||||
@@ -14,5 +14,6 @@ enum {
|
||||
CHARDEV_LAST,
|
||||
};
|
||||
|
||||
extern phandle_t pic_handle;
|
||||
|
||||
cuda_t *cuda_init (const char *path, uint32_t base);
|
||||
|
||||
@@ -194,11 +194,11 @@ DECLARE_UNNAMED_NODE( ob_floppy, INSTALL_OPEN, 2*sizeof(int) );
|
||||
/*
|
||||
* FDC state
|
||||
*/
|
||||
struct drive_state {
|
||||
static struct drive_state {
|
||||
unsigned track;
|
||||
} drive_state[1];
|
||||
|
||||
struct floppy_fdc_state {
|
||||
static struct floppy_fdc_state {
|
||||
int in_sync;
|
||||
int spec1; /* spec1 value last used */
|
||||
int spec2; /* spec2 value last used */
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
static int vga_decode_var(const struct screeninfo *var, struct vga_par *par);
|
||||
static int vga_set_regs(const struct vga_par *par);
|
||||
|
||||
extern const u8 VgaLookupTable[];
|
||||
|
||||
u8 read_seq_b(u16 addr) {
|
||||
outb(addr,SEQ_I);
|
||||
return inb(SEQ_D);
|
||||
@@ -322,6 +320,77 @@ static int vga_decode_var(const struct screeninfo *var,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// originally from the stpc web site
|
||||
//
|
||||
static const unsigned char VgaLookupTable[3 * 0x3f + 3] = {
|
||||
// Red Green Blue
|
||||
0x000, 0x000, 0x000, // 00h
|
||||
0x000, 0x000, 0x02A, // 01h
|
||||
0x000, 0x02A, 0x000, // 02h
|
||||
0x000, 0x02A, 0x02A, // 03h
|
||||
0x02A, 0x000, 0x000, // 04h
|
||||
0x02A, 0x000, 0x02A, // 05h
|
||||
0x02A, 0x02A, 0x000, // 06h
|
||||
0x02A, 0x02A, 0x02A, // 07h
|
||||
0x000, 0x000, 0x015, // 08h
|
||||
0x000, 0x000, 0x03F, // 09h
|
||||
0x000, 0x02A, 0x015, // 0Ah
|
||||
0x000, 0x02A, 0x03F, // 0Bh
|
||||
0x02A, 0x000, 0x015, // 0Ch
|
||||
0x02A, 0x000, 0x03F, // 0Dh
|
||||
0x02A, 0x02A, 0x015, // 0Eh
|
||||
0x02A, 0x02A, 0x03F, // 0Fh
|
||||
0x000, 0x015, 0x000, // 10h
|
||||
0x000, 0x015, 0x02A, // 11h
|
||||
0x000, 0x03F, 0x000, // 12h
|
||||
0x000, 0x03F, 0x02A, // 13h
|
||||
0x02A, 0x015, 0x000, // 14h
|
||||
0x02A, 0x015, 0x02A, // 15h
|
||||
0x02A, 0x03F, 0x000, // 16h
|
||||
0x02A, 0x03F, 0x02A, // 17h
|
||||
0x000, 0x015, 0x015, // 18h
|
||||
0x000, 0x015, 0x03F, // 19h
|
||||
0x000, 0x03F, 0x015, // 1Ah
|
||||
0x000, 0x03F, 0x03F, // 1Bh
|
||||
0x02A, 0x015, 0x015, // 1Ch
|
||||
0x02A, 0x015, 0x03F, // 1Dh
|
||||
0x02A, 0x03F, 0x015, // 1Eh
|
||||
0x02A, 0x03F, 0x03F, // 1Fh
|
||||
0x015, 0x000, 0x000, // 20h
|
||||
0x015, 0x000, 0x02A, // 21h
|
||||
0x015, 0x02A, 0x000, // 22h
|
||||
0x015, 0x02A, 0x02A, // 23h
|
||||
0x03F, 0x000, 0x000, // 24h
|
||||
0x03F, 0x000, 0x02A, // 25h
|
||||
0x03F, 0x02A, 0x000, // 26h
|
||||
0x03F, 0x02A, 0x02A, // 27h
|
||||
0x015, 0x000, 0x015, // 28h
|
||||
0x015, 0x000, 0x03F, // 29h
|
||||
0x015, 0x02A, 0x015, // 2Ah
|
||||
0x015, 0x02A, 0x03F, // 2Bh
|
||||
0x03F, 0x000, 0x015, // 2Ch
|
||||
0x03F, 0x000, 0x03F, // 2Dh
|
||||
0x03F, 0x02A, 0x015, // 2Eh
|
||||
0x03F, 0x02A, 0x03F, // 2Fh
|
||||
0x015, 0x015, 0x000, // 30h
|
||||
0x015, 0x015, 0x02A, // 31h
|
||||
0x015, 0x03F, 0x000, // 32h
|
||||
0x015, 0x03F, 0x02A, // 33h
|
||||
0x03F, 0x015, 0x000, // 34h
|
||||
0x03F, 0x015, 0x02A, // 35h
|
||||
0x03F, 0x03F, 0x000, // 36h
|
||||
0x03F, 0x03F, 0x02A, // 37h
|
||||
0x015, 0x015, 0x015, // 38h
|
||||
0x015, 0x015, 0x03F, // 39h
|
||||
0x015, 0x03F, 0x015, // 3Ah
|
||||
0x015, 0x03F, 0x03F, // 3Bh
|
||||
0x03F, 0x015, 0x015, // 3Ch
|
||||
0x03F, 0x015, 0x03F, // 3Dh
|
||||
0x03F, 0x03F, 0x015, // 3Eh
|
||||
0x03F, 0x03F, 0x03F, // 3Fh
|
||||
};
|
||||
|
||||
/*
|
||||
* From the Linux kernel.
|
||||
* orig by Ben Pfaff and Petr Vandrovec.
|
||||
|
||||
@@ -69,7 +69,7 @@ static inline ducell DPOP(void) {
|
||||
return du;
|
||||
#else
|
||||
ducell du;
|
||||
du = ((ducell) ((ucell) dstack[dstackcnt--]) << bitspercell);
|
||||
du = ((ducell)(ucell) dstack[dstackcnt--]) << bitspercell;
|
||||
du |= (ucell) dstack[dstackcnt--];
|
||||
return du;
|
||||
#endif
|
||||
|
||||
@@ -32,8 +32,8 @@ typedef long long int64_t;
|
||||
|
||||
typedef int32_t cell;
|
||||
typedef uint32_t ucell;
|
||||
typedef int64_t dcell;
|
||||
typedef uint64_t ducell;
|
||||
typedef long long dcell;
|
||||
typedef unsigned long long ducell;
|
||||
|
||||
#define bitspercell (sizeof(cell)<<3)
|
||||
#define bitsperdcell (sizeof(dcell)<<3)
|
||||
|
||||
@@ -34,14 +34,14 @@
|
||||
#define TRAMPOLINE_SIZE (4*sizeof(cell)) /* 4 cells for the trampoline */
|
||||
|
||||
/* state variables */
|
||||
ucell *latest, *state, *base;
|
||||
ucell *memory;
|
||||
static ucell *latest, *state, *base;
|
||||
static ucell *memory;
|
||||
ucell *trampoline;
|
||||
|
||||
/* local variables */
|
||||
static int errors = 0;
|
||||
static int segfault = 0;
|
||||
int verbose = 0;
|
||||
static int verbose = 0;
|
||||
|
||||
static FILE *srcfiles[128];
|
||||
static unsigned int cursrc = 0;
|
||||
@@ -57,7 +57,7 @@ struct include_path {
|
||||
include *next;
|
||||
};
|
||||
|
||||
include includes = { ".", NULL };
|
||||
static include includes = { ".", NULL };
|
||||
|
||||
static ucell * relocation_address=NULL;
|
||||
static int relocation_length=0;
|
||||
@@ -1074,7 +1074,7 @@ int main(int argc, char *argv[])
|
||||
sa.sa_sigaction = segv_handler;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = SA_SIGINFO | SA_NODEFER;
|
||||
sigaction(SIGSEGV, &sa, 0);
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
|
||||
if (verbose)
|
||||
printk("done.\n");
|
||||
|
||||
@@ -44,5 +44,8 @@ extern ucell PC;
|
||||
extern unsigned char *dict;
|
||||
extern cell dicthead;
|
||||
extern ucell *last;
|
||||
#ifdef FCOMPILER
|
||||
extern ucell *trampoline;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,9 +17,7 @@ extern void * const words[];
|
||||
ucell PC;
|
||||
volatile int runforth = 0;
|
||||
|
||||
#ifdef FCOMPILER
|
||||
extern ucell *trampoline;
|
||||
#else
|
||||
#ifndef FCOMPILER
|
||||
/* instead of pointing to an explicit 0 variable we
|
||||
* point behind the pointer.
|
||||
*/
|
||||
|
||||
@@ -4621,73 +4621,3 @@ static const unsigned char fontdata_8x16[FONTDATAMAX] = {
|
||||
0x00, /* 00000000 */
|
||||
|
||||
};
|
||||
//
|
||||
// originally from the stpc web site
|
||||
//
|
||||
const unsigned char VgaLookupTable[3 * 0x3f + 3] = {
|
||||
// Red Green Blue
|
||||
0x000, 0x000, 0x000, // 00h
|
||||
0x000, 0x000, 0x02A, // 01h
|
||||
0x000, 0x02A, 0x000, // 02h
|
||||
0x000, 0x02A, 0x02A, // 03h
|
||||
0x02A, 0x000, 0x000, // 04h
|
||||
0x02A, 0x000, 0x02A, // 05h
|
||||
0x02A, 0x02A, 0x000, // 06h
|
||||
0x02A, 0x02A, 0x02A, // 07h
|
||||
0x000, 0x000, 0x015, // 08h
|
||||
0x000, 0x000, 0x03F, // 09h
|
||||
0x000, 0x02A, 0x015, // 0Ah
|
||||
0x000, 0x02A, 0x03F, // 0Bh
|
||||
0x02A, 0x000, 0x015, // 0Ch
|
||||
0x02A, 0x000, 0x03F, // 0Dh
|
||||
0x02A, 0x02A, 0x015, // 0Eh
|
||||
0x02A, 0x02A, 0x03F, // 0Fh
|
||||
0x000, 0x015, 0x000, // 10h
|
||||
0x000, 0x015, 0x02A, // 11h
|
||||
0x000, 0x03F, 0x000, // 12h
|
||||
0x000, 0x03F, 0x02A, // 13h
|
||||
0x02A, 0x015, 0x000, // 14h
|
||||
0x02A, 0x015, 0x02A, // 15h
|
||||
0x02A, 0x03F, 0x000, // 16h
|
||||
0x02A, 0x03F, 0x02A, // 17h
|
||||
0x000, 0x015, 0x015, // 18h
|
||||
0x000, 0x015, 0x03F, // 19h
|
||||
0x000, 0x03F, 0x015, // 1Ah
|
||||
0x000, 0x03F, 0x03F, // 1Bh
|
||||
0x02A, 0x015, 0x015, // 1Ch
|
||||
0x02A, 0x015, 0x03F, // 1Dh
|
||||
0x02A, 0x03F, 0x015, // 1Eh
|
||||
0x02A, 0x03F, 0x03F, // 1Fh
|
||||
0x015, 0x000, 0x000, // 20h
|
||||
0x015, 0x000, 0x02A, // 21h
|
||||
0x015, 0x02A, 0x000, // 22h
|
||||
0x015, 0x02A, 0x02A, // 23h
|
||||
0x03F, 0x000, 0x000, // 24h
|
||||
0x03F, 0x000, 0x02A, // 25h
|
||||
0x03F, 0x02A, 0x000, // 26h
|
||||
0x03F, 0x02A, 0x02A, // 27h
|
||||
0x015, 0x000, 0x015, // 28h
|
||||
0x015, 0x000, 0x03F, // 29h
|
||||
0x015, 0x02A, 0x015, // 2Ah
|
||||
0x015, 0x02A, 0x03F, // 2Bh
|
||||
0x03F, 0x000, 0x015, // 2Ch
|
||||
0x03F, 0x000, 0x03F, // 2Dh
|
||||
0x03F, 0x02A, 0x015, // 2Eh
|
||||
0x03F, 0x02A, 0x03F, // 2Fh
|
||||
0x015, 0x015, 0x000, // 30h
|
||||
0x015, 0x015, 0x02A, // 31h
|
||||
0x015, 0x03F, 0x000, // 32h
|
||||
0x015, 0x03F, 0x02A, // 33h
|
||||
0x03F, 0x015, 0x000, // 34h
|
||||
0x03F, 0x015, 0x02A, // 35h
|
||||
0x03F, 0x03F, 0x000, // 36h
|
||||
0x03F, 0x03F, 0x02A, // 37h
|
||||
0x015, 0x015, 0x015, // 38h
|
||||
0x015, 0x015, 0x03F, // 39h
|
||||
0x015, 0x03F, 0x015, // 3Ah
|
||||
0x015, 0x03F, 0x03F, // 3Bh
|
||||
0x03F, 0x015, 0x015, // 3Ch
|
||||
0x03F, 0x015, 0x03F, // 3Dh
|
||||
0x03F, 0x03F, 0x015, // 3Eh
|
||||
0x03F, 0x03F, 0x03F, // 3Fh
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user