Changeset 89c57b6 in mainline for kernel/generic/include/mm


Ignore:
Timestamp:
2011-04-13T14:45:41Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
kernel/generic/include/mm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/mm/as.h

    rcefb126 r89c57b6  
    115115       
    116116        /**
    117          * Number of processors on wich is this address space active.
    118          * Protected by asidlock.
     117         * Number of processors on which this
     118         * address space is active. Protected by
     119         * asidlock.
    119120         */
    120121        size_t cpu_refcount;
    121122       
    122         /**
    123          * Address space identifier.
    124          * Constant on architectures that do not support ASIDs.
    125          * Protected by asidlock.
     123        /** Address space identifier.
     124         *
     125         * Constant on architectures that do not
     126         * support ASIDs. Protected by asidlock.
     127         *
    126128         */
    127129        asid_t asid;
    128130       
    129         /** Number of references (i.e tasks that reference this as). */
     131        /** Number of references (i.e. tasks that reference this as). */
    130132        atomic_t refcount;
    131133       
     
    171173        PF_ACCESS_READ,
    172174        PF_ACCESS_WRITE,
    173         PF_ACCESS_EXEC
     175        PF_ACCESS_EXEC,
     176        PF_ACCESS_UNKNOWN
    174177} pf_access_t;
    175178
     
    198201typedef struct {
    199202        mutex_t lock;
     203       
    200204        /** Containing address space. */
    201205        as_t *as;
    202206       
    203         /**
    204          * Flags related to the memory represented by the address space area.
    205          */
     207        /** Memory flags. */
    206208        unsigned int flags;
    207209       
    208         /** Attributes related to the address space area itself. */
     210        /** Address space area attributes. */
    209211        unsigned int attributes;
    210         /** Size of this area in multiples of PAGE_SIZE. */
     212       
     213        /** Number of pages in the area. */
    211214        size_t pages;
     215       
     216        /** Number of resident pages in the area. */
     217        size_t resident;
     218       
    212219        /** Base address of this area. */
    213220        uintptr_t base;
     221       
    214222        /** Map of used space. */
    215223        btree_t used_space;
    216224       
    217225        /**
    218          * If the address space area has been shared, this pointer will
    219          * reference the share info structure.
     226         * If the address space area is shared. this is
     227         * a reference to the share info structure.
    220228         */
    221229        share_info_t *sh_info;
     
    260268extern bool as_area_check_access(as_area_t *, pf_access_t);
    261269extern size_t as_area_get_size(uintptr_t);
    262 extern int used_space_insert(as_area_t *, uintptr_t, size_t);
    263 extern int used_space_remove(as_area_t *, uintptr_t, size_t);
    264 
     270extern bool used_space_insert(as_area_t *, uintptr_t, size_t);
     271extern bool used_space_remove(as_area_t *, uintptr_t, size_t);
    265272
    266273/* Interface to be implemented by architectures. */
     
    302309
    303310/* Address space area related syscalls. */
    304 extern unative_t sys_as_area_create(uintptr_t, size_t, unsigned int);
    305 extern unative_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
    306 extern unative_t sys_as_area_change_flags(uintptr_t, unsigned int);
    307 extern unative_t sys_as_area_destroy(uintptr_t);
     311extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int);
     312extern sysarg_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
     313extern sysarg_t sys_as_area_change_flags(uintptr_t, unsigned int);
     314extern sysarg_t sys_as_area_destroy(uintptr_t);
     315extern sysarg_t sys_as_get_unmapped_area(uintptr_t, size_t);
    308316
    309317/* Introspection functions. */
  • kernel/generic/include/mm/frame.h

    rcefb126 r89c57b6  
    3838
    3939#include <typedefs.h>
     40#include <trace.h>
    4041#include <adt/list.h>
    4142#include <mm/buddy.h>
     
    115116extern zones_t zones;
    116117
    117 static inline uintptr_t PFN2ADDR(pfn_t frame)
     118NO_TRACE static inline uintptr_t PFN2ADDR(pfn_t frame)
    118119{
    119120        return (uintptr_t) (frame << FRAME_WIDTH);
    120121}
    121122
    122 static inline pfn_t ADDR2PFN(uintptr_t addr)
     123NO_TRACE static inline pfn_t ADDR2PFN(uintptr_t addr)
    123124{
    124125        return (pfn_t) (addr >> FRAME_WIDTH);
    125126}
    126127
    127 static inline size_t SIZE2FRAMES(size_t size)
     128NO_TRACE static inline size_t SIZE2FRAMES(size_t size)
    128129{
    129130        if (!size)
     
    132133}
    133134
    134 static inline size_t FRAMES2SIZE(size_t frames)
     135NO_TRACE static inline size_t FRAMES2SIZE(size_t frames)
    135136{
    136137        return (size_t) (frames << FRAME_WIDTH);
    137138}
    138139
    139 static inline bool zone_flags_available(zone_flags_t flags)
     140NO_TRACE static inline bool zone_flags_available(zone_flags_t flags)
    140141{
    141142        return ((flags & (ZONE_RESERVED | ZONE_FIRMWARE)) == 0);
     
    143144
    144145#define IS_BUDDY_ORDER_OK(index, order) \
    145     ((~(((unative_t) -1) << (order)) & (index)) == 0)
     146    ((~(((sysarg_t) -1) << (order)) & (index)) == 0)
    146147#define IS_BUDDY_LEFT_BLOCK(zone, frame) \
    147148    (((frame_index((zone), (frame)) >> (frame)->buddy_order) & 0x01) == 0)
     
    166167extern void frame_set_parent(pfn_t, void *, size_t);
    167168extern void frame_mark_unavailable(pfn_t, size_t);
    168 extern uintptr_t zone_conf_size(size_t);
     169extern size_t zone_conf_size(size_t);
    169170extern bool zone_merge(size_t, size_t);
    170171extern void zone_merge_all(void);
  • kernel/generic/include/mm/slab.h

    rcefb126 r89c57b6  
    126126extern void slab_cache_destroy(slab_cache_t *);
    127127
    128 extern void * slab_alloc(slab_cache_t *, unsigned int);
     128extern void *slab_alloc(slab_cache_t *, unsigned int)
     129    __attribute__((malloc));
    129130extern void slab_free(slab_cache_t *, void *);
    130131extern size_t slab_reclaim(unsigned int);
     
    138139
    139140/* malloc support */
    140 extern void *malloc(size_t, unsigned int);
     141extern void *malloc(size_t, unsigned int)
     142    __attribute__((malloc));
    141143extern void *realloc(void *, size_t, unsigned int);
    142144extern void free(void *);
Note: See TracChangeset for help on using the changeset viewer.