Changeset 371bd7d in mainline for kernel/arch/ppc32/include
- Timestamp:
- 2010-03-27T09:22:17Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36a75a2
- Parents:
- cd82bb1 (diff), eaf22d4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch/ppc32/include
- Files:
-
- 14 edited
-
asm.h (modified) (3 diffs)
-
atomic.h (modified) (7 diffs)
-
boot/boot.h (modified) (1 diff)
-
context.h (modified) (3 diffs)
-
cpuid.h (modified) (1 diff)
-
drivers/pic.h (modified) (1 diff)
-
exception.h (modified) (2 diffs)
-
faddr.h (modified) (1 diff)
-
fpu_context.h (modified) (1 diff)
-
memstr.h (modified) (2 diffs)
-
mm/asid.h (modified) (1 diff)
-
mm/frame.h (modified) (1 diff)
-
mm/tlb.h (modified) (1 diff)
-
types.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/asm.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ppc32_ASM_H_ 37 37 38 #include <arch/types.h>39 38 #include <typedefs.h> 40 39 #include <config.h> … … 146 145 } 147 146 148 void cpu_halt(void); 149 void asm_delay_loop(uint32_t t); 150 147 extern void cpu_halt(void) __attribute__((noreturn)); 148 extern void asm_delay_loop(uint32_t t); 151 149 extern void userspace_asm(uintptr_t uspace_uarg, uintptr_t stack, uintptr_t entry); 152 150 153 151 static inline void pio_write_8(ioport8_t *port, uint8_t v) 154 152 { 155 *port = v; 153 *port = v; 156 154 } 157 155 158 156 static inline void pio_write_16(ioport16_t *port, uint16_t v) 159 157 { 160 *port = v; 158 *port = v; 161 159 } 162 160 163 161 static inline void pio_write_32(ioport32_t *port, uint32_t v) 164 162 { 165 *port = v; 163 *port = v; 166 164 } 167 165 168 166 static inline uint8_t pio_read_8(ioport8_t *port) 169 167 { 170 return *port; 168 return *port; 171 169 } 172 170 173 171 static inline uint16_t pio_read_16(ioport16_t *port) 174 172 { 175 return *port; 173 return *port; 176 174 } 177 175 178 176 static inline uint32_t pio_read_32(ioport32_t *port) 179 177 { 180 return *port; 178 return *port; 181 179 } 182 180 -
kernel/arch/ppc32/include/atomic.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 38 38 static inline void atomic_inc(atomic_t *val) 39 39 { 40 longtmp;41 40 atomic_count_t tmp; 41 42 42 asm volatile ( 43 43 "1:\n" … … 46 46 "stwcx. %0, 0, %2\n" 47 47 "bne- 1b" 48 : "=&r" (tmp), "=m" (val->count) 49 : "r" (&val->count), "m" (val->count) 48 : "=&r" (tmp), 49 "=m" (val->count) 50 : "r" (&val->count), 51 "m" (val->count) 50 52 : "cc" 51 53 ); … … 54 56 static inline void atomic_dec(atomic_t *val) 55 57 { 56 longtmp;57 58 atomic_count_t tmp; 59 58 60 asm volatile ( 59 61 "1:\n" 60 62 "lwarx %0, 0, %2\n" 61 63 "addic %0, %0, -1\n" 62 "stwcx. %0, 0, %2\n"64 "stwcx. %0, 0, %2\n" 63 65 "bne- 1b" 64 : "=&r" (tmp), "=m" (val->count) 65 : "r" (&val->count), "m" (val->count) 66 : "=&r" (tmp), 67 "=m" (val->count) 68 : "r" (&val->count), 69 "m" (val->count) 66 70 : "cc" 67 71 ); 68 72 } 69 73 70 static inline longatomic_postinc(atomic_t *val)74 static inline atomic_count_t atomic_postinc(atomic_t *val) 71 75 { 72 76 atomic_inc(val); … … 74 78 } 75 79 76 static inline longatomic_postdec(atomic_t *val)80 static inline atomic_count_t atomic_postdec(atomic_t *val) 77 81 { 78 82 atomic_dec(val); … … 80 84 } 81 85 82 static inline longatomic_preinc(atomic_t *val)86 static inline atomic_count_t atomic_preinc(atomic_t *val) 83 87 { 84 88 atomic_inc(val); … … 86 90 } 87 91 88 static inline longatomic_predec(atomic_t *val)92 static inline atomic_count_t atomic_predec(atomic_t *val) 89 93 { 90 94 atomic_dec(val); -
kernel/arch/ppc32/include/boot/boot.h
rcd82bb1 r371bd7d 47 47 #ifndef __ASM__ 48 48 49 #include < arch/types.h>49 #include <typedefs.h> 50 50 #include <config.h> 51 51 #include <genarch/ofw/ofw_tree.h> -
kernel/arch/ppc32/include/context.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ppc32_CONTEXT_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 #define SP_DELTA 16 40 #define SP_DELTA 16 41 42 #define context_set(ctx, pc, stack, size) \ 43 context_set_generic(ctx, pc, stack, size) 41 44 42 45 typedef struct { … … 68 71 69 72 ipl_t ipl; 70 } __attribute__ ((packed)) context_t;73 } __attribute__((packed)) context_t; 71 74 72 75 #endif -
kernel/arch/ppc32/include/cpuid.h
rcd82bb1 r371bd7d 36 36 #define KERN_ppc32_CPUID_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 typedef struct { -
kernel/arch/ppc32/include/drivers/pic.h
rcd82bb1 r371bd7d 36 36 #define KERN_ppc32_PIC_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <ddi/irq.h> 40 40 -
kernel/arch/ppc32/include/exception.h
rcd82bb1 r371bd7d 36 36 #define KERN_ppc32_EXCEPTION_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 #include <arch/regutils.h> 40 40 41 typedef struct {41 typedef struct istate { 42 42 uint32_t r0; 43 43 uint32_t r2; … … 98 98 } 99 99 100 static inline unative_t istate_get_fp(istate_t *istate) 101 { 102 return istate->sp; 103 } 104 100 105 #endif 101 106 -
kernel/arch/ppc32/include/faddr.h
rcd82bb1 r371bd7d 36 36 #define KERN_ppc32_FADDR_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #define FADDR(fptr) ((uintptr_t) (fptr)) -
kernel/arch/ppc32/include/fpu_context.h
rcd82bb1 r371bd7d 37 37 38 38 #ifndef KERN_ppc32_TYPES_H_ 39 # include <arch/types.h>39 #include <typedefs.h> 40 40 #endif 41 41 -
kernel/arch/ppc32/include/memstr.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 38 38 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 39 39 40 extern void memsetw(void *dst, size_t cnt, uint16_t x); 41 extern void memsetb(void *dst, size_t cnt, uint8_t x); 42 43 extern int memcmp(const void *a, const void *b, size_t cnt); 40 extern void memsetw(void *, size_t, uint16_t); 41 extern void memsetb(void *, size_t, uint8_t); 44 42 45 43 #endif -
kernel/arch/ppc32/include/mm/asid.h
rcd82bb1 r371bd7d 36 36 #define KERN_ppc32_ASID_H_ 37 37 38 #include < arch/types.h>38 #include <typedefs.h> 39 39 40 40 #define ASID_MAX_ARCH 4096 -
kernel/arch/ppc32/include/mm/frame.h
rcd82bb1 r371bd7d 42 42 #ifndef __ASM__ 43 43 44 #include < arch/types.h>44 #include <typedefs.h> 45 45 46 46 extern uintptr_t last_frame; -
kernel/arch/ppc32/include/mm/tlb.h
rcd82bb1 r371bd7d 37 37 38 38 #include <arch/interrupt.h> 39 #include <arch/types.h>40 39 #include <typedefs.h> 41 40 -
kernel/arch/ppc32/include/types.h
rcd82bb1 r371bd7d 27 27 */ 28 28 29 /** @addtogroup ppc32 29 /** @addtogroup ppc32 30 30 * @{ 31 31 */ … … 35 35 #ifndef KERN_ppc32_TYPES_H_ 36 36 #define KERN_ppc32_TYPES_H_ 37 38 typedef signed char int8_t;39 typedef signed short int16_t;40 typedef signed int int32_t;41 typedef signed long long int64_t;42 43 typedef unsigned char uint8_t;44 typedef unsigned short uint16_t;45 typedef unsigned int uint32_t;46 typedef unsigned long long uint64_t;47 37 48 38 typedef uint32_t size_t; … … 55 45 typedef uint32_t unative_t; 56 46 typedef int32_t native_t; 47 typedef uint32_t atomic_count_t; 57 48 58 49 typedef struct { … … 60 51 61 52 /**< Formats for uintptr_t, size_t */ 62 #define PRIp "x"63 #define PRIs "u"53 #define PRIp "x" 54 #define PRIs "u" 64 55 65 56 /**< Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */ 66 #define PRId8 "d"67 #define PRId16 "d"68 #define PRId32 "d"69 #define PRId64 "lld"70 #define PRIdn "d"57 #define PRId8 "d" 58 #define PRId16 "d" 59 #define PRId32 "d" 60 #define PRId64 "lld" 61 #define PRIdn "d" 71 62 72 #define PRIu8 "u"73 #define PRIu16 "u"74 #define PRIu32 "u"75 #define PRIu64 "llu"76 #define PRIun "u"63 #define PRIu8 "u" 64 #define PRIu16 "u" 65 #define PRIu32 "u" 66 #define PRIu64 "llu" 67 #define PRIun "u" 77 68 78 #define PRIx8 "x"79 #define PRIx16 "x"80 #define PRIx32 "x"81 #define PRIx64 "llx"82 #define PRIxn "x"69 #define PRIx8 "x" 70 #define PRIx16 "x" 71 #define PRIx32 "x" 72 #define PRIx64 "llx" 73 #define PRIxn "x" 83 74 84 75 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
