Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 989 → Rev 990

/kernel/trunk/arch/ppc32/include/atomic.h
33,17 → 33,32
 
typedef struct { volatile __u32 count; } atomic_t;
 
/*
* TODO: these are just placeholders for real implementations of atomic_inc and atomic_dec.
* WARNING: the following functions cause the code to be preemption-unsafe !!!
*/
static inline void atomic_inc(atomic_t *val) {
__u32 tmp;
 
static inline void atomic_inc(atomic_t *val) {
val->count++;
asm __volatile__ (
"1:\n"
"lwarx %0, 0, %2\n"
"addic %0, %0, 1\n"
"stwcx. %0, 0, %2\n"
"bne- 1b"
: "=&r" (tmp), "=m" (val->count)
: "r" (&val->count), "m" (val->count)
: "cc");
}
 
static inline void atomic_dec(atomic_t *val) {
val->count--;
__u32 tmp;
 
asm __volatile__(
"1:\n"
"lwarx %0, 0, %2\n"
"addic %0, %0, -1\n"
"stwcx. %0, 0, %2\n"
"bne- 1b"
: "=&r" (tmp), "=m" (val->count)
: "r" (&val->count), "m" (val->count)
: "cc");
}
 
static inline void atomic_set(atomic_t *val, __u32 i)
/kernel/trunk/arch/ppc32/include/boot/boot.h
31,4 → 31,7
 
#define BOOT_OFFSET 0x2000
 
/* Temporary stack size for boot process */
#define TEMP_STACK_SIZE 0x100
 
#endif
/kernel/trunk/arch/ppc32/include/context.h
33,7 → 33,7
# include <arch/types.h>
#endif
 
#define SP_DELTA 4
#define SP_DELTA 8
 
struct context {
__address sp;
/kernel/trunk/arch/ppc32/include/barrier.h
32,8 → 32,8
#define CS_ENTER_BARRIER() __asm__ volatile ("" ::: "memory")
#define CS_LEAVE_BARRIER() __asm__ volatile ("" ::: "memory")
 
#define memory_barrier()
#define read_barrier()
#define write_barrier()
#define memory_barrier() __asm__ volatile ("sync" ::: "memory")
#define read_barrier() __asm__ volatile ("sync" ::: "memory")
#define write_barrier() __asm__ volatile ("eieio" ::: "memory")
 
#endif
/kernel/trunk/arch/ppc32/include/drivers/cuda.h
30,4 → 30,7
#define __CUDA_H__
 
 
void cuda_init(void);
 
 
#endif