/*
 * C startup code
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 * Copyright 1995 by Ralf Baechle
 */
#include <stand/stdio.h>
#include <linux/string.h>
#include <asm/bootinfo.h>
#include <arc/arc.h>

int __hw_type;
_IO_FILE __FILE[FOPEN_MAX];

void __main(void)
{
    char *SystemID;
    int i;

    /*
     * Detect hardware type
     */
    SystemID = getSystemId();
#if DEBUG
    printf("SystemID = %s\r\n",SystemID);
#endif    
    if(!strcmp(SystemID,"PICA-61"))
	__hw_type == MACH_ACER_PICA_61;
    else if(!strcmp(SystemID,"DESKTECH-ARCStation I"))
	__hw_type == MACH_DESKSTATION_RPC44;
    else if(!strcmp(SystemID,"DESKTECH-TYNE"))
	__hw_type == MACH_DESKSTATION_TYNE;
    else if(!strcmp(SystemID,"Microsoft-Jazz"))
	__hw_type == MACH_MIPS_MAGNUM_4000;
    else
	__hw_type == MACH_UNKNOWN;

    /*
     * Init standard library file handling
     */
    __FILE[0].fh = 0;
    __FILE[1].fh = 1;
    __FILE[2].fh = 1;
    for(i=3;i<FOPEN_MAX;i++)
	__FILE[i].fh = -1;
}
