Add runtime hooks for C++ applications
Detail: Hooks for constructors and destructors using weak symbols referenced by cpplib when starting C++ applications. The weak symbols in the stubs are placed after the kernel init block, and a new "magic word" marker denotes the block is of 5 word length rather than 3 (since the block has historically been followed by the literal pool which can have function offset-like addresses in it). The top 16b of the word is an unlikely opcode, bottom 16b is table size. armsys.c, hostsys.h, clib/cl_entries.s * Move the init flags from stdlib.c into an _init_flags struct. * Move the finalisation function from stdlib.c into armsys namespace. * Save a word of workspace by moving the error recursion flag their too. * Call the new runtime functions for C++ if present. stdlib.c * Library finalisation and flags moved to armsys.c clib/cl_stub.s, h_workspace.s * Add magic word and 2x weak symbols to block kernel/k_body.s, kernel/k_data.s * Capture image descriptor pointer from stubs for later use * Pass the image descriptor to the init procs for their information clib/cl_init.s * Pass the image descriptor on to _clib_initialise() clib/cl_body.s * Inspect the image descriptor, if all 5 words are valid, copy into the function pointers for use by armsys C code clib/clibdata.s, clib/cl_spare.s, clib/cl_data.s * Adjust data size by 2 words for new entries, give back 1 word of flags Admin: Tested with a simplistic 'hello world' type application (test/cppprog.c). ANSILib isn't expected to be used with C++ so is unchanged.
Showing with 159 additions and 62 deletions