Changeset ab92305 in mainline for kernel/generic
- Timestamp:
- 2013-08-19T17:23:31Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4da8fdb
- Parents:
- 2921602 (diff), 4a9728ec (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/generic
- Files:
-
- 5 edited
-
include/mm/as.h (modified) (1 diff)
-
include/mm/frame.h (modified) (3 diffs)
-
src/ddi/ddi.c (modified) (2 diffs)
-
src/mm/as.c (modified) (1 diff)
-
src/mm/frame.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/as.h
r2921602 rab92305 250 250 extern int as_area_change_flags(as_t *, unsigned int, uintptr_t); 251 251 252 //TODO REMOVE! 253 extern as_area_t * find_locked_area(as_t *as, uintptr_t va); 254 252 255 extern unsigned int as_area_get_flags(as_area_t *); 253 256 extern bool as_area_check_access(as_area_t *, pf_access_t); -
kernel/generic/include/mm/frame.h
r2921602 rab92305 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
r2921602 rab92305 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; … … 361 361 NO_TRACE static int dmamem_unmap_anonymous(uintptr_t virt) 362 362 { 363 // TODO: implement unlocking & unmap 364 return EOK; 363 // TODO: This is an ugly hack 364 as_t *as = TASK->as; 365 366 mutex_lock(&as->lock); 367 as_area_t *area = find_locked_area(as, virt); 368 if (!area) { 369 mutex_unlock(&as->lock); 370 return ENOENT; 371 } 372 frame_free_noreserve(area->backend_data.base); 373 area->backend_data.base = 0; 374 area->backend_data.frames = 0; 375 mutex_unlock(&area->lock); 376 mutex_unlock(&as->lock); 377 378 return as_area_destroy(as, virt); 365 379 } 366 380 -
kernel/generic/src/mm/as.c
r2921602 rab92305 672 672 673 673 return NULL; 674 } 675 676 /** UGLY! UGLY! UGLY! */ 677 // TODO: REMOVE ASAP! 678 as_area_t * find_locked_area(as_t *as, uintptr_t va) 679 { 680 return find_area_and_lock(as, va); 674 681 } 675 682 -
kernel/generic/src/mm/frame.c
r2921602 rab92305 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.
