Port libc-based "fat" Ada runtime

This commit is contained in:
Alexander Senier
2019-02-07 15:39:26 +01:00
committed by Norman Feske
parent dc2786dfb1
commit e0a0d07cb3
11 changed files with 1215 additions and 0 deletions

37
include/ada/component.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef _INCLUDE__ADA__COMPONENT_H_
#define _INCLUDE__ADA__COMPONENT_H_
#include <libc/component.h>
namespace Ada { namespace Component {
/**
* Run ada main program
*/
void main(void);
} }
namespace Libc { namespace Component {
extern "C" void adainit(void);
extern "C" void adafinal(void);
extern "C" void __gnat_runtime_initialize(void) { };
extern "C" void __gnat_runtime_finalize(void) { };
extern "C" int gnat_exit_status;
/**
* Construct component
*
* \param env extended interface to the component's execution environment
*/
void construct(Libc::Env &env) {
Libc::with_libc([&] () {
adainit();
Ada::Component::main();
adafinal();
});
env.parent().exit(gnat_exit_status);
}
} }
#endif /* _INCLUDE__ADA__COMPONENT_H_ */