blob: de1de1afd0c5d3ba747a3c945ef15173c161e321 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#ifndef __AOS_RESOURCE_H_
2#define __AOS_RESOURCE_H_
3
4// notes at <https://docs.google.com/document/d/1gzRrVcqL2X9VgNQUI5DrvLVVVziIH7c5ZerATVbiS7U/edit?hl=en_US>
5
6#include <sys/types.h>
7#include "shared_mem.h"
8#include "binheap.h"
9#include "aos_sync.h"
10#include "core_lib.h"
11
12#define AOS_RESOURCE_PRIORITY_STACK_LENGTH 50
13
14extern int RESOURCE_KILL_SIGNAL;
15
16/* Return Values
17 0 = success
18 -1 = you should stop (like if you got killed) (only for request)
19 1 = error
20*/
21int aos_resource_request(aos_resource_entity *local, aos_resource *resource);
22int aos_resource_release(aos_resource_entity *local, aos_resource *resource);
23int aos_resource_entity_set_parent(aos_resource_entity *local, aos_resource_entity *parent);
24aos_resource_entity *aos_resource_entity_create(uint8_t base_priority);
25aos_resource *aos_resource_get(uint16_t num);
26aos_resource_entity *aos_resource_entity_root_get(void);
27
28#endif