luat_lib_coremark.c 800 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "luat_base.h"
  2. #include "printf.h"
  3. #define LUAT_LOG_TAG "coremark"
  4. #include "luat_log.h"
  5. void ee_main(void);;
  6. int ee_printf(const char *fmt, ...) {
  7. va_list va;
  8. va_start(va, fmt);
  9. char buff[512];
  10. vsnprintf_(buff, 512, fmt, va);
  11. va_end(va);
  12. LLOGD("%s", buff);
  13. return 0;
  14. }
  15. // uint32_t ee_iterations = 0;
  16. static int l_coremark_run(lua_State *L) {
  17. // if (lua_isinteger(L, 1))
  18. // ee_iterations = luaL_checkinteger(L, 1);
  19. // else
  20. // ee_iterations = 10*10000;
  21. ee_main();
  22. return 0;
  23. }
  24. #include "rotable2.h"
  25. static const rotable_Reg_t reg_coremark[] =
  26. {
  27. { "run" , ROREG_FUNC(l_coremark_run)},
  28. { NULL, {}}
  29. };
  30. LUAMOD_API int luaopen_coremark( lua_State *L ) {
  31. luat_newlib2(L, reg_coremark);
  32. return 1;
  33. }