changeset 80:2085233a121a ecos-sw-2000-04-07

Merge from eCos master repository on 2000-04-07-07:52:29-BST
author jlarmour
date Fri, 07 Apr 2000 07:45:04 +0000
parents 5b39a5a40ccd
children 89fef2181d7d
files host/tools/configtool/ChangeLog host/tools/configtool/standalone/common/ecosconfig.cxx host/tools/configtool/standalone/win32/Configtool.rc host/tools/configtool/standalone/win32/MainFrm.cpp host/tools/configtool/standalone/win32/res/Splsh16.bmp host/tools/ecostest/common/eCosTestDownloadFilter.cpp host/tools/ecostest/common/eCosTestMonitorFilter.cpp host/tools/ecostest/common/eCosTestSerialFilter.cpp host/tools/pkgadmin/ChangeLog host/tools/pkgadmin/win32/PkgAdmin.rc host/tools/testtool/ChangeLog host/tools/testtool/win32/TestTool.rc packages/ChangeLog packages/NEWS packages/devs/wallclock/current/ChangeLog packages/devs/wallclock/current/cdl/wallclock.cdl packages/devs/wallclock/current/include/wallclock.hxx packages/devs/wallclock/current/src/emulate.cxx packages/devs/wallclock/current/src/sh3.cxx packages/devs/wallclock/current/tests/wallclock.cxx packages/devs/wallclock/sh3/current/ChangeLog packages/devs/wallclock/sh3/current/cdl/wallclock_sh3.cdl packages/devs/wallclock/sh3/current/src/wallclock_sh3.cxx packages/ecos.db packages/ecosadmin.tcl packages/error/current/ChangeLog packages/error/current/include/codes.h packages/hal/arm/aeb/current/ChangeLog packages/hal/arm/aeb/current/src/flash_cksum.tcl packages/hal/arm/arch/current/ChangeLog packages/hal/arm/arch/current/include/hal_arch.h packages/hal/arm/arch/current/src/arm_stub.c packages/hal/arm/arch/current/src/context.S packages/hal/arm/arch/current/src/vectors.S packages/hal/arm/cma230/current/cdl/hal_arm_cma230.cdl packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.h packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.ldi packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.mlt packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.h packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.ldi packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.mlt packages/hal/arm/pid/current/cdl/hal_arm_pid.cdl packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.h packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.ldi packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.mlt packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.h packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.ldi packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.mlt packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.h packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.ldi packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.mlt packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.h packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.ldi packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.mlt packages/hal/mips/jmr3904/current/ChangeLog packages/hal/mips/jmr3904/current/cdl/hal_mips_tx39_jmr3904.cdl packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.ldi packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.mlt packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.ldi packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.mlt packages/hal/mips/sim/current/ChangeLog packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.ldi packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.mlt packages/hal/mips/sim/current/include/pkgconf/mlt_mips_vr4300_sim_ram.h packages/hal/mips/tx39/current/ChangeLog packages/hal/mips/tx39/current/src/mips_tx39.ld packages/hal/powerpc/arch/current/ChangeLog packages/hal/powerpc/arch/current/include/hal_intr.h packages/hal/powerpc/cogent/current/ChangeLog packages/hal/powerpc/cogent/current/src/hal_diag.c packages/hal/sh/arch/current/ChangeLog packages/hal/sh/arch/current/include/hal_intr.h packages/hal/sh/arch/current/include/sh3_scif.inl packages/hal/sh/arch/current/include/sh_regs.h packages/hal/sh/arch/current/src/sh.ld packages/hal/sh/arch/current/src/vectors.S packages/hal/sh/edk/current/ChangeLog packages/hal/sh/edk/current/cdl/hal_sh_edk7708.cdl packages/hal/sh/edk/current/src/hal_diag.c packages/infra/current/cdl/startup.cdl packages/infra/current/src/pkgstart.cxx packages/io/serial/current/ChangeLog packages/io/serial/current/cdl/ser_sh_edk7708.cdl packages/io/serial/current/include/ttyio.h packages/io/serial/current/src/common/tty.c packages/io/serial/current/src/sh/sh_sci_serial.c packages/io/wallclock/current/ChangeLog packages/io/wallclock/current/cdl/wallclock.cdl packages/io/wallclock/current/include/wallclock.hxx packages/io/wallclock/current/src/emulate.cxx packages/io/wallclock/current/src/wallclock.cxx packages/io/wallclock/current/tests/wallclock.cxx packages/io/wallclock/current/tests/wallclock2.cxx packages/language/c/libc/current/ChangeLog packages/language/c/libc/current/cdl/time.cdl packages/language/c/libc/current/src/time/settime.cxx packages/language/c/libc/current/src/time/time.cxx packages/templates/all/ChangeLog packages/templates/all/current.ect packages/templates/default/ChangeLog packages/templates/default/current.ect
diffstat 101 files changed, 2951 insertions(+), 2296 deletions(-) [+]
line wrap: on
line diff
--- a/host/tools/configtool/ChangeLog
+++ b/host/tools/configtool/ChangeLog
@@ -1,3 +1,18 @@
+2000-03-31  John Dallaway  <jld@cygnus.co.uk>
+
+	* standalone/win32/MainFrm.cpp:
+
+	Modify CygMount() to call the correct overloaded form
+	of CSubprocess::Run().
+
+2000-03-29  John Dallaway  <jld@cygnus.co.uk>
+
+	* standalone/win32/Configtool.rc,
+	  standalone/common/ecosconfig.cxx,
+	  standalone/win32/res/Splsh16.bmp:
+
+	Update version strings.	
+
 2000-03-28  John Dallaway  <jld@cygnus.co.uk>
 
 	* standalone/win32/cdl.sh,
--- a/host/tools/configtool/standalone/common/ecosconfig.cxx
+++ b/host/tools/configtool/standalone/common/ecosconfig.cxx
@@ -48,7 +48,7 @@
 #include "cdl_exec.hxx"
 #include "ecosconfig.hxx"
 
-#define TOOL_VERSION "1.3.2"
+#define TOOL_VERSION "1.3.net"
 #define TOOL_COPYRIGHT "Copyright (c) 2000 Red Hat, Inc."
 #define DEFAULT_SAVE_FILE "ecos.ecc"
 
--- a/host/tools/configtool/standalone/win32/Configtool.rc
+++ b/host/tools/configtool/standalone/win32/Configtool.rc
@@ -192,7 +192,7 @@ CAPTION "About ConfigTool"
 FONT 8, "MS Sans Serif", 0, 0, 0x1
 BEGIN
     DEFPUSHBUTTON   "OK",IDOK,178,7,32,14,WS_GROUP
-    LTEXT           "eCos Configuration Tool 1.3.2",IDC_STATIC,40,10,119,8,
+    LTEXT           "eCos Configuration Tool 1.3.net",IDC_STATIC,40,10,119,8,
                     SS_NOPREFIX
     ICON            IDR_MAINFRAME,IDC_STATIC,11,17,21,20
     LTEXT           "Date/Time info",IDC_STATIC_DATETIME,40,23,119,8
--- a/host/tools/configtool/standalone/win32/MainFrm.cpp
+++ b/host/tools/configtool/standalone/win32/MainFrm.cpp
@@ -1235,10 +1235,12 @@ void CMainFrame::CygMount(TCHAR c)
   c=towlower(c);
   if(!m_arMounted[c-_TCHAR('a')]){
     m_arMounted[c-_TCHAR('a')]=true;
-    CString strCmd,strOutput;
+    CString strCmd;
+    String strOutput;
 
     strCmd.Format(_T("mount %c: /%c"),c,c);
-    CSubprocess::Run(strOutput,strCmd);
+    CSubprocess sub;
+    sub.Run(strOutput,strCmd);
   }
 }
 
