Changeset 2c3d8b9 in rtems-libbsd


Ignore:
Timestamp:
Jul 20, 2012, 7:17:05 PM (8 years ago)
Author:
Jennifer Averett <jennifer.averett@…>
Branches:
4.11, a8f29d695e152575479ad1a97fa354f661bebd4d, freebsd-9.3, d892051f37c2c4ad7f345f6a817ea3d38e56a431
Children:
e717e81
Parents:
8fa929e
Message:

Added rtems specific page tracking methods for uma page allocation.

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r8fa929e r2c3d8b9  
    3737C_FILES += rtemsbsd/src/rtems-bsd-rwlock.c
    3838C_FILES += rtemsbsd/src/rtems-bsd-generic.c
     39C_FILES += rtemsbsd/src/rtems-bsd-page.c
    3940C_FILES += rtemsbsd/src/rtems-bsd-panic.c
    4041C_FILES += rtemsbsd/src/rtems-bsd-synch.c
  • freebsd-to-rtems.py

    r8fa929e r2c3d8b9  
    643643                'src/rtems-bsd-rwlock.c',
    644644                'src/rtems-bsd-generic.c',
     645                'src/rtems-bsd-page.c',
    645646                'src/rtems-bsd-panic.c',
    646647                'src/rtems-bsd-synch.c',
  • freebsd/vm/uma_core.c

    r8fa929e r2c3d8b9  
    8686#include <freebsd/vm/vm_kern.h>
    8787#include <freebsd/vm/vm_extern.h>
     88#else
     89void *rtems_page_alloc(int bytes);
     90void *rtems_page_find( void *address );
     91void rtems_page_free( void *address );
    8892#endif /* __rtems__ */
    8993#include <freebsd/vm/uma.h>
     
    10071011 *      NULL if M_NOWAIT is set.
    10081012 */
     1013#ifdef __rtems__
     1014#define PAGE_MASK       (PAGE_SIZE-1)
     1015
     1016#define round_page(x) ((((unsigned long )(x)) + PAGE_MASK) & ~(PAGE_MASK))
     1017#endif
    10091018static void *
    10101019page_alloc(uma_zone_t zone, int bytes, u_int8_t *pflag, int wait)
    10111020{
    1012         void *p;        /* Returned page */
    1013 
    1014         *pflag = UMA_SLAB_KMEM;
     1021     void *p;    /* Returned page */
     1022
     1023     *pflag = UMA_SLAB_KMEM;
    10151024#ifndef __rtems__
    1016         p = (void *) kmem_malloc(kmem_map, bytes, wait);
     1025     p = (void *) kmem_malloc(kmem_map, bytes, wait);
    10171026#else /* __rtems__ */
    1018         p = (void *) malloc(bytes, M_TEMP, wait);
     1027     p = rtems_page_alloc(bytes);
    10191028#endif /* __rtems__ */
    10201029
    1021         return (p);
     1030     return (p);
    10221031}
    10231032
     
    11121121        kmem_free(map, (vm_offset_t)mem, size);
    11131122#else /* __rtems__ */
    1114         free( mem, M_TEMP );
     1123        rtems_page_free( mem );
    11151124#endif /* __rtems__ */
    11161125}
     
    27732782
    27742783        if (!(zone->uz_flags & UMA_ZONE_VTOSLAB)) {
     2784#ifndef __rtems__
    27752785                mem = (u_int8_t *)((unsigned long)item & (~UMA_SLAB_MASK));
     2786#else /* __rtems__ */
     2787                mem = rtems_page_find(item);
     2788#endif /* __rtems__ */
    27762789                keg = zone_first_keg(zone); /* Must only be one. */
    27772790                if (zone->uz_flags & UMA_ZONE_HASH) {
Note: See TracChangeset for help on using the changeset viewer.