Changeset bf05c74 in mainline
- Timestamp:
- 2018-10-24T17:59:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5c38838, 889cdb1
- Parents:
- cfdeedc
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/acpi/acpi.c
rcfdeedc rbf05c74 43 43 #include <mm/km.h> 44 44 #include <log.h> 45 #include <mem.h> 45 46 46 47 #define RSDP_SIGNATURE "RSD PTR " … … 170 171 } 171 172 173 static uint8_t *search_rsdp(uint8_t *base, size_t len) 174 { 175 for (size_t i = 0; i < len; i += 16) { 176 if (memcmp(&base[i], RSDP_SIGNATURE, sizeof(RSDP_SIGNATURE)) == 0 && 177 rsdp_check(&base[i])) 178 return &base[i]; 179 } 180 181 return NULL; 182 } 183 172 184 void acpi_init(void) 173 185 { 174 uint8_t *addr[2] = { NULL, (uint8_t *) PA2KA(0xe0000) };175 unsigned int i;176 unsigned int j;177 unsigned int length[2] = { 1024, 128 * 1024 };178 uint64_t *sig = (uint64_t *) RSDP_SIGNATURE;179 180 186 /* 181 187 * Find Root System Description Pointer … … 184 190 */ 185 191 186 addr[0] = (uint8_t *) PA2KA(ebda); 187 for (i = (ebda ? 0 : 1); i < 2; i++) { 188 for (j = 0; j < length[i]; j += 16) { 189 if ((*((uint64_t *) &addr[i][j]) == *sig) && 190 (rsdp_check(&addr[i][j]))) { 191 acpi_rsdp = (struct acpi_rsdp *) &addr[i][j]; 192 goto rsdp_found; 193 } 194 } 195 } 196 197 return; 198 199 rsdp_found: 192 uint8_t *rsdp = NULL; 193 194 if (ebda) 195 rsdp = search_rsdp((uint8_t *) PA2KA(ebda), 1024); 196 197 if (!rsdp) 198 rsdp = search_rsdp((uint8_t *) PA2KA(0xe0000), 128 * 1024); 199 200 if (!rsdp) 201 return; 202 203 acpi_rsdp = (struct acpi_rsdp *) rsdp; 204 200 205 LOG("%p: ACPI Root System Description Pointer", acpi_rsdp); 201 206 -
kernel/generic/src/lib/ubsan.c
rcfdeedc rbf05c74 34 34 }; 35 35 36 struct type_mismatch_data_v1 { 37 struct source_location loc; 38 struct type_descriptor *type; 39 unsigned char log_alignment; 40 unsigned char type_check_kind; 41 }; 42 36 43 struct overflow_data { 37 44 struct source_location loc; … … 72 79 struct source_location loc; 73 80 struct source_location attr_loc; 81 }; 82 83 struct pointer_overflow_data { 84 struct source_location loc; 74 85 }; 75 86 … … 80 91 */ 81 92 void __ubsan_handle_type_mismatch(struct type_mismatch_data *data, unsigned long ptr); 93 void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, unsigned long ptr); 82 94 void __ubsan_handle_add_overflow(struct overflow_data *data, unsigned long lhs, unsigned long rhs); 83 95 void __ubsan_handle_sub_overflow(struct overflow_data *data, unsigned long lhs, unsigned long rhs); … … 97 109 #endif 98 110 void __ubsan_handle_nonnull_return(struct nonnull_return_data *data); 111 void __ubsan_handle_nonnull_return_v1(struct nonnull_return_data *data, 112 struct source_location *loc); 113 void __ubsan_handle_pointer_overflow(struct pointer_overflow_data *data, 114 unsigned long base, unsigned long result); 99 115 100 116 static void print_loc(const char *func, struct source_location *loc) … … 218 234 ubsan_panic(); 219 235 } 236 237 void __ubsan_handle_nonnull_return_v1(struct nonnull_return_data *data, 238 struct source_location *loc) 239 { 240 print_loc(__func__, &data->loc); 241 ubsan_panic(); 242 } 243 244 void __ubsan_handle_pointer_overflow(struct pointer_overflow_data *data, 245 unsigned long base, unsigned long result) 246 { 247 print_loc(__func__, &data->loc); 248 ubsan_panic(); 249 } 250 251 void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data_v1 *data, 252 unsigned long ptr) 253 { 254 print_loc(__func__, &data->loc); 255 ubsan_panic(); 256 }
Note:
See TracChangeset
for help on using the changeset viewer.