~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/plugins/scriptedwizard/resources/ppc/files/MPC565/src/crt0.S

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * crt0.S -- startup file for PowerPC systems.
 
3
 *
 
4
 */
 
5
 
 
6
#include "mpc555.h"
 
7
 
 
8
/*
 
9
# definitions for clock frequency for phyCOREMPC555/phyCOREMPC565
 
10
# default is phyCOREMPC565 at 40 MHz
 
11
*/
 
12
 
 
13
#ifdef PHYCORE_MPC555
 
14
# define CLOCK_SCALE    0x00104000      /* 40 MHz ((1+1) * 20 MHz) */
 
15
#else
 
16
# ifdef FAST_CLOCK
 
17
#  define CLOCK_SCALE   0x00D04000      /* 56 MHz ((13+1) * 4 MHz) */
 
18
# else
 
19
#  define CLOCK_SCALE   0x00904000      /* 40 MHz (( 9+1) * 4 MHz) */
 
20
# endif
 
21
#endif
 
22
 
 
23
        .file   "crt0.S"
 
24
        .text
 
25
        .globl  _start
 
26
        .type   _start,@function
 
27
_start:
 
28
        /*
 
29
        ** Make the processor to run at specified clock frequency
 
30
        ** by programming PLPRCR register with suitable value
 
31
        */
 
32
#if !defined(HIMO_DEBUG)
 
33
        lis     %r4, __PLPRCRK@ha /* unlock PLPRCR register */
 
34
        lis     %r5, 0x55cc
 
35
        ori     %r5, %r5, 0xaa33
 
36
        stw     %r5, __PLPRCRK@l(%r4)
 
37
 
 
38
        lis     %r4, __PLPRCR@ha
 
39
        lwz     %r5, __PLPRCR@l(%r4)
 
40
        lis     %r5, (CLOCK_SCALE>>16)
 
41
        ori     %r5, %r5, (CLOCK_SCALE & 0xffff)
 
42
        stw     %r5, __PLPRCR@l(%r4)
 
43
 
 
44
        lis     %r4, __SCCR@ha
 
45
        lwz     %r5, __SCCR@l(%r4)
 
46
        lis     %r6, 0x0100     /* clear RTDIV: set pre divider to 4 */
 
47
        andc    %r5,%r5,%r6
 
48
        stw     %r5, __SCCR@l(%r4)
 
49
 
 
50
#endif
 
51
        lis     %r4, __SIMASK@ha
 
52
        li      %r5, 0
 
53
        sth     %r5, __SIMASK@l(%r4)
 
54
 
 
55
 
 
56
        li      %r5, 0x2002
 
57
        mtmsr   %r5
 
58
 
 
59
        /* load the system stack */
 
60
        lis     %r1, __USER_STACK_TOP@ha
 
61
        la      %r1, __USER_STACK_TOP@l(%r1)
 
62
 
 
63
        lis     %r0,0
 
64
        stw     %r0,0(%r1)      /* clear back chain */
 
65
        stwu    %r1,-64(%r1)    /* push another stack frame */
 
66
 
 
67
 
 
68
        /* initialize data sections */
 
69
        bl      clear_table
 
70
        bl      copy_table
 
71
 
 
72
        li      %r3,0           /* argc = 0 */
 
73
        li      %r4,0           /* argv = NULL */
 
74
        /* Let her rip */
 
75
        bl      main
 
76
 
 
77
        /* return value from main is argument to exit */
 
78
        bl      exit
 
79
.Lstart:
 
80
        .size   _start,.Lstart-_start
 
81
 
 
82
 
 
83
        .extern atexit
 
84
        .globl  __atexit
 
85
        .section ".sdata","aw"
 
86
        .align  2
 
87
__atexit:                       /* tell C's eabi-ctor's we have an atexit function */
 
88
        .long   atexit@fixup    /* and that it is to register __do_global_dtors */
 
89
 
 
90
        .section ".fixup","aw"
 
91
        .align  2
 
92
        .long   __atexit
 
93
 
 
94
 
 
95
        .section        ".text"
 
96
        .align 2
 
97
        .globl clear_table
 
98
        .type    clear_table,@function
 
99
clear_table:
 
100
        lis     %r9,__clear_table@ha
 
101
        la      %r9,__clear_table@l(%r9)
 
102
        lwz     %r0,4(%r9)
 
103
        cmpwi   %r0,-1
 
104
        beqlr
 
105
clear_loop1:
 
106
        lwz     %r0,4(%r9)
 
107
        addi    %r11,%r9,8
 
108
        srwi.   %r10,%r0,2
 
109
        lwz     %r9,0(%r9)
 
110
        mtctr   %r10
 
111
        beq     clear_loop3
 
112
        li      %r0,0
 
113
clear_loop2:
 
114
        stw     %r0,0(%r9)
 
115
        addi    %r9,%r9,4
 
116
        bdnz    clear_loop2
 
117
clear_loop3:
 
118
        mr      %r9,%r11
 
119
        lwz     %r0,4(%r9)
 
120
        cmpwi   %r0,-1
 
121
        bne     clear_loop1
 
122
        blr
 
123
clear_table_end:
 
124
        .size    clear_table,clear_table_end-clear_table
 
125
        .align 2
 
126
 
 
127
        .globl copy_table
 
128
        .type    copy_table,@function
 
129
copy_table:
 
130
        lis     %r9,__copy_table@ha
 
131
        la      %r9,__copy_table@l(%r9)
 
132
        lwz     %r0,8(%r9)
 
133
        cmpwi   %r0,-1
 
134
        beqlr
 
135
copy_loop1:
 
136
        lwz     %r0,8(%r9)
 
137
        addi    %r10,%r9,12
 
138
        srwi.   %r11,%r0,2
 
139
        mtctr   %r11
 
140
        lwz     %r11,0(%r9)
 
141
        lwz     %r9,4(%r9)
 
142
        beq     copy_loop3
 
143
copy_loop2:
 
144
        lwz     %r0,0(%r11)
 
145
        addi    %r11,%r11,4
 
146
        stw     %r0,0(%r9)
 
147
        addi    %r9,%r9,4
 
148
        bdnz    copy_loop2
 
149
copy_loop3:
 
150
        mr      %r9,%r10
 
151
        lwz     %r0,8(%r9)
 
152
        cmpwi   %r0,-1
 
153
        bne     copy_loop1
 
154
        blr
 
155
copy_table_end:
 
156
        .size    copy_table,copy_table_end-copy_table
 
157