blob: 538684eb44559bb7145a4922200847dda453f74c [file] [log] [blame]
Brian Silverman14fd0fb2014-01-14 21:42:01 -08001#ifndef AOS_LINUX_CODE_INIT_H_
2#define AOS_LINUX_CODE_INIT_H_
brians343bc112013-02-10 01:53:46 +00003
4namespace aos {
5
Brian Silverman6da04272014-05-18 18:47:48 -07006// In order to use shared memory, one of the Init* functions must be called in
7// exactly 1 thread per process. It is OK to keep going without calling one of
8// them again after fork(2)ing.
9
brians343bc112013-02-10 01:53:46 +000010// Does the non-realtime parts of the initialization process.
11void InitNRT();
12// Initializes everything, including the realtime stuff.
Brian Silvermanf3cfbd72013-10-28 16:26:09 -070013// relative_priority adjusts the priority of this process relative to all of the
14// other ones (positive for higher priority).
15void Init(int relative_priority = 0);
brians343bc112013-02-10 01:53:46 +000016// Same as InitNRT, except will remove an existing shared memory file and create
17// a new one.
18void InitCreate();
19// Cleans up (probably not going to get called very often because few things can
20// exit gracefully).
21void Cleanup();
22
Brian Silvermanfe1ef172014-04-12 17:12:45 -070023// Sets up this process to write core dump files.
Brian Silverman6da04272014-05-18 18:47:48 -070024// This is called by Init*, but it's here for other files that want this
25// behavior without calling Init*.
Brian Silvermanfe1ef172014-04-12 17:12:45 -070026void WriteCoreDumps();
27
brians343bc112013-02-10 01:53:46 +000028} // namespace aos
29
Brian Silverman14fd0fb2014-01-14 21:42:01 -080030#endif // AOS_LINUX_CODE_INIT_H_