[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Kentry



Frank Naumann napisał(a):
Hello!

I'd like to add to kentry/kentry_module:

long _cdecl (*register_shutdown)(long _cdecl (*on_shutdown)(long mode));

Module (device driver or such) could register a function that can be executed at system shutdown, or module unload. "mode" parameter can be following:

#define SHUTOWN 0 /* system is going down, all processes are killed, all file descriptors closed */ #define UNLOAD 1 /* just unload module. System is fully operational and should be operational after this function */

All other values are reserved. If on_shutdown function will get any other value, it should exit at once returning E_OK.

on_shutdown return value should be E_OK if function succeded, or error value if it didn't.

Any comments?


Yes, in this way it don't make much sense and it will not work (e.g. for example to which module belongs the callback?). I planned such things for an extended module interface. Dynamic unload of modules is a little bit problematic as until now no kernel part track a reference if the module is still in use (I'm sure a module unload should be denied if some kernel data structures still reference it :-)).

Ok, the "unload" feature was an extra in my mind, so, how does it look without unload? Just the on_shutdown feature?

--
Semper Fidelis

Adam Klobukowski
atari@gabo.pl