Changeset aaceebc4 in mainline
- Timestamp:
- 2013-03-12T23:10:57Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf39b2e
- Parents:
- 428bd07
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/mm/frame.c
r428bd07 raaceebc4 47 47 48 48 #define PHYSMEM_LIMIT32 UINT64_C(0x100000000) 49 #define PHYSMEM_LIMIT_DMA UINT64_C(0x1000000) 49 50 50 51 size_t hardcoded_unmapped_ktext_size = 0; … … 91 92 else 92 93 conf = minconf; 93 zone_create(pfn, count, conf, 94 ZONE_AVAILABLE | ZONE_LOWMEM); 94 95 if ((pfn * PAGE_SIZE) < PHYSMEM_LIMIT_DMA) { 96 size_t dma_count = min( 97 PHYSMEM_LIMIT_DMA / PAGE_SIZE - pfn, 98 count); 99 zone_create(pfn, dma_count, conf, 100 ZONE_AVAILABLE | ZONE_DMA); 101 count -= dma_count; 102 pfn += dma_count; 103 } 104 105 conf = pfn; 106 if (count) { 107 zone_create(pfn, count, conf, 108 ZONE_AVAILABLE | ZONE_LOWMEM); 109 } 95 110 } else { 96 111 conf = zone_external_conf_alloc(count); 97 if (conf != 0) 112 if (conf != 0) { 98 113 zone_create(pfn, count, conf, 99 114 ZONE_AVAILABLE | ZONE_HIGHMEM); 115 } 100 116 } 101 117 } else if ((e820table[i].type == MEMMAP_MEMORY_ACPI) || -
kernel/generic/include/mm/frame.h
r428bd07 raaceebc4 63 63 /** Allocate a frame which cannot be identity-mapped. */ 64 64 #define FRAME_HIGHMEM 0x20 65 /** Allocate a frame which needs to be from DMA zone. */ 66 #define FRAME_DMA 0x40 65 67 66 68 typedef uint8_t zone_flags_t; … … 77 79 /** Zone contains memory that cannot be identity-mapped */ 78 80 #define ZONE_HIGHMEM 0x10 81 /** Zone contains memory suitable for old ISA DMA */ 82 #define ZONE_DMA 0x20 79 83 80 84 /** Mask of zone bits that must be matched exactly. */ … … 82 86 83 87 #define FRAME_TO_ZONE_FLAGS(ff) \ 84 ((((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : \ 88 ((((ff) & FRAME_DMA) ? ZONE_DMA : \ 89 (((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : \ 85 90 (((ff) & FRAME_HIGHMEM) ? ZONE_HIGHMEM : \ 86 ZONE_LOWMEM /* | ZONE_HIGHMEM */)) | \87 ZONE_AVAILABLE) 91 ZONE_LOWMEM /* | ZONE_HIGHMEM */))) | \ 92 ZONE_AVAILABLE) 88 93 89 94 #define ZONE_FLAGS_MATCH(zf, f) \ -
kernel/generic/src/ddi/ddi.c
r428bd07 raaceebc4 336 336 order = fnzb(pages - 1) + 1; 337 337 338 *phys = frame_alloc_noreserve(order, 0);338 *phys = frame_alloc_noreserve(order, FRAME_DMA); 339 339 if (*phys == NULL) 340 340 return ENOMEM; -
kernel/generic/src/mm/frame.c
r428bd07 raaceebc4 518 518 NO_TRACE static void zone_mark_unavailable(zone_t *zone, size_t frame_idx) 519 519 { 520 ASSERT(zone->flags & ZONE_AVAILABLE); 520 if (!(zone->flags & ZONE_AVAILABLE)) 521 return; 522 // ASSERT(zone->flags & ZONE_AVAILABLE); 521 523 522 524 frame_t *frame = zone_get_frame(zone, frame_idx); … … 935 937 } 936 938 937 if (confframe >= start + count) 938 panic("Cannot find configuration data for zone."); 939 if (confframe >= start + count) { 940 flags &= ~ZONE_AVAILABLE; 941 goto nonavail; 942 // panic("Cannot find configuration data for zone."); 943 } 939 944 } 940 945 … … 960 965 return znum; 961 966 } 962 967 nonavail: 968 (void)0; // label trick 963 969 /* Non-available zone */ 964 970 size_t znum = zones_insert_zone(start, count, flags);
Note:
See TracChangeset
for help on using the changeset viewer.