Changeset 1433ecda in mainline for kernel/arch/amd64/include
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- kernel/arch/amd64/include/arch
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/arch/atomic.h
r47b2d7e3 r1433ecda 45 45 #ifdef CONFIG_SMP 46 46 asm volatile ( 47 "lock incq %[count]\n"48 : [count] "+m" (val->count)49 ); 50 #else 51 asm volatile ( 52 "incq %[count]\n"53 : [count] "+m" (val->count)47 "lock incq %[count]\n" 48 : [count] "+m" (val->count) 49 ); 50 #else 51 asm volatile ( 52 "incq %[count]\n" 53 : [count] "+m" (val->count) 54 54 ); 55 55 #endif /* CONFIG_SMP */ … … 60 60 #ifdef CONFIG_SMP 61 61 asm volatile ( 62 "lock decq %[count]\n"63 : [count] "+m" (val->count)64 ); 65 #else 66 asm volatile ( 67 "decq %[count]\n"68 : [count] "+m" (val->count)62 "lock decq %[count]\n" 63 : [count] "+m" (val->count) 64 ); 65 #else 66 asm volatile ( 67 "decq %[count]\n" 68 : [count] "+m" (val->count) 69 69 ); 70 70 #endif /* CONFIG_SMP */ … … 76 76 77 77 asm volatile ( 78 "lock xaddq %[r], %[count]\n"79 : [count] "+m" (val->count),80 [r] "+r" (r)78 "lock xaddq %[r], %[count]\n" 79 : [count] "+m" (val->count), 80 [r] "+r" (r) 81 81 ); 82 82 … … 89 89 90 90 asm volatile ( 91 "lock xaddq %[r], %[count]\n"92 : [count] "+m" (val->count),93 [r] "+r" (r)91 "lock xaddq %[r], %[count]\n" 92 : [count] "+m" (val->count), 93 [r] "+r" (r) 94 94 ); 95 95 … … 105 105 106 106 asm volatile ( 107 "xchgq %[v], %[count]\n"108 : [v] "+r" (v),109 [count] "+m" (val->count)107 "xchgq %[v], %[count]\n" 108 : [v] "+r" (v), 109 [count] "+m" (val->count) 110 110 ); 111 111 … … 120 120 preemption_disable(); 121 121 asm volatile ( 122 "0:\n"123 " pause\n"124 " mov %[count], %[tmp]\n"125 " testq %[tmp], %[tmp]\n"126 " jnz 0b\n" /* lightweight looping on locked spinlock */127 128 " incq %[tmp]\n" /* now use the atomic operation */129 " xchgq %[count], %[tmp]\n"130 " testq %[tmp], %[tmp]\n"131 " jnz 0b\n"132 : [count] "+m" (val->count),133 [tmp] "=&r" (tmp)122 "0:\n" 123 " pause\n" 124 " mov %[count], %[tmp]\n" 125 " testq %[tmp], %[tmp]\n" 126 " jnz 0b\n" /* lightweight looping on locked spinlock */ 127 128 " incq %[tmp]\n" /* now use the atomic operation */ 129 " xchgq %[count], %[tmp]\n" 130 " testq %[tmp], %[tmp]\n" 131 " jnz 0b\n" 132 : [count] "+m" (val->count), 133 [tmp] "=&r" (tmp) 134 134 ); 135 135 -
kernel/arch/amd64/include/arch/cpuid.h
r47b2d7e3 r1433ecda 55 55 uint32_t cpuid_ecx; 56 56 uint32_t cpuid_edx; 57 } __attribute__ ((packed)) cpu_info_t;57 } __attribute__((packed)) cpu_info_t; 58 58 59 59 extern int has_cpuid(void); -
kernel/arch/amd64/include/arch/cycle.h
r47b2d7e3 r1433ecda 44 44 45 45 asm volatile ( 46 "rdtsc\n"47 : "=a" (lower),48 "=d" (upper)46 "rdtsc\n" 47 : "=a" (lower), 48 "=d" (upper) 49 49 ); 50 50 -
kernel/arch/amd64/include/arch/mm/page.h
r47b2d7e3 r1433ecda 198 198 unsigned int accessed : 1; 199 199 unsigned int dirty : 1; 200 unsigned int unused : 1;200 unsigned int unused : 1; 201 201 unsigned int global : 1; 202 202 unsigned int soft_valid : 1; /**< Valid content even if present bit is cleared. */ … … 205 205 unsigned int addr_32_51 : 21; 206 206 unsigned int no_execute : 1; 207 } __attribute__ ((packed)) pte_t;207 } __attribute__((packed)) pte_t; 208 208 209 209 NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i) -
kernel/arch/amd64/include/arch/pm.h
r47b2d7e3 r1433ecda 37 37 38 38 #ifndef __ASSEMBLER__ 39 #include <typedefs.h>40 #include <arch/context.h>39 #include <typedefs.h> 40 #include <arch/context.h> 41 41 #endif 42 42 … … 91 91 92 92 typedef struct { 93 unsigned limit_0_15 : 16;94 unsigned base_0_15 : 16;95 unsigned base_16_23 : 8;96 unsigned access : 8;97 unsigned limit_16_19 : 4;98 unsigned available : 1;99 unsigned longmode : 1;100 unsigned special : 1;93 unsigned limit_0_15 : 16; 94 unsigned base_0_15 : 16; 95 unsigned base_16_23 : 8; 96 unsigned access : 8; 97 unsigned limit_16_19 : 4; 98 unsigned available : 1; 99 unsigned longmode : 1; 100 unsigned special : 1; 101 101 unsigned granularity : 1; 102 unsigned base_24_31 : 8;103 } __attribute__ ((packed)) descriptor_t;102 unsigned base_24_31 : 8; 103 } __attribute__((packed)) descriptor_t; 104 104 105 105 typedef struct { 106 unsigned limit_0_15 : 16;107 unsigned base_0_15 : 16;108 unsigned base_16_23 : 8;109 unsigned type : 4;106 unsigned limit_0_15 : 16; 107 unsigned base_0_15 : 16; 108 unsigned base_16_23 : 8; 109 unsigned type : 4; 110 110 unsigned : 1; 111 111 unsigned dpl : 2; 112 112 unsigned present : 1; 113 unsigned limit_16_19 : 4;114 unsigned available : 1;113 unsigned limit_16_19 : 4; 114 unsigned available : 1; 115 115 unsigned : 2; 116 116 unsigned granularity : 1; 117 unsigned base_24_31 : 8;117 unsigned base_24_31 : 8; 118 118 unsigned base_32_63 : 32; 119 119 unsigned : 32; 120 } __attribute__ ((packed)) tss_descriptor_t;120 } __attribute__((packed)) tss_descriptor_t; 121 121 122 122 typedef struct { 123 unsigned offset_0_15 : 16;124 unsigned selector : 16;125 unsigned ist :3;126 unsigned unused : 5;127 unsigned type : 5;128 unsigned dpl : 2;123 unsigned offset_0_15 : 16; 124 unsigned selector : 16; 125 unsigned ist : 3; 126 unsigned unused : 5; 127 unsigned type : 5; 128 unsigned dpl : 2; 129 129 unsigned present : 1; 130 unsigned offset_16_31 : 16;131 unsigned offset_32_63 : 32;130 unsigned offset_16_31 : 16; 131 unsigned offset_32_63 : 32; 132 132 unsigned : 32; 133 } __attribute__ ((packed)) idescriptor_t;133 } __attribute__((packed)) idescriptor_t; 134 134 135 135 typedef struct { 136 136 uint16_t limit; 137 137 uint64_t base; 138 } __attribute__ ((packed)) ptr_16_64_t;138 } __attribute__((packed)) ptr_16_64_t; 139 139 140 140 typedef struct { 141 141 uint16_t limit; 142 142 uint32_t base; 143 } __attribute__ ((packed)) ptr_16_32_t;143 } __attribute__((packed)) ptr_16_32_t; 144 144 145 145 typedef struct { … … 160 160 uint16_t iomap_base; 161 161 uint8_t iomap[TSS_IOMAP_SIZE]; 162 } __attribute__ ((packed)) tss_t;162 } __attribute__((packed)) tss_t; 163 163 164 164 extern tss_t *tss_p;
Note:
See TracChangeset
for help on using the changeset viewer.
