Changeset 3772af6 in mainline


Ignore:
Timestamp:
2013-09-09T20:25:27Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ee7f78a
Parents:
c501bc4
Message:

remove the special-purpose DMA zone (including the ZONE_DMA and FRAME_DMA flags)
this most probably breaks Sound Blaster 16, but it is reported to be broken anyhow
a proper platform-independent DMA memory allocation is in the works

Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/mm/frame.c

    rc501bc4 r3772af6  
    4747
    4848#define PHYSMEM_LIMIT32  UINT64_C(0x100000000)
    49 #define PHYSMEM_LIMIT_DMA   UINT64_C(0x1000000)
    5049
    5150size_t hardcoded_unmapped_ktext_size = 0;
     
    9291                                else
    9392                                        conf = minconf;
    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                                 }
     93                                zone_create(pfn, count, conf,
     94                                    ZONE_AVAILABLE | ZONE_LOWMEM);
    11095                        } else {
    11196                                conf = zone_external_conf_alloc(count);
    112                                 if (conf != 0) {
     97                                if (conf != 0)
    11398                                        zone_create(pfn, count, conf,
    11499                                            ZONE_AVAILABLE | ZONE_HIGHMEM);
    115                                 }
    116100                        }
    117101                } else if ((e820table[i].type == MEMMAP_MEMORY_ACPI) ||
  • kernel/generic/include/mm/frame.h

    rc501bc4 r3772af6  
    6363/** Allocate a frame which cannot be identity-mapped. */
    6464#define FRAME_HIGHMEM     0x20
    65 /** Allocate a frame which needs to be from DMA zone. */
    66 #define FRAME_DMA         0x40
    6765
    6866typedef uint8_t zone_flags_t;
     
    7977/** Zone contains memory that cannot be identity-mapped */
    8078#define ZONE_HIGHMEM    0x10
    81 /** Zone contains memory suitable for old ISA DMA */
    82 #define ZONE_DMA        0x20
    8379
    8480/** Mask of zone bits that must be matched exactly. */
    8581#define ZONE_EF_MASK    0x7
    8682
    87 #define FRAME_TO_ZONE_FLAGS(ff) \
    88         ((((ff) & FRAME_DMA) ? ZONE_DMA : \
    89             (((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : \
     83#define FRAME_TO_ZONE_FLAGS(ff) \
     84        ((((ff) & FRAME_LOWMEM) ? ZONE_LOWMEM : \
    9085            (((ff) & FRAME_HIGHMEM) ? ZONE_HIGHMEM : \
    91             ZONE_LOWMEM /* | ZONE_HIGHMEM */))) | \
     86            ZONE_LOWMEM /* | ZONE_HIGHMEM */)) | \
    9287            ZONE_AVAILABLE)
    9388
  • kernel/generic/src/ddi/ddi.c

    rc501bc4 r3772af6  
    336336                order = fnzb(pages - 1) + 1;
    337337       
    338         *phys = frame_alloc_noreserve(order, FRAME_DMA);
     338        *phys = frame_alloc_noreserve(order, 0);
    339339        if (*phys == NULL)
    340340                return ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.