1/** 2 * \file 3 * \brief RAM allocator code (client-side) definitions 4 */ 5 6/* 7 * Copyright (c) 2007, 2008, 2009, 2011, ETH Zurich. 8 * All rights reserved. 9 * 10 * This file is distributed under the terms in the attached LICENSE file. 11 * If you do not find this file, copies can be found by writing to: 12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. 13 */ 14 15 16#ifndef BARRELFISH_RAM_ALLOC_H 17#define BARRELFISH_RAM_ALLOC_H 18 19#include <stdint.h> 20#include <errors/errno.h> 21#include <sys/cdefs.h> 22 23__BEGIN_DECLS 24 25struct capref; 26 27typedef errval_t (* ram_alloc_func_t)(struct capref *ret, uint8_t size_bits, 28 uint64_t minbase, uint64_t maxlimit); 29 30errval_t ram_alloc_fixed(struct capref *ret, uint8_t size_bits, 31 uint64_t minbase, uint64_t maxlimit); 32errval_t ram_alloc(struct capref *retcap, uint8_t size_bits); 33errval_t ram_available(genpaddr_t *available, genpaddr_t *total); 34errval_t ram_alloc_set(ram_alloc_func_t local_allocator); 35void ram_set_affinity(uint64_t minbase, uint64_t maxlimit); 36void ram_get_affinity(uint64_t *minbase, uint64_t *maxlimit); 37void ram_alloc_init(void); 38 39__END_DECLS 40 41#endif // BARRELFISH_RAM_ALLOC_H 42