Author: blueswirl
Date: 2008-12-20 19:36:23 +0100 (Sat, 20 Dec 2008)
New Revision: 296
Modified:
openbios-devel/arch/sparc64/boot.h
openbios-devel/arch/sparc64/openbios.c
openbios-devel/drivers/cuda.c
openbios-devel/drivers/cuda.h
openbios-devel/drivers/floppy.c
openbios-devel/drivers/vga_load_regs.c
openbios-devel/include/openbios/stack.h
openbios-devel/include/sparc32/types.h
openbios-devel/kernel/bootstrap.c
openbios-devel/kernel/include/dict.h
openbios-devel/kernel/internal.c
openbios-devel/modules/font_8x16.c
Log:
Fix Sparse warnings
Modified: openbios-devel/arch/sparc64/boot.h
===================================================================
--- openbios-devel/arch/sparc64/boot.h 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/arch/sparc64/boot.h 2008-12-20 18:36:23 UTC (rev 296)
@@ -22,6 +22,7 @@
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 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);
Modified: openbios-devel/arch/sparc64/openbios.c
===================================================================
--- openbios-devel/arch/sparc64/openbios.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/arch/sparc64/openbios.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -44,7 +44,7 @@
#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 @@
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 @@
}
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;
Modified: openbios-devel/drivers/cuda.c
===================================================================
--- openbios-devel/drivers/cuda.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/drivers/cuda.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -156,7 +156,6 @@
static void
ob_cuda_initialize (int *idx)
{
- extern phandle_t pic_handle;
phandle_t ph=get_cur_dev();
int props[2];
Modified: openbios-devel/drivers/cuda.h
===================================================================
--- openbios-devel/drivers/cuda.h 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/drivers/cuda.h 2008-12-20 18:36:23 UTC (rev 296)
@@ -14,5 +14,6 @@
CHARDEV_LAST,
};
+extern phandle_t pic_handle;
cuda_t *cuda_init (const char *path, uint32_t base);
Modified: openbios-devel/drivers/floppy.c
===================================================================
--- openbios-devel/drivers/floppy.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/drivers/floppy.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -194,11 +194,11 @@
/*
* 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 */
Modified: openbios-devel/drivers/vga_load_regs.c
===================================================================
--- openbios-devel/drivers/vga_load_regs.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/drivers/vga_load_regs.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -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 @@
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.
Modified: openbios-devel/include/openbios/stack.h
===================================================================
--- openbios-devel/include/openbios/stack.h 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/include/openbios/stack.h 2008-12-20 18:36:23 UTC (rev 296)
@@ -69,7 +69,7 @@
return du;
#else
ducell du;
- du = ((ducell) ((ucell) dstack[dstackcnt--]) << bitspercell);
+ du = ((ducell)(ucell) dstack[dstackcnt--]) << bitspercell;
du |= (ucell) dstack[dstackcnt--];
return du;
#endif
Modified: openbios-devel/include/sparc32/types.h
===================================================================
--- openbios-devel/include/sparc32/types.h 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/include/sparc32/types.h 2008-12-20 18:36:23 UTC (rev 296)
@@ -32,8 +32,8 @@
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)
Modified: openbios-devel/kernel/bootstrap.c
===================================================================
--- openbios-devel/kernel/bootstrap.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/kernel/bootstrap.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -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 @@
include *next;
};
-include includes = { ".", NULL };
+static include includes = { ".", NULL };
static ucell * relocation_address=NULL;
static int relocation_length=0;
@@ -1074,7 +1074,7 @@
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");
Modified: openbios-devel/kernel/include/dict.h
===================================================================
--- openbios-devel/kernel/include/dict.h 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/kernel/include/dict.h 2008-12-20 18:36:23 UTC (rev 296)
@@ -44,5 +44,8 @@
extern unsigned char *dict;
extern cell dicthead;
extern ucell *last;
+#ifdef FCOMPILER
+extern ucell *trampoline;
+#endif
#endif
Modified: openbios-devel/kernel/internal.c
===================================================================
--- openbios-devel/kernel/internal.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/kernel/internal.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -17,9 +17,7 @@
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.
*/
Modified: openbios-devel/modules/font_8x16.c
===================================================================
--- openbios-devel/modules/font_8x16.c 2008-12-20 17:29:20 UTC (rev 295)
+++ openbios-devel/modules/font_8x16.c 2008-12-20 18:36:23 UTC (rev 296)
@@ -4621,73 +4621,3 @@
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
-};