Commit 2efacf83 authored by Léo Grange's avatar Léo Grange
Browse files

use static inline instead of extern inline, switch to C99 by default

parent 49eb21a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
struct process;


// extern inline void arch_kernel_contextjmp(struct _context_info *cnt)
// static inline void arch_kernel_contextjmp(struct _context_info *cnt)
//	__attribute__ ((noreturn)) ;

void arch_kernel_contextjmp(struct _context_info *cnt, struct _context_info **old_cnt);
+4 −4
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@


// flush the TLB (set V bit of each entry to 0)
extern inline void mmu_tlbflush() {
static inline void mmu_tlbflush() {
	MMU.MMUCR.BIT.TF = 1;
}

@@ -43,20 +43,20 @@ void mmu_init();


// set the current ASID (dangerous if virtual memory is used consecutivly!)
extern inline void mmu_setasid(unsigned char asid) {
static inline void mmu_setasid(unsigned char asid) {
	MMU.PTEH.BIT.ASID = asid;
}


// get the current ASID
extern inline unsigned char mmu_getasid() {
static inline unsigned char mmu_getasid() {
	return MMU.PTEH.BIT.ASID;
}

// fill and load a TLB entry in PTEL without change informations in PTEH
// (after a TLB miss, PTEH should be valid if the page is allowed)
// PPN must be given like a 1K page number (even for 4K page!)
extern inline void mmu_tlb_fillload(unsigned int ppn, unsigned short flags) {
static inline void mmu_tlb_fillload(unsigned int ppn, unsigned short flags) {
	MMU.PTEL.LONG = (ppn << 10) | flags;
	__asm__ volatile ("ldtlb":::"memory" );
}
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ void vfs_file_init();
 * Allocate a new file structure.
 * Returns NULL if allocation can't be done.
 */
extern inline struct file *vfs_file_alloc() {
static inline struct file *vfs_file_alloc() {
	return pool_alloc(&_vfs_file_palloc);
}

@@ -37,7 +37,7 @@ extern inline struct file *vfs_file_alloc() {
/**
 * Free an allocated file structure.
 */
extern inline void vfs_file_free(struct file *filep) {
static inline void vfs_file_free(struct file *filep) {
	pool_free(&_vfs_file_palloc, filep);
}

+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@ G1A_WRAPPER:=c_g1awrapper


# global tool options
CFLAGS:=-g -Wall -m3 -mb -Os -fno-builtin $(CFLAGS)
CFLAGS:=-g -std=c99 -Wall -m3 -mb -Os -fno-builtin $(CFLAGS)
LDFLAGS:=-nostdlib $(LDFLAGS)
+5 −5
Original line number Diff line number Diff line
@@ -13,27 +13,27 @@ typedef __kernel_uint32 sigset_t;

// not exactly the POSIX specification, but should be usefull :

extern inline int sigemptyset(sigset_t *set) {
static inline int sigemptyset(sigset_t *set) {
	*set = 0;
	return 0;
}

extern inline int sigfillset(sigset_t *set) {
static inline int sigfillset(sigset_t *set) {
	*set = 0xFFFFFFFF;
	return 0;
}

extern inline int sigaddset(sigset_t *set, int sig) {
static inline int sigaddset(sigset_t *set, int sig) {
	*set |= (1<<sig);
	return 0;
}

extern inline int sigdelset(sigset_t *set, int sig) {
static inline int sigdelset(sigset_t *set, int sig) {
	*set &= ~(1<<sig);
	return 0;
}

extern inline int sigismember(sigset_t *set, int sig) {
static inline int sigismember(sigset_t *set, int sig) {
	return (*set & (1<<sig)) != 0;
}

Loading