Changeset aa85487 in mainline for kernel/arch/sparc64/include
- Timestamp:
- 2010-03-07T15:11:56Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- aadf01e
- Parents:
- 2e99277 (diff), 137691a (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/sparc64/include
- Files:
-
- 5 added
- 20 edited
-
atomic.h (modified) (4 diffs)
-
mm/as.h (modified) (1 diff)
-
mm/sun4u/as.h (added)
-
mm/sun4u/tlb.h (modified) (1 diff)
-
mm/sun4u/tsb.h (added)
-
mm/sun4v/frame.h (modified) (2 diffs)
-
mm/sun4v/mmu.h (modified) (2 diffs)
-
mm/sun4v/tlb.h (modified) (1 diff)
-
mm/sun4v/tsb.h (modified) (2 diffs)
-
mm/sun4v/tte.h (modified) (1 diff)
-
mm/tlb.h (modified) (1 diff)
-
mm/tsb.h (modified) (1 diff)
-
smp/sun4v/smp.h (added)
-
sun4v/arch.h (modified) (1 diff)
-
sun4v/cpu.h (modified) (3 diffs)
-
sun4v/hypercall.h (modified) (2 diffs)
-
sun4v/ipi.h (modified) (1 diff)
-
trap/exception.h (modified) (2 diffs)
-
trap/interrupt.h (modified) (4 diffs)
-
trap/regwin.h (modified) (2 diffs)
-
trap/sun4u/interrupt.h (added)
-
trap/sun4v/interrupt.h (added)
-
trap/sun4v/mmu.h (modified) (2 diffs)
-
trap/trap_table.h (modified) (1 diff)
-
types.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/atomic.h
r2e99277 raa85487 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 45 45 * 46 46 * @param val Atomic variable. 47 * @param i Signed value to be added.47 * @param i Signed value to be added. 48 48 * 49 49 * @return Value of the atomic variable as it existed before addition. 50 * 50 51 */ 51 static inline long atomic_add(atomic_t *val, int i)52 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i) 52 53 { 53 uint64_t a, b; 54 54 atomic_count_t a; 55 atomic_count_t b; 56 55 57 do { 56 volatile uintptr_t x = (uint64_t) &val->count;57 58 a = *(( uint64_t *) x);58 volatile uintptr_t ptr = (uintptr_t) &val->count; 59 60 a = *((atomic_count_t *) ptr); 59 61 b = a + i; 60 asm volatile ("casx %0, %2, %1\n" : "+m" (*((uint64_t *)x)), 61 "+r" (b) : "r" (a)); 62 63 asm volatile ( 64 "casx %0, %2, %1\n" 65 : "+m" (*((atomic_count_t *) ptr)), 66 "+r" (b) 67 : "r" (a) 68 ); 62 69 } while (a != b); 63 70 64 71 return a; 65 72 } 66 73 67 static inline longatomic_preinc(atomic_t *val)74 static inline atomic_count_t atomic_preinc(atomic_t *val) 68 75 { 69 76 return atomic_add(val, 1) + 1; 70 77 } 71 78 72 static inline longatomic_postinc(atomic_t *val)79 static inline atomic_count_t atomic_postinc(atomic_t *val) 73 80 { 74 81 return atomic_add(val, 1); 75 82 } 76 83 77 static inline longatomic_predec(atomic_t *val)84 static inline atomic_count_t atomic_predec(atomic_t *val) 78 85 { 79 86 return atomic_add(val, -1) - 1; 80 87 } 81 88 82 static inline longatomic_postdec(atomic_t *val)89 static inline atomic_count_t atomic_postdec(atomic_t *val) 83 90 { 84 91 return atomic_add(val, -1); … … 95 102 } 96 103 97 static inline longtest_and_set(atomic_t *val)104 static inline atomic_count_t test_and_set(atomic_t *val) 98 105 { 99 uint64_t v = 1; 100 volatile uintptr_t x = (uint64_t) &val->count; 101 102 asm volatile ("casx %0, %2, %1\n" : "+m" (*((uint64_t *) x)), 103 "+r" (v) : "r" (0)); 104 106 atomic_count_t v = 1; 107 volatile uintptr_t ptr = (uintptr_t) &val->count; 108 109 asm volatile ( 110 "casx %0, %2, %1\n" 111 : "+m" (*((atomic_count_t *) ptr)), 112 "+r" (v) 113 : "r" (0) 114 ); 115 105 116 return v; 106 117 } … … 108 119 static inline void atomic_lock_arch(atomic_t *val) 109 120 { 110 uint64_t tmp1 = 1;111 uint64_t tmp2 = 0;112 113 volatile uintptr_t x = (uint64_t) &val->count;114 121 atomic_count_t tmp1 = 1; 122 atomic_count_t tmp2 = 0; 123 124 volatile uintptr_t ptr = (uintptr_t) &val->count; 125 115 126 preemption_disable(); 116 127 117 128 asm volatile ( 118 "0:\n" 119 "casx %0, %3, %1\n" 120 "brz %1, 2f\n" 121 "nop\n" 122 "1:\n" 123 "ldx %0, %2\n" 124 "brz %2, 0b\n" 125 "nop\n" 126 "ba %%xcc, 1b\n" 127 "nop\n" 128 "2:\n" 129 : "+m" (*((uint64_t *) x)), "+r" (tmp1), "+r" (tmp2) : "r" (0) 129 "0:\n" 130 "casx %0, %3, %1\n" 131 "brz %1, 2f\n" 132 "nop\n" 133 "1:\n" 134 "ldx %0, %2\n" 135 "brz %2, 0b\n" 136 "nop\n" 137 "ba %%xcc, 1b\n" 138 "nop\n" 139 "2:\n" 140 : "+m" (*((atomic_count_t *) ptr)), 141 "+r" (tmp1), 142 "+r" (tmp2) 143 : "r" (0) 130 144 ); 131 145 -
kernel/arch/sparc64/include/mm/as.h
r2e99277 raa85487 36 36 #define KERN_sparc64_AS_H_ 37 37 38 #include <arch/mm/tte.h> 39 40 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 1 41 42 #define KERNEL_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 43 #define KERNEL_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 44 #define USER_ADDRESS_SPACE_START_ARCH (unsigned long) 0x0000000000000000 45 #define USER_ADDRESS_SPACE_END_ARCH (unsigned long) 0xffffffffffffffff 46 47 #define USTACK_ADDRESS_ARCH (0xffffffffffffffffULL - (PAGE_SIZE - 1)) 48 49 #ifdef CONFIG_TSB 50 51 /** TSB Tag Target register. */ 52 typedef union tsb_tag_target { 53 uint64_t value; 54 struct { 55 unsigned invalid : 1; /**< Invalidated by software. */ 56 unsigned : 2; 57 unsigned context : 13; /**< Software ASID. */ 58 unsigned : 6; 59 uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */ 60 } __attribute__ ((packed)); 61 } tsb_tag_target_t; 62 63 /** TSB entry. */ 64 typedef struct tsb_entry { 65 tsb_tag_target_t tag; 66 tte_data_t data; 67 } __attribute__ ((packed)) tsb_entry_t; 68 69 typedef struct { 70 tsb_entry_t *itsb; 71 tsb_entry_t *dtsb; 72 } as_arch_t; 73 74 #else 75 76 typedef struct { 77 } as_arch_t; 78 79 #endif /* CONFIG_TSB */ 80 81 #include <genarch/mm/as_ht.h> 82 83 #ifdef CONFIG_TSB 84 #include <arch/mm/tsb.h> 85 #define as_invalidate_translation_cache(as, page, cnt) \ 86 tsb_invalidate((as), (page), (cnt)) 87 #else 88 #define as_invalidate_translation_cache(as, page, cnt) 38 #if defined (SUN4U) 39 #include <arch/mm/sun4u/as.h> 40 #elif defined (SUN4V) 41 #include <arch/mm/sun4v/as.h> 89 42 #endif 90 91 extern void as_arch_init(void);92 43 93 44 #endif -
kernel/arch/sparc64/include/mm/sun4u/tlb.h
r2e99277 raa85487 684 684 685 685 extern void dump_sfsr_and_sfar(void); 686 extern void describe_dmmu_fault(void); 686 687 687 688 #endif /* !def __ASM__ */ -
kernel/arch/sparc64/include/mm/sun4v/frame.h
r2e99277 raa85487 33 33 */ 34 34 35 #ifndef KERN_sparc64_ SUN4V_FRAME_H_36 #define KERN_sparc64_ SUN4V_FRAME_H_35 #ifndef KERN_sparc64_sun4v_FRAME_H_ 36 #define KERN_sparc64_sun4v_FRAME_H_ 37 37 38 /*39 * Page size supported by the MMU.40 * For 8K there is the nasty illegal virtual aliasing problem.41 * Therefore, the kernel uses 8K only internally on the TLB and TSB levels.42 */43 38 #define MMU_FRAME_WIDTH 13 /* 8K */ 44 39 #define MMU_FRAME_SIZE (1 << MMU_FRAME_WIDTH) … … 52 47 #include <arch/types.h> 53 48 54 union frame_address {55 uintptr_t address;56 struct {57 #if defined (US)58 unsigned : 23;59 uint64_t pfn : 28; /**< Physical Frame Number. */60 #elif defined (US3)61 unsigned : 21;62 uint64_t pfn : 30; /**< Physical Frame Number. */63 #endif64 unsigned offset : 13; /**< Offset. */65 } __attribute__ ((packed));66 };67 68 typedef union frame_address frame_address_t;69 70 49 extern uintptr_t last_frame; 71 //MH72 //extern uintptr_t end_of_identity;73 74 50 extern void frame_arch_init(void); 75 51 #define physmem_print() -
kernel/arch/sparc64/include/mm/sun4v/mmu.h
r2e99277 raa85487 28 28 */ 29 29 30 /** @addtogroup sparc64mm 30 /** @addtogroup sparc64mm 31 31 * @{ 32 32 */ … … 45 45 #define ASI_SECONDARY_CONTEXT_REG 0x21 /**< secondary context register ASI. */ 46 46 47 48 49 50 51 52 53 54 55 56 57 /* I-MMU ASIs. */58 #define ASI_IMMU 0x5059 #define ASI_IMMU_TSB_8KB_PTR_REG 0x5160 #define ASI_IMMU_TSB_64KB_PTR_REG 0x5261 #define ASI_ITLB_DATA_IN_REG 0x5462 #define ASI_ITLB_DATA_ACCESS_REG 0x5563 #define ASI_ITLB_TAG_READ_REG 0x5664 #define ASI_IMMU_DEMAP 0x5765 66 /* Virtual Addresses within ASI_IMMU. */67 #define VA_IMMU_TSB_TAG_TARGET 0x0 /**< IMMU TSB tag target register. */68 #define VA_IMMU_SFSR 0x18 /**< IMMU sync fault status register. */69 #define VA_IMMU_TSB_BASE 0x28 /**< IMMU TSB base register. */70 #define VA_IMMU_TAG_ACCESS 0x30 /**< IMMU TLB tag access register. */71 #if defined (US3)72 #define VA_IMMU_PRIMARY_EXTENSION 0x48 /**< IMMU TSB primary extension register */73 #define VA_IMMU_NUCLEUS_EXTENSION 0x58 /**< IMMU TSB nucleus extension register */74 #endif75 76 77 /* D-MMU ASIs. */78 #define ASI_DMMU 0x5879 #define ASI_DMMU_TSB_8KB_PTR_REG 0x5980 #define ASI_DMMU_TSB_64KB_PTR_REG 0x5a81 #define ASI_DMMU_TSB_DIRECT_PTR_REG 0x5b82 #define ASI_DTLB_DATA_IN_REG 0x5c83 #define ASI_DTLB_DATA_ACCESS_REG 0x5d84 #define ASI_DTLB_TAG_READ_REG 0x5e85 #define ASI_DMMU_DEMAP 0x5f86 87 /* Virtual Addresses within ASI_DMMU. */88 #define VA_DMMU_TSB_TAG_TARGET 0x0 /**< DMMU TSB tag target register. */89 #define VA_PRIMARY_CONTEXT_REG 0x8 /**< DMMU primary context register. */90 #define VA_SECONDARY_CONTEXT_REG 0x10 /**< DMMU secondary context register. */91 #define VA_DMMU_SFSR 0x18 /**< DMMU sync fault status register. */92 #define VA_DMMU_SFAR 0x20 /**< DMMU sync fault address register. */93 #define VA_DMMU_TSB_BASE 0x28 /**< DMMU TSB base register. */94 #define VA_DMMU_TAG_ACCESS 0x30 /**< DMMU TLB tag access register. */95 #define VA_DMMU_VA_WATCHPOINT_REG 0x38 /**< DMMU VA data watchpoint register. */96 #define VA_DMMU_PA_WATCHPOINT_REG 0x40 /**< DMMU PA data watchpoint register. */97 #if defined (US3)98 #define VA_DMMU_PRIMARY_EXTENSION 0x48 /**< DMMU TSB primary extension register */99 #define VA_DMMU_SECONDARY_EXTENSION 0x50 /**< DMMU TSB secondary extension register */100 #define VA_DMMU_NUCLEUS_EXTENSION 0x58 /**< DMMU TSB nucleus extension register */101 #endif102 103 #ifndef __ASM__104 105 #include <arch/asm.h>106 #include <arch/barrier.h>107 #include <arch/types.h>108 109 #if defined(US)110 /** LSU Control Register. */111 typedef union {112 uint64_t value;113 struct {114 unsigned : 23;115 unsigned pm : 8;116 unsigned vm : 8;117 unsigned pr : 1;118 unsigned pw : 1;119 unsigned vr : 1;120 unsigned vw : 1;121 unsigned : 1;122 unsigned fm : 16;123 unsigned dm : 1; /**< D-MMU enable. */124 unsigned im : 1; /**< I-MMU enable. */125 unsigned dc : 1; /**< D-Cache enable. */126 unsigned ic : 1; /**< I-Cache enable. */127 128 } __attribute__ ((packed));129 } lsu_cr_reg_t;130 #endif /* US */131 132 #endif /* !def __ASM__ */133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 47 #endif 150 48 -
kernel/arch/sparc64/include/mm/sun4v/tlb.h
r2e99277 raa85487 28 28 */ 29 29 30 /** @addtogroup sparc64mm 30 /** @addtogroup sparc64mm 31 31 * @{ 32 32 */ -
kernel/arch/sparc64/include/mm/sun4v/tsb.h
r2e99277 raa85487 28 28 */ 29 29 30 /** @addtogroup sparc64mm 30 /** @addtogroup sparc64mm 31 31 * @{ 32 32 */ … … 71 71 struct pte; 72 72 73 extern void tsb_invalidate(struct as *as, uintptr_t page, count_t pages);73 extern void tsb_invalidate(struct as *as, uintptr_t page, uint64_t pages); 74 74 extern void itsb_pte_copy(struct pte *t); 75 75 extern void dtsb_pte_copy(struct pte *t, bool ro); -
kernel/arch/sparc64/include/mm/sun4v/tte.h
r2e99277 raa85487 27 27 */ 28 28 29 /** @addtogroup sparc64mm 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ -
kernel/arch/sparc64/include/mm/tlb.h
r2e99277 raa85487 36 36 #define KERN_sparc64_TLB_H_ 37 37 38 38 39 #if defined (SUN4U) 39 40 #include <arch/mm/sun4u/tlb.h> -
kernel/arch/sparc64/include/mm/tsb.h
r2e99277 raa85487 36 36 #define KERN_sparc64_TSB_H_ 37 37 38 /* 39 * ITSB abd DTSB will claim 64K of memory, which 40 * is a nice number considered that it is one of 41 * the page sizes supported by hardware, which, 42 * again, is nice because TSBs need to be locked 43 * in TLBs - only one TLB entry will do. 44 */ 45 #define TSB_SIZE 2 /* when changing this, change 46 * as.c as well */ 47 #define ITSB_ENTRY_COUNT (512 * (1 << TSB_SIZE)) 48 #define DTSB_ENTRY_COUNT (512 * (1 << TSB_SIZE)) 49 50 #define TSB_TAG_TARGET_CONTEXT_SHIFT 48 51 52 #ifndef __ASM__ 53 54 #include <arch/mm/tte.h> 55 #include <arch/mm/mmu.h> 56 #include <arch/types.h> 57 58 /** TSB Base register. */ 59 typedef union tsb_base_reg { 60 uint64_t value; 61 struct { 62 uint64_t base : 51; /**< TSB base address, bits 63:13. */ 63 unsigned split : 1; /**< Split vs. common TSB for 8K and 64K 64 * pages. HelenOS uses only 8K pages 65 * for user mappings, so we always set 66 * this to 0. 67 */ 68 unsigned : 9; 69 unsigned size : 3; /**< TSB size. Number of entries is 70 * 512 * 2^size. */ 71 } __attribute__ ((packed)); 72 } tsb_base_reg_t; 73 74 /** Read ITSB Base register. 75 * 76 * @return Content of the ITSB Base register. 77 */ 78 static inline uint64_t itsb_base_read(void) 79 { 80 return asi_u64_read(ASI_IMMU, VA_IMMU_TSB_BASE); 81 } 82 83 /** Read DTSB Base register. 84 * 85 * @return Content of the DTSB Base register. 86 */ 87 static inline uint64_t dtsb_base_read(void) 88 { 89 return asi_u64_read(ASI_DMMU, VA_DMMU_TSB_BASE); 90 } 91 92 /** Write ITSB Base register. 93 * 94 * @param v New content of the ITSB Base register. 95 */ 96 static inline void itsb_base_write(uint64_t v) 97 { 98 asi_u64_write(ASI_IMMU, VA_IMMU_TSB_BASE, v); 99 } 100 101 /** Write DTSB Base register. 102 * 103 * @param v New content of the DTSB Base register. 104 */ 105 static inline void dtsb_base_write(uint64_t v) 106 { 107 asi_u64_write(ASI_DMMU, VA_DMMU_TSB_BASE, v); 108 } 109 110 #if defined (US3) 111 112 /** Write DTSB Primary Extension register. 113 * 114 * @param v New content of the DTSB Primary Extension register. 115 */ 116 static inline void dtsb_primary_extension_write(uint64_t v) 117 { 118 asi_u64_write(ASI_DMMU, VA_DMMU_PRIMARY_EXTENSION, v); 119 } 120 121 /** Write DTSB Secondary Extension register. 122 * 123 * @param v New content of the DTSB Secondary Extension register. 124 */ 125 static inline void dtsb_secondary_extension_write(uint64_t v) 126 { 127 asi_u64_write(ASI_DMMU, VA_DMMU_SECONDARY_EXTENSION, v); 128 } 129 130 /** Write DTSB Nucleus Extension register. 131 * 132 * @param v New content of the DTSB Nucleus Extension register. 133 */ 134 static inline void dtsb_nucleus_extension_write(uint64_t v) 135 { 136 asi_u64_write(ASI_DMMU, VA_DMMU_NUCLEUS_EXTENSION, v); 137 } 138 139 /** Write ITSB Primary Extension register. 140 * 141 * @param v New content of the ITSB Primary Extension register. 142 */ 143 static inline void itsb_primary_extension_write(uint64_t v) 144 { 145 asi_u64_write(ASI_IMMU, VA_IMMU_PRIMARY_EXTENSION, v); 146 } 147 148 /** Write ITSB Nucleus Extension register. 149 * 150 * @param v New content of the ITSB Nucleus Extension register. 151 */ 152 static inline void itsb_nucleus_extension_write(uint64_t v) 153 { 154 asi_u64_write(ASI_IMMU, VA_IMMU_NUCLEUS_EXTENSION, v); 155 } 156 38 #if defined (SUN4U) 39 #include <arch/mm/sun4u/tsb.h> 40 #elif defined (SUN4V) 41 #include <arch/mm/sun4v/tsb.h> 157 42 #endif 158 159 /* Forward declarations. */160 struct as;161 struct pte;162 163 extern void tsb_invalidate(struct as *as, uintptr_t page, size_t pages);164 extern void itsb_pte_copy(struct pte *t, size_t index);165 extern void dtsb_pte_copy(struct pte *t, size_t index, bool ro);166 167 #endif /* !def __ASM__ */168 43 169 44 #endif -
kernel/arch/sparc64/include/sun4v/arch.h
r2e99277 raa85487 58 58 #define SCRATCHPAD_WBUF 0x18 59 59 60 //MH - remove when cpu.h is forked61 #define ASI_NUCLEUS_QUAD_LDD 0x24 /** ASI for 16-byte atomic loads. */62 #define ASI_DCACHE_TAG 0x47 /** ASI D-Cache Tag. */63 #define ASI_ICBUS_CONFIG 0x4a /** ASI of the UPA_CONFIG/FIREPLANE_CONFIG register. */64 65 60 #endif 66 61 -
kernel/arch/sparc64/include/sun4v/cpu.h
r2e99277 raa85487 44 44 #ifndef __ASM__ 45 45 46 #include <atomic.h> 47 #include <synch/spinlock.h> 48 46 49 struct cpu; 47 50 48 /*49 51 typedef struct { 50 52 uint64_t exec_unit_id; … … 55 57 SPINLOCK_DECLARE(proposed_nrdy_lock); 56 58 } exec_unit_t; 57 */58 59 59 60 typedef struct cpu_arch { … … 63 64 generated when the TICK register 64 65 matches this value. */ 65 //exec_unit_t *exec_unit; /**< Physical core. */66 //unsigned long proposed_nrdy; /**< Proposed No. of ready threads67 //so that cores are equally balanced. */66 exec_unit_t *exec_unit; /**< Physical core. */ 67 unsigned long proposed_nrdy; /**< Proposed No. of ready threads 68 so that cores are equally balanced. */ 68 69 } cpu_arch_t; 69 70 -
kernel/arch/sparc64/include/sun4v/hypercall.h
r2e99277 raa85487 75 75 76 76 /* return codes */ 77 #define EOK0 /**< Successful return */78 #define ENOCPU 1 /**< Invalid CPU id */79 #define ENORADDR2 /**< Invalid real address */80 #define ENOINTR 3 /**< Invalid interrupt id */81 #define EBADPGSZ4 /**< Invalid pagesize encoding */82 #define EBADTSB 5 /**< Invalid TSB description */83 #define EINVAL 6 /**< Invalid argument */84 #define EBADTRAP7 /**< Invalid function number */85 #define EBADALIGN8 /**< Invalid address alignment */86 #define EWOULDBLOCK9 /**< Cannot complete operation without blocking */87 #define ENOACCESS10 /**< No access to specified resource */88 #define EIO11 /**< I/O Error */89 #define ECPUERROR12 /**< CPU is in error state */90 #define ENOTSUPPORTED 13 /**< Function not supported */91 #define ENOMAP 14 /**< No mapping found */92 #define ETOOMANY15 /**< Too many items specified / limit reached */93 #define ECHANNEL16 /**< Invalid LDC channel */94 #define EBUSY 17 /**< Operation failed as resource is otherwise busy */77 #define HV_EOK 0 /**< Successful return */ 78 #define HV_ENOCPU 1 /**< Invalid CPU id */ 79 #define HV_ENORADDR 2 /**< Invalid real address */ 80 #define HV_ENOINTR 3 /**< Invalid interrupt id */ 81 #define HV_EBADPGSZ 4 /**< Invalid pagesize encoding */ 82 #define HV_EBADTSB 5 /**< Invalid TSB description */ 83 #define HV_EINVAL 6 /**< Invalid argument */ 84 #define HV_EBADTRAP 7 /**< Invalid function number */ 85 #define HV_EBADALIGN 8 /**< Invalid address alignment */ 86 #define HV_EWOULDBLOCK 9 /**< Cannot complete operation without blocking */ 87 #define HV_ENOACCESS 10 /**< No access to specified resource */ 88 #define HV_EIO 11 /**< I/O Error */ 89 #define HV_ECPUERROR 12 /**< CPU is in error state */ 90 #define HV_ENOTSUPPORTED 13 /**< Function not supported */ 91 #define HV_ENOMAP 14 /**< No mapping found */ 92 #define HV_ETOOMANY 15 /**< Too many items specified / limit reached */ 93 #define HV_ECHANNEL 16 /**< Invalid LDC channel */ 94 #define HV_EBUSY 17 /**< Operation failed as resource is otherwise busy */ 95 95 96 96 … … 190 190 __hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3, 191 191 const uint64_t p4, const uint64_t p5, const uint64_t function_number, 192 uint64_t * constret1)192 uint64_t *ret1) 193 193 { 194 uint64_t errno = __hypercall_fast(p1, p2, p3, p4, p5, function_number); 195 if (ret1 != NULL) { 196 asm volatile ("mov %%o1, %0\n" : "=r" (*ret1)); 197 } 198 return errno; 194 register uint64_t a6 asm("o5") = function_number; 195 register uint64_t a1 asm("o0") = p1; 196 register uint64_t a2 asm("o1") = p2; 197 register uint64_t a3 asm("o2") = p3; 198 register uint64_t a4 asm("o3") = p4; 199 register uint64_t a5 asm("o4") = p5; 200 201 asm volatile ( 202 "ta %8\n" 203 : "=r" (a1), "=r" (a2) 204 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), 205 "i" (FAST_TRAP) 206 : "memory" 207 ); 208 209 if (ret1) 210 *ret1 = a2; 211 212 return a1; 199 213 } 200 214 -
kernel/arch/sparc64/include/sun4v/ipi.h
r2e99277 raa85487 38 38 #define KERN_sparc64_sun4v_IPI_H_ 39 39 40 uint64_t ipi_brodcast_to(void (*func)(void), uint16_t cpu_list[MAX_NUM_STRANDS], 41 uint64_t list_size); 42 uint64_t ipi_unicast_to(void (*func)(void), uint16_t cpu_id); 40 #include <arch/types.h> 41 42 extern uint64_t ipi_brodcast_to(void (*)(void), uint16_t cpu_list[], uint64_t); 43 extern uint64_t ipi_unicast_to(void (*)(void), uint16_t); 43 44 44 45 #endif -
kernel/arch/sparc64/include/trap/exception.h
r2e99277 raa85487 38 38 39 39 #define TT_INSTRUCTION_ACCESS_EXCEPTION 0x08 40 #define TT_INSTRUCTION_ACCESS_MMU_MISS 0x09 40 41 #define TT_INSTRUCTION_ACCESS_ERROR 0x0a 42 #define TT_IAE_UNAUTH_ACCESS 0x0b 43 #define TT_IAE_NFO_PAGE 0x0c 41 44 #define TT_ILLEGAL_INSTRUCTION 0x10 42 45 #define TT_PRIVILEGED_OPCODE 0x11 43 46 #define TT_UNIMPLEMENTED_LDD 0x12 44 47 #define TT_UNIMPLEMENTED_STD 0x13 48 #define TT_DAE_INVALID_ASI 0x14 49 #define TT_DAE_PRIVILEGE_VIOLATION 0x15 50 #define TT_DAE_NC_PAGE 0x16 51 #define TT_DAE_NFO_PAGE 0x17 45 52 #define TT_FP_DISABLED 0x20 46 53 #define TT_FP_EXCEPTION_IEEE_754 0x21 … … 49 56 #define TT_DIVISION_BY_ZERO 0x28 50 57 #define TT_DATA_ACCESS_EXCEPTION 0x30 58 #define TT_DATA_ACCESS_MMU_MISS 0x31 51 59 #define TT_DATA_ACCESS_ERROR 0x32 52 60 #define TT_MEM_ADDRESS_NOT_ALIGNED 0x34 -
kernel/arch/sparc64/include/trap/interrupt.h
r2e99277 raa85487 32 32 /** 33 33 * @file 34 * @brief This file contains interrupt vector trap handler. 34 * @brief This file contains level N interrupt and inter-processor interrupt 35 * trap handler. 35 36 */ 36 37 #ifndef KERN_sparc64_TRAP_INTERRUPT_H_ 38 #define KERN_sparc64_TRAP_INTERRUPT_H_ 39 40 #include <arch/trap/trap_table.h> 41 #include <arch/stack.h> 42 43 /* IMAP register bits */ 44 #define IGN_MASK 0x7c0 45 #define INO_MASK 0x1f 46 #define IMAP_V_MASK (1ULL << 31) 47 48 #define IGN_SHIFT 6 49 50 51 /* Interrupt ASI registers. */ 52 #define ASI_INTR_W 0x77 53 #define ASI_INTR_DISPATCH_STATUS 0x48 54 #define ASI_INTR_R 0x7f 55 #define ASI_INTR_RECEIVE 0x49 56 57 /* VA's used with ASI_INTR_W register. */ 58 #if defined (US) 59 #define ASI_UDB_INTR_W_DATA_0 0x40 60 #define ASI_UDB_INTR_W_DATA_1 0x50 61 #define ASI_UDB_INTR_W_DATA_2 0x60 62 #elif defined (US3) 63 #define VA_INTR_W_DATA_0 0x40 64 #define VA_INTR_W_DATA_1 0x48 65 #define VA_INTR_W_DATA_2 0x50 66 #define VA_INTR_W_DATA_3 0x58 67 #define VA_INTR_W_DATA_4 0x60 68 #define VA_INTR_W_DATA_5 0x68 69 #define VA_INTR_W_DATA_6 0x80 70 #define VA_INTR_W_DATA_7 0x88 71 #endif 72 #define VA_INTR_W_DISPATCH 0x70 73 74 /* VA's used with ASI_INTR_R register. */ 75 #if defined(US) 76 #define ASI_UDB_INTR_R_DATA_0 0x40 77 #define ASI_UDB_INTR_R_DATA_1 0x50 78 #define ASI_UDB_INTR_R_DATA_2 0x60 79 #elif defined (US3) 80 #define VA_INTR_R_DATA_0 0x40 81 #define VA_INTR_R_DATA_1 0x48 82 #define VA_INTR_R_DATA_2 0x50 83 #define VA_INTR_R_DATA_3 0x58 84 #define VA_INTR_R_DATA_4 0x60 85 #define VA_INTR_R_DATA_5 0x68 86 #define VA_INTR_R_DATA_6 0x80 87 #define VA_INTR_R_DATA_7 0x88 88 #endif 89 90 /* Shifts in the Interrupt Vector Dispatch virtual address. */ 91 #define INTR_VEC_DISPATCH_MID_SHIFT 14 92 93 /* Bits in the Interrupt Dispatch Status register. */ 94 #define INTR_DISPATCH_STATUS_NACK 0x2 95 #define INTR_DISPATCH_STATUS_BUSY 0x1 37 #ifndef KERN_sparc64_INTERRUPT_TRAP_H_ 38 #define KERN_sparc64_INTERRUPT_TRAP_H_ 96 39 97 40 #define TT_INTERRUPT_LEVEL_1 0x41 … … 111 54 #define TT_INTERRUPT_LEVEL_15 0x4f 112 55 113 #define TT_INTERRUPT_VECTOR_TRAP 0x6056 #define INTERRUPT_LEVEL_N_HANDLER_SIZE TRAP_TABLE_ENTRY_SIZE 114 57 115 #define INTERRUPT_LEVEL_N_HANDLER_SIZE TRAP_TABLE_ENTRY_SIZE 116 #define INTERRUPT_VECTOR_TRAP_HANDLER_SIZE TRAP_TABLE_ENTRY_SIZE 58 /* IMAP register bits */ 59 #define IGN_MASK 0x7c0 60 #define INO_MASK 0x1f 61 #define IMAP_V_MASK (1ULL << 31) 62 63 #define IGN_SHIFT 6 64 117 65 118 66 #ifdef __ASM__ … … 121 69 PREEMPTIBLE_HANDLER exc_dispatch 122 70 .endm 123 124 .macro INTERRUPT_VECTOR_TRAP_HANDLER 125 PREEMPTIBLE_HANDLER interrupt 126 .endm 127 #endif /* __ASM__ */ 71 #endif 128 72 129 73 #ifndef __ASM__ … … 134 78 #endif /* !def __ASM__ */ 135 79 80 81 #if defined (SUN4U) 82 #include <arch/trap/sun4u/interrupt.h> 83 #elif defined (SUN4V) 84 #include <arch/trap/sun4v/interrupt.h> 85 #endif 86 136 87 #endif 137 88 -
kernel/arch/sparc64/include/trap/regwin.h
r2e99277 raa85487 183 183 add %l0, 1, %l0 184 184 wrpr %l0, 0, %cleanwin 185 #if defined(SUN4U) 185 186 mov %r0, %l0 186 187 mov %r0, %l1 … … 199 200 mov %r0, %o6 200 201 mov %r0, %o7 202 #endif 201 203 retry 202 204 .endm 203 205 #endif /* __ASM__ */ 204 206 205 #if defined (SUN4U)207 #if defined(SUN4U) 206 208 #include <arch/trap/sun4u/regwin.h> 207 #elif defined (SUN4V)209 #elif defined(SUN4V) 208 210 #include <arch/trap/sun4v/regwin.h> 209 211 #endif -
kernel/arch/sparc64/include/trap/sun4v/mmu.h
r2e99277 raa85487 36 36 */ 37 37 38 #ifndef KERN_sparc64_ SUN4V_MMU_TRAP_H_39 #define KERN_sparc64_ SUN4V_MMU_TRAP_H_38 #ifndef KERN_sparc64_sun4v_MMU_TRAP_H_ 39 #define KERN_sparc64_sun4v_MMU_TRAP_H_ 40 40 41 41 #include <arch/stack.h> … … 121 121 * but this time its handler accesse memory which IS mapped. 122 122 */ 123 0: 124 .if (\tl > 0) 125 wrpr %g0, 1, %tl 126 .endif 123 .if (\tl > 0) 124 wrpr %g0, 1, %tl 125 .endif 127 126 128 127 /* -
kernel/arch/sparc64/include/trap/trap_table.h
r2e99277 raa85487 101 101 .macro PREEMPTIBLE_HANDLER f 102 102 sethi %hi(\f), %g1 103 b a %xcc,preemptible_handler103 b preemptible_handler 104 104 or %g1, %lo(\f), %g1 105 105 .endm -
kernel/arch/sparc64/include/types.h
r2e99277 raa85487 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 55 55 typedef uint64_t unative_t; 56 56 typedef int64_t native_t; 57 typedef uint64_t atomic_count_t; 57 58 58 59 typedef struct {
Note:
See TracChangeset
for help on using the changeset viewer.
