-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mostly concerns older toolchains, usage of strtol in the OSD API hand…
…ler, missing parts for Anyka
- Loading branch information
Showing
17 changed files
with
279 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "ak_common.h" | ||
|
||
typedef struct { | ||
void *handle, *handleAkuio, *handleThread; | ||
|
||
int (*fnGetErrorNum)(void); | ||
char* (*fnGetErrorStr)(int error); | ||
} ak_sys_impl; | ||
|
||
static int ak_sys_load(ak_sys_impl *sys_lib) { | ||
if (!(sys_lib->handleThread = dlopen("libplat_thread.so", RTLD_LAZY | RTLD_GLOBAL))) | ||
HAL_ERROR("ak_sys", "Failed to load library!\nError: %s\n", dlerror()); | ||
|
||
if (!(sys_lib->handleAkuio = dlopen("libakuio.so", RTLD_LAZY | RTLD_GLOBAL))) | ||
HAL_ERROR("ak_sys", "Failed to load library!\nError: %s\n", dlerror()); | ||
|
||
if (!(sys_lib->handle = dlopen("libplat_common.so", RTLD_LAZY | RTLD_GLOBAL))) | ||
HAL_ERROR("ak_sys", "Failed to load library!\nError: %s\n", dlerror()); | ||
|
||
if (!(sys_lib->fnGetErrorNum = (int(*)(void)) | ||
hal_symbol_load("ak_sys", sys_lib->handle, "ak_get_error_no"))) | ||
return EXIT_FAILURE; | ||
|
||
if (!(sys_lib->fnGetErrorStr = (char*(*)(int error)) | ||
hal_symbol_load("ak_sys", sys_lib->handle, "ak_get_error_str"))) | ||
return EXIT_FAILURE; | ||
|
||
return EXIT_SUCCESS; | ||
} | ||
|
||
static void ak_sys_unload(ak_sys_impl *sys_lib) { | ||
if (sys_lib->handle) dlclose(sys_lib->handle); | ||
sys_lib->handle = NULL; | ||
if (sys_lib->handleAkuio) dlclose(sys_lib->handleAkuio); | ||
sys_lib->handleAkuio = NULL; | ||
if (sys_lib->handleThread) dlclose(sys_lib->handleThread); | ||
sys_lib->handleThread = NULL; | ||
memset(sys_lib, 0, sizeof(*sys_lib)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.