Changeset 728


Ignore:
Timestamp:
Sep 8, 2022, 11:20:01 AM (3 years ago)
Author:
Paul Smedley
Message:

Fix GFP_ZERO support in vmalloc()

Location:
GPL/branches/uniaud32-next
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/include/linux/gfp.h

    r662 r728  
    22#define __LINUX_GFP_H
    33
    4 #include <asm/page.h>
    5 #include <linux/export.h>
    6 #include <linux/mm.h>
    74#include <linux/types.h>
     5
     6/*
     7 * GFP bitmasks..
     8 */
     9#define __GFP_WAIT      0x01
     10#define __GFP_LOW       0x02
     11#define __GFP_MED       0x04
     12#define __GFP_HIGH      0x08
     13#define __GFP_IO        0x10
     14#define __GFP_SWAP      0x20
    815
    916/* Plain integer GFP bitmasks. Do not use this directly. */
     
    4451#define __GFP_RETRY_MAYFAIL     ((__force gfp_t)___GFP_RETRY_MAYFAIL)
    4552#define GFP_DMA32 0             /* driver must check for 32-bit address */
     53#define GFP_BUFFER      (__GFP_LOW | __GFP_WAIT)
     54#define GFP_ATOMIC      (__GFP_HIGH)
     55#define GFP_USER        (__GFP_LOW | __GFP_WAIT | __GFP_IO)
     56#define GFP_HIGHUSER    (GFP_USER | __GFP_HIGHMEM)
     57#define GFP_KERNEL      (__GFP_MED | __GFP_WAIT | __GFP_IO)
     58#define GFP_NFS         (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
     59#define GFP_KSWAPD      (__GFP_IO | __GFP_SWAP)
     60
    4661
    4762/*
     
    5772#define __GFP_MOVABLE   ((__force gfp_t)___GFP_MOVABLE)  /* ZONE_MOVABLE allowed */
    5873#define GFP_ZONEMASK    (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
     74/* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
     75   platforms, used as appropriate on others */
     76
     77#define GFP_DMA         __GFP_DMA
     78
     79/* Flag - indicates that the buffer can be taken from high memory which is not
     80   directly addressable by the kernel */
     81
     82#define GFP_HIGHMEM     __GFP_HIGHMEM
     83#define __GFP_DMAHIGHMEM  0x100
     84#define GFP_DMAHIGHMEM    __GFP_DMAHIGHMEM
     85
    5986void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
    6087void free_pages_exact(void *virt, size_t size);
  • GPL/branches/uniaud32-next/include/linux/kernel.h

    r720 r728  
    1717#include <linux/string.h>
    1818#include <linux/math.h>
     19#include <linux/export.h>
    1920
    2021/* Optimization barrier */
  • GPL/branches/uniaud32-next/include/linux/mm.h

    r662 r728  
    1111
    1212#define NUMA_NO_NODE    (-1)
    13 /*
    14  * GFP bitmasks..
    15  */
    16 #define __GFP_WAIT      0x01
    17 #define __GFP_LOW       0x02
    18 #define __GFP_MED       0x04
    19 #define __GFP_HIGH      0x08
    20 #define __GFP_IO        0x10
    21 #define __GFP_SWAP      0x20
    22 #define ___GFP_ZERO             0x100u
    23 #define __GFP_ZERO      ((__force gfp_t)___GFP_ZERO)
    24 
    25 #ifdef TARGET_OS2
    26 #define __GFP_DMAHIGHMEM  0x100
    27 #define GFP_DMAHIGHMEM    __GFP_DMAHIGHMEM
    28 #endif
    29 
    30 #define GFP_BUFFER      (__GFP_LOW | __GFP_WAIT)
    31 #define GFP_ATOMIC      (__GFP_HIGH)
    32 #define GFP_USER        (__GFP_LOW | __GFP_WAIT | __GFP_IO)
    33 #define GFP_HIGHUSER    (GFP_USER | __GFP_HIGHMEM)
    34 #define GFP_KERNEL      (__GFP_MED | __GFP_WAIT | __GFP_IO)
    35 #define GFP_NFS         (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
    36 #define GFP_KSWAPD      (__GFP_IO | __GFP_SWAP)
    37 
    38 /* Flag - indicates that the buffer will be suitable for DMA.  Ignored on some
    39    platforms, used as appropriate on others */
    40 
    41 #define GFP_DMA         __GFP_DMA
    42 
    43 /* Flag - indicates that the buffer can be taken from high memory which is not
    44    directly addressable by the kernel */
    45 
    46 #define GFP_HIGHMEM     __GFP_HIGHMEM
    4713
    4814/*
  • GPL/branches/uniaud32-next/include/linux/slab.h

    r727 r728  
    149149};
    150150
    151 #define kvzalloc kzalloc
    152151size_t ksize(const void *);
    153152
  • GPL/branches/uniaud32-next/lib32/memory.c

    r727 r728  
    424424void *__vmalloc(unsigned long size, gfp_t gfp_mask)
    425425{
    426         return vmalloc(size);
     426    LINEAR addr;
     427    addr = (LINEAR) vmalloc(size);
     428
     429    if (gfp_mask & __GFP_ZERO)
     430        memset((LINEAR)addr, 0, size);
     431
     432    return addr;
    427433}
    428434//******************************************************************************
  • GPL/branches/uniaud32-next/lib32/pci.c

    r719 r728  
    3030#include <linux/poll.h>
    3131#include <linux/dma-mapping.h>
     32#include <linux/gfp.h>
    3233#include <asm/uaccess.h>
    3334#include <asm/hardirq.h>
Note: See TracChangeset for help on using the changeset viewer.