Changeset e507afa in mainline
- Timestamp:
- 2005-11-14T19:39:26Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- abb79e84
- Parents:
- 35667f8
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r35667f8 re507afa 48 48 49 49 DEFS = -DARCH=$(ARCH) -DRELEASE=\"$(RELEASE)\" "-DNAME=\"$(NAME)\"" 50 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror - O3 -nostdlib -nostdinc -Igeneric/include/50 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -nostdlib -nostdinc -Igeneric/include/ 51 51 LFLAGS = -M 52 52 AFLAGS = -
Makefile.config
r35667f8 re507afa 37 37 38 38 CONFIG_USERSPACE = n 39 #CONFIG_TEST =39 CONFIG_TEST = 40 40 #CONFIG_TEST = synch/rwlock1 41 41 #CONFIG_TEST = synch/rwlock2 42 42 #CONFIG_TEST = synch/rwlock3 43 43 #CONFIG_TEST = synch/rwlock4 44 CONFIG_TEST = synch/rwlock544 #CONFIG_TEST = synch/rwlock5 45 45 #CONFIG_TEST = synch/semaphore1 46 46 #CONFIG_TEST = synch/semaphore2 -
arch/amd64/Makefile.inc
r35667f8 re507afa 43 43 endif 44 44 45 CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone 45 CFLAGS += -fno-unwind-tables -m64 -mcmodel=kernel -mno-red-zone -O3 46 46 DEFS += -D_CPU=${CPU} 47 47 -
arch/ia32/Makefile.inc
r35667f8 re507afa 43 43 endif 44 44 45 CFLAGS += -O3 45 46 DEFS += -D_CPU=${CPU} 46 47 -
arch/ia64/Makefile.inc
r35667f8 re507afa 39 39 # 40 40 41 CFLAGS += -mconstant-gp -fno-unwind-tables 41 CFLAGS += -mconstant-gp -fno-unwind-tables -minline-int-divide-min-latency -O3 42 42 LFLAGS += -EL 43 43 AFLAGS += -mconstant-gp -
arch/mips32/Makefile.inc
r35667f8 re507afa 42 42 43 43 KERNEL_LOAD_ADDRESS = 0x80100000 44 CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss 44 CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -O2 45 45 DEFS += -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} 46 46 -
arch/mips32/include/atomic.h
r35667f8 re507afa 32 32 #include <arch/types.h> 33 33 34 #define atomic_inc(x) ( a_add(x,1))35 #define atomic_dec(x) ( a_sub(x,1))34 #define atomic_inc(x) ((void) atomic_add(x, 1)) 35 #define atomic_dec(x) ((void) atomic_add(x, -1)) 36 36 37 #define atomic_inc_pre(x) (a _add(x,1)-1)38 #define atomic_dec_pre(x) (a _sub(x,1)+1)37 #define atomic_inc_pre(x) (atomic_add(x, 1) - 1) 38 #define atomic_dec_pre(x) (atomic_add(x, -1) + 1) 39 39 40 #define atomic_inc_post(x) (a_add(x,1))41 #define atomic_dec_post(x) (a_sub(x,1))40 #define atomic_inc_post(x) atomic_add(x, 1) 41 #define atomic_dec_post(x) atomic_add(x, -1) 42 42 43 43 44 44 typedef volatile __u32 atomic_t; 45 45 46 /* 47 * Atomic addition 46 /* Atomic addition of immediate value. 48 47 * 49 * This case is harder, and we have to use the special LL and SC operations 50 * to achieve atomicity. The instructions are similar to LW (load) and SW 51 * (store), except that the LL (load-linked) instruction loads the address 52 * of the variable to a special register and if another process writes to 53 * the same location, the SC (store-conditional) instruction fails. 54 55 Returns (*val)+i 56 48 * @param val Memory location to which will be the immediate value added. 49 * @param i Signed immediate that will be added to *val. 50 * 51 * @return Value after addition. 57 52 */ 58 static inline atomic_t a _add(atomic_t *val, int i)53 static inline atomic_t atomic_add(atomic_t *val, int i) 59 54 { 60 atomic_t tmp, tmp2;55 atomic_t tmp, v; 61 56 62 asm volatile ( 63 " .set push\n" 64 " .set noreorder\n" 65 " nop\n" 57 __asm__ volatile ( 66 58 "1:\n" 67 " ll %0, %1\n" 68 " addu %0, %0, %3\n" 69 " move %2, %0\n" 70 " sc %0, %1\n" 71 " beq %0, 0x0, 1b\n" 72 " move %0, %2\n" 73 " .set pop\n" 74 : "=&r" (tmp), "=o" (*val), "=r" (tmp2) 75 : "r" (i) 59 " ll %0, %1\n" 60 " addiu %0, %0, %3\n" /* same as addi, but never traps on overflow */ 61 " move %2, %0\n" 62 " sc %0, %1\n" 63 " beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ 64 /* nop */ /* nop is inserted automatically by compiler */ 65 : "=r" (tmp), "=m" (*val), "=r" (v) 66 : "i" (i), "i" (0) 76 67 ); 77 return tmp;78 }79 68 80 81 /* 82 * Atomic subtraction 83 * 84 * Implemented in the same manner as a_add, except we substract the value. 85 86 Returns (*val)-i 87 88 */ 89 static inline atomic_t a_sub(atomic_t *val, int i) 90 91 { 92 atomic_t tmp, tmp2; 93 94 asm volatile ( 95 " .set push\n" 96 " .set noreorder\n" 97 " nop\n" 98 "1:\n" 99 " ll %0, %1\n" 100 " subu %0, %0, %3\n" 101 " move %2, %0\n" 102 " sc %0, %1\n" 103 " beq %0, 0x0, 1b\n" 104 " move %0, %2\n" 105 " .set pop\n" 106 : "=&r" (tmp), "=o" (*val), "=r" (tmp2) 107 : "r" (i) 108 ); 109 return tmp; 69 return v; 110 70 } 111 71 -
arch/mips32/include/cpu.h
r35667f8 re507afa 30 30 #define __mips32_CPU_H__ 31 31 32 #include <arch/types.h> 33 32 34 struct cpu_arch { 33 intimp_num;34 intrev_num;35 __u32 imp_num; 36 __u32 rev_num; 35 37 }; 36 38 -
arch/mips32/src/interrupt.c
r35667f8 re507afa 115 115 case 5: /* IRQ3 */ 116 116 case 6: /* IRQ4 */ 117 default: 117 118 print_regdump(pstate); 118 119 panic("unhandled interrupt %d\n", i); -
arch/ppc32/Makefile.inc
r35667f8 re507afa 39 39 # 40 40 41 CFLAGS += -O3 41 42 LFLAGS += -no-check-sections -N 42 43 -
arch/sparc64/Makefile.inc
r35667f8 re507afa 39 39 # 40 40 41 CFLAGS += -mcpu=ultrasparc -m64 41 CFLAGS += -mcpu=ultrasparc -m64 -O3 42 42 LFLAGS += -no-check-sections -N 43 43 -
generic/include/arch.h
r35667f8 re507afa 53 53 */ 54 54 struct the { 55 int preemption_disabled; /**< Preemption disabled counter. */55 count_t preemption_disabled; /**< Preemption disabled counter. */ 56 56 thread_t *thread; /**< Current thread. */ 57 57 task_t *task; /**< Current task. */ -
generic/include/config.h
r35667f8 re507afa 36 36 #define STACK_SIZE PAGE_SIZE 37 37 38 #define CONFIG_MEMORY_SIZE 8*1024*102439 #define CONFIG_HEAP_SIZE 300*102438 #define CONFIG_MEMORY_SIZE (8*1024*1024) 39 #define CONFIG_HEAP_SIZE (300*1024) 40 40 #define CONFIG_STACK_SIZE STACK_SIZE 41 41 -
generic/include/cpu.h
r35667f8 re507afa 46 46 context_t saved_context; 47 47 48 volatile int nrdy;48 volatile count_t nrdy; 49 49 runq_t rq[RQ_COUNT]; 50 volatile int needs_relink;50 volatile count_t needs_relink; 51 51 52 52 spinlock_t timeoutlock; -
generic/include/proc/scheduler.h
r35667f8 re507afa 39 39 #define NEEDS_RELINK_MAX (HZ) 40 40 41 /** Scheduler run queue structure. */ 41 42 struct runq { 42 43 spinlock_t lock; 43 44 link_t rq_head; /**< List of ready threads. */ 44 int n;/**< Number of threads in rq_ready. */45 count_t n; /**< Number of threads in rq_ready. */ 45 46 }; 46 47 … … 52 53 extern void kcpulb(void *arg); 53 54 55 extern void before_thread_runs(void); 56 54 57 /* 55 58 * To be defined by architectures: 56 59 */ 57 60 58 extern void before_thread_runs(void);59 61 extern void before_thread_runs_arch(void); 60 62 -
generic/include/synch/rwlock.h
r35667f8 re507afa 44 44 spinlock_t lock; 45 45 mutex_t exclusive; /**< Mutex for writers, readers can bypass it if readers_in is positive. */ 46 int readers_in;/**< Number of readers in critical section. */46 count_t readers_in; /**< Number of readers in critical section. */ 47 47 }; 48 48 -
generic/include/typedefs.h
r35667f8 re507afa 40 40 41 41 typedef struct config config_t; 42 typedef struct cpu_private_data cpu_private_data_t;43 42 typedef struct cpu_info cpu_info_t; 44 43 -
generic/src/proc/scheduler.c
r35667f8 re507afa 51 51 atomic_t nrdy; 52 52 53 54 53 /** Take actions before new thread runs 55 54 * … … 117 116 * 118 117 */ 119 static struct thread*find_best_thread(void)118 static thread_t *find_best_thread(void) 120 119 { 121 120 thread_t *t; -
test/fpu/fpu1/test.c
r35667f8 re507afa 46 46 static inline double sqrt(double x) { double v; __asm__ ("fsqrt\n" : "=t" (v) : "0" (x)); return v; } 47 47 48 static volatile int threads_ok;48 static atomic_t threads_ok; 49 49 static waitq_t can_start; 50 50 -
test/fpu/mips1/test.c
r35667f8 re507afa 42 42 #define ATTEMPTS 5 43 43 44 static volatile int threads_ok;44 static atomic_t threads_ok; 45 45 static waitq_t can_start; 46 46 -
test/fpu/sse1/test.c
r35667f8 re507afa 42 42 #define ATTEMPTS 5 43 43 44 static volatile int threads_ok;44 static atomic_t threads_ok; 45 45 static waitq_t can_start; 46 46 -
test/synch/rwlock5/test.c
r35667f8 re507afa 76 76 { 77 77 int i, j, k; 78 int readers, writers;78 count_t readers, writers; 79 79 80 80 printf("Read/write locks test #5\n");
Note:
See TracChangeset
for help on using the changeset viewer.