1 |
786 |
skrzyp |
#ifndef CYGONCE_HAL_PROC_ARCH_H
|
2 |
|
|
#define CYGONCE_HAL_PROC_ARCH_H
|
3 |
|
|
//=============================================================================
|
4 |
|
|
//
|
5 |
|
|
// proc_arch.h
|
6 |
|
|
//
|
7 |
|
|
// Processor variant specific abstractions
|
8 |
|
|
//
|
9 |
|
|
//=============================================================================
|
10 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
11 |
|
|
// -------------------------------------------
|
12 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
13 |
|
|
// Copyright (C) 2003, 2006, 2008 Free Software Foundation, Inc.
|
14 |
|
|
//
|
15 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
16 |
|
|
// the terms of the GNU General Public License as published by the Free
|
17 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
//=============================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): bartv
|
45 |
|
|
// Date: 2003-06-04
|
46 |
|
|
//
|
47 |
|
|
//####DESCRIPTIONEND####
|
48 |
|
|
//=============================================================================
|
49 |
|
|
|
50 |
|
|
#include <pkgconf/hal_m68k_mcf5272.h>
|
51 |
|
|
#include <cyg/hal/plf_arch.h>
|
52 |
|
|
#include <cyg/infra/cyg_type.h>
|
53 |
|
|
|
54 |
|
|
// A processor-specific initialization routine is needed
|
55 |
|
|
#if !defined(__ASSEMBLER__) && !defined(HAL_M68K_PROC_INIT)
|
56 |
|
|
externC void hal_m68k_mcf5272_init(void);
|
57 |
|
|
#define HAL_M68K_PROC_INIT() hal_m68k_mcf5272_init()
|
58 |
|
|
#endif
|
59 |
|
|
|
60 |
|
|
// The MCF5272 does not support the bitrev or ff1 instructions so the
|
61 |
|
|
// architectural default versions of HAL_LSBIT_INDEX() and
|
62 |
|
|
// HAL_MSBIT_INDEX() have to be used instead of the mcfxxxx ones.
|
63 |
|
|
#define _HAL_M68K_MCFxxxx_NO_FF1_ 1
|
64 |
|
|
|
65 |
|
|
// Idle action support.
|
66 |
|
|
#if !defined(HAL_IDLE_THREAD_ACTION)
|
67 |
|
|
# if defined(CYGIMP_HAL_M68K_MCF5272_IDLE_run)
|
68 |
|
|
// Do nothing, just use the architectural empty default
|
69 |
|
|
# else
|
70 |
|
|
|
71 |
|
|
# define HAL_IDLE_THREAD_ACTION(_count_) \
|
72 |
|
|
CYG_MACRO_START \
|
73 |
|
|
asm volatile ( \
|
74 |
|
|
"mov.w %%sr, %%d0 ; \n" \
|
75 |
|
|
"mov.w %%d0, 0(%[alpr]); \n" \
|
76 |
|
|
"stop #0x2000 ; \n" \
|
77 |
|
|
"mov.w %%d0, %%sr ; \n" \
|
78 |
|
|
: \
|
79 |
|
|
: [alpr] "a" (HAL_MCFxxxx_MBAR + HAL_MCF5272_ALPR) \
|
80 |
|
|
: "d0" ); \
|
81 |
|
|
CYG_MACRO_END
|
82 |
|
|
|
83 |
|
|
# endif
|
84 |
|
|
#endif
|
85 |
|
|
|
86 |
|
|
// ----------------------------------------------------------------------------
|
87 |
|
|
#endif // CYGONCE_HAL_PROC_ARCH_H
|
88 |
|
|
|