Changeset 495a768 in rtems-libbsd


Ignore:
Timestamp:
Sep 11, 2015, 9:49:47 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
81edae4
Parents:
4c7d385
git-author:
Sebastian Huber <sebastian.huber@…> (09/11/15 09:49:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/11/15 09:50:44)
Message:

ZONE(9): Fix slab flag handling

Disable unused slab flags.

Location:
freebsd/sys
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/kern/kern_mbuf.c

    r4c7d385 r495a768  
    426426{
    427427
     428#ifndef __rtems__
    428429        /* Inform UMA that this allocator uses kernel_map/object. */
    429430        *flags = UMA_SLAB_KERNEL;
    430 #ifndef __rtems__
    431431        return ((void *)kmem_alloc_contig(kernel_map, bytes, wait,
    432432            (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT));
  • freebsd/sys/vm/uma.h

    r4c7d385 r495a768  
    543543 * These flags are setable in the allocf and visible in the freef.
    544544 */
     545#ifndef __rtems__
    545546#define UMA_SLAB_BOOT   0x01            /* Slab alloced from boot pages */
    546547#define UMA_SLAB_KMEM   0x02            /* Slab alloced from kmem_map */
     548#endif /* __rtems__ */
    547549#define UMA_SLAB_KERNEL 0x04            /* Slab alloced from kernel_map */
     550#ifndef __rtems__
    548551#define UMA_SLAB_PRIV   0x08            /* Slab alloced from priv allocator */
    549552#define UMA_SLAB_OFFP   0x10            /* Slab is managed separately  */
    550553#define UMA_SLAB_MALLOC 0x20            /* Slab is a large malloc slab */
    551554/* 0x40 and 0x80 are available */
     555#endif /* __rtems__ */
    552556
    553557/*
  • freebsd/sys/vm/uma_core.c

    r4c7d385 r495a768  
    723723                n = LIST_NEXT(slab, us_link);
    724724
     725#ifndef __rtems__
    725726                /* We have no where to free these to */
    726727                if (slab->us_flags & UMA_SLAB_BOOT) {
     
    728729                        continue;
    729730                }
     731#endif /* __rtems__ */
    730732
    731733                LIST_REMOVE(slab, us_link);
     
    10241026        void *p;        /* Returned page */
    10251027
     1028#ifndef __rtems__
    10261029        *pflag = UMA_SLAB_KMEM;
    1027 #ifndef __rtems__
    10281030        p = (void *) kmem_malloc(kmem_map, bytes, wait);
    10291031#else /* __rtems__ */
     1032        *pflag = 0;
    10301033        p = rtems_bsd_page_alloc(bytes, wait);
    10311034#endif /* __rtems__ */
     
    11221125        kmem_free(map, (vm_offset_t)mem, size);
    11231126#else /* __rtems__ */
    1124         rtems_bsd_page_free(mem);
     1127        if (flags & UMA_SLAB_KERNEL)
     1128                free(mem, M_TEMP);
     1129        else
     1130                rtems_bsd_page_free(mem);
    11251131#endif /* __rtems__ */
    11261132}
Note: See TracChangeset for help on using the changeset viewer.