tests: add am-tests

This commit is contained in:
Zihao Yu 2020-08-23 19:54:16 +08:00
parent 8fbf7f9425
commit 0a123cc9e6
11 changed files with 405 additions and 0 deletions

View file

@ -0,0 +1,24 @@
#ifndef __AMUNIT_H__
#define __AMUNIT_H__
#include <am.h>
#include <klib.h>
#include <klib-macros.h>
#define IOE ({ ioe_init(); })
#define CTE(h) ({ Context *h(Event, Context *); cte_init(h); })
#define VME(f1, f2) ({ void *f1(int); void f2(void *); vme_init(f1, f2); })
#define MPE ({ mpe_init(entry); })
extern void (*entry)();
#define CASE(id, entry_, ...) \
case id: { \
void entry_(); \
entry = entry_; \
__VA_ARGS__; \
entry_(); \
break; \
}
#endif