| 1 | //
|
|---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
|
|---|
| 3 | //
|
|---|
| 4 | // The contents of this file are covered under the licence agreement in the
|
|---|
| 5 | // file "LICENCE" distributed with Cforall.
|
|---|
| 6 | //
|
|---|
| 7 | // startup.c --
|
|---|
| 8 | //
|
|---|
| 9 | // Author : Peter A. Buhr
|
|---|
| 10 | // Created On : Tue Jul 24 16:21:57 2018
|
|---|
| 11 | // Last Modified By : Peter A. Buhr
|
|---|
| 12 | // Last Modified On : Sat Jan 9 23:18:23 2021
|
|---|
| 13 | // Update Count : 34
|
|---|
| 14 | //
|
|---|
| 15 |
|
|---|
| 16 | #include <time.h> // tzset
|
|---|
| 17 | #include <locale.h> // setlocale
|
|---|
| 18 | #include <stdlib.h> // getenv
|
|---|
| 19 | #include "startup.hfa"
|
|---|
| 20 |
|
|---|
| 21 | extern "C" {
|
|---|
| 22 | void __cfaabi_appready_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_APPREADY ) ));
|
|---|
| 23 | void __cfaabi_appready_startup( void ) {
|
|---|
| 24 | tzset(); // initialize time global variables
|
|---|
| 25 | setlocale( LC_NUMERIC, getenv("LANG") );
|
|---|
| 26 | #ifdef __CFA_DEBUG__
|
|---|
| 27 | extern void heapAppStart();
|
|---|
| 28 | heapAppStart();
|
|---|
| 29 | #endif // __CFA_DEBUG__
|
|---|
| 30 | } // __cfaabi_appready_startup
|
|---|
| 31 |
|
|---|
| 32 | void __cfaabi_appready_shutdown( void ) __attribute__(( destructor( STARTUP_PRIORITY_APPREADY ) ));
|
|---|
| 33 | void __cfaabi_appready_shutdown( void ) {
|
|---|
| 34 | #ifdef __CFA_DEBUG__
|
|---|
| 35 | extern void heapAppStop();
|
|---|
| 36 | heapAppStop();
|
|---|
| 37 | #endif // __CFA_DEBUG__
|
|---|
| 38 | } // __cfaabi_appready_shutdown
|
|---|
| 39 |
|
|---|
| 40 | void disable_interrupts() __attribute__(( weak )) {}
|
|---|
| 41 | void enable_interrupts() __attribute__(( weak )) {}
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | extern void __cfaabi_interpose_startup( void );
|
|---|
| 45 | extern void __cfaabi_device_startup ( void );
|
|---|
| 46 | extern void __cfaabi_device_shutdown ( void );
|
|---|
| 47 |
|
|---|
| 48 | void __cfaabi_core_startup( void ) __attribute__(( constructor( STARTUP_PRIORITY_CORE ) ));
|
|---|
| 49 | void __cfaabi_core_startup( void ) {
|
|---|
| 50 | __cfaabi_interpose_startup();
|
|---|
| 51 | __cfaabi_device_startup();
|
|---|
| 52 | } // __cfaabi_core_startup
|
|---|
| 53 |
|
|---|
| 54 | void __cfaabi_core_shutdown( void ) __attribute__(( destructor( STARTUP_PRIORITY_CORE ) ));
|
|---|
| 55 | void __cfaabi_core_shutdown( void ) {
|
|---|
| 56 | __cfaabi_device_shutdown();
|
|---|
| 57 | } // __cfaabi_core_shutdown
|
|---|
| 58 | } // extern "C"
|
|---|
| 59 |
|
|---|
| 60 | struct __spinlock_t;
|
|---|
| 61 | extern "C" {
|
|---|
| 62 | void __cfaabi_dbg_record_lock(struct __spinlock_t & this, const char prev_name[]) __attribute__(( weak )) {}
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
| 65 | // Local Variables: //
|
|---|
| 66 | // mode: c //
|
|---|
| 67 | // tab-width: 4 //
|
|---|
| 68 | // End: //
|
|---|