Changeset 74df77d in mainline
- Timestamp:
- 2005-06-10T16:18:43Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 87cd61f
- Parents:
- 18e0a6c
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/atomic.h
r18e0a6c r74df77d 48 48 } 49 49 50 static inline int test_and_set( int *val) {50 static inline int test_and_set(volatile int *val) { 51 51 int v; 52 52 … … 62 62 63 63 64 extern void spinlock_arch( int *val);64 extern void spinlock_arch(volatile int *val); 65 65 66 66 #endif -
arch/ia32/src/acpi/acpi.c
r18e0a6c r74df77d 79 79 void map_sdt(struct acpi_sdt_header *sdt) 80 80 { 81 int i, cnt, length;82 83 81 map_page_to_frame((__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0); 84 85 length = sdt->length + ((__address) sdt) - ((__address) sdt)&0xfffff000; 86 cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0); 87 88 for (i = 1; i < cnt; i++) 89 map_page_to_frame(((__address) sdt) + i*PAGE_SIZE, ((__address) sdt) + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); 82 map_structure((__address) sdt, sdt->length); 90 83 } 91 84 -
arch/ia32/src/mm/page.c
r18e0a6c r74df77d 61 61 62 62 /* 63 * Identity mapping for all but 0th page.64 * PA2KA(identity) mapping for all but 0th page.63 * Identity mapping for all frames. 64 * PA2KA(identity) mapping for all frames. 65 65 */ 66 for (i = 1; i < frames; i++) {66 for (i = 0; i < frames; i++) { 67 67 map_page_to_frame(i * PAGE_SIZE, i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); 68 68 map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba)); -
arch/ia32/src/smp/mps.c
r18e0a6c r74df77d 405 405 struct __processor_entry *pr; 406 406 __address src, dst; 407 __address frame;408 407 int i; 409 408 … … 417 416 /* 418 417 * We need to access data in frame 0. 419 */ 420 frame = frame_alloc(0); 421 map_page_to_frame(frame,0,PAGE_CACHEABLE,0); 418 * We boldly make use of kernel address space mapping. 419 */ 422 420 423 421 /* 424 422 * Set the warm-reset vector to the real-mode address of 4K-aligned ap_boot() 425 423 */ 426 *((__u16 *) (frame + 0x467+0)) = ((__address) ap_boot) >> 4; /* segment */ 427 *((__u16 *) (frame + 0x467+2)) = 0; /* offset */ 428 429 /* 430 * Give back and unmap the borrowed frame. 431 */ 432 map_page_to_frame(frame,0,PAGE_NOT_PRESENT,0); 433 frame_free(frame); 434 424 *((__u16 *) (PA2KA(0x467+0))) = ((__address) ap_boot) >> 4; /* segment */ 425 *((__u16 *) (PA2KA(0x467+2))) = 0; /* offset */ 426 435 427 /* 436 428 * Save 0xa to address 0xf of the CMOS RAM. … … 472 464 473 465 memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor)); 466 memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0); 474 467 gdtr.base = KA2PA((__address) gdt_new); 475 468 -
include/mm/page.h
r18e0a6c r74df77d 32 32 #include <arch/types.h> 33 33 #include <arch/mm/page.h> 34 #include <typedefs.h> 34 35 35 36 #define PAGE_NOT_CACHEABLE (0<<0) … … 48 49 extern void page_init(void); 49 50 extern void map_page_to_frame(__address page, __address frame, int flags, __address root); 51 extern void map_structure(__address s, size_t size); 50 52 51 53 #endif -
src/mm/page.c
r18e0a6c r74df77d 29 29 #include <mm/page.h> 30 30 #include <arch/mm/page.h> 31 #include <arch/types.h> 32 #include <typedefs.h> 31 33 32 34 void page_init(void) … … 35 37 map_page_to_frame(0x0, 0x0, PAGE_NOT_PRESENT, 0); 36 38 } 39 40 /** Map memory structure 41 * 42 * Identity-map memory structure 43 * considering possible crossings 44 * of page boundaries. 45 * 46 * @param s Address of the structure. 47 * @param size Size of the structure. 48 */ 49 void map_structure(__address s, size_t size) 50 { 51 int i, cnt, length; 52 53 /* TODO: implement portable way of computing page address from address */ 54 length = size + (s - (s & 0xfffff000)); 55 cnt = length/PAGE_SIZE + (length%PAGE_SIZE>0); 56 57 for (i = 0; i < cnt; i++) 58 map_page_to_frame(s + i*PAGE_SIZE, s + i*PAGE_SIZE, PAGE_NOT_CACHEABLE, 0); 59 60 }
Note:
See TracChangeset
for help on using the changeset viewer.