OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [arm/] [linux-crt0.c] - Diff between revs 158 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 158 Rev 816
/** Linux startup code for the ARM processor.
/** Linux startup code for the ARM processor.
 * Written by Shaun Jackman <sjackman@gmail.com>.
 * Written by Shaun Jackman <sjackman@gmail.com>.
 * Copyright 2006 Pathway Connectivity
 * Copyright 2006 Pathway Connectivity
 *
 *
 * Permission to use, copy, modify, and distribute this software
 * Permission to use, copy, modify, and distribute this software
 * is freely granted, provided that this notice is preserved.
 * is freely granted, provided that this notice is preserved.
 */
 */
 
 
#include <stdlib.h>
#include <stdlib.h>
#include <unistd.h>
#include <unistd.h>
 
 
static int _main(int argc, char *argv[]) __attribute__((noreturn));
static int _main(int argc, char *argv[]) __attribute__((noreturn));
 
 
#if __thumb__ && !__thumb2__
#if __thumb__ && !__thumb2__
asm("\n"
asm("\n"
        ".code 32\n"
        ".code 32\n"
        ".global _start\n"
        ".global _start\n"
        ".type _start, %function\n"
        ".type _start, %function\n"
        "_start:\n"
        "_start:\n"
        "\tadr r0, _start_thumb+1\n"
        "\tadr r0, _start_thumb+1\n"
        "\tbx r0\n"
        "\tbx r0\n"
        ".size _start, .-_start\n");
        ".size _start, .-_start\n");
 
 
__attribute__((naked, used))
__attribute__((naked, used))
static void _start_thumb(void)
static void _start_thumb(void)
#else
#else
__attribute__((naked))
__attribute__((naked))
void _start(void)
void _start(void)
#endif
#endif
{
{
        register int *sp asm("sp");
        register int *sp asm("sp");
        _main(*sp, (char **)(sp + 1));
        _main(*sp, (char **)(sp + 1));
}
}
 
 
static int _main(int argc, char *argv[])
static int _main(int argc, char *argv[])
{
{
        environ = argv + argc + 1;
        environ = argv + argc + 1;
        exit(main(argc, argv, environ));
        exit(main(argc, argv, environ));
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.