include, kernel: minor fixes to make compiling and linking work with clang.

(fixing warnings)
This commit is contained in:
Ben Gras 2010-07-06 11:59:19 +00:00
parent dc47875fc7
commit f6f814cb02
12 changed files with 21 additions and 19 deletions

View file

@ -44,7 +44,7 @@ _PROTOTYPE( int fkey_ctl, (int req, int *fkeys, int *sfkeys) );
_PROTOTYPE( int printf, (const char *fmt, ...));
_PROTOTYPE( void kputc, (int c));
_PROTOTYPE( void panic, (const char *fmt, ...));
_PROTOTYPE( __dead void panic, (const char *fmt, ...));
_PROTOTYPE( int getuptime, (clock_t *ticks));
_PROTOTYPE( int getuptime2, (clock_t *ticks, time_t *boottime));
_PROTOTYPE( int tickdelay, (clock_t ticks));

View file

@ -66,8 +66,10 @@ _PROTOTYPE( struct tm *localtime_r, (const time_t *const timep,
struct tm *tmp) );
_PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
const struct tm *_timep) );
_PROTOTYPE(char *strptime, (const char *buf, const char *format,
_PROTOTYPE( char *strptime, (const char *buf, const char *format,
struct tm *timeptr) );
_PROTOTYPE( time_t timegm, (struct tm * const tmp) );
#ifdef _POSIX_SOURCE
_PROTOTYPE( void tzset, (void) );

View file

@ -17,7 +17,7 @@ LDFLAGS+= -.o
.elif ${COMPILER_TYPE} == "gnu"
CPPFLAGS+= -fno-builtin -ffreestanding -fno-stack-protector
LDFLAGS+= -T arch/${ARCH}/kernel.lds
LDFLAGS+= -nostdlib
LDFLAGS+= -nostdlib -L/usr/gnu/lib
DPADD+= ${LIBC}
LDADD+= -lc
.endif

View file

@ -298,7 +298,7 @@ PRIVATE int lapic_enable(void)
val |= APIC_ENABLE | APIC_SPURIOUS_INT_VECTOR;
val &= ~APIC_FOCUS_DISABLED;
lapic_write(LAPIC_SIVR, val);
lapic_read(LAPIC_SIVR);
(void) lapic_read(LAPIC_SIVR);
*((u32_t *)lapic_eoi_addr) = 0;
@ -337,7 +337,7 @@ PRIVATE int lapic_enable(void)
/* accept all interrupts */
lapic_write (LAPIC_TPR, val & ~0xFF);
lapic_read (LAPIC_SIVR);
(void) lapic_read (LAPIC_SIVR);
*((u32_t *)lapic_eoi_addr) = 0;
apic_calibrate_clocks();

View file

@ -39,14 +39,14 @@ PRIVATE int osfxsr_feature; /* FXSAVE/FXRSTOR instructions support (SSEx) */
FORWARD _PROTOTYPE( void ser_debug, (int c));
PUBLIC void arch_monitor(void)
PUBLIC __dead void arch_monitor(void)
{
monitor();
}
PUBLIC int cpu_has_tsc;
PUBLIC void arch_shutdown(const int how)
PUBLIC __dead void arch_shutdown(const int how)
{
vm_stop();

View file

@ -77,7 +77,7 @@ int arch_watchdog_init(void)
/* Setup PC tas NMI for watchdog, is is masked for now */
lapic_write(LAPIC_LVTPCR, APIC_ICR_INT_MASK | APIC_ICR_DM_NMI);
lapic_read(LAPIC_LVTPCR);
(void) lapic_read(LAPIC_LVTPCR);
/* double check if LAPIC is enabled */
if (lapic_addr && watchdog_enabled && watchdog->init) {

View file

@ -66,8 +66,8 @@ struct exception_frame {
_PROTOTYPE( void exception, (struct exception_frame * frame));
/* klib386.s */
_PROTOTYPE( void monitor, (void) );
_PROTOTYPE( void reset, (void) );
_PROTOTYPE( __dead void monitor, (void) );
_PROTOTYPE( __dead void reset, (void) );
_PROTOTYPE( void int86, (void) );
_PROTOTYPE( reg_t read_cr0, (void) );
_PROTOTYPE( reg_t read_cr2, (void) );

View file

@ -36,7 +36,7 @@ _PROTOTYPE( void fpu_sigcontext, (struct proc *, struct sigframe *fr, struct sig
/* main.c */
_PROTOTYPE( void main, (void) );
_PROTOTYPE( void prepare_shutdown, (int how) );
_PROTOTYPE( void minix_shutdown, (struct timer *tp) );
_PROTOTYPE( __dead void minix_shutdown, (struct timer *tp) );
/* proc.c */
@ -166,8 +166,8 @@ _PROTOTYPE( int intr_init, (int, int) );
_PROTOTYPE( void halt_cpu, (void) );
_PROTOTYPE( void arch_init, (void) );
_PROTOTYPE( void ser_putc, (char) );
_PROTOTYPE( void arch_shutdown, (int) );
_PROTOTYPE( void arch_monitor, (void) );
_PROTOTYPE( __dead void arch_shutdown, (int) );
_PROTOTYPE( __dead void arch_monitor, (void) );
_PROTOTYPE( void arch_get_aout_headers, (int i, struct exec *h) );
_PROTOTYPE( void restore_user_context, (struct proc * p) );
_PROTOTYPE( void read_tsc, (unsigned long *high, unsigned long *low) );

View file

@ -348,7 +348,7 @@ PUBLIC void send_sig(endpoint_t proc_nr, int sig_nr)
panic("send_sig to empty process: %d", proc_nr);
rp = proc_addr(proc_nr);
sigaddset(&priv(rp)->s_sig_pending, sig_nr);
(void) sigaddset(&priv(rp)->s_sig_pending, sig_nr);
mini_notify(proc_addr(SYSTEM), rp->p_endpoint);
}
@ -386,14 +386,14 @@ int sig_nr; /* signal to be sent */
panic("cause_sig: signal manager gets lethal signal %d for itself",
sig_nr);
}
sigaddset(&priv(rp)->s_sig_pending, sig_nr);
(void) sigaddset(&priv(rp)->s_sig_pending, sig_nr);
send_sig(rp->p_endpoint, SIGKSIGSM);
return;
}
/* Check if the signal is already pending. Process it otherwise. */
if (! sigismember(&rp->p_pending, sig_nr)) {
sigaddset(&rp->p_pending, sig_nr);
(void) sigaddset(&rp->p_pending, sig_nr);
if (! (RTS_ISSET(rp, RTS_SIGNALED))) { /* other pending */
RTS_SET(rp, RTS_SIGNALED | RTS_SIG_PENDING);
send_sig(sig_mgr, SIGKSIG);

View file

@ -117,7 +117,7 @@ PUBLIC int do_fork(struct proc * caller, message * m_ptr)
* Only one in group should have RTS_SIGNALED, child doesn't inherit tracing.
*/
RTS_UNSET(rpc, (RTS_SIGNALED | RTS_SIG_PENDING | RTS_P_STOP));
sigemptyset(&rpc->p_pending);
(void) sigemptyset(&rpc->p_pending);
rpc->p_seg.p_cr3 = 0;
rpc->p_seg.p_cr3_v = NULL;

View file

@ -30,7 +30,7 @@ PUBLIC int do_getksig(struct proc * caller, message * m_ptr)
/* store signaled process' endpoint */
m_ptr->SIG_ENDPT = rp->p_endpoint;
m_ptr->SIG_MAP = rp->p_pending; /* pending signals map */
sigemptyset(&rp->p_pending); /* clear map in the kernel */
(void) sigemptyset(&rp->p_pending); /* clear map in the kernel */
RTS_UNSET(rp, RTS_SIGNALED); /* blocked by SIG_PENDING */
return(OK);
}

View file

@ -98,7 +98,7 @@ PUBLIC int do_privctl(struct proc * caller, message * m_ptr)
for (i=0; i< NR_SYS_CHUNKS; i++) /* remove pending: */
priv(rp)->s_notify_pending.chunk[i] = 0; /* - notifications */
priv(rp)->s_int_pending = 0; /* - interrupts */
sigemptyset(&priv(rp)->s_sig_pending); /* - signals */
(void) sigemptyset(&priv(rp)->s_sig_pending); /* - signals */
reset_timer(&priv(rp)->s_alarm_timer); /* - alarm */
priv(rp)->s_asyntab= -1; /* - asynsends */
priv(rp)->s_asynsize= 0;