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

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [dhry/] [start.S] - Blame information for rev 31

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 csantifort
/*----------------------------------------------------------------
2
//                                                              //
3
//  start.S                                                     //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  Assembly routines for hello-world.                          //
10
//  As hello-world is a stand-alone application, it needs a     //
11
//  simple start function written in assembly to call the       //
12
//  C code main() function.                                     //
13
//                                                              //
14
//  Author(s):                                                  //
15
//      - Conor Santifort, csantifort.amber@gmail.com           //
16
//                                                              //
17
//////////////////////////////////////////////////////////////////
18
//                                                              //
19
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
20
//                                                              //
21
// This source file may be used and distributed without         //
22
// restriction provided that this copyright statement is not    //
23
// removed from the file and that any derivative work contains  //
24
// the original copyright notice and the associated disclaimer. //
25
//                                                              //
26
// This source file is free software; you can redistribute it   //
27
// and/or modify it under the terms of the GNU Lesser General   //
28
// Public License as published by the Free Software Foundation; //
29
// either version 2.1 of the License, or (at your option) any   //
30
// later version.                                               //
31
//                                                              //
32
// This source is distributed in the hope that it will be       //
33
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
34
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
35
// PURPOSE.  See the GNU Lesser General Public License for more //
36
// details.                                                     //
37
//                                                              //
38
// You should have received a copy of the GNU Lesser General    //
39
// Public License along with this source; if not, download it   //
40
// from http://www.opencores.org/lgpl.shtml                     //
41
//                                                              //
42
----------------------------------------------------------------*/
43
 
44
        .section .text
45
        .globl  start
46
_start:
47
        /* Switch to User Mode */
48
        /* and unset interrupt mask bits */
49
        mov     r0, #0x00000000
50
        teqp    pc, r0
51
 
52
        @ Enable the cache
53
        mov     r0,  #0xffffffff
54
        mcr     15, 0, r0, cr3, cr0, 0   @ cacheable area
55
        mov     r0,  #1
56
        mcr     15, 0, r0, cr2, cr0, 0   @ cache enable
57
 
58
        @ initialize malloc
59
        ldr     r1, AdrMalloc
60
        str     r1, [r1]
61
 
62
        @ initialize the stack pointer
63
        ldr     sp, AdrStack
64
 
65
        @ jump to main
66
        .extern main
67
        bl      main
68
 
69
        b       _testpass
70
 
71
/* stack at top of ddr3 memory space */
72
AdrStack:  .word  0x8000000
73
AdrMalloc: .word  0x7000000
74
 
75
 
76
/* ========================================================================= */
77
/* ========================================================================= */
78
 
79
 

powered by: WebSVN 2.1.0

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