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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [i960/] [kernel/] [head.c] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
/*
/*
 *   FILE: head.c
 *   FILE: head.c
 * AUTHOR: kma
 * AUTHOR: kma
 *  DESCR: Initialization code for the i960.
 *  DESCR: Initialization code for the i960.
 */
 */
 
 
#ident "$Id: head.c,v 1.1 2005-12-20 09:42:38 jcastillo Exp $"
#ident "$Id: head.c,v 1.1 2005-12-20 09:42:38 jcastillo Exp $"
 
 
#include <linux/autoconf.h>
#include <linux/autoconf.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
 
 
/*
/*
 * So here we are! Running at ipl 31, in supervisor mode, on mon960's user
 * So here we are! Running at ipl 31, in supervisor mode, on mon960's user
 * stack. Do we need to do much here? Let's just get right into start_kernel.
 * stack. Do we need to do much here? Let's just get right into start_kernel.
 */
 */
 
 
int main(void)
int main(void)
{
{
        long oldac;
        long oldac;
 
 
        extern void start_kernel(void);
        extern void start_kernel(void);
 
 
        /* 64-bit math routines need the overflow mask bit set */
        /* 64-bit math routines need the overflow mask bit set */
        __asm__ __volatile__
        __asm__ __volatile__
                ("modac %1, %1, %1" : "=r"(oldac) : "0"(1 << 12));
                ("modac %1, %1, %1" : "=r"(oldac) : "0"(1 << 12));
 
 
        /* Make the i960 think it's in an interrupt handler. This has the effect
        /* Make the i960 think it's in an interrupt handler. This has the effect
         * of not switching to the interrupt stack for every interrupt. Of
         * of not switching to the interrupt stack for every interrupt. Of
         * course, we wouldn't need this if there were a sensible way of
         * course, we wouldn't need this if there were a sensible way of
         * specifying an interrupt stack short of reinitializing the CPU, but
         * specifying an interrupt stack short of reinitializing the CPU, but
         * such is life.
         * such is life.
         *
         *
         * XXX: this has the effect of using user stacks for interrupts too.
         * XXX: this has the effect of using user stacks for interrupts too.
         * The world's a scary place.
         * The world's a scary place.
         */
         */
        __asm__ __volatile__ ("modpc    %1, %1, %1" : "=r"(oldac) : "0"(1<<13));
        __asm__ __volatile__ ("modpc    %1, %1, %1" : "=r"(oldac) : "0"(1<<13));
 
 
#ifdef CONFIG_CMDLINE_PROMPT
#ifdef CONFIG_CMDLINE_PROMPT
        /* do crazy command-line obtainments... */
        /* do crazy command-line obtainments... */
#endif
#endif
 
 
        start_kernel();
        start_kernel();
 
 
        printk("XXX: start_kernel returned!!!\n");
        printk("XXX: start_kernel returned!!!\n");
        for(;;) ;
        for(;;) ;
}
}
 
 

powered by: WebSVN 2.1.0

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