Skip to content

Commit

Permalink
Fixed some warnings that were generated when compiling for BBB or QEMU.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswailes committed Oct 10, 2016
1 parent 5ca850f commit 038daa5
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 31 deletions.
12 changes: 6 additions & 6 deletions compile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ $(error PLATFORM is not set. Edit your Makedefs file and add 'PLATFORM=arm-qemu'
endif

ifeq ($(PLATFORM),arm-qemu)
PLAT_CFLAGS = -DARM_QEMU -mcpu=arm1176jz-s -ggdb3
PLAT_CFLAGS = -DARM_QEMU -mcpu=arm1176jz-s -ggdb3
PLAT_LOADADDR = 0x00010000
else ifeq ($(PLATFORM),arm-bbb)
PLAT_CFLAGS = -DARM_BBB -mcpu=cortex-a8
PLAT_CFLAGS = -DARM_BBB -mcpu=cortex-a8
PLAT_LOADADDR = 0x81000000
else ifeq ($(PLATFORM),x86-galileo)
PLAT_CFLAGS =
PLAT_CFLAGS =
endif

TOPDIR = ..
Expand Down Expand Up @@ -56,7 +56,7 @@ REBUILDFLAGS += -s $(TOPDIR)/device/tty \
-s $(TOPDIR)/device/lfs \
-s $(TOPDIR)/device/uart \
-s $(TOPDIR)/device/uart-pl011 \
-s $(TOPDIR)/device/loopback
-s $(TOPDIR)/device/loopback

else ifeq ($(PLATFORM),arm-bbb)
REBUILDFLAGS += -s $(TOPDIR)/device/tty \
Expand Down Expand Up @@ -138,7 +138,7 @@ uboot-tool/mkimage: uboot-tool/mkimage.c
@echo making mkimage
@(cd uboot-tool; make)

$(BLDDIRS):
$(BLDDIRS):
@mkdir -p $(BLDDIRS)

objects: $(LD_LIST)
Expand Down Expand Up @@ -179,7 +179,7 @@ etags:
@(cd $(TOPDIR); find . -name '*.[chS]' -exec etags -a {} \;)

qemu: xinu
export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav; qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot
export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav; qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot

qemu-gdb: xinu
export QEMU_AUDIO_DRV=wav; export QEMU_WAV_PATH=$(TOPDIR)/compile/.wav.wav;qemu-system-arm -M versatilepb -m 512M -nographic -cpu arm1176 -kernel xinu.boot -S -gdb tcp::${GPORT}
Expand Down
9 changes: 6 additions & 3 deletions device/rds/rdsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ devcall rdsinit (
struct rdscblk *rdptr; /* Ptr to device contol block */
struct rdbuff *bptr; /* Ptr to buffer in memory */
/* used to form linked list */
struct rdbuff *pptr; /* Ptr to previous buff on list */
struct rdbuff *pptr = NULL; /* Ptr to previous buff on list */
struct rdbuff *buffend; /* Last address in buffer memory*/
uint32 size; /* Total size of memory needed */
/* buffers */
Expand All @@ -28,7 +28,7 @@ devcall rdsinit (

rdptr->rd_state = RD_FREE;
rdptr->rd_id[0] = NULLCH;

/* Set initial message sequence number */

rdptr->rd_seq = 1;
Expand Down Expand Up @@ -68,7 +68,10 @@ devcall rdsinit (
pptr->rd_status = RD_INVALID; /* Buffer is empty */
pptr->rd_next = bptr; /* Point to next buffer */
}
pptr->rd_next = (struct rdbuff *) NULL; /* Last buffer on list */

if (pptr != NULL) {
pptr->rd_next = (struct rdbuff *) NULL; /* Last buffer on list */
}

/* Create the request list and available buffer semaphores */

Expand Down
4 changes: 0 additions & 4 deletions device/rfs/rflputc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ devcall rflputc(
char ch /* Character to write */
)
{
struct rflcblk *rfptr; /* Pointer to rfl control block */

rfptr = &rfltab[devptr->dvminor];

if (rflwrite(devptr, &ch, 1) != 1) {
return SYSERR;
}
Expand Down
1 change: 0 additions & 1 deletion device/rfs/rfscomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ int32 rfscomm (
int32 retval; /* Return value */
int32 seq; /* Sequence for this exchange */
int16 rtype; /* Reply type in host byte order*/
int32 slot; /* UDP slot */

/* For the first time after reboot, register the server port */

Expand Down
8 changes: 5 additions & 3 deletions device/uart/kvprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <stdarg.h>
#include <stdio.h>

void _doprnt(const char *, va_list, int (*)(int, int), int);
int kputc(int, int);

/**
* @ingroup uartgeneric
*
Expand All @@ -26,14 +29,13 @@
*/
syscall kvprintf(const char *format, va_list ap)
{
int retval;
intmask im;

/* Note: it isn't strictly necessary to disable global interrupts here, but
* it prevents kprintf()'s from stepping on each other toes if you happen to
* call kprintf() from an interrupt handler. */
im = disable();
retval = _doprnt(format, ap, (int (*)(int, int))kputc, (int)&devtab[SERIAL0]);
_doprnt(format, ap, (int (*)(int, int))kputc, (int)&devtab[SERIAL0]);
restore(im);
return retval;
return OK;
}
2 changes: 2 additions & 0 deletions include/dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ struct dns_rr {
uint16 *rdlen; /* RR RD Length */
char *rdata; /* RR Data */
};

uint32 dns_qa(char* dname);
2 changes: 2 additions & 0 deletions include/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ void restore(intmask);
void enable_irq(intmask);
void disable_irq(intmask);

int32 initintc(void);

#define INTC_SYSCONFIG_SOFTRESET 0x00000002
#define INTC_SYSSTATUS_RESETDONE 0x00000001

Expand Down
1 change: 0 additions & 1 deletion include/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ extern qid16 readylist; /* global ID for list of ready processes*/
/* Size of the stack for the null process */

#define NULLSTK 8192 /* stack size for null process */

9 changes: 8 additions & 1 deletion include/prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ extern syscall getc(did32);
/* in file getitem.c */
extern pid32 getfirst(qid16);

pid32 getitem(pid32);

/* in file getmem.c */
extern char *getmem(uint32);

Expand Down Expand Up @@ -365,6 +367,11 @@ extern syscall ptsend(int32, umsg32);
/* in file putc.c */
extern syscall putc(did32, char);

/* in file queue.c */

pid32 dequeue(qid16);
pid32 enqueue(pid32, qid16);

/* in file ramclose.c */
extern devcall ramclose(struct dentry *);

Expand Down Expand Up @@ -629,7 +636,7 @@ devcall loopbackGetc(struct dentry *);
devcall loopbackPutc(struct dentry *, char);
devcall loopbackControl(struct dentry *, int, long, long);

syscall kputc(uchar c, struct dentry *devptr);
syscall kprintf(char *fmt, ...);
#endif /* ARM_QEMU */

#ifdef ARM_BBB
Expand Down
3 changes: 2 additions & 1 deletion include/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ extern int32 strncmp(const char *, const char *, int32);
extern char *strchr(const char *, int32);
extern char *strrchr(const char *, int32);
extern char *strstr(const char *, const char *);
extern int32 strnlen(const char *, uint32);
extern int32 strnlen(const char *, uint32);
extern int strlen(char *str);
int strcpy(char *tar, char *src);
3 changes: 1 addition & 2 deletions lib/doscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static int _innum(int **ptr, int type, int len, int size,
register char *np;
char numbuf[64];
register char c, base;
int expseen, negflg, c1, ndigit;
int negflg, c1, ndigit;
long lcval;

if (type == 'c' || type == 's' || type == '[')
Expand All @@ -181,7 +181,6 @@ static int _innum(int **ptr, int type, int len, int size,
base = 16;
}
np = numbuf;
expseen = 0;
negflg = 0;
while ((c = (*getch) (arg1, arg2)) == ' ' || c == '\t' || c == '\n')
{;
Expand Down
6 changes: 3 additions & 3 deletions shell/xsh_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include <stdio.h>

void function1(){
int *num = 0x10900000;
int *num = (int*)0x10900000;
*num = 300;
printf("[process ID=%d]Value at address 0x%x is %d\n",currpid,num,*num);
}

shellcmd xsh_mmu(int32 args,char *argv[]) {
int *num = 0x10900000;
int *num1 = 0x11C00000;
int *num = (int*)0x10900000;
int *num1 = (int*)0x11C00000;
*num = 100;
*num1 = 200;
printf("[process ID=%d]Value at address 0x%x is %d\n",currpid,num,*num);
Expand Down
4 changes: 2 additions & 2 deletions system/evec.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ void irq_dispatch()

/* If a handler is set for the interrupt, call it */

if(intc_vector[xnum]) {
handler = intc_vector[xnum];
if (intc_vector[xnum]) {
handler = (interrupt(*)(void))intc_vector[xnum];
handler(xnum);
}

Expand Down
2 changes: 1 addition & 1 deletion system/platform/arm-bbb/clkhandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void clkhandler()
{

static uint32 count1000 = 1000; /* variable to count 1000ms */
volatile struct am335x_timer1ms *csrptr = 0x44E31000;
volatile struct am335x_timer1ms *csrptr = (struct am335x_timer1ms *)0x44E31000;
/* Pointer to timer CSR */

/* If there is no interrupt, return */
Expand Down
1 change: 1 addition & 0 deletions system/platform/arm-bbb/xsh_ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <xinu.h>
#include <stdio.h>
#include <string.h>
#include <dns.h>

/*------------------------------------------------------------------------
* xsh_ping - shell command to ping a remote host
Expand Down
3 changes: 0 additions & 3 deletions system/platform/arm-qemu/gettime.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ status gettime(
uint32 *timvar /* Location to store the result */
)
{
uint32 now; /* Current time (UCT) */
int32 retval; /* Return value from call */

/* Get current time in UCT representation (GMT) */

//retval = getutime(&now);
Expand Down
2 changes: 2 additions & 0 deletions system/platform/arm-qemu/kprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <kernel.h>
#include <stdarg.h>

syscall kvprintf(const char *format, va_list ap);

/**
* @ingroup uartgeneric
*
Expand Down

0 comments on commit 038daa5

Please sign in to comment.