mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[libj6] Remove driver_main
The `driver_main` sinature was an alternate signature for `main` implemented with weak symbols, but it causes linking issues when not statically linked, and drivers are going to work differently soon anyway. Just get rid of it for now.
This commit is contained in:
@@ -73,6 +73,9 @@ struct j6_init_args
|
||||
/// Find the first handle of the given type held by this process
|
||||
j6_handle_t j6_find_first_handle(j6_object_type obj_type);
|
||||
|
||||
/// Get the init args
|
||||
const j6_init_args * j6_get_init_args();
|
||||
|
||||
/// Drivers may use driver_main instead of main
|
||||
int driver_main(unsigned, const char **, const char **, const j6_init_args *);
|
||||
|
||||
|
||||
@@ -36,12 +36,18 @@ j6_find_first_handle(j6_object_type obj_type)
|
||||
return j6_handle_invalid;
|
||||
}
|
||||
|
||||
extern "C" j6_init_args *
|
||||
const j6_init_args *
|
||||
j6_get_init_args()
|
||||
{
|
||||
return &init_args;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
__init_libj6(uint64_t arg0, uint64_t arg1)
|
||||
{
|
||||
init_args.args[0] = arg0;
|
||||
init_args.args[1] = arg1;
|
||||
return &init_args;
|
||||
}
|
||||
|
||||
|
||||
#endif // __j6kernel
|
||||
|
||||
@@ -7,7 +7,6 @@ j6 = module("j6",
|
||||
"channel.cpp",
|
||||
"condition.cpp",
|
||||
"init.cpp",
|
||||
"init.s",
|
||||
"memutils.cpp",
|
||||
"mutex.cpp",
|
||||
"protocol_ids.cpp",
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
int
|
||||
driver_main(unsigned argc, const char **argv, const char **env, const j6_init_args *init)
|
||||
main(int argc, const char **argv, const char **env)
|
||||
{
|
||||
j6::syslog("fb driver starting");
|
||||
|
||||
@@ -28,6 +28,7 @@ driver_main(unsigned argc, const char **argv, const char **env, const j6_init_ar
|
||||
using bootproto::devices::video_mode;
|
||||
using bootproto::devices::fb_layout;
|
||||
|
||||
const j6_init_args *init = j6_get_init_args();
|
||||
const uefi_fb *fb = reinterpret_cast<const uefi_fb*>(init->args[0]);
|
||||
|
||||
if (!fb || !fb->framebuffer) {
|
||||
|
||||
@@ -27,7 +27,7 @@ using bootproto::module_type;
|
||||
constexpr uintptr_t stack_top = 0xf80000000;
|
||||
|
||||
int
|
||||
driver_main(unsigned argc, const char **argv, const char **env, const j6_init_args *initp)
|
||||
main(int argc, const char **argv, const char **env)
|
||||
{
|
||||
j6_status_t s;
|
||||
|
||||
@@ -74,6 +74,7 @@ driver_main(unsigned argc, const char **argv, const char **env, const j6_init_ar
|
||||
if (s != j6_status_ok)
|
||||
return s;
|
||||
|
||||
const j6_init_args *initp = j6_get_init_args();
|
||||
uintptr_t modules_addr = initp->args[0];
|
||||
|
||||
std::vector<const module*> mods;
|
||||
|
||||
Reference in New Issue
Block a user