* m68k patches
@ 2005-04-13 11:47 Errin Bechtel
0 siblings, 0 replies; only message in thread
From: Errin Bechtel @ 2005-04-13 11:47 UTC (permalink / raw)
To: ecos-devel
Here are chagnes I made to the hal/m68k files to get
it to compile. I have a mcf5282 port working that I
will submit as soon as I can.
Index: ChangeLog
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/mcf52xx/var/current/ChangeLog,v
retrieving revision 1.2
diff -u -r1.2 ChangeLog
--- ChangeLog 22 Apr 2004 15:26:39 -0000 1.2
+++ ChangeLog 13 Apr 2005 11:31:39 -0000
@@ -1,3 +1,8 @@
+2005-04-13 Errin Bechtel <errin_bechtel@yahoo.com>
+ * include/var_arch.h
+ Fixed HAL_GET_GDB_REGISTERS and
HAL_SET_GDB_REGISTERS, replaced nml_ctxt with normal
to
+ match struct.
+
2004-04-22 Jani Monoses <jani@iv.ro>
* cdl/hal_m68k_mcf52xx.cdl :
Index: include/var_arch.h
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/mcf52xx/var/current/include/var_arch.h,v
retrieving revision 1.1
diff -u -r1.1 var_arch.h
--- include/var_arch.h 29 May 2002 18:28:16 -0000 1.1
+++ include/var_arch.h 13 Apr 2005 11:31:39 -0000
@@ -163,21 +163,21 @@
CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD
*)(_aregval_); \
int _i_;
\
\
- for( _i_ = 0; _i_ < HAL_NUM_D_REGS; _i_++ )
\
- *_regval_++ = (_regs_)->nml_ctxt.d[_i_];
\
+ for( _i_ = 0; _i_ < HAL_NORMAL_SAVED_NUM_D_REGS;
_i_++ ) \
+ *_regval_++ = (_regs_)->normal.d[_i_];
\
\
- for( _i_ = 0; _i_ < HAL_NUM_A_REGS; _i_++ )
\
- *_regval_++ = (_regs_)->nml_ctxt.a[_i_];
\
+ for( _i_ = 0; _i_ < HAL_NORMAL_SAVED_NUM_A_REGS;
_i_++ ) \
+ *_regval_++ = (_regs_)->normal.a[_i_];
\
\
- *_regval_++ = (_regs_)->nml_ctxt.sp;
\
- *_regval_++ = (CYG_ADDRWORD)
((_regs_)->nml_ctxt.sr); \
- *_regval_++ = (_regs_)->nml_ctxt.pc;
\
+ *_regval_++ = (_regs_)->normal.sp;
\
+ *_regval_++ = (CYG_ADDRWORD)
((_regs_)->normal.sr); \
+ *_regval_++ = (_regs_)->normal.pc;
\
/* Undefined registers */
\
for ( _i_ = 0; _i_ < 8; _i_++ )
\
{
\
*((CYG_WORD16*)_regval_)++ = _i_;
\
*((CYG_WORD16*)_regval_)++ = _i_;
\
- *((CYG_WORD16*)_regval_)++ = _i_;
\
+ *((CYG_WORD16*)_regval_)++ = _i_;
\
}
\
*_regval_++ = 0xBADC0DE0;
\
*_regval_++ = 0xBADC0DE1;
\
@@ -190,15 +190,15 @@
CYG_ADDRWORD *_regval_ = (CYG_ADDRWORD
*)(_aregval_); \
int _i_;
\
\
- for( _i_ = 0; _i_ < HAL_NUM_D_REGS; _i_++ )
\
- (_regs_)->nml_ctxt.d[_i_] = *_regval_++;
\
+ for( _i_ = 0; _i_ < HAL_NORMAL_SAVED_NUM_D_REGS;
_i_++ ) \
+ (_regs_)->normal.d[_i_] = *_regval_++;
\
\
- for( _i_ = 0; _i_ < HAL_NUM_A_REGS; _i_++ )
\
- (_regs_)->nml_ctxt.a[_i_] = *_regval_++;
\
+ for( _i_ = 0; _i_ < HAL_NORMAL_SAVED_NUM_A_REGS;
_i_++ ) \
+ (_regs_)->normal.a[_i_] = *_regval_++;
\
\
- (_regs_)->nml_ctxt.sp = *_regval_++;
\
- (_regs_)->nml_ctxt.sr = (CYG_WORD16)
(*_regval_++); \
- (_regs_)->nml_ctxt.pc = *_regval_++;
\
+ (_regs_)->normal.sp = *_regval_++;
\
+ (_regs_)->normal.sr = (CYG_WORD16) (*_regval_++);
\
+ (_regs_)->normal.pc = *_regval_++;
\
CYG_MACRO_END
/*
************************************************************************
*/
Index: ChangeLog
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/arch/current/ChangeLog,v
retrieving revision 1.2
diff -u -r1.2 ChangeLog
--- ChangeLog 22 Apr 2004 15:26:39 -0000 1.2
+++ ChangeLog 13 Apr 2005 11:45:51 -0000
@@ -1,3 +1,15 @@
+2005-04-13 Errin Bechtel <errin_bechtel@yahoo.com>
+ * include/hal_arch.h
+ Added sp & ar members to struct
HAL_SavedRegisters_normal
+ Changed HAL_THREAD_SWITCH_CONTEXT and
HAL_THREAD_LOAD_CONTEXT to match
HAL_SavedRegisters_normal
+ Chagned HAL_THREAD_INIT_CONTEXT to initialize sr &
sp
+
+ * src/hal_misc.c
+ Fixed hal_msbit_index so it would pass the
hal/common/current/tests/basic.c test.
+
+ * src/m68k.ld
+ Added #define SECTION_romvec so that the rom
vectors could be keeped and linked in properly.
+
2004-04-22 Jani Monoses <jani@iv.ro>
* cdl/hal_m68k.cdl :
Index: include/hal_arch.h
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/arch/current/include/hal_arch.h,v
retrieving revision 1.1
diff -u -r1.1 hal_arch.h
--- include/hal_arch.h 29 May 2002 18:28:15 -0000 1.1
+++ include/hal_arch.h 13 Apr 2005 11:45:51 -0000
@@ -72,6 +72,14 @@
#define HAL_NORMAL_SAVED_NUM_A_REGS 7
CYG_ADDRESS a[HAL_NORMAL_SAVED_NUM_A_REGS];
+
+ // Stack Pointer
+
+ CYG_ADDRESS sp;
+
+ // Status Reg
+
+ CYG_WORD32 sr;
// Program Counter
@@ -125,12 +133,12 @@
#define HAL_THREAD_SWITCH_CONTEXT(_fspptr_,_tspptr_)
\
CYG_MACRO_START \
asm volatile (" pea 1f(%%pc)\n" \
- " lea -(8+7)*4(%%sp),%%sp\n" \
+ " lea -(8+7)*4-8(%%sp),%%sp\n"
\
" movem.l
%%d0-%%d7/%%a0-%%a6,(%%sp)\n" \
" move.l %%sp,%0\n" \
" move.l %1,%%sp\n" \
" movem.l
(%%sp),%%d0-%%d7/%%a0-%%a6\n" \
- " lea (8+7)*4(%%sp),%%sp\n" \
+ " lea (8+7)*4+8(%%sp),%%sp\n" \
" rts\n" \
"1:\n" \
: "=g" (*(_fspptr_)) \
@@ -163,7 +171,7 @@
CYG_MACRO_START \
asm volatile (" move.l %0,%%sp\n" \
" movem.l
(%%sp),%%d0-%%d7/%%a0-%%a6\n" \
- " lea (8+7)*4(%%sp),%%sp\n" \
+ " lea (8+7)*4+8(%%sp),%%sp\n" \
" rts\n" \
: \
: "g" (*(_tspptr_)) \
@@ -219,6 +227,8 @@
_regs_->a[HAL_NORMAL_SAVED_NUM_A_REGS-1] =
(CYG_ADDRESS)0; \
/* Thread's starting PC */ \
_regs_->pc = (CYG_ADDRESS)(_entry_); \
+ _regs_->sr = 0x00000000; \
+ _regs_->sp = (CYG_ADDRESS)_regs_; \
\
(_sparg_) = (CYG_ADDRESS)_regs_; \
CYG_MACRO_END
Index: src/hal_misc.c
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/arch/current/src/hal_misc.c,v
retrieving revision 1.1
diff -u -r1.1 hal_misc.c
--- src/hal_misc.c 29 May 2002 18:28:15 -0000 1.1
+++ src/hal_misc.c 13 Apr 2005 11:45:51 -0000
@@ -187,7 +187,7 @@
w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
w = w + (w >> 4);
w = (w & 0x000F000F) + ((w >> 8) & 0x000F000F);
- return (cyg_uint32)((w + (w >> 16)) & 0xFF);
+ return (cyg_uint32)((w + (w >> 16)) & 0xFF) - 1;
}
Index: src/m68k.ld
===================================================================
RCS file:
/cvs/ecos/ecos/packages/hal/m68k/arch/current/src/m68k.ld,v
retrieving revision 1.2
diff -u -r1.2 m68k.ld
--- src/m68k.ld 10 Apr 2003 18:07:54 -0000 1.2
+++ src/m68k.ld 13 Apr 2005 11:45:51 -0000
@@ -193,6 +193,17 @@
__ ## _name_ ## _size = (ABSOLUTE (.) -
ABSOLUTE(__ ## _name_ ## _start)); \
}
\
> _region_
+
+#define SECTION_romvec(_region_, _vma_, _lma_,
_minsize_) \
+ .romvec _vma_ : _lma_
\
+ { __romvec_start = ABSOLUTE (.);
\
+ FORCE_OUTPUT; KEEP(*(.romvec))
\
+ __romvec_datasize = (ABSOLUTE (.) -
ABSOLUTE(__romvec_start)); \
+ . += (_minsize_) > (__romvec_datasize) ?
(_minsize_) - (__romvec_datasize) : 0; \
+ __romvec_end = ABSOLUTE (.);
\
+ __romvec_size = (ABSOLUTE (.) -
ABSOLUTE(__romvec_start)); \
+ }
\
+ > _region_
#define SECTIONS_END \
SECTION_stab \
Errin Bechtel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-13 11:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-13 11:47 m68k patches Errin Bechtel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).