#! ============================================================================
#!  Copyright (C) 2006-2007 Andes Technology, Inc.
#!
#!  Abstract:
#!
#!    This program is start up code for AG101.
#!
#!  Revision History:
#!
#!    Oct.22.2006     Created by Harry.
#!    Dec.05.2006     Fixed up exception vector size to default 16 bytes.
#!    Feb.05.2007     Base on Steven's idea, use .init section as entry.
#!    Oct.23.2007     Modified by Howard.
#!
#! ============================================================================

    .section .init
_start:

fLib_FirstVector:
    sethi       $p0,#0xfffff
    mtsr        $p0,$dimbr                                ! Temp solution for ICE.
    isb
    sethi       $p0,hi20(fLib_Reset_NMI)                  ! The world is start here.
    ori         $p0, $p0, lo12(fLib_Reset_NMI)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_TLB_not_present)                  
    ori         $p0, $p0, lo12(fLib_TLB_not_present)
    jr          $p0 

    .align 4
    sethi       $p0,hi20(fLib_TLB_misc)                  
    ori         $p0, $p0, lo12(fLib_TLB_misc)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_TLB_VLPT_miss)                  
    ori         $p0, $p0, lo12(fLib_TLB_VLPT_miss)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_cache_parity_error)                  
    ori         $p0, $p0, lo12(fLib_cache_parity_error)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_debug)                  
    ori         $p0, $p0, lo12(fLib_debug)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_general_exception)                  
    ori         $p0, $p0, lo12(fLib_general_exception)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_syscall)                  
    ori         $p0, $p0, lo12(fLib_syscall)
    jr          $p0

#!  HW0 = 0x90
    .align 4
    sethi       $p0,hi20(fLib_hw0_interrupt)                  
    ori         $p0, $p0, lo12(fLib_hw0_interrupt)
    jr          $p0

#!  HW1 = 0xA0
    .align 4
    sethi       $p0,hi20(fLib_hw1_interrupt)                  
    ori         $p0, $p0, lo12(fLib_hw1_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4
    sethi       $p0,hi20(fLib_external_interrupt)                  
    ori         $p0, $p0, lo12(fLib_external_interrupt)
    jr          $p0

    .align 4

    ! VEP 1-63
