brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame^] | 1 | #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 | |
| 14 | extern 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 | */ |
| 21 | int aos_resource_request(aos_resource_entity *local, aos_resource *resource); |
| 22 | int aos_resource_release(aos_resource_entity *local, aos_resource *resource); |
| 23 | int aos_resource_entity_set_parent(aos_resource_entity *local, aos_resource_entity *parent); |
| 24 | aos_resource_entity *aos_resource_entity_create(uint8_t base_priority); |
| 25 | aos_resource *aos_resource_get(uint16_t num); |
| 26 | aos_resource_entity *aos_resource_entity_root_get(void); |
| 27 | |
| 28 | #endif |