Skip to content

Commit 27c6721

Browse files
committed
Merge pull request #69 from c1728p9/update_rtos_init_sequence
Update rtos init sequence
2 parents fc4f1e2 + e01bcdc commit 27c6721

File tree

3 files changed

+95
-190
lines changed

3 files changed

+95
-190
lines changed

core/mbed-rtos/rtx/TARGET_ARM7/RTX_CM_lib.h

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -276,60 +276,6 @@ __asm void __rt_entry (void) {
276276

277277
#elif defined (__GNUC__)
278278

279-
#ifdef __CS3__
280-
281-
/* CS3 start_c routine.
282-
*
283-
* Copyright (c) 2006, 2007 CodeSourcery Inc
284-
*
285-
* The authors hereby grant permission to use, copy, modify, distribute,
286-
* and license this software and its documentation for any purpose, provided
287-
* that existing copyright notices are retained in all copies and that this
288-
* notice is included verbatim in any distributions. No written agreement,
289-
* license, or royalty fee is required for any of the authorized uses.
290-
* Modifications to this software may be copyrighted by their authors
291-
* and need not follow the licensing terms described here, provided that
292-
* the new terms are clearly indicated on the first page of each file where
293-
* they apply.
294-
*/
295-
296-
#include "cs3.h"
297-
298-
extern void __libc_init_array (void);
299-
300-
__attribute ((noreturn)) void __cs3_start_c (void){
301-
unsigned regions = __cs3_region_num;
302-
const struct __cs3_region *rptr = __cs3_regions;
303-
304-
/* Initialize memory */
305-
for (regions = __cs3_region_num, rptr = __cs3_regions; regions--; rptr++) {
306-
long long *src = (long long *)rptr->init;
307-
long long *dst = (long long *)rptr->data;
308-
unsigned limit = rptr->init_size;
309-
unsigned count;
310-
311-
if (src != dst)
312-
for (count = 0; count != limit; count += sizeof (long long))
313-
*dst++ = *src++;
314-
else
315-
dst = (long long *)((char *)dst + limit);
316-
limit = rptr->zero_size;
317-
for (count = 0; count != limit; count += sizeof (long long))
318-
*dst++ = 0;
319-
}
320-
321-
/* Run initializers. */
322-
__libc_init_array ();
323-
324-
osKernelInitialize();
325-
set_main_stack();
326-
osThreadCreate(&os_thread_def_main, NULL);
327-
osKernelStart();
328-
for (;;);
329-
}
330-
331-
#else
332-
333279
__attribute__((naked)) void software_init_hook (void) {
334280
__asm (
335281
".syntax unified\n"
@@ -353,8 +299,6 @@ __attribute__((naked)) void software_init_hook (void) {
353299
);
354300
}
355301

356-
#endif
357-
358302
#elif defined (__ICCARM__)
359303

360304
extern int __low_level_init(void);

core/mbed-rtos/rtx/TARGET_CORTEX_A/RTX_CM_lib.h

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -447,59 +447,6 @@ __asm void __rt_entry (void) {
447447

448448
#elif defined (__GNUC__)
449449

450-
#ifdef __CS3__
451-
452-
/* CS3 start_c routine.
453-
*
454-
* Copyright (c) 2006, 2007 CodeSourcery Inc
455-
*
456-
* The authors hereby grant permission to use, copy, modify, distribute,
457-
* and license this software and its documentation for any purpose, provided
458-
* that existing copyright notices are retained in all copies and that this
459-
* notice is included verbatim in any distributions. No written agreement,
460-
* license, or royalty fee is required for any of the authorized uses.
461-
* Modifications to this software may be copyrighted by their authors
462-
* and need not follow the licensing terms described here, provided that
463-
* the new terms are clearly indicated on the first page of each file where
464-
* they apply.
465-
*/
466-
467-
#include "cs3.h"
468-
469-
extern void __libc_init_array (void);
470-
471-
__attribute ((noreturn)) void __cs3_start_c (void){
472-
unsigned regions = __cs3_region_num;
473-
const struct __cs3_region *rptr = __cs3_regions;
474-
475-
/* Initialize memory */
476-
for (regions = __cs3_region_num, rptr = __cs3_regions; regions--; rptr++) {
477-
long long *src = (long long *)rptr->init;
478-
long long *dst = (long long *)rptr->data;
479-
unsigned limit = rptr->init_size;
480-
unsigned count;
481-
482-
if (src != dst)
483-
for (count = 0; count != limit; count += sizeof (long long))
484-
*dst++ = *src++;
485-
else
486-
dst = (long long *)((char *)dst + limit);
487-
limit = rptr->zero_size;
488-
for (count = 0; count != limit; count += sizeof (long long))
489-
*dst++ = 0;
490-
}
491-
492-
/* Run initializers. */
493-
__libc_init_array ();
494-
495-
osKernelInitialize();
496-
osThreadCreate(&os_thread_def_main, NULL);
497-
osKernelStart();
498-
for (;;);
499-
}
500-
501-
#else
502-
503450
__attribute__((naked)) void software_init_hook (void) {
504451
__asm (
505452
".syntax unified\n"
@@ -522,8 +469,6 @@ __attribute__((naked)) void software_init_hook (void) {
522469
);
523470
}
524471

525-
#endif
526-
527472
#elif defined (__ICCARM__)
528473

529474
extern void exit(int arg);

0 commit comments

Comments
 (0)