Changeset 7dd98b6 for libcfa/src


Ignore:
Timestamp:
Nov 3, 2021, 11:47:32 AM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
a1574e2
Parents:
3eb540fb
Message:

Moved cfa_main_returned to libcfa so it works when the main is written in C.

Location:
libcfa/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r3eb540fb r7dd98b6  
    100100// Other Forward Declarations
    101101extern void __wake_proc(processor *);
     102extern int cfa_main_returned;                                                   // from interpose.cfa
    102103
    103104//-----------------------------------------------------------------------------
     
    268269
    269270static void __kernel_shutdown(void) {
     271        if(!cfa_main_returned) return;
    270272        /* paranoid */ verify( __preemption_enabled() );
    271273        disable_interrupts();
  • libcfa/src/heap.cfa

    r3eb540fb r7dd98b6  
    102102} // prtUnfreed
    103103
    104 extern int cfa_main_returned;                                                   // from bootloader.cf
     104extern int cfa_main_returned;                                                   // from interpose.cfa
    105105extern "C" {
    106106        void heapAppStart() {                                                           // called by __cfaabi_appready_startup
  • libcfa/src/interpose.cfa

    r3eb540fb r7dd98b6  
    9494} __cabi_libc;
    9595
     96int cfa_main_returned;
     97
    9698extern "C" {
    9799        void __cfaabi_interpose_startup( void ) {
    98100                const char *version = 0p;
     101                cfa_main_returned = 0;
    99102
    100103                preload_libgcc();
     
    313316
    314317void sigHandler_term( __CFA_SIGPARMS__ ) {
     318        write( STDERR_FILENO, "Handler Term\n", sizeof("Handler Term\n") - 1 );
    315319        abort( true, "Application interrupted by signal: %s.\n", strsignal( sig ) );
    316320}
Note: See TracChangeset for help on using the changeset viewer.