index eefac5a67b14f08a55849eb07e62aef4fb8773ce..c817f195cc7374d6e7b3a1987a987e1c8ee5c7dd
GIT binary patch
literal 166438
zc%1E>UuYcHy~j`0l~+nM+O^hNTN+#Y$FtSimMzP1y;T}1@d_z-<4Cd{%Z{&NwI)GH
z;|J60hd$(?58)EHfjk5Pc?bjoc_;(|g+Ra%2)zUX!4Lw05D3L!FoBR;2%%8Q-19qs
zX3m^Bv)Y|qTk`Dh<5t=^bLPzX^F815XJ(c9@~{4<j{v7qgjDJ80eU$93qpQD23Yw2
z{dXVv-(kZ3PXpQiUDsvjE>6=QW8afcKKX?F<HsKfsoW**-5<&N*)!zU=bw?kyz>_M
z`?uecH~;)6^6!8Dn|$!W2V{PJp4|NFhvZM|XUW;KXUVItzDnME;|^J`jgjf;X>#pM
zja<LDNUqLT$j?9hME>=!f046iZj+nu-6cQLdtAMGmHhLc|0K6=-6HS2^A6cuoF-#q
zW8}t-8|1w=Un4ix&yd$&f1TX<;wE|Ljn_z}a);c#bBBEP$xY(^^gX@DZSupH-;<yI
z@eeXav;WG~i{#UfKO(RH={ouB!}rMdckhzxXXnY+U*00Ozx$T_d2^lo_5F9r&p-c6
z-g@;F^2RH7$XB<%pym9E{P@EU<eRU*B6n}!rr|fp58r=J{&w?Y^37LYk}p2{8~N(y
zUGl-Z?~vDSTqECo_Z|86o3F|HG>@-c-z4w9{U&+k+8y%lo3E4UN`<^i<9zh)TV(U%
zZL&CDBR_xhIr;q4o8<b{b@KM>uaXbndzXCo%{S!j*ZxdC{phdc%P&5sX}?Wgy>^v+
z{J~$y%@02ycW(cky!X}{w2p6+FaGu^`To`q<fFg5PwVSP^5fm_$a}BfC12nCki4>a
zhkX3*UGmk(cWJrrkonqef*`HpA_#(bY_}sJ+Yjmh0Z<1BfI2_`)BysZ4iEr!fB>ii
z1V9}i0O|k%PzMNrIzRx_0Ro^75CC<60QW-&$rD-vON2UzK>|x;&;bvjKV4p87RB}A
z6LBDey(m$Efoqh2z)wPme!sw>mrXx6%1wzmT|E)+9%^zjZ>A#46aI~rTj(WF3ZmqU
zUGCpm$%%UF?Z%)3rSg=za3fD@v6=)LPMZ@C#~{YU{1b-M&Dn7SZ5zr(_-geIp+t#x
zEpZJ|13EAicqh<`4g!AQXFk~DybjQ@4)ios$577tS@)`5y)e=b#5Ljan2N0GK*>kA
zVuGbpa^`XwgfpfTX$R1nAGm(~84iNFj?{rs1m^A$70-_rYQH8Iy1}blq9hlg1HGW;
z5;eb832{y7?jRKybwFGxTW=U7vi`h5P1aFhq$K7*{hH7u!VO;F`r+Q8euqFKxo#+R
zV<LWo1e5c|dA-P9sr9_;ITLyCQ&+0e(}-T1J88)txn2nLnqY8b{MfNOtB<gd+llN4
zMie<-9v(27t{d;04!TTC9q6aq&E$iu1=Il#b(@|}KDe)p0H^~5=u8K0;FnCXll(kr
zB&D?7*MVt_z3;AbAMdtvgwRP&%=-t%)x3UI33k>02Q~-%47%aV)hz%uL*YFLf4Q&T
zC2;>hFj3NVgZT<vU@XKINqfgc3srXs0(oxx@rPf*-7B<GWYhfLxSy!pJeZCatTwmd
zM6h-=^UxbMczdNzTs4B}Krf>kN?k96u~J%1+E`9Cc|!`OS~I5MhHlZVLbtC2z2|sM
zP4wV!Da<->l}oh-*UF$|I6?<*AdjwgiMC;@SBZWPSE+$El5VDhkRN!NZ{zWYo@^Hi
z?YjC?6QZ5fg9352E1T#bs&b4v@ZH}liD{Gx>p*T&2P?`|TC-gp#7Me{4qW{%YV#Ve
z^G~^6UB%8>lR^ipQ^PzzAWGce038et=1)F>cl{q;eQV=FR5P1$9MnOeVhuxOut<u$
z0tHn=!c&helh&gJl2E1vUJbYV_`|<n_X^#%4uaLvTCgFOAJ0_|0wpu(z<4IC1H+Bn
zV3__foIf`l)?(6IS3oG8W&zRXx?5<kSDMa6uIM7pG+P3ia;4wJ>m}h|(PxxS7QDTw
zO18?YD;%{+Cbvkssl2wNeI0b6&?L4FI^kZV+4UQ3acz^+ofWSQ9T2mSJG}e-(*g2;
zfjU3{)BysZ4iEr!fB>ii1V9}i0O|k%PzMNrIzRx_0Ro^75CC<60H^~5Kph|e>Hq;;
z1VIpm?e-*O`#~Kb0O|k%PzMNrIzRx_0Ro^75CC<60H^~5Kph|e>Hq;y2MB;VKmgPM
z0-z2M0Cj)>r~?E*9UuVe00B@32!J|30Mr2jpbiiKb$|e<0|Y=FAOPwB0Z<1BfI2_`
z)BysZ4iF%5I<Ox7&un(K-#aeOp3ELyu;t-gogzNl@EOj)?>QNxpC0u4sr@0FJ-Sg;
zZ?M_OW`BQmNv1CnwCa*^8B-oue)@LcR@TEuv%jD9;(Pg#7kd#IGit`dCF4xd%z1g^
zsc?d6g-DnVtfTw-7(=|VmmV5phX)^<;SsWMBqBctpC6_l;CEIgv6~+3<{#~>NNwyP
z*#Op)BB<~A1s2c{3H||oKRro*EQ+X`5YnI@>VEnUE4P}<{)QzqdU%QlY{>jjP6qPC
z81ge_Dj8&M@V7i~PtS^wK968pA(Ewo;*eMF4LBYg^NtVlW>a+Vq!%wxPtcT;?9<Zo
zel_lWl%GB92lX9gx8Mnm9|XD79)orj9Xu;Pn{}|cTW_R?y?m3+(Qw->dKoj8j2ebt
z`o6<O7Sx+MuowMuL%%wzG+N*26A;DM!PKZ1FHldOAIwaumyfYdI~YiD3A!Lp@F6Y?
z<^e~!6F*Hq4#7o=4mP}xn`3HHj}aIpWPV6-($IFQ9~eqT#(%2@E*1&tRUKU8Eq3_a
z8m&)@Y_OKz_fYmB=H&-#MA1R<5neyhe!zx}p+{{}djS$!gD_~@zP)F%&#-H+5iu@U
zto?sS4<G3ZFbEg<I<P!H7~jXUn!WN{FQV@UFPhp;@dH!I2zP^_7q0OS4-rwagOj^=
zPwsxQdDSIJ2Q#dToh#Cho0GI(F<WN_S!8y8m?%0pCt8Z?#jFF?bzh_(XoO{`cWS>j
ztNs}p#M%s`!F8|(^*uokUkJ!x3~nxTU=f)pe7pi59)T<PRA8Si{lF4wde=yXd>yPA
zN;b=GxB{nFSVe$=u?lIW?vkW~CwZr2l{d4*>-=e6m8_xqmV6z6olnaC=l55_#|5Zv
z=#vNKEc+SW!ImKA85RN^f6@{o1)C&30l~F^4i2-Zbzf)F4~o!Idnb5anI`_=`$3JK
z9GwjMfu;I^sbm&&fdyWMS*hWk)B!W{DX0flMQoIi6K7U4M~NkLumsaO_F2vko@-DB
zi`)-j7={?n(ch0!Q=QyP51tn-^`w6@BKj`GeVVV}z=WRL*m!tlR7yk9fj2HJ!0#&}
zZ{wp}GGe`8pM}QLbU?Ttth2J2N>&_YSriTex%ds~Q5`@RJ?I~@mXaNMPE<VC0qaDM
z@Orn@*;HNnfi(_?FA&l8z?f*M221dqssqNslMoIr{|NoP0#|TpD1IQvg(uaPWUcnR
z5XlB%YmTK+vmaPdCEHY$#Vuys>P;Q+k=^ryMbT0mQ6pRjtg1J>d09XQ!Vg5_S-uYX
z!a9&+`6S;|pzUT&zy~^Sd(3Zvx@dgjuNSiN)(kQ7^ZCInkK$h=S?rVR1yjlVl?ad(
zh3QEhK(`w6tB&;=xmm}$_hVvFKgB!ShCv4wS?7(yE}&BaYie;w{EPMjLi%AP!KQ_a
zygfip3p_KvABb^5_`wrAYZiee!<rlyKvF|iaPG>K?avd#CA&hV6hE-IAI$Zr4p{ZD
z2{Wtztlwy&xf(ohH_WkrZIQsZaPHv^`p@PKxK2~p$9@Ni@&ikZ_^_h`OZ!FEEPI6}
zeI0ncc0+9-Hv2p$@&i6XCy)_-z;zHV*&wk;`}}PtOD=kPQ3n>Awf~yeU2Tdi!{KC+
z9kPv?(SANpgcknI1PS^<Xx;cCuV2O{tih~ie!z7Ar`UKsp6wGWcw$^H*aw*}@$+oy
zcU7F+C$y~j0pSY*-q7Ka(Ur&VAn+)U%eI-$klxe*nS;vhn}???SNA?FhS5b>qqDs|
zRw1k__3=5Hx1TTToJmNo8(C!^1R+=pV{{2XNK-#}MyAUAyYXvjO+=j^c;f=k$3EDs
zF0!r2b*ZvG;qGBSQ1%mt3?*Y%k2c_vqu>p&+u55s;5#yOs9oI0`uP;wP8pj&H^jEz
zzyhqSQq_TRVG^bQLk(p=k?%A;^302T$L|`6_Jech*goPYd*lN<3WrDK+`dnt;m_v8
zcIMi-!%VzvL=iL6HSap#56&s6EQU(9mpujJn~;yZ_zd5ae!(KWssr^Y5cJ<CMwRLt
zTZR~12WvJ|l3|{h_4f}*QF&TH>vzsDE?DZik=3}x_lQQN)&e>h^!F1<ZJ&Au_9VDj
z^o`Y7DqckYZk`S-Q^~aa9`@AKgF3MM`eHu5;#c<MCX2vyFvcIy3msTN9msJ(?%9gU
zpYfCvwSOQU?TGnmUmtHBwQU-f^1P8dI&a8^pP#;~mUo@m4~Ddo?cNlT_z1(f;-}Js
zIw0gf)_BdH8)p?!6mJl$9~JLws8j90{6Ofy^8J9aAiCIE!}6E^W<Qu5YRKL@%LDj<
zssq&z;87)iuD$olxRM{%YFqdLFegj)r1B=p#ys;0?~R7u)d3+h3yr}|SvRyIr=Doc
z*8J0!7F|Eqg6CEmjfDw6mZe-^X<=$orewom^@YaOO^cne^wjnEmiJGhmCVcUa?w<x
z<|I!CW~|7AdvSxvn>3Y*ucp=#YdcC4lBNU8`_U{yi|KS2qopgX=#x$E(2lHI%4pJb
zU?QZAHk&ZA($zNXf*<%{t@=R+h0;ix4kG*@JgB#lPKPmCx<b)Xi&K}-DfEMwpdW-t
znhuP95Tm;8vmb0Jnr5fa4`PCT5F%+hKtE_F8K0!-pe4``LL^NG=m+g2<C8QUv;_J=
zh@|NN{h*y>e3GVvmOwuUku)8kAGDK<PttUN!~=DJ0H^~5Kph|e>Hq;y2MB;VKmgPM
z0-z2M0Cj)>r~?E*9UuVe00B@32!J|30Mr2jpbiiKb$|e<0|Y=FAOPwB0Z<1BfI2_`
z)BysZ4iEr!fB>ii1V9}i0O|k%PzMNrIzRx_0Ro^75CC<60H^~5Kph}JJRO`qwYomg
zKBvUx2X=MJ{!0ha>8@5pj}t=&r|0u-JXS>tdpgzuFns`(&^6lD!RfV_BIvpfD0@%|
zU7}qbTs#q92Hn@eu9uGAgF5L&+S9?Y^$t{UFLbbL7Y+_xp)DO8d$uDP+!Gz35V}G;
zI_Oje_eKXOgl^D|4mukY?wJmD;T)lJ+R(v8Q_~KtUO#l296EGrt%b#8GaVe+zh}?!
z^qxJJrrXxR5j2F3X<Y}W!z+dS#bZi@%gt7l1FNft4qX;8!#X&B+-u8p`f*cZzx4Ql
zH07y1`@`pO`Peb7>mbz1Csy?+rw1ZLaOzkfp00!Q+TLJVk1(z79)`~D+J!pkl$LdH
zT5sHEPa9&H#*X|UJ(kvx$HUE-R(t)Cr?d#^^O_DGZ>b1KG%f2uZ{f9L#%PyAqlY14
zKnK&t&a5=`;|7^%PbhGP&?znJKwC4eMa9#FaLN#8&z3S!-G9F!hCYYDB}0d_tOIRO
zFuMV8C=l_YDT<<l=$`C5f~k?yK^@#^sSHRY@pN#)G&hi}ZfP5e4w`i2^pPfpK!S#_
zzojxDk;K!1x>C44KQOSqdRYnacM|f7ZKMzEKLX1?I`j8+;E(<3m(NdAd${ypexo0k
zv7UnSPhEmh#G5i|hR}Y=5tUdv$os+G^Tz>S38xH`17&7+Nm=;$GVm4%M?58XVbkgK
z@t4Hs1M(#5pqs?ffj8&}o<I7HE)BugOJJop?RmPl-g{YX(?3cf_=e!C=!m=|xbGOh
z1`r^Y4m`IHK5_8gKa)D}^b%U|Yj*H*Fjxv9ZP;V>bP(KE>_%PmGI4aUF2jsZ92C6S
z<WpuD$Teg7CGEt^;yS|)vm6&t2VEtO4&*HH*cR_5Ju9y@^=m*53;(5`xFjzOxq-j6
zh&t#dadaT}iBCnezr<TKhMH6B+m}LT(xwZKoL4rOah}*!;^;uG3{FM9pq>x-M&$bj
z#@1%Yfx!=%emwXv3U$y`;^<)O$g4peM9dPK=wOeyQVu9vK5A;I3`ivRMF)mg23pjC
zxbl2xM^T@7wp0crlKY|q<BKIN>40x7zog4Rf8K~X=#)<8iP6jlbrAJEHrc#KqRt3~
zXb&OM>F~s|r7|Fq#L>a^EhF>ylDvI}sP%&E^`ZI0k$?_@&m{SS2Gl`!iKByg5p?X3
zj*QGV7EZ{+bi@QfZWFw$pO6CK8_UYW#Pk7^2zp2d);&r$jt=Dh&@ufLWhs!$+5$7m
z5WH@GLpvc2;Cw(Xp|?+ZPzU#lI6Cn5i-WJ6_%El-Yr4>92;TOh9Qd^jN4a|--awG<
z5M?Vpse>*XLo6M5?HkxpJR!Tkx8Hoidmt5<;Gg&Ql`e%IF{?6=i^IrW<{httd*$NY
zCzcNU_Py>uV({Nz_FqU+-dFKoCU{DD|G--br1!{0gTGfGU1Gm>yvwluh+hMM-KFTZ
z^4pJeFVql`1$*l#W@70;dEM;TMX@&U-#$<tKdJAprPBw_@87=%UQ+jUpuBRHetFOS
z{pbIv>>kVJ_SOr>r@2rJ-(ZN$x9$DV0}Y>>uyr&;j4msnNgnLTgVvIXr-P<TNA=4r
z&l+PW&Di8is{SybeAg+>bP^gNI($Fz-ugio2qm^N{J@_Jgjo$lG`^^+cIU_!Rh7A8
zcw1RFgy{E`@1GwS*uoEJnsakS8?b;5@^Ih$K>PkeKI)BS{b9682!U3N5JF%H5sIT5
zLWkd9=$0R}fyG;1D1eEei4Jy-AL#EMML5E$t2400_nCI-j}jTdm1OwKF2N+4e4lAs
z{h-V21V0FUzww0OD=Nmnn{y)cl_t&A!(UuW>yHz4A*7E7Q)sCO(QJbsba=;Y^MmmB
zo!tTbfm75U(aNs|M-hE=*WNBjA2)0msT0cdQ`!rSO}^fUe$Y}ft?R(>_YVSJXumw)
z>~+Qb!2If}G=}i9?}+!d5nW#DZ>@?b=a17k>Gbi(L+3mG`v>R;t?MA-?c`_IR)O_a
z{<dcGzl-zIe!zIDIZeOqjDFBkGHvJ}!G9mA6F;~w0@+D^uw(yTTGLE#>waRF*&%+A
z+`pgLEkEdi{Y1tC`1e$k^n9U9bnFLYXa9ZWQ{>dK%cj4-602rfjoz{!bk!ibt*~}=
zu#^AZ`T!X?H9w%`7yTeaH~fI?;Q#&t)xp|)CQi3QKZv0N!v1?KYuowXV>x2_@3H)9
z{nXH@%jgHOh^K=cOsrmqevlv?nClt+pd}Kd14)d2hklSC9iSg{K!S82K|hE=f^>j>
z&;be3fdu^^1_{yu`auUINCy)1gBT=82j~YKkRTmM&<|peARV9|bU=c1AVEKfL4tIE
ze$W94(t!m1AO;E20s27)BuEDm^n(~ANC)T#9grX$NYD>rkRTnPA9O&1bRa=Lh(UsM
zfPT;c3DSWC{U8Pj(gFHG2P8-b67+)@BuEG72OW?g9Z1j*VvrympdWNVf^;B3KZrqs
zbbx-)0SVH91pOce3DN=jK?fvA2NLvy7$iss=m#B;ARS214`PrY9iSg{K!S82K|hE=
zf^>j>&;be3fdu^^1_{!^gXagvH0`ZUZJpE>c{QB|9i)(+r@cRniy#PsAP9mW2!cGQ
zINO~81VIo4K@bE%dXapF68AsZh$Mncxg?)Zm&&Mx-o(i*2VYiLuHZIB?@^fuzqT?_
z*zQ~*_m_MrtO6i~me5P&4Q3!L0jCMQL&0DK<p~r*kC8X}fP+G~cZ_6L8ae;a$qf&#
ztdvex^N~>^$y8G%dhKxTLWg-W4+<%7&M<*<gbo?z6*=MsjLcY;Matsn!tl5SZ@tqX
z`(!>GWrSZ|;U`wu!HSGlVsFdCkGWylP<0k%xXoOq%rk=mmD+@mL<E&`wVYE_QW;K_
zN~vsB7TBq#W=kn5>Jb_dijngLpJ4%RzFeYOrWaIsLQa()SKBPXPKWEj@^!Gl8qekd
zBb(kAAE*}Ul~9yu9XM6x+X)ug%<w2nadc2IXkZz(5@?eZa+C_mn6GpeEZeSoCkrcc
zkax?n$7h*GRhDfyEUx5-ZQEL)A+@=RcUyZCiddu3Eo=OWJ2%CGQ_w9o+bhA2C*%jB
z^_bo>wP4-P74#@0R+J9P(hCF&JW8E~wWk9oJSr^bnMp|7a?8sR*KShhnv*&x7cH41
zYa9Y9<Ko!bEYVX7w7>V;-riKssyVJRW!0;N%5cBku$T@imOWg_C2a#M<OfA==1d2n
z6?^@H7RBHP7Sln6SMXH1%r}B9p`keALN4qE6S)+m>kS8aQZQcXtU!|s9pr4Tfc_ck
z3XsbT&y7tBM7um8C3-=<DE+|6(S~=**7%46EL*%}DQgf8+bY4%C*%jb?QN*KitIcS
zvO`*BEsEv`mgfh{%zt@1(fZ#ki;7!{;RoJkaw;TDFHX5+zIK*In#u5Sy$-itE*C}$
zm1+qxl!5@ek*l1kGou)!VN?gcA51y!pw(b9a5DYe(^jl<@?;S9gACLbw}X?yg9|iN
zw7{|!CCU%@a=#|hta?Lk96!jA3>#$V>M+B-Ad|`Da+wPKpEsw=6XV*^Dfxa-hNezA
z5_)nRvO5e1BP?I3kRLcs$zmIpG){`mADm6AoH!L2{D4l68^Z-wQZY$n=Nvv&u$*9&
zC_flxc90F<kM+s+bU?>`+U(_2o-Yo(&4OUBT&|d|bz#jS`~YlaiM7ADlKI^xR|OME
z!(lp5{lGbCE%0L+h55l$f_0$yflKQ`l(WcAiJ5UqiRed(@`FJZTpm$j?H9ujN^&*`
zy9gyFgI_9$lV#)5QT2m<7^tYfi|k~aVP*$BUI7Z*pyks2pkRvtMF;KV{sAHE2R`*B
z`ma7HB3h=1QGT%E&CC6NRnSh1`GHIw=8MqSztrI;CyW>SevpBd9<SBv{fzNV2c`#>
z==~$Gpfve`leOl`Y<gVf&XDAB!7}O~K!ZorLb)GUVpqlYgB5*3N5oRJeLu*1djt82
zk`oev6helWF82Mv837$wu=eK^9Vn7j;PFQ0jD7%v$Z*k`SvYy7+UQk3P+|Q=%oEjM
z-tR>Z@%^A=_`@5le%qfPWRyK3qYAhXGUkaQ%x}k;ALPe9kAlSk)j<}1<(m0Hjm;(s
zgY}{f*Ywo<AWVLwARq1N+o@uHFw2kXo*!Ic!OO!Oc3@xdqO_?4uYsdvz;$5SQUpIB
zHd7#*>8_L^KV{|;4y;1NT-GTV{GiG=j$qALq1VlF9c=cjA5{53PrOY*AK?eq2y~GG
zKPWluqvg2=-xl6rpWB}wcshtw0TY5*2Yjz%gLU8r<cO~hV6rpiu*}!^l-FA?)c8Dx
zhw-I?BbO9VvL5z>vUK)T$a;kzkQ(hoBg<R|Y~s$R3hbezv%o&nUR0>?SIewMrPA`F
zV%flfcGu?#QR9NcH!~Ls`HTZHwR5aV!IkLJVTy>oF0p?Aeo(Vkyldscm+PRxx5avQ
zeo*CFX%xbzxF6Vb$Q_@M!!PSD6&pJKTsiL+_+zQs1?91!<t;I`M$8knX`x|UFkU^&
z_rQy_TE$^&2Ra|fL!dq4P~&GJsaA&hw1xQrk?mZtZS^UFQ|EJu-d!)0#q26<2f`2P
zCFPNlNUJOxT!ccqH;7NmI&cZNN<ah#8Mry)lO|^ac0gc}U{_&hm{|7IazEc#q}`mm
zg>8#$HrRgRl%0jCOrgex1!p7$S#_L20#BXtY(FudPuiO=t@y!(ksR;I%i(c>)!<TI
zc`zyWbG*?6#9*@trurH|>pDm&n+BpMhGpPJ{G~P6M65205uw1kJzvzYX+eHPydq)s
z+uRS_da<x#^_LnewpAN}NEO@K983+?t+|ThWa~BC>aW%Mqn>X*sI<6$;P7~%`5p5E
ztL|jvhJn@aE~(U{BUm-w>hb)5?GX7*9$qRiCX5L>E4E$CU09%g05gM;#th3-fA)fy
z0S>c?fxS|h@%*6T3@_36GpP~230+;8vn{*0TyZ=d)a!|V{~!YPgon)N!56A!`VTsL
zu0*GRwT9XnPA)Y?rwO%`Ty0jW<$jh<salSBal`<dAV@nftQ184%+HzV)U<NJxlm1I
z`P1V<Ih9J4N93~!Dvk2V)NsxT>>oIpTs0@+u#0llYT*KWx{z^Ty^zUd5;jL@<_Bfi
zR$i*}5_7$@-g*(ldH;YvU~mk}1aF{-8WtQC^-zzX?k5H#sR_W3DfZksIWowzEuNJo
zeo$tc0NlZIE&9e*#Cb2R;Pv&e4#bIkq(TEakcZ(YK|csaQm&^z7ZRoecflX5&3+&@
ziTZOFoGRax)gLdkPptP;m%Yx;8r})(pwqv{8}x(bF^3cOPMZ4F5OY8GCVw(oXg{%S
zV!VH#?iE7AJE2u1ElQ^Ymgfik#X{50Zt#-_9sez_i1k86`-A9K>y!K_mf5rHc6a1b
z6A^pMJTyPi=@y^w2gBv9nmJ)A@O;0?xL*wlVcRxTol=R{en0|J2J~#lcPPwRR)1Na
z8T1I=dOmXhpt9+!U}77;y8*8run(#e2pu@3<&Im<87ZZ5V!xp0WZ;erOQN?)E2-rP
zLW;G)>b7pBQX%mBv&EvLtQqsAQWtX8qfYSPkuRBd3@g$pklw&4lT>I`kV$Rdqy^a~
zXrreJ>XYC?$?!@9l6<HVNUB_cznhn1-)rl5pBs5FaSHMe=cUR8oERVof*=TjAP9mW
U2!bF8f*=TjAP9mW2x8{{0Sz%^NdN!<
--- a/host/tools/ecostest/common/eCosTestDownloadFilter.cpp
+++ b/host/tools/ecostest/common/eCosTestDownloadFilter.cpp
@@ -53,7 +53,7 @@
 #include "eCosStd.h"
 #include "eCosTrace.h"
 
-#define DL_FILTER_VER "$Id: eCosTestDownloadFilter.cpp,v 1.2 2000/03/28 20:13:33 jlarmour Exp $"
+#define DL_FILTER_VER "$Id: eCosTestDownloadFilter.cpp,v 1.3 2000/04/07 07:45:09 jlarmour Exp $"
 #include "eCosTestDownloadFilter.h"
 
 CeCosTestDownloadFilter::CeCosTestDownloadFilter():
--- a/host/tools/ecostest/common/eCosTestMonitorFilter.cpp
+++ b/host/tools/ecostest/common/eCosTestMonitorFilter.cpp
@@ -45,7 +45,7 @@
 
 #include "eCosStd.h"
 
-#define SER_FILTER_VER "$Id: eCosTestMonitorFilter.cpp,v 1.1 2000/03/28 20:13:33 jlarmour Exp $"
+#define SER_FILTER_VER "$Id: eCosTestMonitorFilter.cpp,v 1.2 2000/04/07 07:45:09 jlarmour Exp $"
 #include "eCosTestMonitorFilter.h"
 
 CeCosTestMonitorFilter::CeCosTestMonitorFilter():
--- a/host/tools/ecostest/common/eCosTestSerialFilter.cpp
+++ b/host/tools/ecostest/common/eCosTestSerialFilter.cpp
@@ -51,7 +51,7 @@
 
 #include "eCosStd.h"
 
-#define SER_FILTER_VER "$Id: eCosTestSerialFilter.cpp,v 1.2 2000/03/28 20:13:33 jlarmour Exp $"
+#define SER_FILTER_VER "$Id: eCosTestSerialFilter.cpp,v 1.3 2000/04/07 07:45:09 jlarmour Exp $"
 #include "eCosTestSerialFilter.h"
 
 char msg_ok[] = "OK";
--- a/host/tools/pkgadmin/ChangeLog
+++ b/host/tools/pkgadmin/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-29  John Dallaway  <jld@cygnus.co.uk>
+
+	* win32/PkgAdmin.rc:
+
+	Update version string.	
+
 2000-03-15  John Dallaway  <jld@cygnus.co.uk>
 
 	* win32/PkgAdmin.rc:
--- a/host/tools/pkgadmin/win32/PkgAdmin.rc
+++ b/host/tools/pkgadmin/win32/PkgAdmin.rc
@@ -26,17 +26,17 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 // Dialog
 //
 
-IDD_PKGADMIN_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
+IDD_PKGADMIN_ABOUTBOX DIALOG DISCARDABLE  0, 0, 238, 55
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "About eCos Package Administration Tool"
 FONT 8, "MS Sans Serif"
 BEGIN
-    ICON            IDR_PKGADMIN_MAINFRAME,IDC_STATIC,11,11,20,20
-    LTEXT           "eCos Package Administration Tool 1.3.2",IDC_STATIC,40,
-                    10,131,8,SS_NOPREFIX
+    ICON            IDR_PKGADMIN_MAINFRAME,IDC_STATIC,11,11,21,20
+    LTEXT           "eCos Package Administration Tool 1.3.net",IDC_STATIC,40,
+                    10,134,8,SS_NOPREFIX
     LTEXT           "Copyright © 1999-2000 Red Hat, Inc.",IDC_STATIC,40,25,
                     139,8
-    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
+    DEFPUSHBUTTON   "OK",IDOK,181,7,50,14,WS_GROUP
 END
 
 IDD_PKGADMIN_DIALOG DIALOGEX 0, 0, 320, 204
@@ -66,7 +66,7 @@ BEGIN
     IDD_PKGADMIN_ABOUTBOX, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 228
+        RIGHTMARGIN, 231
         TOPMARGIN, 7
         BOTTOMMARGIN, 48
     END
--- a/host/tools/testtool/ChangeLog
+++ b/host/tools/testtool/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-05  John Dallaway  <jld@cygnus.co.uk>
+
+	* win32/TestTool.rc:
+
+	Relocate the OK button in the IDD_TT_PROPERTIES dialog.
+
 2000-03-13  John Dallaway  <jld@cygnus.co.uk>
 
 	* win32/testtoolres.h,
--- a/host/tools/testtool/win32/TestTool.rc
+++ b/host/tools/testtool/win32/TestTool.rc
@@ -148,7 +148,7 @@ BEGIN
     CONTROL         "&Remote",IDC_TT_RADIO_REMOTE,"Button",
                     BS_AUTORADIOBUTTON,51,90,41,10
     PUSHBUTTON      "&Connection...",IDC_TT_SETTINGS,7,114,50,14
-    DEFPUSHBUTTON   "OK",IDOK,61,114,50,14
+    DEFPUSHBUTTON   "OK",IDOK,96,114,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,150,114,50,14
     COMBOBOX        IDC_TT_DOWNLOADTIMEOUT_COMBO,55,35,94,54,
                     CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
--- a/packages/ChangeLog
+++ b/packages/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* ecos.db: Wallclock moved.
+
 2000-03-24  Jonathan Larmour  <jlarmour@redhat.co.uk>
 
 	* ecosrelease.tcl: Allow running if cygtclsh80 is the tcl shell, as
--- a/packages/NEWS
+++ b/packages/NEWS
@@ -1,3 +1,7 @@
+* WallClock reworked, making it simpler to implement new drivers.
+  New drivers
+  o SH3 RTC module
+
 -------- eCos 1.3.1 public net release:
 
 * New architectures and variants
deleted file mode 100644
--- a/packages/devs/wallclock/current/ChangeLog
+++ /dev/null
@@ -1,174 +0,0 @@
-2000-03-17  Jesper Skov  <jskov@redhat.com>
-
-	* cdl/wallclock.cdl: 
-	* src/sh3.cxx: 
-	Added wallclock driver for SH3 RTC module.
-
-2000-01-31 Simon FitzMaurice  <sdf@cygnus.co.uk>
-  * cdl/wallclock.cdl:
-
-  Adjust help URLs in line with new doc layout.
-
-2000-01-28 Simon FitzMaurice  <sdf@cygnus.co.uk>
-  * cdl/wallclock.cdl:
-
-  Adjust help URLs in line with new doc layout.
-
-2000-01-19  Hugo Tyson  <hmt@cygnus.co.uk>
-
-	* cdl/*.cdl: Add descriptions to a number of options &c which were
-	lacking same, also tidied up other typos as noticed en passant.
-
-1999-11-03  John Dallaway  <jld@cygnus.co.uk>
-
-	* cdl/wallclock.cdl: Define build options.
-
-1999-07-14  Jesper Skov  <jskov@cygnus.co.uk>
-
-	* src/emulate.cxx: Include pkgconf/kernel.h.
-
-1999-04-20  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* tests/wallclock.cxx (cyg_start): Output message to show the test
-	has started
-	(wallclock_thread): Add call to CYG_TEST_STILL_ALIVE, so the user
-	can see that the test is still running.
-	Fix for PR 19870
-
-1999-04-12  John Dallaway  <jld@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h: Add cdl_package doc attribute.
-
-1999-04-07  Jesper Skov  <jskov@cygnus.co.uk>
-        PR 19667
-	* tests/wallclock.cxx (cyg_start): 
-	Changed to use the new Cyg_Thread constructor.
-
-1999-03-22  Hugo Tyson  <hmt@cygnus.co.uk>
-
-	* tests/wallclock.cxx: 
-	Use CYGNUM_HAL_STACK_SIZE_TYPICAL for the stack size instead of
-	CYGNUM_HAL_MINIMUM_STACK_SIZE.
-
-1999-03-12  Hugo Tyson  <hmt@cygnus.co.uk>
-
-	* tests/wallclock.cxx: 
-	Deal with CYGNUM_HAL_MINIMUM_STACK_SIZE requirement.
-
-
-1999-03-05  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* include/wallclock.hxx:
-	Remove dependency on cyg/kernel/ktypes.h
-	Tidy
-
-	* src/emulate.cxx:
-	Include cyg/kernel/ktypes.h since it isn't included in wallclock.hxx
-	any more
-
-1999-03-04  Gary Thomas  <gthomas@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h: Make package stand-alone (no "DEVICES").
-
-1999-02-02  Jesper Skov  <jskov@cygnus.co.uk>
-        PR 18970
-	* tests/wallclock.cxx (LOOPS_SIM): Only do two loops on
-	SIM. MN10300 sim takes 1min15secs to do one loop.
-
-1999-01-26  Jesper Skov  <jskov@cygnus.co.uk>
-        (PR 18305)
-	* tests/wallclock.cxx: Removed MIPS specific hackery. Now
-	dependent on cyg_test_is_simulator state.
-
-1999-01-21  Jesper Skov  <jskov@cygnus.co.uk>
-        PR 18847
-	* tests/wallclock.cxx (LOOPS_HW): Reduce run-time to 20 seconds.
-
-1999-01-19  Nick Garnett  <nickg@cygnus.co.uk>
-
-	* tests/wallclock.cxx: Added test of cyg_test_is_simulator to
-	reduce time on simulated hardware. PR 18715.
-
-1998-12-17  Jesper Skov  <jskov@cygnus.co.uk>
-
-	* tests/wallclock.cxx: Do NOP test if kernel RTC disabled.
-
-1998-10-23  Jesper Skov  <jskov@cygnus.co.uk>
-
-	* tests/wallclock.cxx: Reduce test time on TX39 SIM.
-
-Tue Oct 20 15:54:09 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* src/PKGconf.mak: 
-	Remove unnecessary override of PKGCONF_CXXFLAGS
-
-1998-09-26  Bart Veer  <bartv@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h:
-	PR17501: When using the emulation there is a requirement on the
-	kernel clock. This has been added to the configuration data.
-	If real hardware were used then this dependency would disappear,
-	but currently there is no easy way to express this, and there are
-	no hardware implementations.
-
-1998-09-12  Bart Veer  <bartv@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h:
-	Added missing descriptions (PR 17184)
-
-1998-09-02  Bart Veer  <bartv@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h:
-	Added minimal configuration data.
-
-Fri Aug 28 09:40:19 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* tests/wallclock.cxx:
-	Rename int main(argc, argv) to void cyg_start( void ) under the
-	new entry point system. Therefore also remove return code.
-	
-Tue Aug 18 16:49:20 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* tests/wallclock.cxx: 
-	Move inclusion of thread.inl before sched.hxx to prevent inline
-	warnings
-
-1998-07-31  Nick Garnett  <nickg@cygnus.co.uk>
-
-	* include/pkgconf/wallclock.h:
-	Added this file to contain wallclock confiuration parameters.
-	
-	* src/emulate.cxx: 
-	Now uses pkgconf/wallclock.h for configuration.
-
-Wed Jul 22 21:04:15 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
-
-	* src/emulate.cxx: 
-	Remove unnecessary include of <cyg/devs/table.h> and remove an
-	unused variable (result) from get_current_time()
-
-//####COPYRIGHTBEGIN####
-//                                                                          
-// -------------------------------------------                              
-// The contents of this file are subject to the Red Hat eCos Public License 
-// Version 1.1 (the "License"); you may not use this file except in         
-// compliance with the License.  You may obtain a copy of the License at    
-// http://www.redhat.com/                                                   
-//                                                                          
-// Software distributed under the License is distributed on an "AS IS"      
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-// License for the specific language governing rights and limitations under 
-// the License.                                                             
-//                                                                          
-// The Original Code is eCos - Embedded Configurable Operating System,      
-// released September 30, 1998.                                             
-//                                                                          
-// The Initial Developer of the Original Code is Red Hat.                   
-// Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-// All Rights Reserved.                                                     
-// -------------------------------------------                              
-//                                                                          
-//####COPYRIGHTEND####
-
-
deleted file mode 100644
--- a/packages/devs/wallclock/current/cdl/wallclock.cdl
+++ /dev/null
@@ -1,128 +0,0 @@
-# ====================================================================
-#
-#      wallclock.cdl
-#
-#      eCos wallclock configuration data
-#
-# ====================================================================
-#####COPYRIGHTBEGIN####
-#                                                                          
-# -------------------------------------------                              
-# The contents of this file are subject to the Red Hat eCos Public License 
-# Version 1.1 (the "License"); you may not use this file except in         
-# compliance with the License.  You may obtain a copy of the License at    
-# http://www.redhat.com/                                                   
-#                                                                          
-# Software distributed under the License is distributed on an "AS IS"      
-# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-# License for the specific language governing rights and limitations under 
-# the License.                                                             
-#                                                                          
-# The Original Code is eCos - Embedded Configurable Operating System,      
-# released September 30, 1998.                                             
-#                                                                          
-# The Initial Developer of the Original Code is Red Hat.                   
-# Portions created by Red Hat are                                          
-# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-# All Rights Reserved.                                                     
-# -------------------------------------------                              
-#                                                                          
-#####COPYRIGHTEND####
-# ====================================================================
-######DESCRIPTIONBEGIN####
-#
-# Author(s):      jskov
-# Original data:  nickg
-# Contributors:
-# Date:           1999-07-13
-#
-#####DESCRIPTIONEND####
-#
-# ====================================================================
-
-cdl_package CYGPKG_DEVICES_WALLCLOCK {
-    display       "Wallclock device"
-    requires      CYGVAR_KERNEL_COUNTERS_CLOCK
-    include_dir   cyg/devs
-    define_header wallclock.h
-    description   "
-        The wallclock device provides real time stamps, as opposed
-        to the eCos kernel timers which typically just count the
-        number of clock ticks since the hardware was powered up.
-        Depending on the target platform this device may involve
-        interacting with a suitable clock chip, or it may be
-        emulated by using the kernel timers."
-
-    cdl_interface CYGINT_WALLCLOCK_IMPLEMENTATIONS {
-        display       "Number of wallclock implementations"
-        requires      { CYGINT_WALLCLOCK_IMPLEMENTATIONS == 1 }
-    }
-
-    cdl_interface CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS {
-        display       "Number of hardware wallclock implementations"
-    }
-
-    cdl_option CYGIMP_WALLCLOCK_EMULATE {
-        display       "Wallclock emulator"
-        default_value { CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS == 0 }
-        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
-        compile       emulate.cxx
-        description   "
-            When this option is enabled, a wallclock device will be
-            emulated using the kernel real-time clock."
-    }
-
-    cdl_option CYGIMP_WALLCLOCK_SH3 {
-        display       "SH3 Wallclock"
-        default_value { CYGPKG_HAL_SH }
-        active_if     CYGPKG_HAL_SH
-        compile       sh3.cxx
-        implements    CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS
-        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
-        description   "
-            When this option is enabled, a wallclock driver using the
-            SH3's on-core Realtime Clock module will be built."
-    }
-
-
-    cdl_component CYGPKG_DEVICES_WALLCLOCK_OPTIONS {
-        display "Wallclock build options"
-        flavor  none
-        description   "
-	    Package specific build options including control over
-	    compiler flags used only in building this package,
-	    and details of which tests are built."
-
-
-        cdl_option CYGPKG_DEVICES_WALLCLOCK_CFLAGS_ADD {
-            display "Additional compiler flags"
-            flavor  data
-            no_define
-            default_value { "" }
-            description   "
-                This option modifies the set of compiler flags for
-                building the wallclock device. These flags are used in addition
-                to the set of global flags."
-        }
-
-        cdl_option CYGPKG_DEVICES_WALLCLOCK_CFLAGS_REMOVE {
-            display "Supressed compiler flags"
-            flavor  data
-            no_define
-            default_value { "" }
-            description   "
-                This option modifies the set of compiler flags for
-                building the wallclock device. These flags are removed from
-                the set of global flags if present."
-        }
-
-        cdl_option CYGPKG_DEVICES_WALLCLOCK_TESTS {
-            display "Wallclock tests"
-            flavor  data
-            no_define
-            calculated { "tests/wallclock" }
-            description   "
-                This option specifies the set of tests for the wallclock device."
-        }
-    }
-}
deleted file mode 100644
--- a/packages/devs/wallclock/current/include/wallclock.hxx
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef CYGONCE_DEVS_WALLCLOCK_HXX
-#define CYGONCE_DEVS_WALLCLOCK_HXX
-
-//==========================================================================
-//
-//      wallclock.hxx
-//
-//      Wallclock interface declaration
-//
-//==========================================================================
-//####COPYRIGHTBEGIN####
-//                                                                          
-// -------------------------------------------                              
-// The contents of this file are subject to the Red Hat eCos Public License 
-// Version 1.1 (the "License"); you may not use this file except in         
-// compliance with the License.  You may obtain a copy of the License at    
-// http://www.redhat.com/                                                   
-//                                                                          
-// Software distributed under the License is distributed on an "AS IS"      
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-// License for the specific language governing rights and limitations under 
-// the License.                                                             
-//                                                                          
-// The Original Code is eCos - Embedded Configurable Operating System,      
-// released September 30, 1998.                                             
-//                                                                          
-// The Initial Developer of the Original Code is Red Hat.                   
-// Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-// All Rights Reserved.                                                     
-// -------------------------------------------                              
-//                                                                          
-//####COPYRIGHTEND####
-//==========================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):     nickg
-// Contributors:  nickg
-// Date:          1999-03-05
-// Purpose:       Wall Clock declarations
-// Description:   This file defines the interface to the wall clock device
-//                that provides real time stamps. This is either an interface
-//                to a hardware RTC like the Dallas DS12887, or it is emulated
-//                using the kernel clock.
-// Usage:         #include <cyg/devs/wallclock.hxx>
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <cyg/infra/cyg_type.h>
-
-// -------------------------------------------------------------------------
-// Wallclock class
-
-class Cyg_WallClock
-{
-
-public:
-
-    Cyg_WallClock();
-
-    // Returns the current timestamp. This may involve reading the
-    // hardware, so it may take anything up to a second to complete.
-    cyg_uint32 get_current_time();
-
-    // Sets the value of the timestamp relative to now. This may involve
-    // writing to the hardware, so it may take anything up to a second to
-    // complete.
-    void set_current_time( cyg_uint32 time_stamp );
-
-    // A static pointer to the single system defined wall clock device.
-    static Cyg_WallClock *wallclock;
-
-};
-
-// -------------------------------------------------------------------------
-
-#endif // ifndef CYGONCE_DEVS_WALLCLOCK_HXX
-// EOF wallclock.hxx
deleted file mode 100644
--- a/packages/devs/wallclock/current/src/emulate.cxx
+++ /dev/null
@@ -1,119 +0,0 @@
-//==========================================================================
-//
-//      devs/wallclock/emulate.cxx
-//
-//      Wallclock emulation implementation
-//
-//==========================================================================
-//####COPYRIGHTBEGIN####
-//                                                                          
-// -------------------------------------------                              
-// The contents of this file are subject to the Red Hat eCos Public License 
-// Version 1.1 (the "License"); you may not use this file except in         
-// compliance with the License.  You may obtain a copy of the License at    
-// http://www.redhat.com/                                                   
-//                                                                          
-// Software distributed under the License is distributed on an "AS IS"      
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-// License for the specific language governing rights and limitations under 
-// the License.                                                             
-//                                                                          
-// The Original Code is eCos - Embedded Configurable Operating System,      
-// released September 30, 1998.                                             
-//                                                                          
-// The Initial Developer of the Original Code is Red Hat.                   
-// Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-// All Rights Reserved.                                                     
-// -------------------------------------------                              
-//                                                                          
-//####COPYRIGHTEND####
-//==========================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):     nickg
-// Contributors:  nickg
-// Date:          1999-03-05
-// Purpose:       Wallclock emulation
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <pkgconf/wallclock.h>  // Wallclock device config
-
-#ifdef CYGIMP_WALLCLOCK_EMULATE
-
-#include <pkgconf/kernel.h>             // Kernel config
-
-#include <cyg/infra/cyg_type.h> // Common type definitions and support
-#include <cyg/hal/hal_diag.h>   // HAL diagnostic output
-
-#include <cyg/devs/wallclock.hxx>
-
-#include <cyg/kernel/ktypes.h>
-#include <cyg/kernel/sched.hxx>
-#include <cyg/kernel/clock.hxx>
-
-#include <cyg/kernel/sched.inl>
-
-
-/*---------------------------------------------------------------------------*/
-// Local static variables
-
-static Cyg_WallClock wallclock_instance CYG_INIT_PRIORITY( CLOCK );
-
-static cyg_tick_count epoch_ticks;
-
-static cyg_uint32 epoch_time_stamp;
-
-Cyg_WallClock *Cyg_WallClock::wallclock;
-
-/*---------------------------------------------------------------------------*/
-// Constructor
-
-Cyg_WallClock::Cyg_WallClock()
-{
-    // install instance pointer
-    wallclock = &wallclock_instance;
-}
-
-/*---------------------------------------------------------------------------*/
-// Returns the current timestamp. This may involve reading the
-// hardware, so it may take anything up to a second to complete.
-
-cyg_uint32 Cyg_WallClock::get_current_time()
-{
-    Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution();
-        
-    Cyg_Scheduler::lock();
-
-    cyg_tick_count diff = Cyg_Clock::real_time_clock->current_value()
-                          - epoch_ticks;
-
-    diff = ( diff * res.dividend ) / ( res.divisor * 1000000000LL ) ;
-    
-    Cyg_Scheduler::unlock();
-
-    return epoch_time_stamp + diff;
-}
-
-/*---------------------------------------------------------------------------*/
-// Sets the value of the timestamp relative to now. This may involve
-// writing to the hardware, so it may take anything up to a second to
-// complete.
-void Cyg_WallClock::set_current_time( cyg_uint32 time_stamp )
-{
-    Cyg_Scheduler::lock();
-
-    epoch_time_stamp    = time_stamp;
-    epoch_ticks         = Cyg_Clock::real_time_clock->current_value();
-
-    Cyg_Scheduler::unlock();
-}
-
-/*---------------------------------------------------------------------------*/
-
-#endif
-/*---------------------------------------------------------------------------*/
-/* End of devs/wallclock/emulate.cxx */
deleted file mode 100644
--- a/packages/devs/wallclock/current/src/sh3.cxx
+++ /dev/null
@@ -1,242 +0,0 @@
-//==========================================================================
-//
-//      devs/wallclock/sh3.cxx
-//
-//      Wallclock emulation implementation
-//
-//==========================================================================
-//####COPYRIGHTBEGIN####
-//                                                                          
-// -------------------------------------------                              
-// The contents of this file are subject to the Red Hat eCos Public License 
-// Version 1.1 (the "License"); you may not use this file except in         
-// compliance with the License.  You may obtain a copy of the License at    
-// http://www.redhat.com/                                                   
-//                                                                          
-// Software distributed under the License is distributed on an "AS IS"      
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-// License for the specific language governing rights and limitations under 
-// the License.                                                             
-//                                                                          
-// The Original Code is eCos - Embedded Configurable Operating System,      
-// released September 30, 1998.                                             
-//                                                                          
-// The Initial Developer of the Original Code is Red Hat.                   
-// Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-// All Rights Reserved.                                                     
-// -------------------------------------------                              
-//                                                                          
-//####COPYRIGHTEND####
-//==========================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):     jskov
-// Contributors:  jskov
-// Date:          2000-03-17
-// Purpose:       Wallclock driver for SH3 CPU RTC module
-//
-// Notes:         Currently only reads from the RTC. There should be a config
-//                option for selecting whether to do init-read or read-write
-//                to the clock. This will be useful on targets which have
-//                battery backing on the RTC circuitry.
-//
-//####DESCRIPTIONEND####
-//
-//==========================================================================
-
-#include <pkgconf/kernel.h>             // Kernel config
-#include <pkgconf/wallclock.h>          // Wallclock device config
-
-#include <cyg/infra/cyg_type.h>         // Common type definitions and support
-#include <cyg/kernel/sched.inl>
-
-#include <cyg/devs/wallclock.hxx>
-
-#include <cyg/hal/sh_regs.h>            // RTC register definitions
-
-#include <cyg/infra/diag.h>         // Common type definitions and support
-
-
-//-----------------------------------------------------------------------------
-// Local static variables
-
-static Cyg_WallClock wallclock_instance CYG_INIT_PRIORITY( CLOCK );
-
-static cyg_uint32 hw_epoch_base;
-
-static cyg_uint32 epoch_ticks;
-static cyg_uint32 epoch_time_stamp;
-
-Cyg_WallClock *Cyg_WallClock::wallclock;
-
-
-//-----------------------------------------------------------------------------
-// BCD helper macros
-#define TO_BCD(x) (((x/10)<<4) | (x%10))
-#define TO_DEC(x) (((x>>4)*10) + (x&0xf))
-
-//-----------------------------------------------------------------------------
-// Functions for setting and getting the hardware clock counters
-
-// Year must be last two digits of "western calendar year". Leap year when
-// divisible by four.
-static void
-set_sh3_hwclock(cyg_uint32 year, cyg_uint32 month, cyg_uint32 mday,
-                cyg_uint32 hour, cyg_uint32 minute, cyg_uint32 second)
-{
-    // Stop RTC
-    HAL_WRITE_UINT8(CYGARC_REG_RCR2, CYGARC_REG_RCR2_RESET);
-
-    // Program it
-    HAL_WRITE_UINT8(CYGARC_REG_RYRCNT,  TO_BCD(year));
-    HAL_WRITE_UINT8(CYGARC_REG_RMONCNT, TO_BCD(month));
-    HAL_WRITE_UINT8(CYGARC_REG_RDAYCNT, TO_BCD(mday));
-    HAL_WRITE_UINT8(CYGARC_REG_RHRCNT,  TO_BCD(hour));
-    HAL_WRITE_UINT8(CYGARC_REG_RMINCNT, TO_BCD(minute));
-    HAL_WRITE_UINT8(CYGARC_REG_RSECCNT, TO_BCD(second));
-
-    // Start RTC
-    HAL_WRITE_UINT8(CYGARC_REG_RCR1, CYGARC_REG_RCR1_CIE);
-    HAL_WRITE_UINT8(CYGARC_REG_RCR2, 
-                    CYGARC_REG_RCR2_RTCEN | CYGARC_REG_RCR2_START);
-
-}
-
-static void
-get_sh3_hwclock(cyg_uint32* year, cyg_uint32* month, cyg_uint32* mday,
-                cyg_uint32* hour, cyg_uint32* minute, cyg_uint32* second)
-{
-    cyg_uint8 tmp;
-
-    do {
-        // Clear carry flag
-        HAL_WRITE_UINT8(CYGARC_REG_RCR1, 0);
-        
-        // Read time
-        HAL_READ_UINT8(CYGARC_REG_RYRCNT, tmp);
-        *year = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RMONCNT, tmp);
-        *month = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RDAYCNT, tmp);
-        *mday = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RHRCNT, tmp);
-        *hour = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RMINCNT, tmp);
-        *minute = TO_DEC(tmp);
-        HAL_READ_UINT8(CYGARC_REG_RSECCNT, tmp);
-        *second = TO_DEC(tmp);
-
-        // Read carry flag
-        HAL_READ_UINT8(CYGARC_REG_RCR1, tmp);
-    } while (CYGARC_REG_RCR1_CF & tmp); // loop if carry set
-}
-
-//-----------------------------------------------------------------------------
-// Functions providing a simple read-elapsed-seconds interface to the
-// hardware clock
-
-// This function is from the Linux kernel.
-//
-// Converts Gregorian date to seconds since 1970-01-01 00:00:00.
-// Assumes input in normal date format, i.e. 1980-12-31 23:59:59
-// => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
-//
-// This algorithm was first published by Gauss (I think).
-//
-// WARNING: this function will overflow on 2106-02-07 06:28:16 on
-// machines were long is 32-bit! (However, as time_t is signed, we
-// will already get problems at other places on 2038-01-19 03:14:08)
-static cyg_uint32
-_simple_mktime(cyg_uint32 year, cyg_uint32 mon,
-		     cyg_uint32 day, cyg_uint32 hour,
-		     cyg_uint32 min, cyg_uint32 sec)
-{
-	if (0 >= (int) (mon -= 2)) {	/* 1..12 -> 11,12,1..10 */
-		mon += 12;	/* Puts Feb last since it has leap day */
-		year -= 1;
-	}
-	return (((
-		(cyg_uint32)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
-		year*365 - 719499
-		)*24 + hour /* now have hours */
-		)*60 + min /* now have minutes */
-		)*60 + sec; /* finally seconds */
-}
-
-// Returns number of elapsed ticks since the hw_epoch_base
-static inline cyg_uint32 
-get_hw_ticks(void)
-{
-    cyg_uint32 year, month, mday, hour, minute, second;
-
-    get_sh3_hwclock(&year, &month, &mday, &hour, &minute, &second);
-
-#if 0
-    // This will cause the test to eventually fail due to these printouts
-    // causing timer interrupts to be lost...
-    diag_printf("year %02d\n", year);
-    diag_printf("month %02d\n", month);
-    diag_printf("mday %02d\n", mday);
-    diag_printf("hour %02d\n", hour);
-    diag_printf("minute %02d\n", minute);
-    diag_printf("second %02d\n", second);
-#endif
-
-    cyg_uint32 now = _simple_mktime(year, month, mday, hour, minute, second);
-    return now - hw_epoch_base;
-}
-
-static inline void
-init_hw_ticks(void)
-{
-    // This is our base: 1970-01-01 00:00:00
-    // Set the HW clock - if for nothing else, just to be sure it's in a
-    // legal range. Any arbitrary base could be used.
-    // After this the hardware clock is only read.
-    hw_epoch_base = _simple_mktime(1970,1,1,0,0,0);
-    set_sh3_hwclock(70,1,1,0,0,0);
-}
-
-//-----------------------------------------------------------------------------
-// Constructor
-
-Cyg_WallClock::Cyg_WallClock()
-{
-    // install instance pointer
-    wallclock = &wallclock_instance;
-
-    init_hw_ticks();
-}
-
-//-----------------------------------------------------------------------------
-// Returns the current timestamp. This may involve reading the
-// hardware, so it may take anything up to a second to complete.
-
-cyg_uint32 Cyg_WallClock::get_current_time()
-{
-    Cyg_Scheduler::lock();
-
-    cyg_uint32 diff = get_hw_ticks() - epoch_ticks;
-
-    Cyg_Scheduler::unlock();
-
-    return epoch_time_stamp + diff;
-}
-
-//-----------------------------------------------------------------------------
-// Sets the value of the timestamp relative to now. This may involve
-// writing to the hardware, so it may take anything up to a second to
-// complete.
-void Cyg_WallClock::set_current_time( cyg_uint32 time_stamp )
-{
-    Cyg_Scheduler::lock();
-
-    epoch_time_stamp    = time_stamp;
-    epoch_ticks         = get_hw_ticks();
-
-    Cyg_Scheduler::unlock();
-}
-
-//-----------------------------------------------------------------------------
-// End of devs/wallclock/sh3.cxx
deleted file mode 100644
--- a/packages/devs/wallclock/current/tests/wallclock.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-//==========================================================================
-//
-//        wallclock.cxx
-//
-//        WallClock test
-//
-//==========================================================================
-//####COPYRIGHTBEGIN####
-//                                                                          
-// -------------------------------------------                              
-// The contents of this file are subject to the Red Hat eCos Public License 
-// Version 1.1 (the "License"); you may not use this file except in         
-// compliance with the License.  You may obtain a copy of the License at    
-// http://www.redhat.com/                                                   
-//                                                                          
-// Software distributed under the License is distributed on an "AS IS"      
-// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
-// License for the specific language governing rights and limitations under 
-// the License.                                                             
-//                                                                          
-// The Original Code is eCos - Embedded Configurable Operating System,      
-// released September 30, 1998.                                             
-//                                                                          
-// The Initial Developer of the Original Code is Red Hat.                   
-// Portions created by Red Hat are                                          
-// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
-// All Rights Reserved.                                                     
-// -------------------------------------------                              
-//                                                                          
-//####COPYRIGHTEND####
-//==========================================================================
-//#####DESCRIPTIONBEGIN####
-//
-// Author(s):     nickg
-// Contributors:    nickg
-// Date:          1998-07-20
-// Description:   Tests the Kernel Wall Clock
-//                This test exercises the WallClock class and checks that it
-//                keeps time correctly.
-//####DESCRIPTIONEND####
-// -------------------------------------------------------------------------
-
-#include <pkgconf/kernel.h>
-
-#include <cyg/kernel/thread.hxx>
-#include <cyg/kernel/thread.inl>
-#include <cyg/kernel/sched.hxx>
-#include <cyg/kernel/mutex.hxx>
-#include <cyg/kernel/sema.hxx>
-#include <cyg/kernel/clock.hxx>
-
-#include <cyg/kernel/diag.h>
-
-#include <cyg/devs/wallclock.hxx>
-
-#include <cyg/infra/testcase.h>
-
-#if defined(CYGFUN_KERNEL_THREADS_TIMER) && \
-    defined(CYGVAR_KERNEL_COUNTERS_CLOCK)
-
-#include <cyg/kernel/sched.inl>
-
-// -------------------------------------------------------------------------
-// Data for the test
-
-#ifdef CYGNUM_HAL_STACK_SIZE_TYPICAL
-#define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
-#else
-#define STACKSIZE       (2*1024)        // size of thread stack
-#endif
-
-char thread_stack[STACKSIZE];
-
-inline void *operator new(size_t size, void *ptr) { return ptr; };
-
-// array of threads.
-char thread[sizeof(Cyg_Thread)];
-
-Cyg_Thread *th;
-
-#define EPOCH 900000000U
-
-// MN10300 sim takes 1min15secs to do one loop on 300MHz PII.
-#define LOOPS_SIM       2
-#define LOOPS_HW        20
-
-cyg_int32 loops = LOOPS_HW;
-cyg_tick_count one_sec;
-
-// -------------------------------------------------------------------------
-// Thread body
-
-
-void wallclock_thread( CYG_ADDRWORD id )
-{
-    cyg_uint32 wtime;
-
-    Cyg_WallClock::wallclock->set_current_time( EPOCH );
-
-    for( int i = 0; i < loops; i++ )
-    {
-        CYG_TEST_STILL_ALIVE(i, "tick...");
-
-        wtime = Cyg_WallClock::wallclock->get_current_time();
-
-        if(wtime != EPOCH+i)
-        {
-            CYG_TEST_FAIL_FINISH( "Clock out of sync" );
-        }
-
-        th->delay( one_sec );        
-    }
-
-    CYG_TEST_PASS_FINISH("Wallclock OK");
-    
-}
-
-// -------------------------------------------------------------------------
-
-
-externC void
-cyg_start( void )
-{
-    CYG_TEST_INIT();
-
-    CYG_TEST_INFO("Starting wallclock test");
-
-    if( cyg_test_is_simulator ) loops = LOOPS_SIM;
-    
-    Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution();
-    
-    one_sec = ( res.divisor * 1000000000LL ) / res.dividend ;
-    
-    th = new((void *)&thread) Cyg_Thread(CYG_SCHED_DEFAULT_INFO,
-                                         wallclock_thread,
-                                         0,
-                                         "wallclock_thread",
-                                         (CYG_ADDRESS)thread_stack,
-                                         STACKSIZE
-        );
-
-    th->resume();
-
-    // Get the world going
-    Cyg_Scheduler::scheduler.start();
-
-}
-
-#else // if defined(CYGFUN_KERNEL_THREADS_TIMER) etc...
-
-externC void
-cyg_start( void )
-{
-    CYG_TEST_INIT();
-    CYG_TEST_PASS_FINISH("N/A: Kernel real-time clock/threads timer disabled");
-}
-
-#endif // if defined(CYGFUN_KERNEL_THREADS_TIMER) etc...
-
-// -------------------------------------------------------------------------
-// EOF wallclock.cxx
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh3/current/ChangeLog
@@ -0,0 +1,59 @@
+2000-04-06  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock_sh3.cdl: Only active when wallclock is.
+
+2000-04-05  John Dallaway  <jld@cygnus.co.uk>
+
+	* cdl/wallclock_sh3.cdl: 
+
+	Provide hardware wallclock implementation as a radio button.
+
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* src/wallclock_sh3.cxx: 
+	Moved from devs/wallclock/current to here.
+	Get API from io/wallclock.
+	Deleted all non-SH3 changelog entries
+
+2000-03-29  Jesper Skov  <jskov@redhat.com>
+
+	* tests/wallclock2.cxx:
+	* include/wallclock.hxx:
+	* src/sh3.cxx: 
+	* src/wallclock.cxx: 
+	* cdl/wallclock.cdl:
+	Reworked WallClock API. It should now be simpler to add new
+	wallclock drivers. Added a simple test to print out the current
+	wallclock value so a human can verify battery backup works.
+
+2000-03-17  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock.cdl: 
+	* src/sh3.cxx: 
+	Added wallclock driver for SH3 RTC module.
+
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+
+
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh3/current/cdl/wallclock_sh3.cdl
@@ -0,0 +1,95 @@
+# ====================================================================
+#
+#      wallclock_sh3.cdl
+#
+#      eCos wallclock SH3 RTC-module driver configuration data
+#
+# ====================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# -------------------------------------------                              
+# The contents of this file are subject to the Red Hat eCos Public License 
+# Version 1.1 (the "License"); you may not use this file except in         
+# compliance with the License.  You may obtain a copy of the License at    
+# http://www.redhat.com/                                                   
+#                                                                          
+# Software distributed under the License is distributed on an "AS IS"      
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+# License for the specific language governing rights and limitations under 
+# the License.                                                             
+#                                                                          
+# The Original Code is eCos - Embedded Configurable Operating System,      
+# released September 30, 1998.                                             
+#                                                                          
+# The Initial Developer of the Original Code is Red Hat.                   
+# Portions created by Red Hat are                                          
+# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+# All Rights Reserved.                                                     
+# -------------------------------------------                              
+#                                                                          
+#####COPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      jskov
+# Original data:  nickg
+# Contributors:
+# Date:           2000-04-05
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_DEVICES_WALLCLOCK_SH3 {
+    parent        CYGPKG_IO_WALLCLOCK
+    active_if     CYGPKG_IO_WALLCLOCK
+    display       "SH3 RTC-module wallclock driver"
+    requires      CYGPKG_HAL_SH
+    hardware
+    compile       wallclock_sh3.cxx
+    define_proc {
+        puts $::cdl_header "#undef CYGSEM_WALLCLOCK_SET_GET_MODE"
+    }
+    implements    CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS
+    active_if     CYGIMP_WALLCLOCK_HARDWARE
+
+    cdl_option CYGIMP_WALLCLOCK_HARDWARE {
+        parent    CYGPKG_IO_WALLCLOCK_IMPLEMENTATION
+        display       "Hardware wallclock"
+        default_value 1
+        implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
+    }
+
+    cdl_component CYGPKG_DEVICES_WALLCLOCK_SH3_OPTIONS {
+        display "SH3 RTC-module wallclock build options"
+        flavor  none
+        description   "
+	    Package specific build options including control over
+	    compiler flags used only in building this package,
+	    and details of which tests are built."
+
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are used in addition
+                to the set of global flags."
+        }
+
+        cdl_option CYGPKG_DEVICES_WALLCLOCK_SH3_CFLAGS_REMOVE {
+            display "Supressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are removed from
+                the set of global flags if present."
+        }
+
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/devs/wallclock/sh3/current/src/wallclock_sh3.cxx
@@ -0,0 +1,168 @@
+//==========================================================================
+//
+//      devs/wallclock/sh3.cxx
+//
+//      Wallclock emulation implementation
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jskov
+// Contributors:  jskov
+// Date:          2000-03-17
+// Purpose:       Wallclock driver for SH3 CPU RTC module
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/kernel.h>             // Kernel config
+#include <pkgconf/wallclock.h>          // Wallclock device config
+
+#include <cyg/infra/cyg_type.h>         // Common type definitions and support
+
+#define __CYGBLD_DRIVER_PRIVATE
+#include <cyg/io/wallclock.hxx>         // The WallClock API
+
+#include <cyg/hal/sh_regs.h>            // RTC register definitions
+
+#include <cyg/hal/hal_io.h>             // IO macros
+
+#include <cyg/infra/diag.h>             // For debugging
+
+
+
+//-----------------------------------------------------------------------------
+// Functions for setting and getting the hardware clock counters
+
+// Year must be last two digits of "western calendar year". Leap year when
+// divisible by four.
+static void
+set_sh3_hwclock(cyg_uint32 year, cyg_uint32 month, cyg_uint32 mday,
+                cyg_uint32 hour, cyg_uint32 minute, cyg_uint32 second)
+{
+    // Stop RTC
+    HAL_WRITE_UINT8(CYGARC_REG_RCR2, CYGARC_REG_RCR2_RESET);
+
+    // Program it
+    HAL_WRITE_UINT8(CYGARC_REG_RYRCNT,  TO_BCD(year));
+    HAL_WRITE_UINT8(CYGARC_REG_RMONCNT, TO_BCD(month));
+    HAL_WRITE_UINT8(CYGARC_REG_RDAYCNT, TO_BCD(mday));
+    HAL_WRITE_UINT8(CYGARC_REG_RHRCNT,  TO_BCD(hour));
+    HAL_WRITE_UINT8(CYGARC_REG_RMINCNT, TO_BCD(minute));
+    HAL_WRITE_UINT8(CYGARC_REG_RSECCNT, TO_BCD(second));
+
+    // Start RTC
+    HAL_WRITE_UINT8(CYGARC_REG_RCR1, CYGARC_REG_RCR1_CIE);
+    HAL_WRITE_UINT8(CYGARC_REG_RCR2, 
+                    CYGARC_REG_RCR2_RTCEN | CYGARC_REG_RCR2_START);
+
+}
+
+static void
+get_sh3_hwclock(cyg_uint32* year, cyg_uint32* month, cyg_uint32* mday,
+                cyg_uint32* hour, cyg_uint32* minute, cyg_uint32* second)
+{
+    cyg_uint8 tmp;
+
+    do {
+        // Clear carry flag
+        HAL_WRITE_UINT8(CYGARC_REG_RCR1, 0);
+        
+        // Read time
+        HAL_READ_UINT8(CYGARC_REG_RYRCNT, tmp);
+        *year = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RMONCNT, tmp);
+        *month = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RDAYCNT, tmp);
+        *mday = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RHRCNT, tmp);
+        *hour = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RMINCNT, tmp);
+        *minute = TO_DEC(tmp);
+        HAL_READ_UINT8(CYGARC_REG_RSECCNT, tmp);
+        *second = TO_DEC(tmp);
+
+        // Read carry flag
+        HAL_READ_UINT8(CYGARC_REG_RCR1, tmp);
+    } while (CYGARC_REG_RCR1_CF & tmp); // loop if carry set
+}
+
+//-----------------------------------------------------------------------------
+// Functions required for the hardware-driver API.
+
+// Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+cyg_uint32 
+Cyg_WallClock::get_hw_seconds(void)
+{
+    cyg_uint32 year, month, mday, hour, minute, second;
+
+    get_sh3_hwclock(&year, &month, &mday, &hour, &minute, &second);
+
+#if 0
+    // This will cause the test to eventually fail due to these printouts
+    // causing timer interrupts to be lost...
+    diag_printf("year %02d\n", year);
+    diag_printf("month %02d\n", month);
+    diag_printf("mday %02d\n", mday);
+    diag_printf("hour %02d\n", hour);
+    diag_printf("minute %02d\n", minute);
+    diag_printf("second %02d\n", second);
+#endif
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+    // We know what we initialized the hardware for : 1970, so by doing this
+    // the returned time should be OK for 30 years uptime.
+    year += 1900;
+#else
+    // Need to use sliding window or similar to figure out what the
+    // century should be... Patent issue is unclear, and since there's
+    // no battery backup of the clock, there's little point in
+    // investigating.
+# error "Need some magic here to figure out century counter"
+#endif
+
+    cyg_uint32 now = _simple_mktime(year, month, mday, hour, minute, second);
+    return now;
+}
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+
+void
+Cyg_WallClock::init_hw_seconds(void)
+{
+    // This is our base: 1970-01-01 00:00:00
+    // Set the HW clock - if for nothing else, just to be sure it's in a
+    // legal range. Any arbitrary base could be used.
+    // After this the hardware clock is only read.
+    set_sh3_hwclock(70,1,1,0,0,0);
+}
+
+#endif // CYGSEM_WALLCLOCK_SET_GET_MODE
+
+//-----------------------------------------------------------------------------
+// End of devs/wallclock/sh3.cxx
--- a/packages/ecos.db
+++ b/packages/ecos.db
@@ -97,12 +97,23 @@ package CYGPKG_IO_PCI	{
            This package contains the PCI configuration library."
 }
 
-package CYGPKG_DEVICES_WALLCLOCK {
-	alias		{ "Wallclock device code" wallclock devices_wallclock device_wallclock }
-	directory	devs/wallclock
+package CYGPKG_IO_WALLCLOCK {
+	alias		{ "Wallclock device framework" wallclock devices_wallclock device_wallclock }
+	directory	io/wallclock
 	script          wallclock.cdl
         description "
-           This package provides a wallclock device."
+           This package provides a wallclock device framework. It is
+           also necessary to select an actual driver implementation."
+}
+
+package CYGPKG_DEVICES_WALLCLOCK_SH3 {
+	alias		{ "Wallclock driver for SH3 RTC module" devices_wallclock_sh3 device_wallclock_sh3 }
+	directory	devs/wallclock/sh3
+	script          wallclock_sh3.cdl
+	hardware
+        description "
+           This package provides a wallclock driver implementation for the
+           Hitachi SH3 CPU's RTC module."
 }
 
 package CYGPKG_DEVICES_WATCHDOG {
@@ -136,6 +147,7 @@ many Level E (Extended) features. uITRON
 embedded RTOS standard."
 }
 
+
 package CYGPKG_LIBC {
 	alias		{ "C library" libc clib clibrary }
 	directory	language/c/libc
@@ -265,6 +277,7 @@ package CYGPKG_HAL_SH_EDK7708 {
            eCos on a Hitachi SH3 EDK7708 board."
 }
 
+
 # --------------------------------------------------------------------------
 # i386 packages
 package CYGPKG_HAL_I386 {
@@ -584,7 +597,10 @@ package CYGPKG_HAL_MN10300_AM33_STB {
 
 target pid {
 	alias { "ARM development board (PID)" PID }
-	packages { CYGPKG_HAL_ARM CYGPKG_HAL_ARM_PID CYGPKG_IO_SERIAL }
+	packages { CYGPKG_HAL_ARM
+                   CYGPKG_HAL_ARM_PID
+                   CYGPKG_IO_SERIAL
+        }
         description "
 The pid target provides the packages needed to run eCos on an ARM
 development board (formerly known as PID)."
@@ -592,7 +608,10 @@ development board (formerly known as PID
 
 target aeb {
 	alias { "ARM evaluation board (AEB-1)" aeb1 }
-	packages { CYGPKG_HAL_ARM CYGPKG_HAL_ARM_AEB CYGPKG_IO_SERIAL }
+	packages { CYGPKG_HAL_ARM
+                   CYGPKG_HAL_ARM_AEB
+                   CYGPKG_IO_SERIAL
+        }
         description "
 The aeb target provides the packages needed to run eCos on an ARM
 evaluation board (AEB-1)."
@@ -600,7 +619,11 @@ evaluation board (AEB-1)."
 
 target ebsa285 {
 	alias { "Intel EBSA285 StrongARM board" ebsa }
-	packages { CYGPKG_HAL_ARM CYGPKG_HAL_ARM_EBSA285 CYGPKG_IO_SERIAL CYGPKG_IO_PCI }
+	packages { CYGPKG_HAL_ARM
+                   CYGPKG_HAL_ARM_EBSA285
+                   CYGPKG_IO_SERIAL
+                   CYGPKG_IO_PCI
+        }
         description "
         The ebsa285 target provides the packages needed to run
         eCos on an Intel EBSA285 StrongARM board."
@@ -608,15 +631,20 @@ target ebsa285 {
 
 target edb7xxx {
         alias		{ "Cirrus Logic development board" edb7211 eb7xxx eb7211 }
-	packages	{ CYGPKG_HAL_ARM CYGPKG_HAL_ARM_EDB7XXX
-                          CYGPKG_IO_SERIAL }
+	packages	{ CYGPKG_HAL_ARM
+                          CYGPKG_HAL_ARM_EDB7XXX
+                          CYGPKG_IO_SERIAL
+        }
         description "
 The edb7xxx target provides the packages needed to run eCos on Cirrus Logic development boards."
     }
 
 target cma230 {
         alias		{ "Cogent CMA230/222 board" cma222 }
-	packages	{ CYGPKG_HAL_ARM CYGPKG_HAL_ARM_CMA230 CYGPKG_IO_SERIAL }
+	packages	{ CYGPKG_HAL_ARM
+                          CYGPKG_HAL_ARM_CMA230
+                          CYGPKG_IO_SERIAL
+        }
         description "
 The cma230 target provides the packages needed to run eCos on a Cogent 
 CMA230 (ARM7TDMI) or CMA222 (ARM710T) board."
@@ -627,18 +655,27 @@ CMA230 (ARM7TDMI) or CMA222 (ARM710T) bo
 
 target sh7708 {
 	alias       { "Hitachi EDK/SH7708 board" edk7708 }
-	packages    { CYGPKG_HAL_SH CYGPKG_HAL_SH_EDK7708 CYGPKG_IO_SERIAL }
+	packages    { CYGPKG_HAL_SH
+                      CYGPKG_HAL_SH_EDK7708
+                      CYGPKG_IO_SERIAL
+                      CYGPKG_DEVICES_WALLCLOCK_SH3 
+        }
 	enable      { CYGPKG_HAL_SH_7708 }
         description "
            The sh7708 target provides the packages needed to run
            eCos on a Hitachi EDK/SH7708 board."
 }
 
+
+
 # --------------------------------------------------------------------------
 # i386 targets
 target linux {
         alias		{ "Linux synthetic target" }
-	packages        { CYGPKG_HAL_I386 CYGPKG_HAL_I386_LINUX CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_I386
+                          CYGPKG_HAL_I386_LINUX
+                          CYGPKG_IO_SERIAL 
+        }
         description "
     	    The linux target provides the 
     	    packages needed to run eCos binaries on top of the i386
@@ -647,7 +684,10 @@ target linux {
 
 target pc {
         alias		{ "i386 PC target" }
-	packages        { CYGPKG_HAL_I386 CYGPKG_HAL_I386_PC CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_I386
+                          CYGPKG_HAL_I386_PC
+                          CYGPKG_IO_SERIAL
+        }
         description "
     	    The pc target provides the 
     	    packages needed to run eCos binaries on a standard i386
@@ -659,7 +699,10 @@ target pc {
 
 target sleb {
 	alias		{ "Fujitsu MB86800-MA01 board" }
-	packages        { CYGPKG_HAL_SPARCLITE CYGPKG_HAL_SPARCLITE_SLEB CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_SPARCLITE
+                          CYGPKG_HAL_SPARCLITE_SLEB
+                          CYGPKG_IO_SERIAL
+        }
         description "
     	    The sleb target provides the packages need to run eCos
             on a Fujitsu MB86800-MA01 board."
@@ -667,7 +710,10 @@ target sleb {
 
 target sparclite_sim {
 	alias		{ "SPARClite simulator" sl_sim sparcl_sim }
-	packages        { CYGPKG_HAL_SPARCLITE CYGPKG_HAL_SPARCLITE_SIM CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_SPARCLITE 
+                          CYGPKG_HAL_SPARCLITE_SIM
+                          CYGPKG_IO_SERIAL
+        }
         description "
     	    The sparclite_sim target provides the packages need to run eCos
             on the SPARClite simulator."
@@ -678,7 +724,11 @@ target sparclite_sim {
 
 target cma28x {
         alias		{ "Cogent CMA286/287 board" cma286 cma287 }
-	packages        { CYGPKG_HAL_POWERPC CYGPKG_HAL_POWERPC_MPC8xx CYGPKG_HAL_POWERPC_COGENT CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_POWERPC
+                          CYGPKG_HAL_POWERPC_MPC8xx 
+                          CYGPKG_HAL_POWERPC_COGENT
+                          CYGPKG_IO_SERIAL
+        }
         description "
             The cma28x target provides the packages needed to run
             eCos on a Cogent CMA286 or CMA287 board."
@@ -686,7 +736,11 @@ target cma28x {
 
 target fads {
         alias		{ "Motorola MPC8xxFADS board" }
-	packages        { CYGPKG_HAL_POWERPC CYGPKG_HAL_POWERPC_MPC8xx CYGPKG_HAL_POWERPC_FADS CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_POWERPC
+                          CYGPKG_HAL_POWERPC_MPC8xx 
+                          CYGPKG_HAL_POWERPC_FADS
+                          CYGPKG_IO_SERIAL
+        }
         description "
             The fads target provides the packages needed to run
             eCos on a Motorola MPC8xxFADS board."
@@ -694,7 +748,12 @@ target fads {
 
 target mbx {
         alias		{ "Motorola MBX860/821 board" mbx860 mbx821 }
-	packages        { CYGPKG_HAL_POWERPC CYGPKG_HAL_POWERPC_MPC8xx CYGPKG_HAL_POWERPC_MBX CYGPKG_HAL_QUICC CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_POWERPC
+                          CYGPKG_HAL_POWERPC_MPC8xx
+                          CYGPKG_HAL_POWERPC_MBX
+                          CYGPKG_HAL_QUICC 
+                          CYGPKG_IO_SERIAL
+        }
         description "
             The mbx target provides the packages needed to run
             eCos on a Motorola MBX860 or MBX821 board."
@@ -702,7 +761,11 @@ target mbx {
 
 target psim {
 	alias		{ "PowerPC simulator" ppc_sim powerpc_sim }
-	packages        { CYGPKG_HAL_POWERPC CYGPKG_HAL_POWERPC_PPC60x CYGPKG_HAL_POWERPC_SIM CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_POWERPC
+                          CYGPKG_HAL_POWERPC_PPC60x
+                          CYGPKG_HAL_POWERPC_SIM
+                          CYGPKG_IO_SERIAL
+        }
         description "
             The psim target provides the packages needed to run
             eCos in the PSIM simulator."
@@ -713,7 +776,11 @@ target psim {
 
 target jmr3904 {
         alias		{ "Toshiba JMR-TX3904 board" jmr tx39 }
-	packages        { CYGPKG_HAL_MIPS CYGPKG_HAL_MIPS_TX39 CYGPKG_HAL_MIPS_TX39_JMR3904 CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_MIPS
+                          CYGPKG_HAL_MIPS_TX39
+                          CYGPKG_HAL_MIPS_TX39_JMR3904
+                          CYGPKG_IO_SERIAL
+        }
         description "
            The jmr3904 target provides the packages needed to run
            eCos on a Toshiba JMR-TX3904 board. This target can also
@@ -725,7 +792,10 @@ target jmr3904 {
 
 target tx39_sim {
         alias		{ "TX39 minimal simulator" }
-	packages        { CYGPKG_HAL_MIPS CYGPKG_HAL_MIPS_TX39 CYGPKG_HAL_MIPS_SIM }
+	packages        { CYGPKG_HAL_MIPS
+                          CYGPKG_HAL_MIPS_TX39
+                          CYGPKG_HAL_MIPS_SIM
+        }
         description "
            The tx39_sim target provides the packages needed to run
            eCos in the TX39 minimal simulator. To use this minimal
@@ -737,7 +807,11 @@ target tx39_sim {
 
 target vrc4373 {
         alias		{ "NEC VRC4373 board" }
-	packages        { CYGPKG_HAL_MIPS CYGPKG_HAL_MIPS_VR4300 CYGPKG_HAL_MIPS_VR4300_VRC4373 CYGPKG_IO_SERIAL CYGPKG_IO_PCI }
+	packages        { CYGPKG_HAL_MIPS
+                          CYGPKG_HAL_MIPS_VR4300
+                          CYGPKG_HAL_MIPS_VR4300_VRC4373
+                          CYGPKG_IO_SERIAL CYGPKG_IO_PCI
+        }
         description "
            The vrc4373 target provides the packages needed to run
 eCos on an NEC VRC4373 board."
@@ -748,7 +822,10 @@ eCos on an NEC VRC4373 board."
 
 target am31_sim {
         alias		{ "MN10300 AM31 minimal simulator" }
-	packages        { CYGPKG_HAL_MN10300 CYGPKG_HAL_MN10300_AM31 CYGPKG_HAL_MN10300_AM31_SIM }
+	packages        { CYGPKG_HAL_MN10300
+                          CYGPKG_HAL_MN10300_AM31
+                          CYGPKG_HAL_MN10300_AM31_SIM
+        }
         description "
            The am31_sim target provides the packages need to run
            eCos in the MN10300 minimal simulator. It is not possible to
@@ -758,7 +835,11 @@ target am31_sim {
 
 target stdeval1 {
         alias		{ "Matsushita stdeval1 board" }
-	packages        { CYGPKG_HAL_MN10300 CYGPKG_HAL_MN10300_AM31_STDEVAL1 CYGPKG_HAL_MN10300_AM31 CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_MN10300 
+                          CYGPKG_HAL_MN10300_AM31_STDEVAL1 
+                          CYGPKG_HAL_MN10300_AM31 
+                          CYGPKG_IO_SERIAL 
+        }
         description "
            The stdeval1 target provides the packages needed to run
            eCos on a Matsushita stdeval1 board. This target can also
@@ -768,7 +849,11 @@ target stdeval1 {
 
 target stb {
         alias		{ "Matsushita STB board" }
-	packages        { CYGPKG_HAL_MN10300 CYGPKG_HAL_MN10300_AM33_STB CYGPKG_HAL_MN10300_AM33 CYGPKG_IO_SERIAL }
+	packages        { CYGPKG_HAL_MN10300
+                          CYGPKG_HAL_MN10300_AM33_STB
+                          CYGPKG_HAL_MN10300_AM33
+                          CYGPKG_IO_SERIAL 
+        }
         description "
            The stb target provides the packages needed to run
            eCos on a Matsushita STB board."
--- a/packages/ecosadmin.tcl
+++ b/packages/ecosadmin.tcl
@@ -63,7 +63,7 @@
 # ----------------------------------------------------------------------------
 # ecosadmin.tcl requires at least version 8.0 of Tcl, since it makes use of
 # namespaces. It is possible that some users still have older versions.
-set a b
+
 if { [info tclversion] < 8.0 } {
 	puts "This script requires Tcl 8.0 or later. You are running Tcl [info patchlevel]."
 	return
--- a/packages/error/current/ChangeLog
+++ b/packages/error/current/ChangeLog
@@ -1,3 +1,7 @@
+2000-03-31  Nick Garnett  <nickg@cygnus.co.uk>
+
+	* include/codes.h: Added some further codes.
+
 1999-04-14  John Dallaway  <jld@cygnus.co.uk>
 
 	* include/pkgconf/error.h: Add cdl_package doc attribute.
--- a/packages/error/current/include/codes.h
+++ b/packages/error/current/include/codes.h
@@ -122,10 +122,14 @@ externC char *
 #define ERANGE           34    // Math result cannot be represented
 #define ENOSYS           38    // Function not implemented
 
+#define ENOTSUP          95    // POSIX not supported error
+
 #define EEOF             200   // End of file reached
 #define ENOSUPP          201   // Operation not supported
 #define EDEVNOSUPP       202   // Device does not support this operation
 
+#define EDEADLK          301   // POSIX deadlock error
+
 #ifdef CYGPKG_NET
 // Additional errors used by networking
 #define ENXIO            300   // Device not configured
--- a/packages/hal/arm/aeb/current/ChangeLog
+++ b/packages/hal/arm/aeb/current/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-07  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* src/flash_cksum.tcl:
+	Apply the below change to this file now that it's moved here
+
 2000-03-12  Bart Veer  <bartv@redhat.com>
 
 	* misc/flash_cksum.tcl:
--- a/packages/hal/arm/aeb/current/src/flash_cksum.tcl
+++ b/packages/hal/arm/aeb/current/src/flash_cksum.tcl
@@ -150,5 +150,18 @@ set cksum [checksum $args(1)]
     set cksum [bswap $cksum]
 # }
 
-puts "[format 0x%8.8X $cksum]"
+# Tcl up to at least version 8.3 has problems on alphas,
+# Tcl_FormatObjCmd() invokes Tcl_GetIntFromObj() which
+# ends up doing dodgy conversions between int and long.
+# This results in an error if bit 32 is set. Rewriting
+# the format string to output one byte at a time is
+# safer.
 
+# puts "[format 0x%8.8X $cksum]"
+
+puts [format "0x%02X%02X%02X%02X"       \
+	[expr (($cksum >> 24) & 0x0FF)] \
+	[expr (($cksum >> 16) & 0x0FF)] \
+	[expr (($cksum >>  8) & 0x0FF)] \
+	[expr (($cksum      ) & 0x0FF)]]
+
--- a/packages/hal/arm/arch/current/ChangeLog
+++ b/packages/hal/arm/arch/current/ChangeLog
@@ -1,3 +1,11 @@
+2000-04-04  Jesper Skov  <jskov@redhat.com>
+
+	* src/context.S: 
+	* src/vectors.S: 
+	Wrap the trivial thumb stuff in macros so the important bits stand
+	out.
+	Fix dumb bug.
+	
 2000-03-24  Jesper Skov  <jskov@redhat.com>
 
 	* src/arm_stub.c: Make place_break thumb-aware.
--- a/packages/hal/arm/arch/current/include/hal_arch.h
+++ b/packages/hal/arm/arch/current/include/hal_arch.h
@@ -193,7 +193,7 @@ asm volatile (" .code 16;"              
 
 # define HAL_BREAKINST           HAL_BREAKINST_THUMB
 # define HAL_BREAKINST_SIZE      HAL_BREAKINST_THUMB_SIZE
-#else
+#else // __thumb__
 
 #define HAL_BREAKPOINT(_label_)                   \
 asm volatile (" .globl  " #_label_ ";"            \
--- a/packages/hal/arm/arch/current/src/arm_stub.c
+++ b/packages/hal/arm/arch/current/src/arm_stub.c
@@ -637,5 +637,4 @@ cyg_hal_gdb_break_is_set (void)
 }
 
 
-
 #endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
--- a/packages/hal/arm/arch/current/src/context.S
+++ b/packages/hal/arm/arch/current/src/context.S
@@ -1,10 +1,10 @@
-// #=============================================================================
+// #===========================================================================
 // #
-// #	context.S
+// #    context.S
 // #
-// #	ARM context switch code
+// #    ARM context switch code
 // #
-// #=============================================================================
+// #===========================================================================
 // ####COPYRIGHTBEGIN####
 //                                                                          
 // -------------------------------------------                              
@@ -28,35 +28,50 @@
 // -------------------------------------------                              
 //                                                                          
 // ####COPYRIGHTEND####
-// #=============================================================================
+// #===========================================================================
 // ######DESCRIPTIONBEGIN####
 // #
-// # Author(s): 	nickg, gthomas
-// # Contributors:	nickg, gthomas
-// # Date:	1998-09-15
-// # Purpose:	ARM context switch code
-// # Description:	This file contains implementations of the thread context 
-// #		switch routines. It also contains the longjmp() and setjmp()
-// #              routines.
+// # Author(s):    nickg, gthomas
+// # Contributors: nickg, gthomas
+// # Date:         1998-09-15
+// # Purpose:      ARM context switch code
+// # Description:  This file contains implementations of the thread context 
+// #               switch routines. It also contains the longjmp() and setjmp()
+// #               routines.
 // #
 // #####DESCRIPTIONEND####
 // #
-// #=============================================================================
+// #===========================================================================
 
 #include <pkgconf/hal.h>
 
 #include "arm.inc"
 
-	.text
+        .text
 
-// ------------------------------------------------------------------------------
-//  function declaration macro
-		
-#define FUNC_START(name) \
-        .globl name; \
-name:	
-		
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+//  function declaration macro (start body in ARM mode)
+                
+#ifdef __thumb__
+#define FUNC_START_ARM(_name_, _r_)              \
+        .code   16                              ;\
+        .thumb_func                             ;\
+        .globl _name_                           ;\
+_name_:                                         ;\
+        ldr     _r_,=_name_ ## _ARM             ;\
+        bx      _r_                             ;\
+        .code   32                              ;\
+_name_ ## _ARM:
+
+#else
+
+#define FUNC_START_ARM(_name_, _r_) \
+        .globl _name_; \
+_name_: 
+        
+#endif
+        
+// ----------------------------------------------------------------------------
 //  hal_thread_switch_context
 //  Switch thread contexts
 //  R0 = address of sp of next thread to execute
@@ -66,111 +81,69 @@ name:
 
 // Note: this is a little wasteful since r0..r3 don't need to be saved.
 // They are saved here though so that the information can match the HAL_SavedRegisters
-	
-#ifdef __thumb__
-	.code	16	
-	.thumb_func
-#endif
-FUNC_START(hal_thread_switch_context)
+        
+FUNC_START_ARM(hal_thread_switch_context, r2)
+        mov     ip,sp                   // saved stack pointer
+        stmfd   sp!,{fp,ip,lr,pc}       // filler
+        stmfd   sp!,{r0-r10,fp,ip,lr,pc}
+        mrs     r2,cpsr
+        str     r2,[sp,#armreg_cpsr]
+        str     sp,[r1]                 // return new stack pointer
 #ifdef __thumb__
-	ldr	r2,=hal_thread_switch_context_ARM
-	bx	r2
-	.code	32
-FUNC_START(hal_thread_switch_context_ARM)
-#endif
-	mov	ip,sp			// saved stack pointer
-        stmfd   sp!,{fp,ip,lr,pc}       // filler
-	stmfd	sp!,{r0-r10,fp,ip,lr,pc}
-	mrs	r2,cpsr
-	str	r2,[sp,#armreg_cpsr]
-	str	sp,[r1]			// return new stack pointer
-#ifdef __thumb__
-	b	hal_thread_load_context_ARM	// skip mode switch stuff
+        b       hal_thread_load_context_ARM // skip mode switch stuff
 #endif
 
-	# Now load the destination thread by dropping through
-	# to hal_thread_load_context
-	
-// ------------------------------------------------------------------------------
+        # Now load the destination thread by dropping through
+        # to hal_thread_load_context
+        
+// ----------------------------------------------------------------------------
 //  hal_thread_load_context
 //  Load thread context
 //  R0 = address of sp of next thread to execute
-//  Note that this function is also the second half of hal_thread_switch_context
-//  and is simply dropped into from it.
-	
-#ifdef __thumb__
-	.code	16	
-	.thumb_func
-#endif
-FUNC_START(hal_thread_load_context)
+//  Note that this function is also the second half of
+//  hal_thread_switch_context and is simply dropped into from it.
+        
+FUNC_START_ARM(hal_thread_load_context, r2)
+        ldr     fp,[r0]                 // get context to restore
+        mrs     r0,cpsr                 // disable IRQ's
+        orr     r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        msr     cpsr,r0
+        ldr     r0,[fp,#armreg_cpsr]
+        msr     spsr,r0
+        ldmfd   fp,{r0-r10,fp,sp,lr}
 #ifdef __thumb__
-	ldr	r2,=hal_thread_load_context_ARM
-	bx	r2
-	.code	32
-FUNC_START(hal_thread_load_context_ARM)
-#endif
-	ldr	fp,[r0]			// get context to restore
-	mrs	r0,cpsr			// disable IRQ's
-	orr	r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	msr	cpsr,r0
-	ldr	r0,[fp,#armreg_cpsr]
-	msr	spsr,r0
-	ldmfd	fp,{r0-r10,fp,sp,lr}
-#ifdef __thumb__
-	mrs	r1,spsr			// r1 is scratch 
+        mrs     r1,spsr                 // r1 is scratch 
                                         // [r0 holds initial thread arg]
-	msr	cpsr,r1			// hopefully no mode switch here!
-	bx	lr
+        msr     cpsr,r1                 // hopefully no mode switch here!
+        bx      lr
 #else
-	movs	pc,lr	                // also restores saved PSR
+        movs    pc,lr                   // also restores saved PSR
 #endif
 
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
 //  HAL longjmp, setjmp implementations
 //  hal_setjmp saves only to callee save registers 4-14
 //  and lr into buffer supplied in r0[arg0]
 
-#ifdef __thumb__
-	.code	16	
-	.thumb_func
-#endif
-FUNC_START(hal_setjmp)
+FUNC_START_ARM(hal_setjmp, r2)
+        stmea   r0,{r4-r14}
+        mov     r0,#0
 #ifdef __thumb__
-	ldr	r2,=hal_setjmp_ARM
-	bx	r2
-	.code	32
-FUNC_START(hal_setjmp_ARM)
-#endif
-	stmea	r0,{r4-r14}
-	mov	r0,#0
-#ifdef __thumb__
-	bx	lr
+        bx      lr
 #else
-	mov	pc,lr;		# return
+        mov     pc,lr;          # return
 #endif
 
 //  hal_longjmp loads state from r0[arg0] and returns
-	
-#ifdef __thumb__
-	.code	16	
-	.thumb_func
-#endif
-FUNC_START(hal_longjmp)
+        
+FUNC_START_ARM(hal_longjmp, r2)
+        ldmfd   r0,{r4-r14}
+        mov     r0,r1;          # return [arg1]
 #ifdef __thumb__
-	ldr	r2,=hal_longjmp_ARM
-	bx	r2
-	.code	32
-FUNC_START(hal_longjmp_ARM)
-#endif
-	ldmfd	r0,{r4-r14}
-	mov	r0,r1;		# return [arg1]
-#ifdef __thumb__
-	bx	lr
+        bx      lr
 #else
-	mov	pc,lr
+        mov     pc,lr
 #endif
 
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
 //  end of context.S
-
-	
--- a/packages/hal/arm/arch/current/src/vectors.S
+++ b/packages/hal/arm/arch/current/src/vectors.S
@@ -37,8 +37,8 @@
 // # Purpose:       ARM exception vectors
 // # Description:   This file defines the code placed into the exception
 // #                vectors. It also contains the first level default VSRs
-// #		    that save and restore state for both exceptions and
-// #		    interrupts.
+// #                that save and restore state for both exceptions and
+// #                interrupts.
 // #
 // #####DESCRIPTIONEND####
 // #
@@ -61,12 +61,54 @@
 
 #include "arm.inc"
 
-#define FUNC_START(name)	\
-        .globl _name;		\
-_name:	
+#ifdef __thumb__
+// Switch to thumb mode
+#define THUMB_MODE(_r_, _l_)                     \
+        ldr     _r_,=_l_ ## f+1                 ;\
+        bx      _r_                             ;\
+        .pool                                   ;\
+        .code   16                              ;\
+        .thumb_func                             ;\
+ _l_:
+
+// Switch to ARM mode
+#define ARM_MODE(_r_, _l_)                       \
+        ldr     _r_,=_l_ ## f                   ;\
+        bx      _r_                             ;\
+        .pool                                   ;\
+        .code   32                              ;\
+ _l_:
 
-#define PTR(name) 		\
-.##name: .word	name
+// Function definition, start executing body in ARM mode
+#define FUNC_START_ARM(_name_, _r_)              \
+        .code   16                              ;\
+        .thumb_func                             ;\
+        .globl _name_                           ;\
+_name_:                                         ;\
+        ldr     _r_,=_name_ ## _ARM             ;\
+        bx      _r_                             ;\
+        .code   32                              ;\
+_name_ ## _ARM:
+
+#else
+
+// Switch to thumb mode
+#define THUMB_MODE(_r_, _l_)
+
+// Switch to ARM mode
+#define ARM_MODE(_r_, _l_)
+
+// Function definition, start executing body in ARM mode
+#define FUNC_START_ARM(_name_, _r_) \
+        .globl _name_; \
+_name_: 
+
+#endif
+
+        
+
+#define PTR(name)               \
+.##name: .word  name
 
 #ifdef CYGHWR_HAL_ARM_HAS_MMU
 #define UNMAPPED(x) ((x)-__exception_handlers)
@@ -74,11 +116,11 @@
 #define UNMAPPED(x) (x)
 #endif
                                 
-#define UNMAPPED_PTR(name) 		\
-.##name: .word	UNMAPPED(name)
+#define UNMAPPED_PTR(name)              \
+.##name: .word  UNMAPPED(name)
 
 
-	.file	"vectors.S"
+        .file   "vectors.S"
 
 
 // CYGHWR_LED_MACRO can be defined in hal_platform_setup.h. It's free to
@@ -89,7 +131,7 @@
 #ifndef CYGHWR_LED_MACRO
 #define CYGHWR_LED_MACRO
 #endif
-	
+        
 .macro LED x
     CYGHWR_LED_MACRO
 .endm
@@ -99,137 +141,137 @@
 // Hardware exception vectors.
 //   This entire section will be copied to location 0x0000 at startup time.
 //
-	.code	32
-	.section ".vectors","ax"
-	.global	__exception_handlers
+        .code   32
+        .section ".vectors","ax"
+        .global __exception_handlers
 __exception_handlers:
-	ldr	pc,.reset_vector		// 0x00
-	ldr	pc,.undefined_instruction	// 0x04
-	ldr	pc,.software_interrupt		// 0x08 start && software int
-	ldr	pc,.abort_prefetch		// 0x0C
-	ldr	pc,.abort_data			// 0x10
-	.word	0				// unused
-	ldr	pc,.IRQ				// 0x18
-	ldr	pc,.FIQ				// 0x1C
+        ldr     pc,.reset_vector                // 0x00
+        ldr     pc,.undefined_instruction       // 0x04
+        ldr     pc,.software_interrupt          // 0x08 start && software int
+        ldr     pc,.abort_prefetch              // 0x0C
+        ldr     pc,.abort_data                  // 0x10
+        .word   0                               // unused
+        ldr     pc,.IRQ                         // 0x18
+        ldr     pc,.FIQ                         // 0x1C
 
 // The layout of these pointers should match the vector table above since
 // they are copied in pairs.
-	.global	vectors
+        .global vectors
 vectors:
-UNMAPPED_PTR(reset_vector)			// 0x20
-PTR(undefined_instruction)			// 0x24
-PTR(software_interrupt)				// 0x28
-PTR(abort_prefetch)				// 0x2C
-PTR(abort_data)					// 0x30
-	.word	0				// 0x34
-PTR(IRQ)					// 0x38
-PTR(FIQ)					// 0x3c
+UNMAPPED_PTR(reset_vector)                      // 0x20
+PTR(undefined_instruction)                      // 0x24
+PTR(software_interrupt)                         // 0x28
+PTR(abort_prefetch)                             // 0x2C
+PTR(abort_data)                                 // 0x30
+        .word   0                               // 0x34
+PTR(IRQ)                                        // 0x38
+PTR(FIQ)                                        // 0x3c
 PTR(start) // This is copied to 0x28 for bootup // 0x40
-	   // location 0x40 is used for storing DRAM size if known
-	   // for some platforms.
+           // location 0x40 is used for storing DRAM size if known
+           // for some platforms.
 
 // Other vectors
-	.balign 16      // Should be at 0x50
-	.balign 32
+        .balign 16      // Should be at 0x50
+        .balign 32
 
-	.text	
+        .text   
 // Startup code which will get the machine into supervisor mode
-	.global	reset_vector
-	.type	reset_vector,function
+        .global reset_vector
+        .type   reset_vector,function
 reset_vector:
-	PLATFORM_SETUP1		// Early stage platform initialization
-				// which can set DRAM size at 0x40
-				// see <cyg/hal/hal_platform_setup.h>
+        PLATFORM_SETUP1         // Early stage platform initialization
+                                // which can set DRAM size at 0x40
+                                // see <cyg/hal/hal_platform_setup.h>
 
         // Come here to reset board
 warm_reset:                 
 
 #if defined(CYG_HAL_STARTUP_RAM) && \
     !defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
-	mrs	r7,cpsr			// move back to IRQ mode
-	and	r7,r7,#CPSR_MODE_BITS
-	cmp	r7,#CPSR_SUPERVISOR_MODE
-	beq	start
+        mrs     r7,cpsr                 // move back to IRQ mode
+        and     r7,r7,#CPSR_MODE_BITS
+        cmp     r7,#CPSR_SUPERVISOR_MODE
+        beq     start
 #endif
 
-	// We cannot access any LED registers until after PLATFORM_SETUP1
-	LED 7
+        // We cannot access any LED registers until after PLATFORM_SETUP1
+        LED 7
 
-	mov	r0,#0		// move vectors
-	// We cannot perform a store until after PLATFORM_SETUP1
+        mov     r0,#0           // move vectors
+        // We cannot perform a store until after PLATFORM_SETUP1
 #ifndef CYGPKG_HAL_ARM_EBSA285  // EBSA285 sets the DRAM size above
-	str	r0, [r0,#0x40]  // DRAM size to zero => unknown
+        str     r0, [r0,#0x40]  // DRAM size to zero => unknown
 #endif
 
-        ldr	r1,=__exception_handlers
+        ldr     r1,=__exception_handlers
 #ifndef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	// Wait with this if stubs are included (see further down).
-	ldr	r2,[r1,#0x04]	// undefined instruction
-	str	r2,[r0,#0x04]
-	ldr	r2,[r1,#0x24]	
-	str	r2,[r0,#0x24]
+        // Wait with this if stubs are included (see further down).
+        ldr     r2,[r1,#0x04]   // undefined instruction
+        str     r2,[r0,#0x04]
+        ldr     r2,[r1,#0x24]   
+        str     r2,[r0,#0x24]
 #endif
-	ldr	r2,[r1,#0x08]	// software interrupt
-	str	r2,[r0,#0x08]
+        ldr     r2,[r1,#0x08]   // software interrupt
+        str     r2,[r0,#0x08]
 
 
 #if defined(CYG_HAL_STARTUP_RAM)
 // Ugly hack to get into supervisor mode
-	ldr	r2,[r1,#0x40]
-	str	r2,[r0,#0x28]
+        ldr     r2,[r1,#0x40]
+        str     r2,[r0,#0x28]
 
-	LED 6
-		
-	swi			// switch to supervisor mode
+        LED 6
+                
+        swi                     // switch to supervisor mode
 #endif        
 
 // =========================================================================
 // Real startup code. We jump here from the reset vector to set up the world.
-	.globl	start
-start:	
+        .globl  start
+start:  
 
-	LED 5
+        LED 5
 
 #if defined(CYG_HAL_STARTUP_RAM) && \
     !defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
 // If we get restarted, hang here to avoid corrupting memory
-	ldr	r0,.init_flag
-	ldr	r1,[r0]
-1:	cmp	r1,#0
-	bne	1b
-	ldr	r1,init_done
-	str	r1,[r0]
+        ldr     r0,.init_flag
+        ldr     r1,[r0]
+1:      cmp     r1,#0
+        bne     1b
+        ldr     r1,init_done
+        str     r1,[r0]
 #endif
 
-	// Reset software interrupt pointer
-	mov	r0,#0		// move vectors
-	ldr	r1,.__exception_handlers
+        // Reset software interrupt pointer
+        mov     r0,#0           // move vectors
+        ldr     r1,.__exception_handlers
 #if defined(CYG_HAL_STARTUP_RAM) && \
     !defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS)
-	cmp	r7,#CPSR_SUPERVISOR_MODE
-	beq	10f
+        cmp     r7,#CPSR_SUPERVISOR_MODE
+        beq     10f
 #endif
-	ldr	r2,[r1,#0x28]	// software interrupt
-	str	r2,[r0,#0x28]
+        ldr     r2,[r1,#0x28]   // software interrupt
+        str     r2,[r0,#0x28]
 10:
-	ldr	r2,[r1,#0x18]	// IRQ
-	str	r2,[r0,#0x18]
-	ldr	r2,[r1,#0x38]
-	str	r2,[r0,#0x38]
-	ldr	r2,[r1,#0x1C]	// FIQ
-	str	r2,[r0,#0x1C]
-	ldr	r2,[r1,#0x3C]
-	str	r2,[r0,#0x3C]
-	ldr	r2,[r1,#0x0C]	// abort (prefetch)
-	str	r2,[r0,#0x0C]
-	ldr	r2,[r1,#0x2C]	
-	str	r2,[r0,#0x2C]
-	ldr	r2,[r1,#0x10]	// abort (data)
-	str	r2,[r0,#0x10]
-	ldr	r2,[r1,#0x30]
-	str	r2,[r0,#0x30]
+        ldr     r2,[r1,#0x18]   // IRQ
+        str     r2,[r0,#0x18]
+        ldr     r2,[r1,#0x38]
+        str     r2,[r0,#0x38]
+        ldr     r2,[r1,#0x1C]   // FIQ
+        str     r2,[r0,#0x1C]
+        ldr     r2,[r1,#0x3C]
+        str     r2,[r0,#0x3C]
+        ldr     r2,[r1,#0x0C]   // abort (prefetch)
+        str     r2,[r0,#0x0C]
+        ldr     r2,[r1,#0x2C]   
+        str     r2,[r0,#0x2C]
+        ldr     r2,[r1,#0x10]   // abort (data)
+        str     r2,[r0,#0x10]
+        ldr     r2,[r1,#0x30]
+        str     r2,[r0,#0x30]
 
-	LED 4
+        LED 4
 
 #if defined(CYG_HAL_STARTUP_ROM)
         // Set up reset vector
@@ -237,108 +279,101 @@ 10:
         str     r2,[r0,#0x00]
         ldr     r2,=warm_reset
         str     r2,[r0,#0x20]
-	// Relocate [copy] data from ROM to RAM
-	ldr	r3,.__rom_data_start
-	ldr	r4,.__ram_data_start
-	ldr	r5,.__ram_data_end
-	cmp	r4,r5		// jump if no data to move
-	beq	2f
-	sub	r3,r3,#4	// loop adjustments
-	sub	r4,r4,#4
-1:	ldr	r0,[r3,#4]!	// copy info
-	str	r0,[r4,#4]!
-	cmp	r4,r5
-	bne	1b
+        // Relocate [copy] data from ROM to RAM
+        ldr     r3,.__rom_data_start
+        ldr     r4,.__ram_data_start
+        ldr     r5,.__ram_data_end
+        cmp     r4,r5           // jump if no data to move
+        beq     2f
+        sub     r3,r3,#4        // loop adjustments
+        sub     r4,r4,#4
+1:      ldr     r0,[r3,#4]!     // copy info
+        str     r0,[r4,#4]!
+        cmp     r4,r5
+        bne     1b
 2:
 #endif
 
-	// initialize interrupt/exception environments
-	ldr	sp,.__startup_stack
-	mov	r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_IRQ_MODE)
-	msr	cpsr,r0
-	ldr	sp,.__exception_stack
-	mov	r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_FIQ_MODE)
-	msr	cpsr,r0
-	ldr	sp,.__FIQ_exception_stack
-	mov	r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_UNDEF_MODE)
-	msr	cpsr,r0
-	ldr	sp,.__exception_stack
+        // initialize interrupt/exception environments
+        ldr     sp,.__startup_stack
+        mov     r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_IRQ_MODE)
+        msr     cpsr,r0
+        ldr     sp,.__exception_stack
+        mov     r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_FIQ_MODE)
+        msr     cpsr,r0
+        ldr     sp,.__FIQ_exception_stack
+        mov     r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_UNDEF_MODE)
+        msr     cpsr,r0
+        ldr     sp,.__exception_stack
 
-	// initialize CPSR (machine state register)
-	mov	r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
-	msr	cpsr,r0
+        // initialize CPSR (machine state register)
+        mov     r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
+        msr     cpsr,r0
 
-	// Note: some functions in LIBGCC1 will cause a "restore from SPSR"!!
-	msr	spsr,r0
+        // Note: some functions in LIBGCC1 will cause a "restore from SPSR"!!
+        msr     spsr,r0
 
-	// initialize stack
-	ldr	sp,.__startup_stack
+        // initialize stack
+        ldr     sp,.__startup_stack
 
-	// clear BSS
-	ldr	r1,.__bss_start
-	ldr	r2,.__bss_end
-	mov	r0,#0
-	cmp	r1,r2
-	beq	2f
-1:	str	r0,[r1],#4
-	cmp	r1,r2
-	bne	1b
+        // clear BSS
+        ldr     r1,.__bss_start
+        ldr     r2,.__bss_end
+        mov     r0,#0
+        cmp     r1,r2
+        beq     2f
+1:      str     r0,[r1],#4
+        cmp     r1,r2
+        bne     1b
 2:
 
-#ifdef __thumb__
-// Run kernel + application in THUMB mode
-	ldr	r1,=10f+1
-	bx	r1
-        .pool
-	.code	16
-	.thumb_func
-10:
-#endif
+        // Run kernel + application in THUMB mode
+        THUMB_MODE(r1,10)
 
-	LED 3
-	
-	// Call platform specific hardware initialization
-	bl	hal_hardware_init
+        LED 3
+        
+        // Call platform specific hardware initialization
+        bl      hal_hardware_init
 
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	bl      initialize_stub
+        bl      initialize_stub
 
-	// Now that stub is initialized, change vector. It is possible
-	// to single-step through most of the init code, except the below.
-	// Put a breakpoint at the call to cyg_hal_invoke_constructors to
-	// pass over this bit (s-s depends on internal state in the stub).
+        // Now that stub is initialized, change vector. It is possible
+        // to single-step through most of the init code, except the below.
+        // Put a breakpoint at the call to cyg_hal_invoke_constructors to
+        // pass over this bit (s-s depends on internal state in the stub).
 #endif
 
 #if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) || \
     defined(CYGIMP_HAL_PROCESS_ALL_EXCEPTIONS)
-	mov	r0,#0		// move vectors
-	ldr	r1,=__exception_handlers
-	ldr	r2,[r1,#0x04]	// undefined instruction
-	str	r2,[r0,#0x04]
-	ldr	r2,[r1,#0x24]	
-	str	r2,[r0,#0x24]
+        mov     r0,#0           // move vectors
+        ldr     r1,=__exception_handlers
+        ldr     r2,[r1,#0x04]   // undefined instruction
+        str     r2,[r0,#0x04]
+        ldr     r2,[r1,#0x24]   
+        str     r2,[r0,#0x24]
 #endif
 
-	LED 2
-	
-	// Run through static constructors
-	bl	cyg_hal_invoke_constructors
+        LED 2
+        
+        // Run through static constructors
+        bl      cyg_hal_invoke_constructors
 
-	LED 1
-	
-	// This starts up the eCos kernel
-	bl	cyg_start
+        LED 1
+        
+        // This starts up the eCos kernel
+        bl      cyg_start
 _start_hang:
-	b	_start_hang
-	.code	32
+        b       _start_hang
+        .code   32
         
         .global reset_platform
         .type   reset_platform,function
 reset_platform:         
 #ifdef CYGSEM_HAL_ROM_MONITOR
-	// initialize CPSR (machine state register)
-	mov	r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
-	msr	cpsr,r0
+        // initialize CPSR (machine state register)
+        mov     r0,#(CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE|CPSR_SUPERVISOR_MODE)
+        msr     cpsr,r0
         b       warm_reset
 #else
         mov     r0,#0
@@ -346,543 +381,448 @@ reset_platform:
 #endif                   
 
 init_done:
-	.long	0xDEADB00B
+        .long   0xDEADB00B
 
 //
 // Exception handlers
 // Assumption: get here from a Supervisor context [mode]
 //
-	.code	32
+        .code   32
 undefined_instruction:
-	ldr	sp,.__undef_exception_stack	// get good stack
-	stmfd	sp!,{r0,fp,ip,lr}		
-	mrs	r0,spsr
-	stmfd	sp!,{r0}
-	mov	ip,sp			// save SP which will vanish with
+        ldr     sp,.__undef_exception_stack     // get good stack
+        stmfd   sp!,{r0,fp,ip,lr}               
+        mrs     r0,spsr
+        stmfd   sp!,{r0}
+        mov     ip,sp                   // save SP which will vanish with
                                         //   mode switch
-	mrs	r0,cpsr			// switch to Supervisor Mode
-	bic	r0,r0,#CPSR_MODE_BITS
-	orr	r0,r0,#CPSR_SUPERVISOR_MODE
-	msr	cpsr,r0			// sp,lr are now old values
-	mov	fp,sp
+        mrs     r0,cpsr                 // switch to Supervisor Mode
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_SUPERVISOR_MODE
+        msr     cpsr,r0                 // sp,lr are now old values
+        mov     fp,sp
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	ldr	sp,.__GDB_stack
-	cmp	fp,sp			// already on GDB stack?
-	bhi	10f	
-	ldr	r0,.__GDB_stack_base		
-	cmp	fp,r0
-	bls	10f			// no - switch to GDB stack
+        ldr     sp,.__GDB_stack
+        cmp     fp,sp                   // already on GDB stack?
+        bhi     10f     
+        ldr     r0,.__GDB_stack_base            
+        cmp     fp,r0
+        bls     10f                     // no - switch to GDB stack
                                         //      (already in sp)
-	mov	sp,fp			// yes - no switch
+        mov     sp,fp                   // yes - no switch
 10:
 #endif
-	sub	sp,sp,#ARMREG_SIZE	// make space for frame
-	stmea	sp,{r0-r10,fp}		// save immediately visible registers
-	ldmfd	ip,{r0-r4}		// saved registers
-#if 1
+        sub     sp,sp,#ARMREG_SIZE      // make space for frame
+        stmea   sp,{r0-r10,fp}          // save immediately visible registers
+        ldmfd   ip,{r0-r4}              // saved registers
         // Adjust PC according to CPU mode
-	tst	r0,#CPSR_THUMB_ENABLE
-	subeq	r4,r4,#4		// PC at time of interrupt (ARM)
-	subne	r4,r4,#2		// PC at time of interrupt (thumb)
-#else
-	sub	r4,r4,#4		// PC at time of interrupt
+        tst     r0,#CPSR_THUMB_ENABLE
+        subeq   r4,r4,#4                // PC at time of interrupt (ARM)
+        subne   r4,r4,#2                // PC at time of interrupt (thumb)
+        str     r0,[sp,#armreg_cpsr]    // CPSR at time of interrupt
+        str     r1,[sp,#armreg_r0]      // saved R0
+        str     r2,[sp,#armreg_fp]      // saved FP
+        str     r3,[sp,#armreg_ip]      // saved IP
+        str     r4,[sp,#armreg_pc]      // PC at time of interrupt
+        str     lr,[sp,#armreg_lr]      // LR at time of interrupt
+        add     r0,ip,#ARMREG_SIZE
+        str     fp,[sp,#armreg_sp]      // SP at time of interrupt
+#ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
+        mov     r0,sp
+        bl      cyg_hal_report_undefined_instruction
 #endif
-	str	r0,[sp,#armreg_cpsr]	// CPSR at time of interrupt
-	str	r1,[sp,#armreg_r0]	// saved R0
-	str	r2,[sp,#armreg_fp]	// saved FP
-	str	r3,[sp,#armreg_ip]	// saved IP
-	str	r4,[sp,#armreg_pc]	// PC at time of interrupt
-	str	lr,[sp,#armreg_lr]	// LR at time of interrupt
-	add	r0,ip,#ARMREG_SIZE
-	str	fp,[sp,#armreg_sp]	// SP at time of interrupt
-#ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
-	mov	r0,sp
-	bl	cyg_hal_report_undefined_instruction
-#endif
-	mov	v1,#CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION
-	b	call_exception_handler
+        mov     v1,#CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION
+        b       call_exception_handler
 
-	.code	32
+        .code   32
 software_interrupt:
-	sub	sp,sp,#ARMREG_SIZE+16	// make space for frame
-	stmea	sp,{r0-r10,fp}		// save immediately visible registers
-	mrs	r0,spsr
-#if 1
+        sub     sp,sp,#ARMREG_SIZE+16   // make space for frame
+        stmea   sp,{r0-r10,fp}          // save immediately visible registers
+        mrs     r0,spsr
         // Adjust PC according to CPU mode
-	tst	r0,#CPSR_THUMB_ENABLE
-	subeq	r3,lr,#4		// PC at time of interrupt (ARM)
-	subne	r3,lr,#2		// PC at time of interrupt (thumb)
-#else
-	sub	r3,lr,#4		// PC at time of interrupt
+        tst     r0,#CPSR_THUMB_ENABLE
+        subeq   r3,lr,#4                // PC at time of interrupt (ARM)
+        subne   r3,lr,#2                // PC at time of interrupt (thumb)
+        str     r0,[sp,#armreg_cpsr]    // CPSR at time of interrupt
+        str     ip,[sp,#armreg_ip]      // saved IP
+        str     r3,[sp,#armreg_pc]      // PC at time of interrupt
+        str     lr,[sp,#armreg_lr]      // LR at time of interrupt
+        add     r0,sp,#ARMREG_SIZE+16
+        str     r0,[sp,#armreg_sp]      // SP at time of interrupt
+#ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
+        mov     r0,sp
+        bl      cyg_hal_report_software_interrupt
 #endif
-	str	r0,[sp,#armreg_cpsr]	// CPSR at time of interrupt
-	str	ip,[sp,#armreg_ip]	// saved IP
-	str	r3,[sp,#armreg_pc]	// PC at time of interrupt
-	str	lr,[sp,#armreg_lr]	// LR at time of interrupt
-	add	r0,sp,#ARMREG_SIZE+16
-	str	r0,[sp,#armreg_sp]	// SP at time of interrupt
-#ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
-	mov	r0,sp
-	bl	cyg_hal_report_software_interrupt
-#endif
-	mov	v1,#CYGNUM_HAL_EXCEPTION_INTERRUPT
-	b	call_exception_handler
+        mov     v1,#CYGNUM_HAL_EXCEPTION_INTERRUPT
+        b       call_exception_handler
 
-	.code	32
+        .code   32
 abort_prefetch:
-	ldr	sp,.__undef_exception_stack	// get good stack
-	sub	lr,lr,#4		// PC at time of interrupt
-	stmfd	sp!,{r0,fp,ip,lr}		
-	mrs	r0,spsr
-	stmfd	sp!,{r0}
-	mov	ip,sp			// save SP which will vanish with
+        ldr     sp,.__undef_exception_stack     // get good stack
+        sub     lr,lr,#4                // PC at time of interrupt
+        stmfd   sp!,{r0,fp,ip,lr}               
+        mrs     r0,spsr
+        stmfd   sp!,{r0}
+        mov     ip,sp                   // save SP which will vanish with
                                         //   mode switch
-	mrs	r0,cpsr			// switch to Supervisor Mode
-	bic	r0,r0,#CPSR_MODE_BITS
-	orr	r0,r0,#CPSR_SUPERVISOR_MODE
-	msr	cpsr,r0			// sp,lr are now old values
-	mov	fp,sp
+        mrs     r0,cpsr                 // switch to Supervisor Mode
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_SUPERVISOR_MODE
+        msr     cpsr,r0                 // sp,lr are now old values
+        mov     fp,sp
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	ldr	sp,.__GDB_stack
-	cmp	fp,sp			// already on GDB stack?
-	bhi	10f	
-	ldr	r0,.__GDB_stack_base		
-	cmp	fp,r0
-	bls	10f			// no - switch to GDB stack
+        ldr     sp,.__GDB_stack
+        cmp     fp,sp                   // already on GDB stack?
+        bhi     10f     
+        ldr     r0,.__GDB_stack_base            
+        cmp     fp,r0
+        bls     10f                     // no - switch to GDB stack
                                         //      (already in sp)
-	mov	sp,fp			// yes - no switch
+        mov     sp,fp                   // yes - no switch
 10:
 #endif
-	sub	sp,sp,#ARMREG_SIZE	// make space for frame
-	stmea	sp,{r0-r10,fp}		// save immediately visible registers
-	ldmfd	ip,{r0-r4}		// saved registers
-	str	r0,[sp,#armreg_cpsr]	// CPSR at time of interrupt
-	str	r1,[sp,#armreg_r0]	// saved R0
-	str	r2,[sp,#armreg_fp]	// saved FP
-	str	r3,[sp,#armreg_ip]	// saved IP
-	str	r4,[sp,#armreg_pc]	// PC at time of interrupt
-	str	lr,[sp,#armreg_lr]	// LR at time of interrupt
-	add	r0,ip,#ARMREG_SIZE
-	str	fp,[sp,#armreg_sp]	// SP at time of interrupt
+        sub     sp,sp,#ARMREG_SIZE      // make space for frame
+        stmea   sp,{r0-r10,fp}          // save immediately visible registers
+        ldmfd   ip,{r0-r4}              // saved registers
+        str     r0,[sp,#armreg_cpsr]    // CPSR at time of interrupt
+        str     r1,[sp,#armreg_r0]      // saved R0
+        str     r2,[sp,#armreg_fp]      // saved FP
+        str     r3,[sp,#armreg_ip]      // saved IP
+        str     r4,[sp,#armreg_pc]      // PC at time of interrupt
+        str     lr,[sp,#armreg_lr]      // LR at time of interrupt
+        add     r0,ip,#ARMREG_SIZE
+        str     fp,[sp,#armreg_sp]      // SP at time of interrupt
 #ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
-	mov	r0,sp
-	bl	cyg_hal_report_abort_prefetch
+        mov     r0,sp
+        bl      cyg_hal_report_abort_prefetch
 #endif
-	mov	v1,#CYGNUM_HAL_EXCEPTION_CODE_ACCESS
-	b	call_exception_handler
+        mov     v1,#CYGNUM_HAL_EXCEPTION_CODE_ACCESS
+        b       call_exception_handler
 
-	.code	32
+        .code   32
 abort_data:
-	ldr	sp,.__undef_exception_stack	// get good stack
-	sub	lr,lr,#4		// PC at time of interrupt
-	stmfd	sp!,{r0,fp,ip,lr}		
-	mrs	r0,spsr
-	stmfd	sp!,{r0}
-	mov	ip,sp			// save SP which will vanish with
+        ldr     sp,.__undef_exception_stack     // get good stack
+        sub     lr,lr,#4                // PC at time of interrupt
+        stmfd   sp!,{r0,fp,ip,lr}               
+        mrs     r0,spsr
+        stmfd   sp!,{r0}
+        mov     ip,sp                   // save SP which will vanish with
                                         //   mode switch
-	mrs	r0,cpsr			// switch to Supervisor Mode
-	bic	r0,r0,#CPSR_MODE_BITS
-	orr	r0,r0,#CPSR_SUPERVISOR_MODE
-	msr	cpsr,r0			// sp,lr are now old values
-	mov	fp,sp
+        mrs     r0,cpsr                 // switch to Supervisor Mode
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_SUPERVISOR_MODE
+        msr     cpsr,r0                 // sp,lr are now old values
+        mov     fp,sp
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	ldr	sp,.__GDB_stack
-	cmp	fp,sp			// already on GDB stack?
-	bhi	10f	
-	ldr	r0,.__GDB_stack_base		
-	cmp	fp,r0
-	bls	10f			// no - switch to GDB stack
+        ldr     sp,.__GDB_stack
+        cmp     fp,sp                   // already on GDB stack?
+        bhi     10f     
+        ldr     r0,.__GDB_stack_base            
+        cmp     fp,r0
+        bls     10f                     // no - switch to GDB stack
                                         //      (already in sp)
-	mov	sp,fp			// yes - no switch
+        mov     sp,fp                   // yes - no switch
 10:
 #endif
-	sub	sp,sp,#ARMREG_SIZE	// make space for frame
-	stmea	sp,{r0-r10,fp}		// save immediately visible registers
-	ldmfd	ip,{r0-r4}		// saved registers
-	str	r0,[sp,#armreg_cpsr]	// CPSR at time of interrupt
-	str	r1,[sp,#armreg_r0]	// saved R0
-	str	r2,[sp,#armreg_fp]	// saved FP
-	str	r3,[sp,#armreg_ip]	// saved IP
-	str	r4,[sp,#armreg_pc]	// PC at time of interrupt
-	str	lr,[sp,#armreg_lr]	// LR at time of interrupt
-	add	r0,ip,#ARMREG_SIZE
-	str	fp,[sp,#armreg_sp]	// SP at time of interrupt
+        sub     sp,sp,#ARMREG_SIZE      // make space for frame
+        stmea   sp,{r0-r10,fp}          // save immediately visible registers
+        ldmfd   ip,{r0-r4}              // saved registers
+        str     r0,[sp,#armreg_cpsr]    // CPSR at time of interrupt
+        str     r1,[sp,#armreg_r0]      // saved R0
+        str     r2,[sp,#armreg_fp]      // saved FP
+        str     r3,[sp,#armreg_ip]      // saved IP
+        str     r4,[sp,#armreg_pc]      // PC at time of interrupt
+        str     lr,[sp,#armreg_lr]      // LR at time of interrupt
+        add     r0,ip,#ARMREG_SIZE
+        str     fp,[sp,#armreg_sp]      // SP at time of interrupt
 #ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
-	mov	r0,sp
-	bl	cyg_hal_report_abort_data
+        mov     r0,sp
+        bl      cyg_hal_report_abort_data
 #endif
-	mov	v1,#CYGNUM_HAL_EXCEPTION_DATA_ACCESS
-	b	call_exception_handler
+        mov     v1,#CYGNUM_HAL_EXCEPTION_DATA_ACCESS
+        b       call_exception_handler
 
         
 //
 // Dispatch an exception handler.
 
-	.code	32
+        .code   32
 call_exception_handler:
-	str	v1,[sp,#armreg_vector]
-	mov	r0,sp
-#ifdef __thumb__
-// Switch to thumb mode
-	ldr	r9,=10f+1
-	bx	r9
-        .pool
-	.code	16
-	.thumb_func
-10:
-#endif
-	bl	exception_handler
+        str     v1,[sp,#armreg_vector]
+        mov     r0,sp
+
+        THUMB_MODE(r9,10)
+
+        bl      exception_handler
 #ifdef  CYGHWR_HAL_ARM_DUMP_EXCEPTIONS
-	mov	r0,sp
-	bl	cyg_hal_report_exception_handler_returned
-#endif
-#ifdef __thumb__
-// Switch back to ARM mode
-	ldr	r1,=10f
-	bx	r1
-        .pool
-	.code	32
-	.thumb_func
-10:
+        mov     r0,sp
+        bl      cyg_hal_report_exception_handler_returned
 #endif
 
-// Restore [interrupted] context
-	mov	ip,sp			// get stack pointer
+        ARM_MODE(r1,10)
 
-	mrs	r0,cpsr			// move back to IRQ mode
-	orr	r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	msr	cpsr,r0
+// Restore [interrupted] context
+        mov     ip,sp                   // get stack pointer
+
+        mrs     r0,cpsr                 // move back to IRQ mode
+        orr     r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        msr     cpsr,r0
         nop
         nop
 
-	ldr	lr,[ip,#armreg_lr]
-	ldr	sp,[sp,#armreg_sp]
+        ldr     lr,[ip,#armreg_lr]
+        ldr     sp,[sp,#armreg_sp]
                         
-	bic	r0,r0,#CPSR_MODE_BITS
-       	orr	r0,r0,#CPSR_IRQ_MODE
-	msr	cpsr,r0
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_IRQ_MODE
+        msr     cpsr,r0
 
-	mov	sp,ip
-	ldr	lr,[sp,#armreg_pc]
-	ldr	r0,[sp,#armreg_cpsr]
-	ldr	ip,[sp,#armreg_ip]
-	msr	spsr,r0
-	ldmfd	sp,{r0-r10,fp}
+        mov     sp,ip
+        ldr     lr,[sp,#armreg_pc]
+        ldr     r0,[sp,#armreg_cpsr]
+        ldr     ip,[sp,#armreg_ip]
+        msr     spsr,r0
+        ldmfd   sp,{r0-r10,fp}
 
-	movs	pc,lr			// restore PC from LR, CPSR from SPSR
+        movs    pc,lr                   // restore PC from LR, CPSR from SPSR
 
 // Handle device interrupts
 // This is slightly more complicated than the other exception handlers because
 // it needs to interface with the kernel (if present).
 
-	.code	32
+        .code   32
 FIQ:
-	// Note: I use this exception stack while saving the context because
-	// the current SP does not seem to be always valid in this CPU mode.
-	ldr	sp,.__FIQ_exception_stack	// get good stack
-	sub	lr,lr,#4		// PC at time of interrupt
-	stmfd	sp!,{r0,fp,ip,lr}		
-	mrs	r0,spsr
-	stmfd	sp!,{r0}
+        // Note: I use this exception stack while saving the context because
+        // the current SP does not seem to be always valid in this CPU mode.
+        ldr     sp,.__FIQ_exception_stack       // get good stack
+        sub     lr,lr,#4                // PC at time of interrupt
+        stmfd   sp!,{r0,fp,ip,lr}               
+        mrs     r0,spsr
+        stmfd   sp!,{r0}
         b       handle_IRQ_or_FIQ
 
 IRQ:
-	// Note: I use this exception stack while saving the context because
-	// the current SP does not seem to be always valid in this CPU mode.
-	ldr	sp,.__exception_stack	// get good stack
-	sub	lr,lr,#4		// PC at time of interrupt
-	stmfd	sp!,{r0,fp,ip,lr}		
-	mrs	r0,spsr
-	stmfd	sp!,{r0}
+        // Note: I use this exception stack while saving the context because
+        // the current SP does not seem to be always valid in this CPU mode.
+        ldr     sp,.__exception_stack   // get good stack
+        sub     lr,lr,#4                // PC at time of interrupt
+        stmfd   sp!,{r0,fp,ip,lr}               
+        mrs     r0,spsr
+        stmfd   sp!,{r0}
 
 handle_IRQ_or_FIQ:              
-	mov	ip,sp			// save SP which will vanish with
+        mov     ip,sp                   // save SP which will vanish with
                                         //   mode switch
-	mrs	r0,cpsr			// switch to Supervisor Mode
-	bic	r0,r0,#CPSR_MODE_BITS
-	orr	r0,r0,#CPSR_SUPERVISOR_MODE|CPSR_FIQ_DISABLE|CPSR_IRQ_DISABLE
-	msr	cpsr,r0			// sp,lr are now old values
-	mov	fp,sp			// save old SP
-	sub	sp,sp,#ARMREG_SIZE	// make space for frame
-	stmea	sp,{r0-r10,fp}		// save immediately visible registers
-	ldmfd	ip,{r0-r4}		// saved registers
-	str	r0,[sp,#armreg_cpsr]	// CPSR at time of interrupt
-	str	r1,[sp,#armreg_r0]	// saved R0
-	str	r2,[sp,#armreg_fp]	// saved FP
-	str	r3,[sp,#armreg_ip]	// saved IP
-	str	r4,[sp,#armreg_pc]	// PC at time of interrupt
-	str	lr,[sp,#armreg_lr]	// LR at time of interrupt
-	str	fp,[sp,#armreg_sp]	// SP at time of interrupt
-	mov	v6,sp			// Save pointer to register frame
+        mrs     r0,cpsr                 // switch to Supervisor Mode
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_SUPERVISOR_MODE|CPSR_FIQ_DISABLE|CPSR_IRQ_DISABLE
+        msr     cpsr,r0                 // sp,lr are now old values
+        mov     fp,sp                   // save old SP
+        sub     sp,sp,#ARMREG_SIZE      // make space for frame
+        stmea   sp,{r0-r10,fp}          // save immediately visible registers
+        ldmfd   ip,{r0-r4}              // saved registers
+        str     r0,[sp,#armreg_cpsr]    // CPSR at time of interrupt
+        str     r1,[sp,#armreg_r0]      // saved R0
+        str     r2,[sp,#armreg_fp]      // saved FP
+        str     r3,[sp,#armreg_ip]      // saved IP
+        str     r4,[sp,#armreg_pc]      // PC at time of interrupt
+        str     lr,[sp,#armreg_lr]      // LR at time of interrupt
+        str     fp,[sp,#armreg_sp]      // SP at time of interrupt
+        mov     v6,sp                   // Save pointer to register frame
 
-//	mov	r0,sp
-//	bl	_show_frame_in
+//      mov     r0,sp
+//      bl      _show_frame_in
 
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
-	// Switch to interrupt stack
-	ldr	r2,.irq_level		// current number of nested interrupts
-	ldr	r0,[r2]
-	add	r1,r0,#1
-	str	r1,[r2]			// if was zero, switch stacks
-	cmp	r0,#0
-	moveq	r1,sp			// save old stack pointer
-	ldreq	sp,.__interrupt_stack
-	stmeqfd	sp!,{r1}
+        // Switch to interrupt stack
+        ldr     r2,.irq_level           // current number of nested interrupts
+        ldr     r0,[r2]
+        add     r1,r0,#1
+        str     r1,[r2]                 // if was zero, switch stacks
+        cmp     r0,#0
+        moveq   r1,sp                   // save old stack pointer
+        ldreq   sp,.__interrupt_stack
+        stmeqfd sp!,{r1}
 10:
 #endif
 
-	// The entire CPU state is now stashed on the stack,
-	// increment the scheduler lock and handle the interrupt
+        // The entire CPU state is now stashed on the stack,
+        // increment the scheduler lock and handle the interrupt
 
-#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT			
-	.extern	cyg_scheduler_sched_lock
-	ldr	r3,.cyg_scheduler_sched_lock
-	ldr	r4,[r3]
-	add	r4,r4,#1
-	str	r4,[r3]
+#ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT                 
+        .extern cyg_scheduler_sched_lock
+        ldr     r3,.cyg_scheduler_sched_lock
+        ldr     r4,[r3]
+        add     r4,r4,#1
+        str     r4,[r3]
 #endif
 
-#ifdef __thumb__
-// Switch to thumb mode
-	ldr	r3,=10f+1
-	bx	r3
-        .pool
-	.code	16
-	.thumb_func
-10:
-#endif
-	mov	r0,v6
-	bl	hal_IRQ_handler		// determine interrupt source
-	mov	v1,r0			// returned vector #
+        THUMB_MODE(r3,10)
+
+        mov     r0,v6
+        bl      hal_IRQ_handler         // determine interrupt source
+        mov     v1,r0                   // returned vector #
 
 #if defined(CYGPKG_KERNEL_INSTRUMENT) && \
     defined(CYGDBG_KERNEL_INSTRUMENT_INTR)
-	ldr	r0,=RAISE_INTR		// arg0 = type = INTR,RAISE
-	mov	r1,v1			// arg1 = vector
-	mov	r2,#0			// arg2 = 0
-	bl	cyg_instrument		// call instrument function
+        ldr     r0,=RAISE_INTR          // arg0 = type = INTR,RAISE
+        mov     r1,v1                   // arg1 = vector
+        mov     r2,#0                   // arg2 = 0
+        bl      cyg_instrument          // call instrument function
 #endif
 
-#ifdef __thumb__
-// Switch to ARM mode
-	ldr	r0,=10f
-	bx	r0
-        .pool
-	.code	32
-10:
-#endif
-	mov	r0,v1			// vector #
-#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS	
+        ARM_MODE(r0,10)
+
+        mov     r0,v1                   // vector #
+#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS     
         cmp     r0,#0                   // ignore spurious interrupts
         beq     spurious_IRQ
 #endif // CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS        
-	ldr	r1,.hal_interrupt_data
-	ldr	r1,[r1,v1,lsl #2]	// handler data
-	ldr	r2,.hal_interrupt_handlers
-	ldr	v3,[r2,v1,lsl #2]	// handler (indexed by vector #)
-	mov	r2,v6			// register frame (this is necessary
-					// for the ISR too, for ^C detection)
+        ldr     r1,.hal_interrupt_data
+        ldr     r1,[r1,v1,lsl #2]       // handler data
+        ldr     r2,.hal_interrupt_handlers
+        ldr     v3,[r2,v1,lsl #2]       // handler (indexed by vector #)
+        mov     r2,v6                   // register frame (this is necessary
+                                        // for the ISR too, for ^C detection)
 
 #ifdef __thumb__
-	ldr	lr,=10f
-	bx	v3			// invoke handler (thumb mode)
+        ldr     lr,=10f
+        bx      v3                      // invoke handler (thumb mode)
         .pool
-	.code	16
-	.thumb_func
+        .code   16
+        .thumb_func
 IRQ_10T:
-10:	ldr	r2,=15f
-	bx	r2			// switch back to ARM mode
+10:     ldr     r2,=15f
+        bx      r2                      // switch back to ARM mode
         .pool
-	.code	32
+        .code   32
 15:
 IRQ_15A:
 #else
-	mov	lr,pc			// invoke handler (call indirect
-	mov	pc,v3                   // thru v3)
+        mov     lr,pc                   // invoke handler (call indirect
+        mov     pc,v3                   // thru v3)
 #endif
 
-#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS	
+#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS     
 spurious_IRQ:           
-#endif // CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS	
+#endif // CYGIMP_HAL_COMMON_INTERRUPTS_IGNORE_SPURIOUS  
 
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
-	// If we are returning from the last nested interrupt, move back
-	// to the thread stack. interrupt_end() must be called on the
-	// thread stack since it potentially causes a context switch.
-	ldr	r2,.irq_level
-	ldr	r3,[r2]
-	subs	r1,r3,#1
-	str	r1,[r2]
-	ldreq	sp,[sp]		// This should be the saved stack pointer
+        // If we are returning from the last nested interrupt, move back
+        // to the thread stack. interrupt_end() must be called on the
+        // thread stack since it potentially causes a context switch.
+        ldr     r2,.irq_level
+        ldr     r3,[r2]
+        subs    r1,r3,#1
+        str     r1,[r2]
+        ldreq   sp,[sp]         // This should be the saved stack pointer
 #endif
 #ifdef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
-	// The return value from the handler (in r0) will indicate whether a 
-	// DSR is to be posted. Pass this together with a pointer to the
-	// interrupt object we have just used to the interrupt tidy up routine.
+        // The return value from the handler (in r0) will indicate whether a 
+        // DSR is to be posted. Pass this together with a pointer to the
+        // interrupt object we have just used to the interrupt tidy up routine.
 
-	ldr	r1,.hal_interrupt_objects
-	ldr	r1,[r1,v1,lsl #2]
-	mov	r2,v6		// register frame
-#ifdef __thumb__
-// Switch to thumb mode
-	ldr	r3,=10f+1
-	bx	r3
-        .pool
-	.code	16
-	.thumb_func
-10:
-IRQ_20T:
-#endif
-	bl	interrupt_end   // post any bottom layer handler
+        ldr     r1,.hal_interrupt_objects
+        ldr     r1,[r1,v1,lsl #2]
+        mov     r2,v6           // register frame
+
+        THUMB_MODE(r3,10)
+
+        bl      interrupt_end   // post any bottom layer handler
                                 // threads and call scheduler
 #endif
 
-#ifdef __thumb__
-// Switch to ARM mode
-	ldr	r1,=10f
-	bx	r1
-        .pool
-	.code	32
-10:
-IRQ_20A:
-#endif
+        ARM_MODE(r1,10)
+
+//      mov     r0,sp
+//      bl      show_frame_out
 
-//	mov	r0,sp
-//	bl	show_frame_out
+        mov     ip,sp                   // get stack pointer
 
-	mov	ip,sp			// get stack pointer
-
-	mrs	r0,cpsr			// move back to IRQ mode
-	orr	r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	msr	cpsr,r0
+        mrs     r0,cpsr                 // move back to IRQ mode
+        orr     r0,r0,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        msr     cpsr,r0
         nop
         nop
 
-	ldr	lr,[ip,#armreg_lr]
-	ldr	sp,[sp,#armreg_sp]
+        ldr     lr,[ip,#armreg_lr]
+        ldr     sp,[sp,#armreg_sp]
                         
-	bic	r0,r0,#CPSR_MODE_BITS
-	orr	r0,r0,#CPSR_IRQ_MODE
-	msr	cpsr,r0
+        bic     r0,r0,#CPSR_MODE_BITS
+        orr     r0,r0,#CPSR_IRQ_MODE
+        msr     cpsr,r0
 
-	mov	sp,ip
-	ldr	lr,[sp,#armreg_pc]
-	ldr	r0,[sp,#armreg_cpsr]
-	ldr	ip,[sp,#armreg_ip]
-	msr	spsr,r0
-	ldmfd	sp,{r0-r10,fp}
-	movs	pc,lr			// restore PC from LR, CPSR from SPSR
+        mov     sp,ip
+        ldr     lr,[sp,#armreg_pc]
+        ldr     r0,[sp,#armreg_cpsr]
+        ldr     ip,[sp,#armreg_ip]
+        msr     spsr,r0
+        ldmfd   sp,{r0-r10,fp}
+        movs    pc,lr                   // restore PC from LR, CPSR from SPSR
 
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
 // Execute pending DSRs the interrupt stack
 // Note: this can only be called from code running on a thread stack
-	.global	hal_interrupt_stack_call_pending_DSRs
-#ifdef __thumb__
-	.code	16
-	.thumb_func
-#endif
-hal_interrupt_stack_call_pending_DSRs:
-#ifdef __thumb__
-	ldr	r1,=10f
-	bx	r1
-        .pool
-	.code	32
-10:
-hal_interrupt_stack_call_pending_DSRs_ARM:
-#endif
-        stmfd	sp!,{r4,r5,lr}
-	// Disable interrupts
-	mrs	r4,cpsr			// disable IRQ's
-	orr	r2,r4,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	bic	r5,r4,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	msr	cpsr,r2
-	// Switch to interrupt stack
-	mov	r3,sp			// save old stack pointer
-	ldr	sp,.__interrupt_stack
-	stmfd	sp!,{r3}		// stored at top of interrupt stack
-	ldr	r2,.irq_level		// current number of nested interrupts
-	ldr	r3,[r2]
-	add	r3,r3,#1		// bump nesting level
-	str	r3,[r2]
-	msr	cpsr,r5			// enable interrupts
+FUNC_START_ARM(hal_interrupt_stack_call_pending_DSRs, r1)
+        stmfd   sp!,{r4,r5,lr}
+        // Disable interrupts
+        mrs     r4,cpsr                 // disable IRQ's
+        orr     r2,r4,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        bic     r5,r4,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        msr     cpsr,r2
+        // Switch to interrupt stack
+        mov     r3,sp                   // save old stack pointer
+        ldr     sp,.__interrupt_stack
+        stmfd   sp!,{r3}                // stored at top of interrupt stack
+        ldr     r2,.irq_level           // current number of nested interrupts
+        ldr     r3,[r2]
+        add     r3,r3,#1                // bump nesting level
+        str     r3,[r2]
+        msr     cpsr,r5                 // enable interrupts
+
+        THUMB_MODE(r1,20)
+
+        bl      cyg_interrupt_call_pending_DSRs
+
+
+        ARM_MODE(r1,22)
+
+        // Disable interrupts
+        mrs     r1,cpsr                 // disable IRQ's
+        orr     r2,r1,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
+        msr     cpsr,r2
+
+        // Move back to the thread stack.
+        ldr     r2,.irq_level
+        ldr     r3,[r2]
+        sub     r3,r3,#1                // decrement nesting level
+        str     r3,[r2]
+        ldr     sp,[sp]                 // This should be the saved stack pointer
+        msr     cpsr,r4                 // restore interrupts to original state
 
 #ifdef __thumb__
-	ldr	r1,=20f+1
-	bx	r1
-        .pool
-	.code	16
-	.thumb_func
-20:
-#endif
-	bl	cyg_interrupt_call_pending_DSRs
-#ifdef __thumb__
-	ldr	r1,=22f
-	bx	r1
-        .pool
-	.code	32
-22:
-#endif
-
-	// Disable interrupts
-	mrs	r1,cpsr			// disable IRQ's
-	orr	r2,r1,#CPSR_IRQ_DISABLE|CPSR_FIQ_DISABLE
-	msr	cpsr,r2
-
-	// Move back to the thread stack.
-	ldr	r2,.irq_level
-	ldr	r3,[r2]
-	sub	r3,r3,#1		// decrement nesting level
-	str	r3,[r2]
-	ldr	sp,[sp]			// This should be the saved stack pointer
-	msr	cpsr,r4			// restore interrupts to original state
-
-#ifdef __thumb__
-	ldmfd	sp!,{r4,r5,lr}		// return
-	bx	lr
+        ldmfd   sp!,{r4,r5,lr}          // return
+        bx      lr
 #else
-	ldmfd	sp!,{r4,r5,pc}		// return
+        ldmfd   sp!,{r4,r5,pc}          // return
 #endif // __thumb__
 #endif // CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
         
 // Thumb-only support functions
 #ifdef __thumb__
-        .global hal_disable_interrupts
-        .code   16
-        .thumb_func
-hal_disable_interrupts: 
-        ldr     r1,=hal_disable_interrupts_ARM
-        bx      r1                      // switch to 32 bit mode
-        .pool
-        .code   32
-hal_disable_interrupts_ARM:             
+
+FUNC_START_ARM(hal_disable_interrupts, r1)
         mrs     r0,cpsr                 // current state
         orr     r1,r0,#0xC0             // mask both FIQ and IRQ
         msr     cpsr,r1
         bx      lr                      // exit, _old_ in r0        
 
-        .global hal_enable_interrupts
-        .code   16
-        .thumb_func
-hal_enable_interrupts: 
-        ldr     r1,=hal_enable_interrupts_ARM
-        bx      r1                      // switch to 32 bit mode
-        .pool
-        .code   32
-hal_enable_interrupts_ARM:               
+FUNC_START_ARM(hal_enable_interrupts, r1)
         mrs     r0,cpsr                 // current state
         bic     r1,r0,#0xC0             // mask both FIQ and IRQ
         msr     cpsr,r1
         bx      lr                      // exit
         
-        .global hal_restore_interrupts
-        .code   16
-        .thumb_func
-hal_restore_interrupts: 
-        ldr     r1,=hal_restore_interrupts_ARM
-        bx      r1                      // switch to 32 bit mode
-        .pool
-        .code   32
-hal_restore_interrupts_ARM:             
+FUNC_START_ARM(hal_restore_interrupts, r1)
         mrs     r1,cpsr                 // current state
         bic     r1,r1,#0xC0             // mask out FIQ/IRQ bits
         and     r0,r0,#0xC0             // keep only FIQ/IRQ
@@ -890,15 +830,7 @@ hal_restore_interrupts_ARM:
         msr     cpsr,r1
         bx      lr                      // exit        
 
-        .global hal_query_interrupts
-        .code   16
-        .thumb_func
-hal_query_interrupts: 
-        ldr     r1,=hal_query_interrupts_ARM
-        bx      r1                      // switch to 32 bit mode
-        .pool
-        .code   32
-hal_query_interrupts_ARM:               
+FUNC_START_ARM(hal_query_interrupts, r1)
         mrs     r0,cpsr                 // current state
         bx      lr                      // exit, state in r0
 
@@ -906,43 +838,39 @@ hal_query_interrupts_ARM:
 
 // Dummy/support functions
 
-	.global	__gccmain
-	.global	_psr
-	.global	_sp
+        .global __gccmain
+        .global _psr
+        .global _sp
 
 #ifdef __thumb__
         .code   16
         .thumb_func
 __gccmain:
-	bx      lr
+        bx      lr
 
         .code   16
         .thumb_func
 _psr:
-        ldr     r1,=_psr_ARM
-        bx      r1
-        .pool
-        .code   32
-_psr_ARM:               
-	mrs	r0,cpsr
+        ARM_MODE(r1,10)
+        mrs     r0,cpsr
         bx      lr
 
         .code   16
         .thumb_func
 _sp:
-	mov	r0,sp
-	bx      lr
+        mov     r0,sp
+        bx      lr
 #else
 __gccmain:
-	mov	pc,lr	
+        mov     pc,lr   
 
 _psr:
-	mrs	r0,cpsr
-	mov	pc,lr
+        mrs     r0,cpsr
+        mov     pc,lr
 
 _sp:
-	mov	r0,sp
-	mov	pc,lr
+        mov     r0,sp
+        mov     pc,lr
 #endif                
 
 
@@ -979,7 +907,7 @@ PTR(__interrupt_stack)
 //
 // Identification - useful to find out when a system was configured
 _eCos_id:
-	.asciz	"eCos : " __DATE__
+        .asciz  "eCos : " __DATE__
 
 
 // -------------------------------------------------------------------------
@@ -991,30 +919,30 @@ PTR(__interrupt_stack)
 // generated by magic without proper dependencies in arm.inc
 // Recompiling will not DTRT without manual intervention.
 
-	.data
+        .data
 
 init_flag:
-	.long	0
+        .long   0
 
-	.extern hal_default_isr
+        .extern hal_default_isr
 
-	.globl	hal_interrupt_handlers
+        .globl  hal_interrupt_handlers
 hal_interrupt_handlers:
-	.rept	CYGNUM_HAL_ISR_COUNT
-	.long	hal_default_isr
-	.endr
+        .rept   CYGNUM_HAL_ISR_COUNT
+        .long   hal_default_isr
+        .endr
 
-	.globl	hal_interrupt_data
+        .globl  hal_interrupt_data
 hal_interrupt_data:
-	.rept	CYGNUM_HAL_ISR_COUNT
-	.long	0
-	.endr
+        .rept   CYGNUM_HAL_ISR_COUNT
+        .long   0
+        .endr
 
-	.globl	hal_interrupt_objects
+        .globl  hal_interrupt_objects
 hal_interrupt_objects:
-	.rept	CYGNUM_HAL_ISR_COUNT
-	.long	0
-	.endr
+        .rept   CYGNUM_HAL_ISR_COUNT
+        .long   0
+        .endr
 
 // -------------------------------------------------------------------------
 // Temporary interrupt stack
@@ -1041,30 +969,30 @@ hal_interrupt_objects:
 #define CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE 4096
 #endif
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
-	.balign 16
-	.global cyg_interrupt_stack_base
+        .balign 16
+        .global cyg_interrupt_stack_base
 cyg_interrupt_stack_base:
 __interrupt_stack_base:
         .rept CYGNUM_HAL_COMMON_INTERRUPTS_STACK_SIZE
         .byte 0
         .endr
-	.balign 16
-	.global cyg_interrupt_stack
+        .balign 16
+        .global cyg_interrupt_stack
 cyg_interrupt_stack:
 __interrupt_stack:
 irq_level:
-	.long	0
+        .long   0
 #endif
 
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
-	.balign 16
+        .balign 16
 __GDB_stack_base:
         .rept 0x400
         .byte 0
         .endr
 __GDB_stack:
 #endif
-	.balign 16
+        .balign 16
 __startup_stack_base:
 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK
         .rept 512
@@ -1073,7 +1001,7 @@ irq_level:
 #endif
         .byte 0
         .endr
-	.balign 16
+        .balign 16
 __startup_stack:
 
 #ifdef PLATFORM_EXTRAS
--- a/packages/hal/arm/cma230/current/cdl/hal_arm_cma230.cdl
+++ b/packages/hal/arm/cma230/current/cdl/hal_arm_cma230.cdl
@@ -161,11 +161,7 @@ cdl_package CYGPKG_HAL_ARM_CMA230 {
             display "Global command prefix"
             flavor  data
             no_define
-            if {1} {
-                default_value { CYGHWR_THUMB ? "thumb-elf" : "arm-elf" }
-            } else {
-                default_value { "arm-elf" }
-            }
+            default_value { CYGHWR_THUMB ? "thumb-elf" : "arm-elf" }
             description "
                 This option specifies the command prefix used when
                 invoking the build tools."
@@ -175,12 +171,8 @@ cdl_package CYGPKG_HAL_ARM_CMA230 {
             display "Global compiler flags"
             flavor  data
             no_define
-            if {1} {
-                default_value { CYGHWR_THUMB ? "-mthumb-interwork -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
-            } else {
-                default_value { "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
-            }
+            default_value { CYGHWR_THUMB ? "-mthumb-interwork -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
             description   "
                 This option controls the global compiler flags which are used to
                 compile all packages by default. Individual packages may define
@@ -213,12 +205,8 @@ cdl_package CYGPKG_HAL_ARM_CMA230 {
             display "Global linker flags"
             flavor  data
             no_define
-            if {1} {
-                default_value { CYGHWR_THUMB ? "-g -nostdlib -Wl,--gc-sections -Wl,-static -mthumb-interwork" :
-                                               "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
-            } else {
-                default_value { "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
-            }
+            default_value { CYGHWR_THUMB ? "-g -nostdlib -Wl,--gc-sections -Wl,-static -mthumb-interwork" :
+            "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// eCos memory layout - Tue Nov 09 08:15:25 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x200000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x8000)
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.ldi
+++ /dev/null
@@ -1,24 +0,0 @@
-// eCos memory layout - Tue Nov 09 08:15:25 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x200000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    __reserved = 0; . = __reserved + 0x8000;
-    SECTION_rom_vectors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_ram.mlt
+++ /dev/null
@@ -1,12 +0,0 @@
-version 0
-region ram 0 200000 0 !
-section reserved 8000 1 0 0 1 1 1 1 0 0 rom_vectors rom_vectors !
-section rom_vectors 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 data data !
-section data 0 1 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// eCos memory layout - Tue Nov 09 08:31:08 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x200000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-#define CYGMEM_REGION_rom (0xe000000)
-#define CYGMEM_REGION_rom_SIZE (0x40000)
-#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x1000)
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.ldi
+++ /dev/null
@@ -1,25 +0,0 @@
-// eCos memory layout - Tue Nov 09 08:31:08 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x200000
-    rom : ORIGIN = 0xe000000, LENGTH = 0x40000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    SECTION_rom_vectors (rom, 0xe000000, LMA_EQ_VMA)
-    SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
-    __reserved = 0; . = __reserved + 0x1000;
-    SECTION_data (ram, ALIGN (0x1), FOLLOWING (.gcc_except_table))
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/cma230/current/include/pkgconf/mlt_arm_cma230T_rom.mlt
+++ /dev/null
@@ -1,13 +0,0 @@
-version 0
-region ram 0 200000 0 !
-region rom e000000 40000 1 !
-section reserved 1000 1 0 0 1 1 1 0 0 0 data !
-section data 0 1 1 1 0 1 0 0 bss !
-section bss 0 4 0 1 0 0 0 0 !
-section rom_vectors 0 1 0 1 1 1 1 1 e000000 e000000 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 0 0 1 data !
--- a/packages/hal/arm/pid/current/cdl/hal_arm_pid.cdl
+++ b/packages/hal/arm/pid/current/cdl/hal_arm_pid.cdl
@@ -176,11 +176,7 @@ cdl_package CYGPKG_HAL_ARM_PID {
             display "Global command prefix"
             flavor  data
             no_define
-            if {1} {
-                default_value { CYGHWR_THUMB ? "thumb-elf" : "arm-elf" }
-            } else {
-                default_value { "arm-elf" }
-            }
+            default_value { CYGHWR_THUMB ? "thumb-elf" : "arm-elf" }
             description "
                 This option specifies the command prefix used when
                 invoking the build tools."
@@ -190,19 +186,12 @@ cdl_package CYGPKG_HAL_ARM_PID {
             display "Global compiler flags"
             flavor  data
             no_define
-            if {1} {
-                 default_value { (CYGHWR_THUMB && CYGHWR_HAL_ARM_BIGENDIAN) ? "-mthumb-interwork -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   CYGHWR_THUMB ? "-mthumb-interwork -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
-            } else { 
-                default_value { (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
-                   "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
-            }
+            default_value { (CYGHWR_THUMB && CYGHWR_HAL_ARM_BIGENDIAN) ? "-mthumb-interwork -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            CYGHWR_THUMB ? "-mthumb-interwork -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
+            "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
             description   "
                 This option controls the global compiler flags which are used to
                 compile all packages by default. Individual packages may define
@@ -213,19 +202,12 @@ cdl_package CYGPKG_HAL_ARM_PID {
             display "Global linker flags"
             flavor  data
             no_define
-            if {1} {
-                 default_value { (CYGHWR_THUMB && CYGHWR_HAL_ARM_BIGENDIAN) ? "-mthumb-interwork -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   CYGHWR_THUMB ? "-mthumb-interwork -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
-            } else { 
-                default_value { (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
-                   "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
-            }
+            default_value { (CYGHWR_THUMB && CYGHWR_HAL_ARM_BIGENDIAN) ? "-mthumb-interwork -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
+            CYGHWR_THUMB ? "-mthumb-interwork -g -nostdlib -Wl,--gc-sections -Wl,-static" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") && ! CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm9 -g -nostdlib -Wl,--gc-sections -Wl,-static" :
+            (CYGHWR_HAL_ARM_CPU_FAMILY != "ARM9") && CYGHWR_HAL_ARM_BIGENDIAN ? "-mcpu=arm7tdmi -mbig-endian -g -nostdlib -Wl,--gc-sections -Wl,-static" :
+            "-mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:57:37 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x8000)
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.ldi
+++ /dev/null
@@ -1,24 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:57:37 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x80000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    __reserved = 0; . = __reserved + 0x8000;
-    SECTION_rom_vectors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_ram.mlt
+++ /dev/null
@@ -1,12 +0,0 @@
-version 0
-region ram 0 80000 0 !
-section reserved 8000 1 0 0 1 1 1 1 0 0 rom_vectors rom_vectors !
-section rom_vectors 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 data data !
-section data 0 1 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:59:24 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-#define CYGMEM_REGION_rom (0x4000000)
-#define CYGMEM_REGION_rom_SIZE (0x80000)
-#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x800)
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.ldi
+++ /dev/null
@@ -1,25 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:59:24 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x80000
-    rom : ORIGIN = 0x4000000, LENGTH = 0x80000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    SECTION_rom_vectors (rom, 0x4000000, LMA_EQ_VMA)
-    SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
-    __reserved = 0; . = __reserved + 0x800;
-    SECTION_data (ram, ALIGN (0x1), FOLLOWING (.gcc_except_table))
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidTBE_rom.mlt
+++ /dev/null
@@ -1,13 +0,0 @@
-version 0
-region ram 0 80000 0 !
-region rom 4000000 80000 1 !
-section reserved 800 1 0 0 1 1 1 0 0 0 data !
-section data 0 1 1 1 0 1 0 0 bss !
-section bss 0 4 0 1 0 0 0 0 !
-section rom_vectors 0 1 0 1 1 1 1 1 4000000 4000000 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 0 0 1 data !
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.h
+++ /dev/null
@@ -1,13 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:57:37 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x8000)
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.ldi
+++ /dev/null
@@ -1,24 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:57:37 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x80000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    __reserved = 0; . = __reserved + 0x8000;
-    SECTION_rom_vectors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_data (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_ram.mlt
+++ /dev/null
@@ -1,12 +0,0 @@
-version 0
-region ram 0 80000 0 !
-section reserved 8000 1 0 0 1 1 1 1 0 0 rom_vectors rom_vectors !
-section rom_vectors 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 data data !
-section data 0 1 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:59:24 1999
-
-// This is a generated file - changes will be lost if ConfigTool(MLT) is run
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-#define CYGMEM_REGION_rom (0x4000000)
-#define CYGMEM_REGION_rom_SIZE (0x80000)
-#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
-extern char CYG_LABEL_NAME (_reserved) [];
-#define CYGMEM_SECTION_reserved (CYG_LABEL_NAME (_reserved))
-#define CYGMEM_SECTION_reserved_SIZE (0x800)
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.ldi
+++ /dev/null
@@ -1,25 +0,0 @@
-// eCos memory layout - Tue Nov 09 06:59:24 1999
-
-// This is a generated file - do not edit
-
-MEMORY
-{
-    ram : ORIGIN = 0, LENGTH = 0x80000
-    rom : ORIGIN = 0x4000000, LENGTH = 0x80000
-}
-
-SECTIONS
-{
-    SECTIONS_BEGIN
-    SECTION_rom_vectors (rom, 0x4000000, LMA_EQ_VMA)
-    SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fixup (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
-    __reserved = 0; . = __reserved + 0x800;
-    SECTION_data (ram, ALIGN (0x1), FOLLOWING (.gcc_except_table))
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTIONS_END
-}
deleted file mode 100644
--- a/packages/hal/arm/pid/current/include/pkgconf/mlt_arm_pidT_rom.mlt
+++ /dev/null
@@ -1,13 +0,0 @@
-version 0
-region ram 0 80000 0 !
-region rom 4000000 80000 1 !
-section reserved 800 1 0 0 1 1 1 0 0 0 data !
-section data 0 1 1 1 0 1 0 0 bss !
-section bss 0 4 0 1 0 0 0 0 !
-section rom_vectors 0 1 0 1 1 1 1 1 4000000 4000000 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 fixup fixup !
-section fixup 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 0 0 1 data !
--- a/packages/hal/mips/jmr3904/current/ChangeLog
+++ b/packages/hal/mips/jmr3904/current/ChangeLog
@@ -1,3 +1,19 @@
+2000-04-04  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* include/pkgconf/mlt_mips_tx39_jmr3904_rom.ldi: 
+	* include/pkgconf/mlt_mips_tx39_jmr3904_rom.mlt: 
+	* include/pkgconf/mlt_mips_tx39_jmr3904_ram.ldi: 
+	* include/pkgconf/mlt_mips_tx39_jmr3904_ram.mlt: 
+	Split lit section into lit4 and lit8
+	DEVTAB -> devtab
+	Update alignments
+	For ROM startup, ensure all relevant sections are relocated,
+	not just .data
+	Above changed as per new mips_tx39.ld in variant HAL
+
+	* cdl/hal_mips_tx39_jmr3904.cdl (CYG_HAL_STARTUP): Fix board
+	name typo
+
 2000-03-16  Jonathan Larmour  <jlarmour@redhat.co.uk>
 
 	* include/pkgconf/mlt_mips_tx39_jmr3904_ram.h,
--- a/packages/hal/mips/jmr3904/current/cdl/hal_mips_tx39_jmr3904.cdl
+++ b/packages/hal/mips/jmr3904/current/cdl/hal_mips_tx39_jmr3904.cdl
@@ -71,7 +71,7 @@ cdl_package CYGPKG_HAL_MIPS_TX39_JMR3904
 	no_define
 	define -file system.h CYG_HAL_STARTUP
         description   "
-           When targetting the EDK7708 board it is possible to build
+           When targetting the JMR3904 board it is possible to build
            the system for either RAM bootstrap, ROM bootstrap, or STUB
            bootstrap. RAM bootstrap generally requires that the board
            is equipped with ROMs containing a suitable ROM monitor or
--- a/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.ldi
+++ b/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.ldi
@@ -1,4 +1,4 @@
-// eCos memory layout - Thu Mar 16 16:19:05 2000
+// eCos memory layout - Mon Apr 03 21:03:12 2000
 
 // This is a generated file - do not edit
 
@@ -11,25 +11,26 @@ SECTIONS
 {
     SECTIONS_BEGIN
     SECTION_rom_vectors (ram, 0x80008000, LMA_EQ_VMA)
-    SECTION_ROMISC (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_RELOCS (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_init (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_ROMISC (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_RELOCS (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_init (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA)
     SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA)
     SECTION_data1 (ram, ALIGN (0x8), LMA_EQ_VMA)
-    SECTION_eh_frame (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_ctors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dtors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_DEVTAB (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_got (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dynamic (ram, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_eh_frame (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_ctors (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_dtors (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_devtab (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_got (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_dynamic (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_sdata (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_lit (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_lit8 (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_lit4 (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_sbss (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
     SECTIONS_END
 }
--- a/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.mlt
+++ b/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_ram.mlt
@@ -1,23 +1,24 @@
 version 0
 region ram 80008000 78000 0 !
 section rom_vectors 0 1 0 1 1 1 1 1 80008000 80008000 ROMISC ROMISC !
-section ROMISC 0 1 0 1 0 1 0 1 RELOCS RELOCS !
-section RELOCS 0 1 0 1 0 1 0 1 init init !
-section init 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 data data !
+section ROMISC 0 4 0 1 0 1 0 1 RELOCS RELOCS !
+section RELOCS 0 4 0 1 0 1 0 1 init init !
+section init 0 4 0 1 0 1 0 1 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 8 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 8 0 1 0 1 0 1 data data !
 section data 0 8 0 1 0 1 0 1 data1 data1 !
 section data1 0 8 0 1 0 1 0 1 eh_frame eh_frame !
-section eh_frame 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 ctors ctors !
-section ctors 0 1 0 1 0 1 0 1 dtors dtors !
-section dtors 0 1 0 1 0 1 0 1 DEVTAB DEVTAB !
-section DEVTAB 0 1 0 1 0 1 0 1 got got !
-section got 0 1 0 1 0 1 0 1 dynamic dynamic !
-section dynamic 0 1 0 1 0 1 0 1 sdata sdata !
-section sdata 0 4 0 1 0 1 0 1 lit lit !
-section lit 0 4 0 1 0 1 0 1 sbss sbss !
-section sbss 0 4 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
+section eh_frame 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 0 1 0 1 0 1 ctors ctors !
+section ctors 0 4 0 1 0 1 0 1 dtors dtors !
+section dtors 0 4 0 1 0 1 0 1 devtab devtab !
+section devtab 0 4 0 1 0 1 0 1 got got !
+section got 0 4 0 1 0 1 0 1 dynamic dynamic !
+section dynamic 0 4 0 1 0 1 0 1 sdata sdata !
+section sdata 0 4 0 1 0 1 0 1 lit8 lit8 !
+section lit8 0 8 0 1 0 1 0 1 lit4 lit4 !
+section lit4 0 8 0 1 0 1 0 1 sbss sbss !
+section sbss 0 8 0 1 0 1 0 1 bss bss !
+section bss 0 8 0 1 0 0 0 0 !
--- a/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.ldi
+++ b/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.ldi
@@ -1,4 +1,4 @@
-// eCos memory layout - Thu Mar 16 16:47:52 2000
+// eCos memory layout - Mon Apr 03 20:58:39 2000
 
 // This is a generated file - do not edit
 
@@ -12,25 +12,26 @@ SECTIONS
 {
     SECTIONS_BEGIN
     SECTION_rom_vectors (rom, 0xbfc00000, LMA_EQ_VMA)
-    SECTION_ROMISC (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_RELOCS (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_init (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (rom, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (rom, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_ROMISC (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_RELOCS (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_init (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_text (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_fini (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_rodata (rom, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_rodata1 (rom, ALIGN (0x8), LMA_EQ_VMA)
     SECTION_data (ram, 0x80000200, FOLLOWING (.rodata1))
-    SECTION_data1 (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_eh_frame (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_ctors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dtors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_DEVTAB (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_got (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dynamic (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_sdata (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_lit (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_data1 (ram, ALIGN (0x8), FOLLOWING (.data))
+    SECTION_eh_frame (ram, ALIGN (0x8), FOLLOWING (.data1))
+    SECTION_gcc_except_table (ram, ALIGN (0x8), FOLLOWING (.eh_frame))
+    SECTION_ctors (ram, ALIGN (0x8), FOLLOWING (.gcc_except_table))
+    SECTION_dtors (ram, ALIGN (0x8), FOLLOWING (.ctors))
+    SECTION_devtab (ram, ALIGN (0x8), FOLLOWING (.dtors))
+    SECTION_got (ram, ALIGN (0x8), FOLLOWING (.devtab))
+    SECTION_dynamic (ram, ALIGN (0x8), FOLLOWING (.got))
+    SECTION_sdata (ram, ALIGN (0x8), FOLLOWING (.dynamic))
+    SECTION_lit8 (ram, ALIGN (0x8), FOLLOWING (.sdata))
+    SECTION_lit4 (ram, ALIGN (0x8), FOLLOWING (.lit8))
+    SECTION_sbss (ram, ALIGN (0x8), FOLLOWING (.lit4))
+    SECTION_bss (ram, ALIGN (0x8), FOLLOWING (.sbss))
     SECTIONS_END
 }
--- a/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.mlt
+++ b/packages/hal/mips/jmr3904/current/include/pkgconf/mlt_mips_tx39_jmr3904_rom.mlt
@@ -1,24 +1,25 @@
 version 0
 region ram 80000200 7fe00 0 !
 region rom bfc00000 80000 1 !
-section data 0 8 1 1 1 1 0 0 80000200 data1 !
-section data1 0 1 0 1 0 1 0 1 eh_frame eh_frame !
-section eh_frame 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 ctors ctors !
-section ctors 0 1 0 1 0 1 0 1 dtors dtors !
-section dtors 0 1 0 1 0 1 0 1 DEVTAB DEVTAB !
-section DEVTAB 0 1 0 1 0 1 0 1 got got !
-section got 0 1 0 1 0 1 0 1 dynamic dynamic !
-section dynamic 0 1 0 1 0 1 0 1 sdata sdata !
-section sdata 0 4 0 1 0 1 0 1 lit lit !
-section lit 0 4 0 1 0 1 0 1 sbss sbss !
-section sbss 0 4 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
+section data 0 8 1 1 1 1 0 1 80000200 data1 data1 !
+section data1 0 8 1 1 0 1 0 1 eh_frame eh_frame !
+section eh_frame 0 8 1 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 8 1 1 0 1 0 1 ctors ctors !
+section ctors 0 8 1 1 0 1 0 1 dtors dtors !
+section dtors 0 8 1 1 0 1 0 1 devtab devtab !
+section devtab 0 8 1 1 0 1 0 1 got got !
+section got 0 8 1 1 0 1 0 1 dynamic dynamic !
+section dynamic 0 8 1 1 0 1 0 1 sdata sdata !
+section sdata 0 8 1 1 0 1 0 1 lit8 lit8 !
+section lit8 0 8 1 1 0 1 0 1 lit4 lit4 !
+section lit4 0 8 1 1 0 1 0 1 sbss sbss !
+section sbss 0 8 1 1 0 1 0 1 bss bss !
+section bss 0 8 1 1 0 0 0 0 !
 section rom_vectors 0 1 0 1 1 1 1 1 bfc00000 bfc00000 ROMISC ROMISC !
-section ROMISC 0 1 0 1 0 1 0 1 RELOCS RELOCS !
-section RELOCS 0 1 0 1 0 1 0 1 init init !
-section init 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 0 0 1 data !
+section ROMISC 0 8 0 1 0 1 0 1 RELOCS RELOCS !
+section RELOCS 0 8 0 1 0 1 0 1 init init !
+section init 0 8 0 1 0 1 0 1 text text !
+section text 0 8 0 1 0 1 0 1 fini fini !
+section fini 0 8 0 1 0 1 0 1 rodata rodata !
+section rodata 0 8 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 8 0 1 0 0 0 1 data !
--- a/packages/hal/mips/sim/current/ChangeLog
+++ b/packages/hal/mips/sim/current/ChangeLog
@@ -1,3 +1,12 @@
+2000-04-04  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* include/pkgconf/mlt_mips_tx39_sim_ram.ldi,
+	  include/pkgconf/mlt_mips_tx39_sim_ram.mlt: 
+	Split lit section into lit4 and lit8
+	DEVTAB -> devtab
+	Update alignments
+	Above changed as per new mips_tx39.ld in variant HAL
+
 2000-03-16  Jonathan Larmour  <jlarmour@redhat.co.uk>
 
 	* sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.h,
--- a/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.ldi
+++ b/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.ldi
@@ -1,4 +1,4 @@
-// eCos memory layout - Thu Mar 16 16:55:45 2000
+// eCos memory layout - Mon Apr 03 21:10:37 2000
 
 // This is a generated file - do not edit
 
@@ -11,26 +11,27 @@ SECTIONS
 {
     SECTIONS_BEGIN
     SECTION_rom_vectors (ram, 0x80000000, LMA_EQ_VMA)
-    SECTION_ROMISC (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_RELOCS (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_init (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_text (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_fini (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_rodata1 (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_vsr_table (ram, ALIGN (0x1), LMA_EQ_VMA)
+    SECTION_ROMISC (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_RELOCS (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_init (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_vsr_table (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA)
     SECTION_data1 (ram, ALIGN (0x8), LMA_EQ_VMA)
-    SECTION_eh_frame (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_ctors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dtors (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_DEVTAB (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_got (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_dynamic (ram, ALIGN (0x1), LMA_EQ_VMA)
-    SECTION_sdata (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_lit (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA)
-    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_eh_frame (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_ctors (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_dtors (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_devtab (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_got (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_dynamic (ram, ALIGN (0x4), LMA_EQ_VMA)
+    SECTION_sdata (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_lit8 (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_lit4 (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_sbss (ram, ALIGN (0x8), LMA_EQ_VMA)
+    SECTION_bss (ram, ALIGN (0x8), LMA_EQ_VMA)
     SECTIONS_END
 }
--- a/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.mlt
+++ b/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_tx39_sim_ram.mlt
@@ -1,24 +1,25 @@
 version 0
 region ram 80000000 80000 0 !
 section rom_vectors 0 1 0 1 1 1 1 1 80000000 80000000 ROMISC ROMISC !
-section ROMISC 0 1 0 1 0 1 0 1 RELOCS RELOCS !
-section RELOCS 0 1 0 1 0 1 0 1 init init !
-section init 0 1 0 1 0 1 0 1 text text !
-section text 0 1 0 1 0 1 0 1 fini fini !
-section fini 0 1 0 1 0 1 0 1 rodata rodata !
-section rodata 0 1 0 1 0 1 0 1 rodata1 rodata1 !
-section rodata1 0 1 0 1 0 1 0 1 vsr_table vsr_table !
-section vsr_table 0 1 0 1 0 1 0 1 data data !
+section ROMISC 0 4 0 1 0 1 0 1 RELOCS RELOCS !
+section RELOCS 0 4 0 1 0 1 0 1 init init !
+section init 0 4 0 1 0 1 0 1 text text !
+section text 0 4 0 1 0 1 0 1 fini fini !
+section fini 0 4 0 1 0 1 0 1 rodata rodata !
+section rodata 0 8 0 1 0 1 0 1 rodata1 rodata1 !
+section rodata1 0 8 0 1 0 1 0 1 vsr_table vsr_table !
+section vsr_table 0 4 0 1 0 1 0 1 data data !
 section data 0 8 0 1 0 1 0 1 data1 data1 !
 section data1 0 8 0 1 0 1 0 1 eh_frame eh_frame !
-section eh_frame 0 1 0 1 0 1 0 1 gcc_except_table gcc_except_table !
-section gcc_except_table 0 1 0 1 0 1 0 1 ctors ctors !
-section ctors 0 1 0 1 0 1 0 1 dtors dtors !
-section dtors 0 1 0 1 0 1 0 1 DEVTAB DEVTAB !
-section DEVTAB 0 1 0 1 0 1 0 1 got got !
-section got 0 1 0 1 0 1 0 1 dynamic dynamic !
-section dynamic 0 1 0 1 0 1 0 1 sdata sdata !
-section sdata 0 4 0 1 0 1 0 1 lit lit !
-section lit 0 4 0 1 0 1 0 1 sbss sbss !
-section sbss 0 4 0 1 0 1 0 1 bss bss !
-section bss 0 4 0 1 0 0 0 0 !
+section eh_frame 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
+section gcc_except_table 0 4 0 1 0 1 0 1 ctors ctors !
+section ctors 0 4 0 1 0 1 0 1 dtors dtors !
+section dtors 0 4 0 1 0 1 0 1 devtab devtab !
+section devtab 0 4 0 1 0 1 0 1 got got !
+section got 0 4 0 1 0 1 0 1 dynamic dynamic !
+section dynamic 0 4 0 1 0 1 0 1 sdata sdata !
+section sdata 0 8 0 1 0 1 0 1 lit8 lit8 !
+section lit8 0 8 0 1 0 1 0 1 lit4 lit4 !
+section lit4 0 8 0 1 0 1 0 1 sbss sbss !
+section sbss 0 8 0 1 0 1 0 1 bss bss !
+section bss 0 8 0 1 0 0 0 0 !
--- a/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_vr4300_sim_ram.h
+++ b/packages/hal/mips/sim/current/include/pkgconf/mlt_mips_vr4300_sim_ram.h
@@ -1,10 +1,10 @@
-// eCos memory layout - Thu Nov 25 22:16:12 1999
-
-// This is a generated file - do not edit
-
-#include <cyg/infra/cyg_type.h>
-#include <stddef.h>
-
-#define CYGMEM_REGION_ram (0x80000000)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
-#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
+// eCos memory layout - Thu Nov 25 22:16:12 1999
+
+// This is a generated file - do not edit
+
+#include <cyg/infra/cyg_type.h>
+#include <stddef.h>
+
+#define CYGMEM_REGION_ram (0x80000000)
+#define CYGMEM_REGION_ram_SIZE (0x80000)
+#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
--- a/packages/hal/mips/tx39/current/ChangeLog
+++ b/packages/hal/mips/tx39/current/ChangeLog
@@ -1,3 +1,14 @@
+2000-04-06  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* src/mips_tx39.ld: Define __CTOR_LIST__, __CTOR_END__, __DTOR_LIST__,
+	__DTOR_END__ regardless, for compatibility with old toolchains
+
+2000-04-04  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* src/mips_tx39.ld: Make sure some potentially empty sections are
+	output.	Replace __rom_data_start which was accidentally removed.
+	Split lit section into lit8 and lit4.
+
 2000-03-16  Jonathan Larmour  <jlarmour@redhat.co.uk>
 
 	* src/mips_tx39.ld: Update from latest "mips-tx39-elf-ld --verbose"
--- a/packages/hal/mips/tx39/current/src/mips_tx39.ld
+++ b/packages/hal/mips/tx39/current/src/mips_tx39.ld
@@ -43,9 +43,15 @@ INPUT(extras.o)
 #endif
 GROUP(libtarget.a libgcc.a)
 
+/* FIXME: The MLT should pass in the required alignment since it must be
+ * the same as the VMA's alignment. As a result of this bug, all the JMR3904
+ * ROM mlt files have alignment 8, when some should have alignment 4
+ * (902557-CR)
+ */
 #define ALIGN_LMA 8
 #define FOLLOWING(_section_) AT ((LOADADDR (_section_) + SIZEOF (_section_) + ALIGN_LMA - 1) & ~ (ALIGN_LMA - 1))
 #define LMA_EQ_VMA
+#define FORCE_OUTPUT . = .
 
 #define SECTIONS_BEGIN
 
@@ -140,7 +146,7 @@ GROUP(libtarget.a libgcc.a)
 #define SECTION_init(_region_, _vma_, _lma_)   \
   .init _vma_ : _lma_                          \
     {                                          \
-      KEEP (*(.init))                          \
+      FORCE_OUTPUT; KEEP (*(.init))            \
     } > _region_ =0
 
 #define SECTION_text(_region_, _vma_, _lma_)   \
@@ -159,25 +165,25 @@ GROUP(libtarget.a libgcc.a)
 #define SECTION_fini(_region_, _vma_, _lma_)   \
   .fini _vma_ : _lma_                          \
     {                                          \
-      KEEP (*(.fini))                          \
+      FORCE_OUTPUT; KEEP (*(.fini))                   \
     } > _region_ =0
 
 #define SECTION_rodata(_region_, _vma_, _lma_)        \
   .rodata _vma_ : _lma_                               \
     {                                                 \
-      *(.rodata*) *(.rodata.*) *(.gnu.linkonce.r*)    \
+      FORCE_OUTPUT; *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*)    \
     } > _region_
 
 #define SECTION_rodata1(_region_, _vma_, _lma_)       \
   .rodata1 _vma_ : _lma_                              \
     {                                                 \
-      *(.rodata1) *(.rodata1.*)                       \
+     FORCE_OUTPUT; *(.rodata1) *(.rodata1.*)          \
     } > _region_
 
 #define SECTION_vsr_table(_region_, _vma_, _lma_)     \
   .vsr_table _vma_ : _lma_                            \
     {                                                 \
-      *(.vsr_table)                                   \
+      FORCE_OUTPUT; *(.vsr_table)                     \
     } > _region_
 
 #define SECTION_data(_region_, _vma_, _lma_)          \
@@ -187,24 +193,25 @@ GROUP(libtarget.a libgcc.a)
       *(.data) *(.data.*) *(.gnu.linkonce.d*)         \
     . = ALIGN (8);                                    \
     SORT(CONSTRUCTORS)                                \
-    } > _region_
+    } > _region_                                      \
+    __rom_data_start = LOADADDR(.data);
 
 #define SECTION_data1(_region_, _vma_, _lma_)         \
   .data1 _vma_ : _lma_                                \
     {                                                 \
-       *(.data1) *(.data1.*)                          \
+       FORCE_OUTPUT; *(.data1) *(.data1.*)            \
     } > _region_
 
 #define SECTION_eh_frame(_region_, _vma_, _lma_)      \
   .eh_frame _vma_ : _lma_                             \
     {                                                 \
-       *(.eh_frame)                                   \
+       FORCE_OUTPUT; *(.eh_frame)                     \
     } > _region_
 
 #define SECTION_gcc_except_table(_region_, _vma_, _lma_) \
   .gcc_except_table _vma_ : _lma_                        \
     {                                                    \
-      *(.gcc_except_table)                               \
+      FORCE_OUTPUT; *(.gcc_except_table)                 \
     } > _region_
 
 
@@ -223,31 +230,43 @@ GROUP(libtarget.a libgcc.a)
        The .ctor section from the crtend file contains the
        end of ctors marker and it must be last */
 
+/* FIXME: We shouldn't need to define __CTOR_LIST__/__CTOR_END__
+   and __DTOR_LIST__/__DTOR_END__ except by the PROVIDE lines.
+   However this doesn't work for old (99r1-era) toolchains, so
+   leave it for now. */
+
 #define SECTION_ctors(_region_, _vma_, _lma_)     \
   .ctors _vma_ : _lma_                            \
     {                                             \
+      FORCE_OUTPUT;                               \
       KEEP (*crtbegin.o(.ctors))                  \
+      __CTOR_LIST__ = .;                \
       PROVIDE (__CTOR_LIST__ = .);                \
       KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))   \
       KEEP (*(SORT(.ctors.*)))                    \
       KEEP (*(.ctors))                            \
+      __CTOR_END__ = .;                 \
       PROVIDE (__CTOR_END__ = .);                 \
     } > _region_
 
 #define SECTION_dtors(_region_, _vma_, _lma_)     \
   .dtors _vma_ : _lma_                            \
     {                                             \
+      FORCE_OUTPUT;                               \
       KEEP (*crtbegin.o(.dtors))                  \
+      __DTOR_LIST__ = .;                \
       PROVIDE (__DTOR_LIST__ = .);                \
       KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))   \
       KEEP (*(SORT(.dtors.*)))                    \
       KEEP (*(.dtors))                            \
+      __DTOR_END__ = .;                 \
       PROVIDE (__DTOR_END__ = .);                 \
     } > _region_
 
-#define SECTION_DEVTAB(_region_, _vma_, _lma_)    \
+#define SECTION_devtab(_region_, _vma_, _lma_)    \
   .devtab _vma_ : _lma_                           \
     {                                             \
+      FORCE_OUTPUT;                               \
       __DEVTAB__ = .;                             \
       KEEP (*(SORT(.devtab*)))                    \
        __DEVTAB_END__ = .;                        \
@@ -260,42 +279,44 @@ GROUP(libtarget.a libgcc.a)
   _gp = ALIGN(16) + 0x7ff0;                     \
   .got _vma_ : _lma_                            \
     {                                           \
-      *(.got.plt) *(.got)                       \
+      FORCE_OUTPUT; *(.got.plt) *(.got)         \
     } > _region_
 
 #define SECTION_dynamic(_region_, _vma_, _lma_) \
   .dynamic _vma_ : _lma_                        \
     {                                           \
-      *(.dynamic)                               \
+      FORCE_OUTPUT; *(.dynamic)                 \
     } > _region_
 
   /* We want the small data sections together, so single-instruction offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
 
-#define SECTION_sdata(_region_, _vma_, _lma_)   \
-  .sdata _vma_ : _lma_                          \
-    {                                           \
-      *(.sdata) *(.sdata.*) *(.gnulinkonce.s*)  \
+#define SECTION_sdata(_region_, _vma_, _lma_)                 \
+  .sdata _vma_ : _lma_                                        \
+    {                                                         \
+      FORCE_OUTPUT; *(.sdata) *(.sdata.*) *(.gnulinkonce.s*)  \
     } > _region_
 
-#define SECTION_lit(_region_, _vma_, _lma_)     \
+#define SECTION_lit8(_region_, _vma_, _lma_)    \
   .lit8 _vma_ : _lma_                           \
     {                                           \
-      *(.lit8)                                  \
-    } > _region_                                \
+      FORCE_OUTPUT; *(.lit8)                    \
+    } > _region_
+
+#define SECTION_lit4(_region_, _vma_, _lma_)    \
   .lit4 : FOLLOWING(.lit8)                      \
     {                                           \
-      *(.lit4)                                  \
+      FORCE_OUTPUT; *(.lit4)                    \
     } > _region_                                \
   __ram_data_end = .; _edata = . ;              \
   PROVIDE (edata = .);
 
-#define SECTION_sbss(_region_, _vma_, _lma_)      \
-  __bss_start = .; _fbss = .;                     \
-  .sbss _vma_ : _lma_                             \
-    {                                             \
-      *(.dynsbss) *(.sbss) *(.sbss.*) *(.scommon) \
+#define SECTION_sbss(_region_, _vma_, _lma_)                    \
+  __bss_start = .; _fbss = .;                                   \
+  .sbss _vma_ : _lma_                                           \
+    {                                                           \
+      FORCE_OUTPUT; *(.dynsbss) *(.sbss) *(.sbss.*) *(.scommon) \
     } > _region_
 
 #define SECTION_bss(_region_, _vma_, _lma_)       \
--- a/packages/hal/powerpc/arch/current/ChangeLog
+++ b/packages/hal/powerpc/arch/current/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-06  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* include/hal_intr.h (HAL_CLOCK_RESET): Prevent warning
+	(patch thanks to Sergei Organov (osv at javad.ru))
+
 2000-03-13  Jesper Skov  <jskov@redhat.com>
 	Case 103356
 	* include/hal_intr.h (HAL_CLOCK_RESET): Add to decrementer instead
--- a/packages/hal/powerpc/arch/current/include/hal_intr.h
+++ b/packages/hal/powerpc/arch/current/include/hal_intr.h
@@ -354,7 +354,7 @@ externC void cyg_hal_default_exception_v
         "bgt    1f;"                            \
         "mr     %0,%1;"                         \
         "1: mtdec %0;"                          \
-        : "&=r" (tmp)                           \
+        : "=&r" (tmp)                           \
         : "r"(_period_)                         \
         : "cc"                                  \
         );                                      \
--- a/packages/hal/powerpc/cogent/current/ChangeLog
+++ b/packages/hal/powerpc/cogent/current/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-04  Jesper Skov  <jskov@redhat.com>
+
+	* src/hal_diag.c (hal_diag_write_char): Add GDB critical IO region
+	handling.
+
 2000-03-02  Jesper Skov  <jskov@redhat.com>
 
 	* src/hal_diag.c (ai_write_char): fix typos.
--- a/packages/hal/powerpc/cogent/current/src/hal_diag.c
+++ b/packages/hal/powerpc/cogent/current/src/hal_diag.c
@@ -159,7 +159,11 @@ hal_diag_write_char(char c)
         // receive interrupt will be seen when we re-enable interrupts
         // later.
         
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+        CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old);
+#else
         HAL_DISABLE_INTERRUPTS(old);
+#endif
         
         while(1)
         {
@@ -206,7 +210,11 @@ hal_diag_write_char(char c)
         pos = 0;
 
         // And re-enable interrupts
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+        CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old);
+#else
         HAL_RESTORE_INTERRUPTS(old);
+#endif
         
     }
 }
--- a/packages/hal/sh/arch/current/ChangeLog
+++ b/packages/hal/sh/arch/current/ChangeLog
@@ -1,3 +1,18 @@
+2000-04-06  Jesper Skov  <jskov@redhat.com>
+
+	* src/sh.ld (_hal_vsr_table): Get address from platform CDL.
+
+2000-03-31  Jesper Skov  <jskov@redhat.com>
+
+	* include/sh_regs.h: Added bit definitions for BSC.
+
+	* include/sh_regs.h: Replaced hardcoded baud rate constants with
+	a macro which calculates the proper values based on baud rate
+	and CPU clock speed.
+
+	* src/vectors.S: ISR mask tables enabled per CPU variant, not
+	target.
+
 2000-03-20  Jesper Skov  <jskov@redhat.com>
 
 	* include/sh_regs.h: Add definitions for RTC module.
--- a/packages/hal/sh/arch/current/include/hal_intr.h
+++ b/packages/hal/sh/arch/current/include/hal_intr.h
@@ -51,6 +51,7 @@
 //==========================================================================
 
 #include <pkgconf/hal.h>
+#include CYGBLD_HAL_CPU_MODULES_H       // INTC module selection
 
 // More include statements below. First part of this file must be
 // usable for both assembly and C files, so only use defines here.
@@ -127,10 +128,11 @@
 #define CYGNUM_HAL_INTERRUPT_REF_RCMI        30
 #define CYGNUM_HAL_INTERRUPT_REF_ROVI        31
 
+#define CYGNUM_HAL_ISR_MAX                   CYGNUM_HAL_INTERRUPT_REF_ROVI
+
 
 // CYGNUM_HAL_ISR_COUNT must match CYG_ISR_TABLE_SIZE defined in vectors.S.
 #define CYGNUM_HAL_ISR_MIN                   CYGNUM_HAL_INTERRUPT_NMI
-#define CYGNUM_HAL_ISR_MAX                   CYGNUM_HAL_INTERRUPT_REF_ROVI
 #define CYGNUM_HAL_ISR_COUNT                 ( CYGNUM_HAL_ISR_MAX + 1 )
 
 // Exception vectors. These are the values used when passed out to an
@@ -416,6 +418,15 @@ externC cyg_uint8 cyg_hal_ILVL_table[];
         break;                                                           \
                                                                          \
     /* IPRB */                                                           \
+    case CYGNUM_HAL_INTERRUPT_SCI_ERI:                                   \
+    case CYGNUM_HAL_INTERRUPT_SCI_RXI:                                   \
+    case CYGNUM_HAL_INTERRUPT_SCI_TXI:                                   \
+    case CYGNUM_HAL_INTERRUPT_SCI_TEI:                                   \
+        HAL_READ_UINT16(CYGARC_REG_IPRB, iprX);                          \
+        iprX &= ~CYGARC_REG_IPRB_SCI_MASK;                               \
+        iprX |= (_level_)*CYGARC_REG_IPRB_SCI_PRI1;                      \
+        HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX);                         \
+        break;                                                           \
     case CYGNUM_HAL_INTERRUPT_WDT_ITI:                                   \
         HAL_READ_UINT16(CYGARC_REG_IPRB, iprX);                          \
         iprX &= ~CYGARC_REG_IPRB_WDT_MASK;                               \
@@ -429,15 +440,6 @@ externC cyg_uint8 cyg_hal_ILVL_table[];
         iprX |= (_level_)*CYGARC_REG_IPRB_REF_PRI1;                      \
         HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX);                         \
         break;                                                           \
-    case CYGNUM_HAL_INTERRUPT_SCI_ERI:                                   \
-    case CYGNUM_HAL_INTERRUPT_SCI_RXI:                                   \
-    case CYGNUM_HAL_INTERRUPT_SCI_TXI:                                   \
-    case CYGNUM_HAL_INTERRUPT_SCI_TEI:                                   \
-        HAL_READ_UINT16(CYGARC_REG_IPRB, iprX);                          \
-        iprX &= ~CYGARC_REG_IPRB_SCI_MASK;                               \
-        iprX |= (_level_)*CYGARC_REG_IPRB_SCI_PRI1;                      \
-        HAL_WRITE_UINT16(CYGARC_REG_IPRB, iprX);                         \
-        break;                                                           \
                                                                          \
     case CYGNUM_HAL_INTERRUPT_RESERVED_1E0:                              \
     case CYGNUM_HAL_INTERRUPT_RESERVED_3E0:                              \
new file mode 100644
--- /dev/null
+++ b/packages/hal/sh/arch/current/include/sh3_scif.inl
@@ -0,0 +1,298 @@
+#ifndef CYGONCE_HAL_SH3_SCIF_H
+#define CYGONCE_HAL_SH3_SCIF_H
+//=============================================================================
+//
+//      sh3_scif.inl
+//
+//      Simple driver for the SH3 Serial Communication Interface with FIFO
+//
+//=============================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//=============================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):   jskov
+// Contributors:jskov
+// Date:        2000-03-30
+// Description: Simple driver for the SH Serial Communication Interface
+//              The driver can be used for either the SCIF or the IRDA
+//              modules (the latter can act as the former).
+//              Clients of this file can configure the behavior with:
+//              CYG_SCIF_IRDA:   if used for IrDA instead of SCIF
+//              CYG_SCIF_PUBLIC: define to export init, get, and put functions.
+//              CYG_SCIF_STUB:   define to get extra stub functions
+//              CYG_SCIF_NAME_PREFIX: Function prefix. Default is hal_sci_
+//                                    Using different prefixes can be required
+//                                    if both serial ports are used from the
+//                                    same source file.
+//####DESCRIPTIONEND####
+//
+//=============================================================================
+
+#include <pkgconf/hal.h>
+
+#include <cyg/hal/hal_io.h>             // IO macros
+#include <cyg/hal/hal_intr.h>           // HAL_ENABLE/MASK/UNMASK_INTERRUPTS
+#include <cyg/hal/sh_regs.h>            // serial register definitions
+
+#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
+#include <cyg/hal/sh_stub.h>            // target_register_t
+#endif
+
+// Unless explicitly asked to export functions, keep them local.
+#ifndef CYG_SCIF_PUBLIC
+#define CYG_SCIF_PUBLIC static
+#endif
+
+// Function names are prefix with hal_sci_ unless something else is specified.
+#ifndef CYG_SCIF_NAME_PREFIX
+#define CYG_SCIF_NAME_PREFIX hal_scif_
+#endif
+
+//-----------------------------------------------------------------------------
+// Register base.
+// Can be used to drive either the IrDA controller or the SCIF controller
+#ifdef CYG_SCIF_IRDA
+# define SC_BASE (CYGARC_REG_SCSMR1)
+#else
+# define SC_BASE (CYGARC_REG_SCSMR2)
+#endif
+
+#define _SCSMR  (SC_BASE+0)
+#define _SCBRR  (SC_BASE+2)
+#define _SCSCR  (SC_BASE+4)
+#define _SCFTDR (SC_BASE+6)
+#define _SCSSR  (SC_BASE+8)
+#define _SCFRDR (SC_BASE+10)
+#define _SCFCR  (SC_BASE+12)
+#define _SCFDR  (SC_BASE+14)
+
+//-----------------------------------------------------------------------------
+// Name Conversion magic.
+#define Str(x, y) x ## y
+#define Xstr(x, y) Str(x, y)
+#define NC(_name)  Xstr(CYG_SCIF_NAME_PREFIX, _name)
+
+//-----------------------------------------------------------------------------
+// The exported functions.
+// Base:
+CYG_SCIF_PUBLIC void NC(init_serial)( void );
+CYG_SCIF_PUBLIC int  NC(get_char)( void );
+CYG_SCIF_PUBLIC void NC(put_char)( int c );
+// GDB BREAK support:
+#if defined(CYG_SCIF_STUB) && defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
+int  NC(interruptible)( int state );
+void NC(init_break_irq)( void );
+int  cyg_hal_gdb_isr( target_register_t pc ); // called from vectors.S
+#endif
+
+//-----------------------------------------------------------------------------
+// The minimal init, get and put functions. All by polling.
+
+CYG_SCIF_PUBLIC void NC(init_serial)( void )
+{
+    // Disable interrupts.
+#ifdef CYG_SCIF_IRDA
+    // Note: This affects out all IRDA sources, not only RXI1.
+    HAL_INTERRUPT_MASK(CYGNUM_HAL_INTERRUPT_IRDA_RXI1);
+#else
+    // Note: This affects out all SCIF sources, not only RXI2.
+    HAL_INTERRUPT_MASK(CYGNUM_HAL_INTERRUPT_SCIF_RXI2);
+#endif
+
+    // Disable everything.
+    HAL_WRITE_UINT8(_SCSCR, 0);
+
+    // Reset FIFO.
+    HAL_WRITE_UINT8(_SCFCR, CYGARC_REG_SCFCR2_TFRST|CYGARC_REG_SCFCR2_RFRST);
+
+#ifdef CYG_SCIF_IRDA
+    // 8-1-no parity, clear IRMOD.
+    HAL_WRITE_UINT8(_SCSMR, 0);
+#else
+    // 8-1-no parity.
+    HAL_WRITE_UINT8(_SCSMR, 0);
+#endif
+
+#ifndef CYG_HAL_STARTUP_RAM
+    {
+        // Set speed to 38400 - but only if configured for ROM; if
+        // configured for RAM, we could be hosted by either the eCos
+        // stub (running 38400, already initialized) or the Hitachi
+        // ROM (running 9600 - reinitializing to 38400 would cause GDB
+        // to lose the connection).
+        cyg_uint8 tmp;
+        HAL_READ_UINT8(_SCSMR, tmp);
+        tmp &= ~CYGARC_REG_SCSMR2_CKSx_MASK;
+        tmp |= CYGARC_SCBRR2_CKSx(38400);
+        HAL_WRITE_UINT8(_SCSMR, tmp);
+        HAL_WRITE_UINT8(_SCBRR, CYGARC_SCBRR2_N(38400));
+    }
+#endif
+
+    // Let things settle: Here we should should wait the equivalent of
+    // one bit interval, i.e. 1/38400 second, but until we have
+    // something like the Linux jiffies, it's hard to do reliably. So
+    // just move on and hope for the best (this is unlikely to cause
+    // problems since the CPU has just come out of reset anyway).
+
+    // Bring FIFO out of reset and set to trigger on every char in
+    // FIFO (or C-c input would not be processed).
+    HAL_WRITE_UINT8(_SCFCR, CYGARC_REG_SCFCR2_RTRG_1|CYGARC_REG_SCFCR2_TTRG_1);
+
+    // Leave Tx/Rx interrupts disabled, but enable Tx/Rx
+    HAL_WRITE_UINT8(_SCSCR, CYGARC_REG_SCSCR2_TE|CYGARC_REG_SCSCR2_RE);
+}
+
+CYG_SCIF_PUBLIC int NC(get_char)( void )
+{
+    cyg_uint8 c;
+    cyg_uint16 fdr;
+
+    do {
+        HAL_READ_UINT16(_SCFDR, fdr);
+    } while ((fdr & CYGARC_REG_SCFDR2_RCOUNT_MASK) == 0);
+
+    HAL_READ_UINT8(_SCFRDR, c);
+
+    // Clear FIFO full flag.
+    HAL_WRITE_UINT8(_SCSSR,
+                    CYGARC_REG_SCSSR2_CLEARMASK & ~CYGARC_REG_SCSSR2_RDF);
+
+    return c;
+}
+
+CYG_SCIF_PUBLIC void NC(put_char)( int c )
+{
+    cyg_uint16 fdr;
+
+    do {
+        HAL_READ_UINT16(_SCFDR, fdr);
+    } while ((fdr & CYGARC_REG_SCFDR2_TCOUNT_MASK >> CYGARC_REG_SCFDR2_TCOUNT_shift) < 16);
+
+    HAL_WRITE_UINT8(_SCFTDR, c);
+
+    // Clear FIFO-empty/transmit end flags.
+    HAL_WRITE_UINT8(_SCSSR, CYGARC_REG_SCSSR2_CLEARMASK   
+                    & ~(CYGARC_REG_SCSSR2_TDFE | CYGARC_REG_SCSSR2_TEND ));
+
+    // Hang around until the character has been safely sent.
+    do {
+        HAL_READ_UINT16(_SCFDR, fdr);
+    } while ((fdr & CYGARC_REG_SCFDR2_TCOUNT_MASK) == 0);
+}
+
+
+//-----------------------------------------------------------------------------
+// Additional functions required to provide GDB BREAK support.
+
+#if defined(CYG_SCIF_STUB) && defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
+int NC(interruptible)( int state )
+{
+    if (state) {
+#ifdef CYG_SCIF_IRDA
+        // Note: This affects out all IRDA sources, not only RXI1.
+        HAL_INTERRUPT_UNMASK(CYGNUM_HAL_INTERRUPT_IRDA_RXI1);
+#else
+        // Note: This affects out all SCIF sources, not only RXI2.
+        HAL_INTERRUPT_UNMASK(CYGNUM_HAL_INTERRUPT_SCIF_RXI2);
+#endif
+    } else {
+#ifdef CYG_SCIF_IRDA
+        // Note: This affects out all IRDA sources, not only RXI1.
+        HAL_INTERRUPT_MASK(CYGNUM_HAL_INTERRUPT_IRDA_RXI1);
+#else
+        // Note: This affects out all SCIF sources, not only RXI2.
+        HAL_INTERRUPT_MASK(CYGNUM_HAL_INTERRUPT_SCIF_RXI2);
+#endif
+    }
+
+    return 0;
+}
+
+void NC(init_break_irq)( void )
+{
+    cyg_uint8 scr;
+
+    NC(interruptible)(0);
+
+    // Enable serial receive interrupts.
+
+    // Enable Rx interrupts
+    HAL_READ_UINT8(_SCSCR, scr);
+    scr |= CYGARC_REG_SCSCR2_RIE;
+    HAL_WRITE_UINT8(_SCSCR, scr);
+    HAL_ENABLE_INTERRUPTS();
+
+    NC(interruptible)(1);
+}
+
+// This ISR is called from the interrupt handler.
+int cyg_hal_gdb_isr( target_register_t pc )
+{
+    cyg_uint8 c;
+    cyg_uint16 fdr;
+
+    HAL_READ_UINT16(_SCFDR, fdr);
+    if ((fdr & CYGARC_REG_SCFDR2_RCOUNT_MASK) != 0) {
+        HAL_READ_UINT8(_SCFRDR, c);
+
+        // Clear buffer full flag.
+        HAL_WRITE_UINT8(_SCSSR, 
+                        CYGARC_REG_SCSSR2_CLEARMASK & ~CYGARC_REG_SCSSR2_RDF);
+
+        if ( 3 == c )
+        {
+            // Ctrl-C: set a breakpoint at PC so GDB will display the
+            // correct program context when stopping rather than the
+            // interrupt handler.
+            cyg_hal_gdb_interrupt( pc );
+        }
+
+        // Interrupt handled. Don't call ISR proper. At return
+        // from the VSR, execution will stop at the breakpoint
+        // just set.
+        return 0;
+    }
+
+    // Not caused by GDB. Call ISR proper.
+    return 1;
+}
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Undefine all macros used in this file.
+#undef CYG_SCIF_IRDA
+#undef CYG_SCIF_PUBLIC
+#undef CYG_SCIF_STUB
+#undef CYG_SCIF_NAME_PREFIX
+#undef NC
+#undef Str
+#undef Xstr
+
+//-----------------------------------------------------------------------------
+// end of sh3_scif.inl
+#endif // CYGONCE_HAL_SH3_SCIF_INL
--- a/packages/hal/sh/arch/current/include/sh_regs.h
+++ b/packages/hal/sh/arch/current/include/sh_regs.h
@@ -143,6 +143,87 @@
 #define CYGARC_REG_BCR1_DRAMTP1         0x0008
 #define CYGARC_REG_BCR1_DRAMTP0         0x0004
 
+// Bus widths for areas
+#define CYGARC_REG_BCR2_A6_8            0x1000
+#define CYGARC_REG_BCR2_A6_16           0x2000
+#define CYGARC_REG_BCR2_A6_32           0x3000
+#define CYGARC_REG_BCR2_A5_8            0x0400
+#define CYGARC_REG_BCR2_A5_16           0x0800
+#define CYGARC_REG_BCR2_A5_32           0x0c00
+#define CYGARC_REG_BCR2_A4_8            0x0100
+#define CYGARC_REG_BCR2_A4_16           0x0200
+#define CYGARC_REG_BCR2_A4_32           0x0300
+#define CYGARC_REG_BCR2_A3_8            0x0040
+#define CYGARC_REG_BCR2_A3_16           0x0080
+#define CYGARC_REG_BCR2_A3_32           0x00c0
+#define CYGARC_REG_BCR2_A2_8            0x0010
+#define CYGARC_REG_BCR2_A2_16           0x0020
+#define CYGARC_REG_BCR2_A2_32           0x0030
+
+// Memory type selection and other IO behavior controls
+#define CYGARC_REG_BCR1_PULA            0x8000 // Pin A25 to A0 Pull-Up
+#define CYGARC_REG_BCR1_PULD            0x4000 // Pin D31 to D0 Pull-Up
+#define CYGARC_REG_BCR1_HIZMEM          0x2000 // Hi-Z memory control
+#define CYGARC_REG_BCR1_HIZCNT          0x1000 // High-Z Control
+#define CYGARC_REG_BCR1_ENDIAN          0x0800 // Endian Flag
+#define CYGARC_REG_BCR1_A0_BST_MASK     0x0600 // Area 0 Burst ROM Control
+#define CYGARC_REG_BCR1_A0_BST_4        0x0200
+#define CYGARC_REG_BCR1_A0_BST_8        0x0400
+#define CYGARC_REG_BCR1_A0_BST_16       0x0600
+#define CYGARC_REG_BCR1_A5_BST_MASK     0x0180 // Area 5 Burst ROM Control
+#define CYGARC_REG_BCR1_A5_BST_4        0x0080
+#define CYGARC_REG_BCR1_A5_BST_8        0x0100
+#define CYGARC_REG_BCR1_A5_BST_16       0x0180
+#define CYGARC_REG_BCR1_A6_BST_MASK     0x0060 // Area 6 Burst ROM Control
+#define CYGARC_REG_BCR1_A6_BST_4        0x0020
+#define CYGARC_REG_BCR1_A6_BST_8        0x0040
+#define CYGARC_REG_BCR1_A6_BST_16       0x0060
+#define CYGARC_REG_BCR1_DRAMTP_MASK     0x001c // Area 2, Area 3 Memory Type
+#define CYGARC_REG_BCR1_A5PCM           0x0002 // Area 5 Bus Type
+#define CYGARC_REG_BCR1_A6PCM           0x0001 // Area 6 Bus Type
+
+// Intercycle wait states
+#define CYGARC_REG_WCR1_WAITSEL         0x8000 // WAIT Sampling Timing Select
+#define CYGARC_REG_WCR1_A6I_MASK        0x3000 // Intercycle Idle Specification
+#define CYGARC_REG_WCR1_A6I_SHIFT       12
+#define CYGARC_REG_WCR1_A5I_MASK        0x0c00
+#define CYGARC_REG_WCR1_A5I_SHIFT       10
+#define CYGARC_REG_WCR1_A4I_MASK        0x0300
+#define CYGARC_REG_WCR1_A4I_SHIFT       8
+#define CYGARC_REG_WCR1_A3I_MASK        0x00c0
+#define CYGARC_REG_WCR1_A3I_SHIFT       6
+#define CYGARC_REG_WCR1_A2I_MASK        0x0030
+#define CYGARC_REG_WCR1_A2I_SHIFT       4
+#define CYGARC_REG_WCR1_A0I_MASK        0x0003
+#define CYGARC_REG_WCR1_A0I_SHIFT       0
+
+#define CYGARC_REG_WCR1_1WS         1
+#define CYGARC_REG_WCR1_2WS         2
+#define CYGARC_REG_WCR1_3WS         3
+
+
+// Wait states
+#define CYGARC_REG_WCR2_A6_MASK         0xe000 // Wait states + burst pitch
+#define CYGARC_REG_WCR2_A6_SHIFT        13
+#define CYGARC_REG_WCR2_A5_MASK         0x1c00 // Wait states + burst pitch
+#define CYGARC_REG_WCR2_A5_SHIFT        10
+#define CYGARC_REG_WCR2_A4_MASK         0x0380 // Wait states
+#define CYGARC_REG_WCR2_A4_SHIFT        7
+#define CYGARC_REG_WCR2_A3_MASK         0x0060 // Wait states / CAS latency
+#define CYGARC_REG_WCR2_A3_SHIFT        5
+#define CYGARC_REG_WCR2_A2_MASK         0x0018 // Wait states / CAS latency
+#define CYGARC_REG_WCR2_A2_SHIFT        3
+#define CYGARC_REG_WCR2_A0_MASK         0x0007 // Wait states + burst pitch
+#define CYGARC_REG_WCR2_A0_SHIFT        0
+
+#define CYGARC_REG_WCR2_1WS             1
+#define CYGARC_REG_WCR2_2WS             2
+#define CYGARC_REG_WCR2_3WS             3
+#define CYGARC_REG_WCR2_4WS             4
+#define CYGARC_REG_WCR2_6WS             5
+#define CYGARC_REG_WCR2_8WS             6
+#define CYGARC_REG_WCR2_10WS            7
+
 
 
 //++++++ Module UBC ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -263,6 +344,7 @@
 #define CYGARC_REG_IPRB_SCI_MASK        0x00f0
 #define CYGARC_REG_IPRB_SCI_PRI1        0x0010
 
+
 //++++++ Module RTC ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 //--------------------------------------------------------------------------
@@ -353,53 +435,17 @@
 // to prevent other bits than the one of interest to be cleared.
 #define CYGARC_REG_SCSSR_CLEARMASK      0xf8
 
-// FIXME: Let config control this
 // Baud rate values calculated for peripheral clock = 15MHz (Pf = 15). 
 // n is CKS setting (0-3)
-// N = (Pf/(64^(n-1)*B))*10^6-1
+// N = (Pf/(64*2^(2n-1)*B))*10^6-1
 // E(%) = ((Pf*10^6/((N+1)*B*(64^(n-1)))-1)*100
-#define CYGARC_REG_SCBRR_50
-#define CYGARC_REG_CKSx_50
-#define CYGARC_REG_SCBRR_75
-#define CYGARC_REG_CKSx_75
-#define CYGARC_REG_SCBRR_110
-#define CYGARC_REG_CKSx_110
-#define CYGARC_REG_SCBRR_134_5
-#define CYGARC_REG_CKSx_134_5
-#define CYGARC_REG_SCBRR_150
-#define CYGARC_REG_CKSx_150
-#define CYGARC_REG_SCBRR_200
-#define CYGARC_REG_CKSx_200
-#define CYGARC_REG_SCBRR_300
-#define CYGARC_REG_CKSx_300
-#define CYGARC_REG_SCBRR_600
-#define CYGARC_REG_CKSx_600
-#define CYGARC_REG_SCBRR_1200
-#define CYGARC_REG_CKSx_1200
-#define CYGARC_REG_SCBRR_1800
-#define CYGARC_REG_CKSx_1800
-#define CYGARC_REG_SCBRR_2400
-#define CYGARC_REG_CKSx_2400
-#define CYGARC_REG_SCBRR_3600
-#define CYGARC_REG_CKSx_3600
-#define CYGARC_REG_SCBRR_4800           97
-#define CYGARC_REG_CKSx_4800            0
-#define CYGARC_REG_SCBRR_7200
-#define CYGARC_REG_CKSx_7200
-#define CYGARC_REG_SCBRR_9600           48
-#define CYGARC_REG_CKSx_9600            0
-#define CYGARC_REG_SCBRR_14400          32
-#define CYGARC_REG_CKSx_14400           0
-#define CYGARC_REG_SCBRR_19200          23
-#define CYGARC_REG_CKSx_19200           0
-#define CYGARC_REG_SCBRR_38400          11
-#define CYGARC_REG_CKSx_38400           0
-#define CYGARC_REG_SCBRR_57600          7
-#define CYGARC_REG_CKSx_57600           0
-#define CYGARC_REG_SCBRR_115200         3
-#define CYGARC_REG_CKSx_115200          0
-#define CYGARC_REG_SCBRR_234000
-#define CYGARC_REG_CKSx_234000
+//  So this macro is only valid when serial is configured for n=0:
+//       N = (Pf/(32*B))*10^6-1
+#define CYGARC_SCBRR_N(_b_)     \
+    (((_b_) < 4800) ? 0 :       \
+      ((_b_) > 115200) ? 0 :    \
+       (CYGHWR_HAL_SH_BOARD_SPEED*1000000/(32*(_b_))-1))
+#define CYGARC_SCBRR_CKSx(_b_) 0
 
 
 
--- a/packages/hal/sh/arch/current/src/sh.ld
+++ b/packages/hal/sh/arch/current/src/sh.ld
@@ -119,8 +119,8 @@ GROUP(libtarget.a libgcc.a)
 
 #include <pkgconf/system.h>
 #include CYGHWR_MEMORY_LAYOUT_LDI
+#include CYGBLD_HAL_PLATFORM_H
 
-// Define VSR table to reside at fixed address. This address will
-// probably have to be platform specific...
-_hal_vsr_table = 0x08000000;
+// Define VSR table to reside at fixed address.
+_hal_vsr_table = CYGHWR_HAL_VSR_TABLE;
 
--- a/packages/hal/sh/arch/current/src/vectors.S
+++ b/packages/hal/sh/arch/current/src/vectors.S
@@ -675,7 +675,7 @@ 2:
 
 #ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING
 
-#ifdef CYGPKG_HAL_SH_EDK7708
+#if defined(CYGPKG_HAL_SH_7708) || defined(CYGPKG_HAL_SH_7709A)
         # The interrupt mask bits in the SR are not updated by the
         # CPU. Proper nested operation requires the level to be
         # found and put in the SR.
@@ -964,11 +964,11 @@ 2:
 
         # The rest of the table consists of programmable levels, maintained
         # by the HAL_INTERRUPT_SET_LEVEL macro.
-#ifdef CYGPKG_HAL_SH_EDK7708
+#if defined(CYGPKG_HAL_SH_7708) || defined(CYGPKG_HAL_SH_7709A)
         .rept   (CYGNUM_HAL_ISR_MAX-CYGNUM_HAL_INTERRUPT_RESERVED_3E0)
         .byte   0xf
         .endr
-#endif // CYGPKG_HAL_SH_EDK7708
+#endif // CYGPKG_HAL_SH_7708 || CYGPKG_HAL_SH_7709A
 #endif // CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING
 
 #---------------------------------------------------------------------------
--- a/packages/hal/sh/edk/current/ChangeLog
+++ b/packages/hal/sh/edk/current/ChangeLog
@@ -1,3 +1,21 @@
+2000-04-06  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* cdl/hal_sh_edk7708.cdl: Use -g now that toolchains work with that
+	(and in fact new toolchains no longer work with -ggdb)
+
+2000-04-06  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/hal_sh_edk7708.cdl: Define vsr base location.
+
+2000-04-04  Jesper Skov  <jskov@redhat.com>
+
+	* src/hal_diag.c (hal_diag_write_char): Add GDB critical IO region
+	handling.
+
+2000-03-20  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/hal_sh_edk7708.cdl: Added board speed variable.
+
 2000-03-09  Jesper Skov  <jskov@redhat.com>
 
 	* src/hal_diag.c: Fix compiler warning.
--- a/packages/hal/sh/edk/current/cdl/hal_sh_edk7708.cdl
+++ b/packages/hal/sh/edk/current/cdl/hal_sh_edk7708.cdl
@@ -57,6 +57,8 @@ cdl_package CYGPKG_HAL_SH_EDK7708 {
     define_proc {
         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_sh.h>"
         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_sh_edk7708.h>"
+
+        puts $::cdl_header "#define CYGHWR_HAL_VSR_TABLE 0x08000000"
     }
 
     cdl_component CYG_HAL_STARTUP {
@@ -77,6 +79,14 @@ cdl_package CYGPKG_HAL_SH_EDK7708 {
            equivalent technology."
     }
 
+    cdl_option CYGHWR_HAL_SH_BOARD_SPEED {
+        display          "Development board clock speed (MHz)"
+        flavor           data
+        calculated       15
+        description      "
+           The EDK/7708 board uses a 15MHz crystal."
+   }
+
     # Real-time clock/counter specifics
     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
         display       "Real-time clock constants."
@@ -100,7 +110,7 @@ cdl_package CYGPKG_HAL_SH_EDK7708 {
         cdl_option CYGNUM_HAL_RTC_PERIOD {
             display       "Real-time clock period"
             flavor        data
-           calculated     37500
+            calculated    { CYGHWR_HAL_SH_BOARD_SPEED*1000000/CYGNUM_HAL_RTC_DENOMINATOR/4 }
         }
     }
 
@@ -127,7 +137,7 @@ cdl_package CYGPKG_HAL_SH_EDK7708 {
             display "Global compiler flags"
             flavor  data
             no_define
-            default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" : "-ml -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
+              default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" : "-ml -m3 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -ggdb -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
             description   "
                 This option controls the global compiler flags which
                 are used to compile all packages by
@@ -139,7 +149,7 @@ cdl_package CYGPKG_HAL_SH_EDK7708 {
             display "Global linker flags"
             flavor  data
             no_define
-            default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" : "-ml -m3 -ggdb -nostdlib -Wl,--gc-sections -Wl,-static" }
+            default_value { CYGHWR_HAL_SH_BIGENDIAN ? "-mb -m3 -nostdlib -Wl,--gc-sections -Wl,-static" : "-ml -m3 -nostdlib -Wl,--gc-sections -Wl,-static" }
             description   "
                 This option controls the global linker flags. Individual
                 packages may define options which override these global flags."
--- a/packages/hal/sh/edk/current/src/hal_diag.c
+++ b/packages/hal/sh/edk/current/src/hal_diag.c
@@ -97,7 +97,11 @@ hal_diag_write_char(char c)
         // receive interrupt will be seen when we re-enable interrupts
         // later.
         
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+        CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old);
+#else
         HAL_DISABLE_INTERRUPTS(old);
+#endif
         
         while(1)
         {
@@ -140,7 +144,11 @@ hal_diag_write_char(char c)
         pos = 0;
 
         // And re-enable interrupts
+#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
+        CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old);
+#else
         HAL_RESTORE_INTERRUPTS(old);
+#endif
         
     }
 }
--- a/packages/infra/current/cdl/startup.cdl
+++ b/packages/infra/current/cdl/startup.cdl
@@ -93,3 +93,4 @@ cdl_option CYGSEM_START_UITRON_COMPATIBI
         you must call cyg_uitron_start() from your own
         cyg_package_start() or cyg_userstart()."
 }
+
--- a/packages/infra/current/src/pkgstart.cxx
+++ b/packages/infra/current/src/pkgstart.cxx
@@ -67,6 +67,7 @@
 # include <cyg/compat/uitron/uit_func.h>
 #endif
 
+
 // FUNCTION PROTOTYPES
 
 externC void
@@ -86,6 +87,7 @@ cyg_package_start( void )
     cyg_uitron_start();
 #endif
 
+    
 #ifdef CYGSEM_START_ISO_C_COMPATIBILITY
     // This works even if the kernel is there, but if not, then it
     // calls the user main() and doesn't return until it does!
--- a/packages/io/serial/current/ChangeLog
+++ b/packages/io/serial/current/ChangeLog
@@ -1,3 +1,21 @@
+2000-04-07  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* src/common/tty.c (tty_read): Correct handling of modes with newlines
+
+2000-04-05  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* src/common/tty.c (tty_read): CRLF conversion should use \r\n not \n\r
+	(tty_write): Similarly
+
+	* include/ttyio.h: Update CYG_TTY_IN_FLAGS_CRLF and
+	CYG_TTY_IN_FLAGS_CRLF to match
+
+2000-03-31  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/ser_sh_edk7708.cdl: Limit legal baud rate range.
+	* src/sh/sh_sci_serial.c: Use baud rate macro instead of hardwired
+	constants.
+
 2000-03-28  John Dallaway  <jld@cygnus.co.uk>
 
 	* cdl/io_serial.cdl,
--- a/packages/io/serial/current/cdl/ser_sh_edk7708.cdl
+++ b/packages/io/serial/current/cdl/ser_sh_edk7708.cdl
@@ -57,9 +57,7 @@ cdl_component CYGPKG_IO_SERIAL_SH_EDK770
     cdl_option CYGNUM_IO_SERIAL_SH_EDK7708_SCI_BAUD {
         display       "Baud rate for the SH SCI driver"
         flavor        data
-        legal_values  { 50 75 110 "134_5" 150 200 300 600 1200 1800 2400 3600
-                      4800 7200 9600 14400 19200 38400 57600 115200 234000
-        }
+        legal_values  { 4800 9600 14400 19200 38400 57600 115200 }
         default_value 38400
         description   "
             This option specifies the default baud rate (speed) for the 
--- a/packages/io/serial/current/include/ttyio.h
+++ b/packages/io/serial/current/include/ttyio.h
@@ -60,13 +60,13 @@ typedef struct {
 } cyg_tty_info_t;
 
 // TTY flags - used to control behaviour when sending data to tty
-#define CYG_TTY_OUT_FLAGS_CRLF  0x0001  // Map '\n' => '\n\r' on output
+#define CYG_TTY_OUT_FLAGS_CRLF  0x0001  // Map '\n' => '\r\n' on output
 
 #define CYG_TTY_OUT_FLAGS_DEFAULT (CYG_TTY_OUT_FLAGS_CRLF)
 
 // TTY flags - used to control behaviour when receiving data from tty
 #define CYG_TTY_IN_FLAGS_CR      0x0001  // Map '\r' => '\n' on input
-#define CYG_TTY_IN_FLAGS_CRLF    0x0002  // Map '\n\r' => '\n' on input
+#define CYG_TTY_IN_FLAGS_CRLF    0x0002  // Map '\r\n' => '\n' on input
 #define CYG_TTY_IN_FLAGS_ECHO    0x0004  // Echo characters as processed
 #define CYG_TTY_IN_FLAGS_BINARY  0x0008  // No input processing
 
--- a/packages/io/serial/current/src/common/tty.c
+++ b/packages/io/serial/current/src/common/tty.c
@@ -166,11 +166,12 @@ tty_write(cyg_io_handle_t handle, const 
     bytes_successful = 0;
     actually_written = 0;
     while (bytes_successful++ < *len) {
-        xbuf[size++] = (c = *buf++);
+        c = *buf++;
         if ((c == '\n') &&
             (priv->dev_info.tty_out_flags & CYG_TTY_OUT_FLAGS_CRLF)) {
             xbuf[size++] = '\r';
         }
+        xbuf[size++] = c;
         // Always leave room for possible CR/LF expansion
         if ((size == (BUFSIZE-1)) ||
             (bytes_successful == *len)) {
@@ -209,7 +210,9 @@ tty_read(cyg_io_handle_t handle, void *_
         }
         buf[size++] = c;
         if ((priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_BINARY) == 0) {
-            if ((c == '\b') || (c == 0x7F)) {
+            switch (c) {
+            case '\b':    /* drop through */
+            case 0x7f:
                 size -= 2;  // erase one character + 'backspace' char
                 if (size < 0) {
                     size = 0;
@@ -217,21 +220,35 @@ tty_read(cyg_io_handle_t handle, void *_
                     clen = 3;
                     cyg_io_write(chan, "\b \b", &clen);
                 }
-            } else if ((c == '\n') || (c == '\r')) {
-                clen = 2;
-                if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_ECHO) {
-                    cyg_io_write(chan, "\n\r", &clen);
+                break;
+            case '\r':
+                if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_CRLF) {
+                    /* Don't do anything because a '\n' will come next */
+                    break;
                 }
-                if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_CRLF) {
+                if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_CR) {
                     c = '\n';  // Map CR -> LF
                 }
+                /* drop through */
+            case '\n':
+                if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_ECHO) {
+                    if (priv->dev_info.tty_out_flags & CYG_TTY_OUT_FLAGS_CRLF) {
+                        clen = 2;
+                        cyg_io_write(chan, "\r\n", &clen);
+                    } else {
+                        clen = 1;
+                        cyg_io_write(chan, &c, &clen);
+                    }
+                }
                 buf[size-1] = c;
-                break;
-            } else {
+                *len = size;
+                return ENOERR;
+            default:
                 if (priv->dev_info.tty_in_flags & CYG_TTY_IN_FLAGS_ECHO) {
                     clen = 1;
                     cyg_io_write(chan, &c, &clen);
                 }
+                break;
             }
         }
     }
--- a/packages/io/serial/current/src/sh/sh_sci_serial.c
+++ b/packages/io/serial/current/src/sh/sh_sci_serial.c
@@ -91,27 +91,27 @@ static short select_parity[] = {
 
 static unsigned short select_baud[] = {
     0,    // Unused
-    0, // 50
-    0,    // 75
-    0, // 110
-    0,    // 134.5
-    0, // 150
-    0,    // 200
-    0,  // 300
-    0,  // 600
-    0,  // 1200
-    0,    // 1800
-    0,   // 2400
-    0,    // 3600
-    0,   // 4800
-    0,   // 7200
-    CYGARC_REG_CKSx_9600<<8|CYGARC_REG_SCBRR_9600,   // 9600
-    CYGARC_REG_CKSx_14400<<8|CYGARC_REG_SCBRR_14400,   // 14400
-    CYGARC_REG_CKSx_19200<<8|CYGARC_REG_SCBRR_19200,   // 19200
-    CYGARC_REG_CKSx_38400<<8|CYGARC_REG_SCBRR_38400, // 38400
-    CYGARC_REG_CKSx_57600<<8|CYGARC_REG_SCBRR_57600,    // 57600
-    CYGARC_REG_CKSx_115200<<8|CYGARC_REG_SCBRR_115200,    // 115200
-    0,    // 230400
+    CYGARC_SCBRR_CKSx(50)<<8 | CYGARC_SCBRR_N(50),
+    CYGARC_SCBRR_CKSx(75)<<8 | CYGARC_SCBRR_N(75),
+    CYGARC_SCBRR_CKSx(110)<<8 | CYGARC_SCBRR_N(110),
+    CYGARC_SCBRR_CKSx(134)<<8 | CYGARC_SCBRR_N(134),
+    CYGARC_SCBRR_CKSx(150)<<8 | CYGARC_SCBRR_N(150),
+    CYGARC_SCBRR_CKSx(200)<<8 | CYGARC_SCBRR_N(200),
+    CYGARC_SCBRR_CKSx(300)<<8 | CYGARC_SCBRR_N(300),
+    CYGARC_SCBRR_CKSx(600)<<8 | CYGARC_SCBRR_N(600),
+    CYGARC_SCBRR_CKSx(1200)<<8 | CYGARC_SCBRR_N(1200),
+    CYGARC_SCBRR_CKSx(1800)<<8 | CYGARC_SCBRR_N(1800),
+    CYGARC_SCBRR_CKSx(2400)<<8 | CYGARC_SCBRR_N(2400),
+    CYGARC_SCBRR_CKSx(3600)<<8 | CYGARC_SCBRR_N(3600),
+    CYGARC_SCBRR_CKSx(4800)<<8 | CYGARC_SCBRR_N(4800),
+    CYGARC_SCBRR_CKSx(7200)<<8 | CYGARC_SCBRR_N(7200),
+    CYGARC_SCBRR_CKSx(9600)<<8 | CYGARC_SCBRR_N(9600),
+    CYGARC_SCBRR_CKSx(14400)<<8 | CYGARC_SCBRR_N(14400),
+    CYGARC_SCBRR_CKSx(19200)<<8 | CYGARC_SCBRR_N(19200),
+    CYGARC_SCBRR_CKSx(38400)<<8 | CYGARC_SCBRR_N(38400),
+    CYGARC_SCBRR_CKSx(57600)<<8 | CYGARC_SCBRR_N(57600),
+    CYGARC_SCBRR_CKSx(115200)<<8 | CYGARC_SCBRR_N(115200),
+    CYGARC_SCBRR_CKSx(230400)<<8 | CYGARC_SCBRR_N(230400)
 };
 
 
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/ChangeLog
@@ -0,0 +1,211 @@
+2000-04-06  Jonathan Larmour  <jlarmour@redhat.co.uk>
+
+	* tests/wallclock2.cxx: Test correct libc feature CDL
+
+2000-04-05  John Dallaway  <jld@cygnus.co.uk>
+
+	* cdl/wallclock.cdl:
+
+	Implement wallclock implementations as radio buttons.
+
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* tests/wallclock.cxx: 
+	Increase precision of test.
+	
+	* src/wallclock.cxx: 
+	* src/emulate.cxx: 
+	* tests/wallclock.cxx: 
+	* tests/wallclock2.cxx: 
+
+	* Moved common code, emulation device and tests to io/wallclock.
+
+2000-04-04  Jesper Skov  <jskov@redhat.com>
+
+	* tests/wallclock2.cxx: Include testcase.h before conditional NA.
+
+2000-03-29  Jesper Skov  <jskov@redhat.com>
+
+	* tests/wallclock2.cxx:
+	* include/wallclock.hxx:
+	* src/sh3.cxx: 
+	* src/wallclock.cxx: 
+	* cdl/wallclock.cdl:
+	Reworked WallClock API. It should now be simpler to add new
+	wallclock drivers. Added a simple test to print out the current
+	wallclock value so a human can verify battery backup works.
+
+2000-03-17  Jesper Skov  <jskov@redhat.com>
+
+	* cdl/wallclock.cdl: 
+	* src/sh3.cxx: 
+	Added wallclock driver for SH3 RTC module.
+
+2000-01-31 Simon FitzMaurice  <sdf@cygnus.co.uk>
+  * cdl/wallclock.cdl:
+
+  Adjust help URLs in line with new doc layout.
+
+2000-01-28 Simon FitzMaurice  <sdf@cygnus.co.uk>
+  * cdl/wallclock.cdl:
+
+  Adjust help URLs in line with new doc layout.
+
+2000-01-19  Hugo Tyson  <hmt@cygnus.co.uk>
+
+	* cdl/*.cdl: Add descriptions to a number of options &c which were
+	lacking same, also tidied up other typos as noticed en passant.
+
+1999-11-03  John Dallaway  <jld@cygnus.co.uk>
+
+	* cdl/wallclock.cdl: Define build options.
+
+1999-07-14  Jesper Skov  <jskov@cygnus.co.uk>
+
+	* src/emulate.cxx: Include pkgconf/kernel.h.
+
+1999-04-20  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* tests/wallclock.cxx (cyg_start): Output message to show the test
+	has started
+	(wallclock_thread): Add call to CYG_TEST_STILL_ALIVE, so the user
+	can see that the test is still running.
+	Fix for PR 19870
+
+1999-04-12  John Dallaway  <jld@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h: Add cdl_package doc attribute.
+
+1999-04-07  Jesper Skov  <jskov@cygnus.co.uk>
+        PR 19667
+	* tests/wallclock.cxx (cyg_start): 
+	Changed to use the new Cyg_Thread constructor.
+
+1999-03-22  Hugo Tyson  <hmt@cygnus.co.uk>
+
+	* tests/wallclock.cxx: 
+	Use CYGNUM_HAL_STACK_SIZE_TYPICAL for the stack size instead of
+	CYGNUM_HAL_MINIMUM_STACK_SIZE.
+
+1999-03-12  Hugo Tyson  <hmt@cygnus.co.uk>
+
+	* tests/wallclock.cxx: 
+	Deal with CYGNUM_HAL_MINIMUM_STACK_SIZE requirement.
+
+
+1999-03-05  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* include/wallclock.hxx:
+	Remove dependency on cyg/kernel/ktypes.h
+	Tidy
+
+	* src/emulate.cxx:
+	Include cyg/kernel/ktypes.h since it isn't included in wallclock.hxx
+	any more
+
+1999-03-04  Gary Thomas  <gthomas@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h: Make package stand-alone (no "DEVICES").
+
+1999-02-02  Jesper Skov  <jskov@cygnus.co.uk>
+        PR 18970
+	* tests/wallclock.cxx (LOOPS_SIM): Only do two loops on
+	SIM. MN10300 sim takes 1min15secs to do one loop.
+
+1999-01-26  Jesper Skov  <jskov@cygnus.co.uk>
+        (PR 18305)
+	* tests/wallclock.cxx: Removed MIPS specific hackery. Now
+	dependent on cyg_test_is_simulator state.
+
+1999-01-21  Jesper Skov  <jskov@cygnus.co.uk>
+        PR 18847
+	* tests/wallclock.cxx (LOOPS_HW): Reduce run-time to 20 seconds.
+
+1999-01-19  Nick Garnett  <nickg@cygnus.co.uk>
+
+	* tests/wallclock.cxx: Added test of cyg_test_is_simulator to
+	reduce time on simulated hardware. PR 18715.
+
+1998-12-17  Jesper Skov  <jskov@cygnus.co.uk>
+
+	* tests/wallclock.cxx: Do NOP test if kernel RTC disabled.
+
+1998-10-23  Jesper Skov  <jskov@cygnus.co.uk>
+
+	* tests/wallclock.cxx: Reduce test time on TX39 SIM.
+
+Tue Oct 20 15:54:09 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* src/PKGconf.mak: 
+	Remove unnecessary override of PKGCONF_CXXFLAGS
+
+1998-09-26  Bart Veer  <bartv@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h:
+	PR17501: When using the emulation there is a requirement on the
+	kernel clock. This has been added to the configuration data.
+	If real hardware were used then this dependency would disappear,
+	but currently there is no easy way to express this, and there are
+	no hardware implementations.
+
+1998-09-12  Bart Veer  <bartv@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h:
+	Added missing descriptions (PR 17184)
+
+1998-09-02  Bart Veer  <bartv@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h:
+	Added minimal configuration data.
+
+Fri Aug 28 09:40:19 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* tests/wallclock.cxx:
+	Rename int main(argc, argv) to void cyg_start( void ) under the
+	new entry point system. Therefore also remove return code.
+	
+Tue Aug 18 16:49:20 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* tests/wallclock.cxx: 
+	Move inclusion of thread.inl before sched.hxx to prevent inline
+	warnings
+
+1998-07-31  Nick Garnett  <nickg@cygnus.co.uk>
+
+	* include/pkgconf/wallclock.h:
+	Added this file to contain wallclock confiuration parameters.
+	
+	* src/emulate.cxx: 
+	Now uses pkgconf/wallclock.h for configuration.
+
+Wed Jul 22 21:04:15 1998  Jonathan Larmour  <jlarmour@cygnus.co.uk>
+
+	* src/emulate.cxx: 
+	Remove unnecessary include of <cyg/devs/table.h> and remove an
+	unused variable (result) from get_current_time()
+
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+
+
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/cdl/wallclock.cdl
@@ -0,0 +1,134 @@
+# ====================================================================
+#
+#      wallclock.cdl
+#
+#      eCos wallclock configuration data
+#
+# ====================================================================
+#####COPYRIGHTBEGIN####
+#                                                                          
+# -------------------------------------------                              
+# The contents of this file are subject to the Red Hat eCos Public License 
+# Version 1.1 (the "License"); you may not use this file except in         
+# compliance with the License.  You may obtain a copy of the License at    
+# http://www.redhat.com/                                                   
+#                                                                          
+# Software distributed under the License is distributed on an "AS IS"      
+# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+# License for the specific language governing rights and limitations under 
+# the License.                                                             
+#                                                                          
+# The Original Code is eCos - Embedded Configurable Operating System,      
+# released September 30, 1998.                                             
+#                                                                          
+# The Initial Developer of the Original Code is Red Hat.                   
+# Portions created by Red Hat are                                          
+# Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+# All Rights Reserved.                                                     
+# -------------------------------------------                              
+#                                                                          
+#####COPYRIGHTEND####
+# ====================================================================
+######DESCRIPTIONBEGIN####
+#
+# Author(s):      jskov
+# Original data:  nickg
+# Contributors:
+# Date:           1999-07-13
+#
+#####DESCRIPTIONEND####
+#
+# ====================================================================
+
+cdl_package CYGPKG_IO_WALLCLOCK {
+    display       "Wallclock device"
+    include_dir   cyg/io
+    define_header wallclock.h
+    description   "
+        The wallclock device provides real time stamps, as opposed
+        to the eCos kernel timers which typically just count the
+        number of clock ticks since the hardware was powered up.
+        Depending on the target platform this device may involve
+        interacting with a suitable clock chip, or it may be
+        emulated by using the kernel timers."
+
+    compile       wallclock.cxx
+
+    cdl_interface CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS {
+        display       "Number of wallclock hardware implementations"
+    }
+
+    cdl_interface CYGINT_WALLCLOCK_IMPLEMENTATIONS {
+        display       "Number of wallclock implementations"
+        requires      1 == CYGINT_WALLCLOCK_IMPLEMENTATIONS
+    }
+
+    cdl_component CYGPKG_IO_WALLCLOCK_IMPLEMENTATION {
+        display "Wallclock implementation"
+        flavor none
+        no_define
+        description "Implementations of the wallclock device."
+
+        cdl_option CYGPKG_WALLCLOCK_EMULATE {
+            default_value { 0 == CYGINT_WALLCLOCK_HW_IMPLEMENTATIONS }
+            display       "Wallclock emulator"
+            implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
+            compile       emulate.cxx
+            define_proc {
+                puts $::cdl_header "#undef CYGSEM_WALLCLOCK_SET_GET_MODE"
+            }
+            description   "
+                When this option is enabled, a wallclock device will be
+                emulated using the kernel real-time clock."
+        }
+
+        cdl_option CYGIMP_WALLCLOCK_NONE {
+            display       "No wallclock"
+            default_value 0
+            implements    CYGINT_WALLCLOCK_IMPLEMENTATIONS
+            description   "Disables the wallclock."
+        }
+    }
+
+    cdl_component CYGPKG_IO_WALLCLOCK_OPTIONS {
+        display "Wallclock build options"
+        flavor  none
+        description   "
+	    Package specific build options including control over
+	    compiler flags used only in building this package,
+	    and details of which tests are built."
+
+
+        cdl_option CYGPKG_IO_WALLCLOCK_CFLAGS_ADD {
+            display "Additional compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are used in addition
+                to the set of global flags."
+        }
+
+        cdl_option CYGPKG_IO_WALLCLOCK_CFLAGS_REMOVE {
+            display "Supressed compiler flags"
+            flavor  data
+            no_define
+            default_value { "" }
+            description   "
+                This option modifies the set of compiler flags for
+                building the wallclock device. These flags are removed from
+                the set of global flags if present."
+        }
+
+        cdl_option CYGPKG_IO_WALLCLOCK_TESTS {
+            display "Wallclock tests"
+            flavor  data
+            no_define
+            calculated { "tests/wallclock tests/wallclock2" }
+            description   "
+                This option specifies the set of tests for the
+                wallclock device."
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/include/wallclock.hxx
@@ -0,0 +1,146 @@
+#ifndef CYGONCE_IO_WALLCLOCK_HXX
+#define CYGONCE_IO_WALLCLOCK_HXX
+
+//==========================================================================
+//
+//      wallclock.hxx
+//
+//      Wallclock interface declaration
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     nickg
+// Contributors:  nickg
+// Date:          1999-03-05
+// Purpose:       Wall Clock declarations
+// Description:   This file defines the interface to the wall clock device
+//                that provides real time stamps. Actual implementations of
+//                this driver can be found in devs/wallclock.
+// Usage:         #include <cyg/io/wallclock.hxx>
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <cyg/infra/cyg_type.h>
+
+// -------------------------------------------------------------------------
+// Wallclock class
+
+class Cyg_WallClock
+{
+
+public:
+
+    Cyg_WallClock();
+
+    // Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+    // This may involve reading the hardware, so it may take anything
+    // up to a second to complete.
+    cyg_uint32 get_current_time();
+
+    // Sets the clock. Argument is seconds elapsed since 1970-01-01 00:00:00.
+    // This may involve writing to the hardware, so it may take
+    // anything up to a second to complete.
+    void set_current_time( cyg_uint32 time_stamp );
+
+    // A static pointer to the single system defined wall clock device.
+    static Cyg_WallClock *wallclock;
+
+private:
+
+    // Functions implemented by the hardware-specific part of the
+    // driver.
+
+    // Note: While the API specifies elapsed time since 1970-01-01
+    // 00:00:00 this is only an actual requirement if the driver is
+    // used in set-get mode - in init-get mode, the upper layer of the
+    // driver only needs to know the number of elapsed seconds between
+    // the init_hw_seconds and get_hw_seconds calls; the hardware
+    // epoch base is factored out, so the driver can use any base
+    // desired (see the emulated device).
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+    // Called to initialize the hardware clock to a known sane state.
+    void init_hw_seconds( void );
+#endif
+
+    // Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+    // (or any desired epoch when in init-get mode)
+    cyg_uint32 get_hw_seconds( void );
+
+#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
+    // Sets the clock. Argument is seconds elapsed since 1970-01-01 00:00:00.
+    void set_hw_seconds( cyg_uint32 secs );
+#endif
+};
+
+#ifdef __CYGBLD_DRIVER_PRIVATE
+
+// -------------------------------------------------------------------------
+// Some helper functions
+
+// This function is from the Linux kernel.
+//
+// Converts Gregorian date to seconds since 1970-01-01 00:00:00.
+// Assumes input in normal date format, i.e. 1980-12-31 23:59:59
+// => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
+//
+// This algorithm was first published by Gauss (I think).
+//
+// WARNING: this function will overflow on 2106-02-07 06:28:16 on
+// machines were long is 32-bit! (However, as time_t is signed, we
+// will already get problems at other places on 2038-01-19 03:14:08)
+static cyg_uint32
+_simple_mktime(cyg_uint32 year, cyg_uint32 mon,
+		     cyg_uint32 day, cyg_uint32 hour,
+		     cyg_uint32 min, cyg_uint32 sec)
+{
+	if (0 >= (int) (mon -= 2)) {	/* 1..12 -> 11,12,1..10 */
+		mon += 12;	/* Puts Feb last since it has leap day */
+		year -= 1;
+	}
+	return (((
+		(cyg_uint32)(year/4 - year/100 + year/400 + 367*mon/12 + day) +
+		year*365 - 719499
+		)*24 + hour /* now have hours */
+		)*60 + min /* now have minutes */
+		)*60 + sec; /* finally seconds */
+}
+
+//-----------------------------------------------------------------------------
+// BCD helper macros
+#define TO_BCD(x) (((x/10)<<4) | (x%10))
+#define TO_DEC(x) (((x>>4)*10) + (x&0xf))
+
+
+// -------------------------------------------------------------------------
+#endif // __CYGBLD_DRIVER_PRIVATE
+
+#endif // ifndef CYGONCE_DEVS_WALLCLOCK_HXX
+// EOF wallclock.hxx
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/src/emulate.cxx
@@ -0,0 +1,85 @@
+//==========================================================================
+//
+//      io/wallclock/emulate.cxx
+//
+//      Wallclock emulation implementation
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     nickg
+// Contributors:  nickg
+// Date:          1999-03-05
+// Purpose:       Wallclock emulation
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/wallclock.h>          // Wallclock device config
+#include <pkgconf/kernel.h>             // Kernel config
+
+#include <cyg/infra/cyg_type.h>         // Common type definitions and support
+#include <cyg/kernel/ktypes.h>
+
+#include <cyg/io/wallclock.hxx>         // The WallClock API
+
+#include <cyg/kernel/clock.hxx>         // Access to kernel clock
+#include <cyg/kernel/clock.inl>
+
+
+// Remember the tick count at the time of initialization.
+static cyg_tick_count epoch_ticks;
+
+//-----------------------------------------------------------------------------
+// Called to initialize the hardware clock with a known valid
+// time. Which of course isn't required when doing emulation using the
+// kernel clock. But we set the private epoch base to "now".
+void
+Cyg_WallClock::init_hw_seconds( void )
+{
+    // Remember the current clock tick count.
+    epoch_ticks = Cyg_Clock::real_time_clock->current_value();
+}
+
+//-----------------------------------------------------------------------------
+// Returns the number of seconds elapsed since the init call.
+cyg_uint32 
+Cyg_WallClock::get_hw_seconds( void )
+{
+    Cyg_Clock::cyg_resolution res = 
+        Cyg_Clock::real_time_clock->get_resolution();
+    cyg_tick_count secs = Cyg_Clock::real_time_clock->current_value()
+        - epoch_ticks;
+
+    secs = ( secs * res.dividend ) / ( res.divisor * 1000000000LL ) ;
+
+    return secs;
+}
+
+//-----------------------------------------------------------------------------
+// End of devs/wallclock/emulate.cxx
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/src/wallclock.cxx
@@ -0,0 +1,140 @@
+//==========================================================================
+//
+//      devs/wallclock/wallclock.cxx
+//
+//      Wallclock base
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jskov
+// Contributors:  jskov
+// Date:          2000-03-28
+// Purpose:       Wallclock base driver
+// Description:   This provides a generic wallclock base driver which
+//                relies on sub-drivers to provide the interface functions
+//                to the hardware device (see wallclock.hxx for details).
+//
+//                The driver can be configured to run in one of two modes:
+//                  init-get mode:
+//                    In this mode, the hardware driver only needs to
+//                    implement a function to read the hardware clock
+//                    and a (possibly empty) init function which makes
+//                    sure the hardware clock is properly initialized.
+//                    While the driver in this mode has a smaller memory
+//                    foot-print, it does not support battery-backed up
+//                    clocks.
+//
+//                  set-get mode:
+//                    Requires both set and get functions for the hardware
+//                    device. While bigger, it allows support of 
+//                    battery-backed up clocks.
+//
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/kernel.h>             // Kernel config
+#include <pkgconf/wallclock.h>          // Wallclock device config
+
+#include <cyg/infra/cyg_type.h>         // Common type definitions and support
+
+#include <cyg/kernel/sched.inl>         // For lock/unlock 
+
+#include <cyg/io/wallclock.hxx>         // The WallClock API
+
+
+//-----------------------------------------------------------------------------
+// Local static variables
+
+static Cyg_WallClock wallclock_instance CYG_INIT_PRIORITY( CLOCK );
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+static cyg_uint32 epoch_ticks;
+static cyg_uint32 epoch_time_stamp;
+#endif
+
+Cyg_WallClock *Cyg_WallClock::wallclock;
+
+//-----------------------------------------------------------------------------
+// Constructor
+
+Cyg_WallClock::Cyg_WallClock()
+{
+    // install instance pointer
+    wallclock = &wallclock_instance;
+
+#ifndef CYGSEM_WALLCLOCK_SET_GET_MODE
+    // Since set_hw_seconds is not going to write to the hardware
+    // clock, initialize it to a sane state now.
+    init_hw_seconds();
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// Returns the number of seconds elapsed since 1970-01-01 00:00:00.
+// This may involve reading the hardware, so it may take anything up to
+// a second to complete.
+
+cyg_uint32 Cyg_WallClock::get_current_time()
+{
+    cyg_uint32 res;
+
+    Cyg_Scheduler::lock();
+
+#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
+    res = get_hw_seconds();
+#else
+    res = epoch_time_stamp + get_hw_seconds() - epoch_ticks;
+#endif
+
+    Cyg_Scheduler::unlock();
+
+    return res;
+}
+
+//-----------------------------------------------------------------------------
+// Sets the clock. Argument is seconds elapsed since 1970-01-01 00:00:00.
+// This may involve reading or writing to the hardware, so it may take
+// anything up to a second to complete.
+void Cyg_WallClock::set_current_time( cyg_uint32 time_stamp )
+{
+    Cyg_Scheduler::lock();
+
+#ifdef CYGSEM_WALLCLOCK_SET_GET_MODE
+    set_hw_seconds(time_stamp);
+#else
+    epoch_time_stamp    = time_stamp;
+    epoch_ticks         = get_hw_seconds();
+#endif
+
+    Cyg_Scheduler::unlock();
+}
+
+//-----------------------------------------------------------------------------
+// End of devs/wallclock/wallclock.cxx
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/tests/wallclock.cxx
@@ -0,0 +1,170 @@
+//==========================================================================
+//
+//        wallclock.cxx
+//
+//        WallClock test
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     nickg
+// Contributors:    nickg
+// Date:          1998-07-20
+// Description:   Tests the Kernel Wall Clock
+//                This test exercises the WallClock class and checks that it
+//                keeps time correctly.
+//####DESCRIPTIONEND####
+// -------------------------------------------------------------------------
+
+#include <pkgconf/kernel.h>
+
+#include <cyg/kernel/thread.hxx>
+#include <cyg/kernel/thread.inl>
+#include <cyg/kernel/sched.hxx>
+#include <cyg/kernel/mutex.hxx>
+#include <cyg/kernel/sema.hxx>
+#include <cyg/kernel/clock.hxx>
+
+#include <cyg/kernel/diag.h>
+
+#include <cyg/io/wallclock.hxx>
+
+#include <cyg/infra/testcase.h>
+
+#if defined(CYGFUN_KERNEL_THREADS_TIMER) && \
+    defined(CYGVAR_KERNEL_COUNTERS_CLOCK)
+
+#include <cyg/kernel/sched.inl>
+
+// -------------------------------------------------------------------------
+// Data for the test
+
+#ifdef CYGNUM_HAL_STACK_SIZE_TYPICAL
+#define STACKSIZE CYGNUM_HAL_STACK_SIZE_TYPICAL
+#else
+#define STACKSIZE       (2*1024)        // size of thread stack
+#endif
+
+char thread_stack[STACKSIZE];
+
+inline void *operator new(size_t size, void *ptr) { return ptr; };
+
+// array of threads.
+char thread[sizeof(Cyg_Thread)];
+
+Cyg_Thread *th;
+
+#define EPOCH 900000000U
+
+// MN10300 sim takes 1min15secs to do one loop on 300MHz PII.
+#define LOOPS_SIM       2
+#define LOOPS_HW        10
+
+cyg_int32 loops = LOOPS_HW;
+cyg_tick_count one_sec;
+
+// -------------------------------------------------------------------------
+// Thread body
+
+
+void wallclock_thread( CYG_ADDRWORD id )
+{
+    cyg_uint32 wtime;
+    cyg_tick_count ticks;
+
+    Cyg_WallClock::wallclock->set_current_time( EPOCH );
+
+    // Check clock only every other second since the call itself may
+    // take about a second.
+    for( int i = 0; i < loops; i += 2 )
+    {
+        // Make a note of the time
+        ticks = Cyg_Clock::real_time_clock->current_value();
+
+        wtime = Cyg_WallClock::wallclock->get_current_time();
+        if(wtime != EPOCH+i)
+        {
+            CYG_TEST_FAIL_FINISH( "Clock out of sync" );
+        }
+
+        CYG_TEST_STILL_ALIVE(i, "2xtick...");
+
+        // then calculate how much the above took so the delay
+        // below can be made accurate.
+        ticks = Cyg_Clock::real_time_clock->current_value() - ticks;
+
+        th->delay( 2*one_sec - ticks );
+    }
+
+    CYG_TEST_PASS_FINISH("Wallclock OK");
+    
+}
+
+// -------------------------------------------------------------------------
+
+
+externC void
+cyg_start( void )
+{
+    CYG_TEST_INIT();
+
+    CYG_TEST_INFO("Starting wallclock test");
+
+    if( cyg_test_is_simulator ) loops = LOOPS_SIM;
+    
+    Cyg_Clock::cyg_resolution res = Cyg_Clock::real_time_clock->get_resolution();
+    
+    one_sec = ( res.divisor * 1000000000LL ) / res.dividend ;
+    
+    th = new((void *)&thread) Cyg_Thread(CYG_SCHED_DEFAULT_INFO,
+                                         wallclock_thread,
+                                         0,
+                                         "wallclock_thread",
+                                         (CYG_ADDRESS)thread_stack,
+                                         STACKSIZE
+        );
+
+    th->resume();
+
+    // Get the world going
+    Cyg_Scheduler::scheduler.start();
+
+}
+
+#else // if defined(CYGFUN_KERNEL_THREADS_TIMER) etc...
+
+externC void
+cyg_start( void )
+{
+    CYG_TEST_INIT();
+    CYG_TEST_PASS_FINISH("N/A: Kernel real-time clock/threads timer disabled");
+}
+
+#endif // if defined(CYGFUN_KERNEL_THREADS_TIMER) etc...
+
+// -------------------------------------------------------------------------
+// EOF wallclock.cxx
new file mode 100644
--- /dev/null
+++ b/packages/io/wallclock/current/tests/wallclock2.cxx
@@ -0,0 +1,106 @@
+//==========================================================================
+//
+//        wallclock2.cxx
+//
+//        WallClock battery backed up test
+//
+//==========================================================================
+//####COPYRIGHTBEGIN####
+//                                                                          
+// -------------------------------------------                              
+// The contents of this file are subject to the Red Hat eCos Public License 
+// Version 1.1 (the "License"); you may not use this file except in         
+// compliance with the License.  You may obtain a copy of the License at    
+// http://www.redhat.com/                                                   
+//                                                                          
+// Software distributed under the License is distributed on an "AS IS"      
+// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the 
+// License for the specific language governing rights and limitations under 
+// the License.                                                             
+//                                                                          
+// The Original Code is eCos - Embedded Configurable Operating System,      
+// released September 30, 1998.                                             
+//                                                                          
+// The Initial Developer of the Original Code is Red Hat.                   
+// Portions created by Red Hat are                                          
+// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.                             
+// All Rights Reserved.                                                     
+// -------------------------------------------                              
+//                                                                          
+//####COPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s):     jskov
+// Contributors:  jskov
+// Date:          2000-03-29
+// Description:   Tests the WallClock device.
+//                Prints wallclock setting (for human verification that time
+//                matches the expected value). Then tries to set/restore
+//                clock value, and verifies that the WallClock epoch matches
+//                that of the libc.
+//####DESCRIPTIONEND####
+// -------------------------------------------------------------------------
+
+#include <pkgconf/system.h>
+#include <cyg/infra/testcase.h>
+#include <cyg/infra/diag.h>
+#ifdef CYGPKG_LIBC
+#include <pkgconf/libc.h>
+#endif
+
+#if defined(CYGSEM_LIBC_TIME_CLOCK_WORKING)
+
+#include <time.h>
+#include <cyg/io/wallclock.hxx>
+
+// -------------------------------------------------------------------------
+
+
+externC int
+main (void )
+{
+    time_t now, test;
+
+    CYG_TEST_INIT();
+
+    // make this predictable - independent of the user option
+    cyg_libc_time_setzoneoffsets(0, 3600);
+    cyg_libc_time_setdst( CYG_LIBC_TIME_DSTOFF );
+
+    // Print out current setting so a human can verify that clock state
+    // was valid.
+    now = (time_t) Cyg_WallClock::wallclock->get_current_time();
+    diag_printf("WallClock is set to: %s", ctime(&now));
+
+    // Check that set/get works
+    Cyg_WallClock::wallclock->set_current_time( 0 );
+    test = (time_t) Cyg_WallClock::wallclock->get_current_time();
+    Cyg_WallClock::wallclock->set_current_time( now );
+    CYG_TEST_PASS_FAIL(0 == test, "Can set WallClock to epoch");
+    
+    // Test that the wallclock and libc use same epoch.
+    test = (time_t) 0;
+    CYG_TEST_PASS_FAIL(!strcmp(ctime(&test), "Thu Jan 01 00:00:00 1970\n"),
+                       "WallClock epoch matches libc epoch");
+
+    CYG_TEST_FINISH("Finished wallclock battery test");
+}
+
+#else 
+#define NA_MSG "Requires libc time functions"
+#endif
+
+#ifdef NA_MSG
+
+externC void
+cyg_start( void )
+{
+    CYG_TEST_INIT();
+    CYG_TEST_PASS_FINISH(NA_MSG);
+}
+
+#endif // NA_MSG
+
+// -------------------------------------------------------------------------
+// EOF wallclock2.cxx
--- a/packages/language/c/libc/current/ChangeLog
+++ b/packages/language/c/libc/current/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* src/time/settime.cxx: 
+	* src/time/time.cxx: 
+	Wallclock moved to io/.
+	
 2000-03-28  John Dallaway  <jld@cygnus.co.uk>
 
 	* cdl/string.cdl,
--- a/packages/language/c/libc/current/cdl/time.cdl
+++ b/packages/language/c/libc/current/cdl/time.cdl
@@ -55,7 +55,7 @@ cdl_option CYGSEM_LIBC_TIME_CLOCK_WORKIN
 
 cdl_option CYGSEM_LIBC_TIME_TIME_WORKING {
     display       "Working time() function"
-    requires      CYGPKG_DEVICES_WALLCLOCK
+    requires      CYGPKG_IO_WALLCLOCK
     default_value 1
     description   "
         This option controls whether time() will
@@ -67,7 +67,7 @@ cdl_option CYGSEM_LIBC_TIME_TIME_WORKING
 
 cdl_option CYGSEM_LIBC_TIME_SETTIME_WORKING {
     display       "Working cyg_libc_time_settime() function"
-    requires      CYGPKG_DEVICES_WALLCLOCK
+    requires      CYGPKG_IO_WALLCLOCK
     default_value 1
     description   "
         This option controls whether cyg_libc_time_settime()
--- a/packages/language/c/libc/current/src/time/settime.cxx
+++ b/packages/language/c/libc/current/src/time/settime.cxx
@@ -53,7 +53,7 @@
 #include <cyg/infra/cyg_ass.h>     // Assertion infrastructure
 #include <cyg/infra/cyg_trac.h>    // Tracing infrastructure
 #ifdef CYGSEM_LIBC_TIME_SETTIME_WORKING
-# include <cyg/devs/wallclock.hxx> // Wallclock class definitions
+# include <cyg/io/wallclock.hxx> // Wallclock class definitions
 #endif
 
 // FUNCTIONS
--- a/packages/language/c/libc/current/src/time/time.cxx
+++ b/packages/language/c/libc/current/src/time/time.cxx
@@ -56,7 +56,7 @@
 #include <time.h>                  // Main date and time definitions
 
 #ifdef CYGSEM_LIBC_TIME_TIME_WORKING
-# include <cyg/devs/wallclock.hxx> // Wallclock class definitions
+# include <cyg/io/wallclock.hxx> // Wallclock class definitions
 #endif
 
 // FUNCTIONS
--- a/packages/templates/all/ChangeLog
+++ b/packages/templates/all/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* current.ect: Wallclock moved.
+
 1999-12-09  Bart Veer  <bartv@cygnus.co.uk>
 
 	* templates/all directory created
--- a/packages/templates/all/current.ect
+++ b/packages/templates/all/current.ect
@@ -17,7 +17,7 @@ cdl_configuration template_all {
     package     CYGPKG_LIBM current ;
     package     CYGPKG_UITRON current ;
     package     CYGPKG_DEVICES_WATCHDOG current ;
-    package     CYGPKG_DEVICES_WALLCLOCK current ;
+    package     CYGPKG_IO_WALLCLOCK current ;
     package     CYGPKG_ERROR current ;
 };
 
--- a/packages/templates/default/ChangeLog
+++ b/packages/templates/default/ChangeLog
@@ -1,3 +1,7 @@
+2000-04-05  Jesper Skov  <jskov@redhat.com>
+
+	* current.ect: Wallclock moved.
+
 1999-12-09  Bart Veer  <bartv@cygnus.co.uk>
 
 	* templates/default directory created
--- a/packages/templates/default/current.ect
+++ b/packages/templates/default/current.ect
@@ -17,7 +17,7 @@ kernel, C and maths libraries, plus thei
     package     CYGPKG_KERNEL current ;
     package     CYGPKG_LIBC current ;
     package     CYGPKG_LIBM current ;
-    package     CYGPKG_DEVICES_WALLCLOCK current ;
+    package     CYGPKG_IO_WALLCLOCK current ;
     package     CYGPKG_ERROR current ;
 };