Changeset 482f968 in mainline for kernel/generic/src/mm/frame.c
- Timestamp:
- 2018-10-31T16:48:51Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 91a8f83, bab75df6
- Parents:
- 37781819
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
r37781819 r482f968 815 815 } 816 816 817 static size_t try_find_zone(size_t count, bool lowmem, 818 pfn_t frame_constraint, size_t hint) 819 { 820 if (!lowmem) { 821 size_t znum = find_free_zone(count, 822 ZONE_HIGHMEM | ZONE_AVAILABLE, frame_constraint, hint); 823 if (znum != (size_t) -1) 824 return znum; 825 } 826 827 return find_free_zone(count, ZONE_LOWMEM | ZONE_AVAILABLE, 828 frame_constraint, hint); 829 } 830 817 831 /** Allocate frames of physical memory. 818 832 * … … 843 857 irq_spinlock_lock(&zones.lock, true); 844 858 859 // TODO: Print diagnostic if neither is explicitly specified. 860 bool lowmem = (flags & FRAME_LOWMEM) || !(flags & FRAME_HIGHMEM); 861 845 862 /* 846 863 * First, find suitable frame zone. 847 864 */ 848 size_t znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags), 849 frame_constraint, hint); 865 size_t znum = try_find_zone(count, lowmem, frame_constraint, hint); 850 866 851 867 /* … … 859 875 860 876 if (freed > 0) 861 znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags),877 znum = try_find_zone(count, lowmem, 862 878 frame_constraint, hint); 863 879 … … 868 884 869 885 if (freed > 0) 870 znum = find_free_zone(count, FRAME_TO_ZONE_FLAGS(flags),886 znum = try_find_zone(count, lowmem, 871 887 frame_constraint, hint); 872 888 }
Note:
See TracChangeset
for help on using the changeset viewer.