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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [RX600_RX62N-RSK_Renesas/] [RTOSDemo/] [Renesas-Files/] [resetprg.c] - Blame information for rev 638

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

Line No. Rev Author Line
1 585 jeremybenn
/***********************************************************************/
2
/*                                                                     */
3
/*  FILE        :resetprg.c                                            */
4
/*  DATE        :Wed, Aug 11, 2010                                     */
5
/*  DESCRIPTION :Reset Program                                         */
6
/*  CPU TYPE    :Other                                                 */
7
/*                                                                     */
8
/*  This file is generated by Renesas Project Generator (Ver.4.50).    */
9
/*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
10
/*                                                                     */
11
/***********************************************************************/
12
 
13
 
14
 
15
/*********************************************************************
16
*
17
* Device     : RX/RX600
18
*
19
* File Name  : resetprg.c
20
*
21
* Abstract   : Reset Program.
22
*
23
* History    : 1.00  (2009-08-07)
24
*
25
* NOTE       : THIS IS A TYPICAL EXAMPLE.
26
*
27
* Copyright(c) 2009 Renesas Technology Corp.
28
*               And Renesas Solutions Corp.,All Rights Reserved.
29
*
30
*********************************************************************/
31
 
32
#include        <machine.h>
33
#include        <_h_c_lib.h>
34
//#include      <stddef.h>                                      // Remove the comment when you use errno
35
//#include      <stdlib.h>                                      // Remove the comment when you use rand()
36
#include        "typedefine.h"
37
#include        "stacksct.h"
38
 
39
#pragma inline_asm Change_PSW_PM_to_UserMode
40
static void Change_PSW_PM_to_UserMode(void);
41
 
42
#ifdef __cplusplus
43
extern "C" {
44
#endif
45
void PowerON_Reset_PC(void);
46
void main(void);
47
#ifdef __cplusplus
48
}
49
#endif
50
 
51
#ifdef __cplusplus                              // Use SIM I/O
52
extern "C" {
53
#endif
54
extern void _INIT_IOLIB(void);
55
extern void _CLOSEALL(void);
56
#ifdef __cplusplus
57
}
58
#endif
59
 
60
#define PSW_init  0x00010000
61
#define FPSW_init 0x00000100
62
 
63
//extern void srand(_UINT);             // Remove the comment when you use rand()
64
//extern _SBYTE *_s1ptr;                                // Remove the comment when you use strtok()
65
 
66
//#ifdef __cplusplus                            // Use Hardware Setup
67
//extern "C" {
68
//#endif
69
//extern void HardwareSetup(void);
70
//#ifdef __cplusplus
71
//}
72
//#endif
73
 
74
//#ifdef __cplusplus                    // Remove the comment when you use global class object
75
//extern "C" {                                  // Sections C$INIT and C$END will be generated
76
//#endif
77
//extern void _CALL_INIT(void);
78
//extern void _CALL_END(void);
79
//#ifdef __cplusplus
80
//}
81
//#endif
82
 
83
#pragma section ResetPRG
84
 
85
#pragma entry PowerON_Reset_PC
86
 
87
void PowerON_Reset_PC(void)
88
{
89
        set_intb((unsigned long)__sectop("C$VECT"));
90
        set_fpsw(FPSW_init);
91
 
92
        _INITSCT();
93
 
94
//      _INIT_IOLIB();                                  // Remove the comment when you use SIM I/O
95
 
96
//      errno=0;                                                // Remove the comment when you use errno
97
//      srand((_UINT)1);                                // Remove the comment when you use rand()
98
//      _s1ptr=NULL;                                    // Remove the comment when you use strtok()
99
 
100
//      HardwareSetup();                                // Use Hardware Setup
101
    nop();
102
 
103
//      _CALL_INIT();                                   // Remove the comment when you use global class object
104
 
105
        set_psw(PSW_init);                              // Set Ubit & Ibit for PSW
106
//      Change_PSW_PM_to_UserMode();    // DO NOT CHANGE TO USER MODE IF USING FREERTOS!
107
        ( void ) Change_PSW_PM_to_UserMode; // Just to avoid compiler warnings.
108
 
109
        main();
110
 
111
//      _CLOSEALL();                                    // Use SIM I/O
112
 
113
//      _CALL_END();                                    // Remove the comment when you use global class object
114
 
115
        brk();
116
}
117
 
118
static void Change_PSW_PM_to_UserMode(void)
119
{
120
        MVFC   PSW,R1
121
        OR     #00100000h,R1
122
        PUSH.L R1
123
        MVFC   PC,R1
124
        ADD    #10,R1
125
        PUSH.L R1
126
        RTE
127
        NOP
128
        NOP
129
}

powered by: WebSVN 2.1.0

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