# HG changeset patch # User jlarmour # Date 961173839 0 # Node ID c37d3a9e1b280d1041c1cefc0a4ac33da2375285 # Parent 991657282121afedfdd653838ec1488445b597ae Merge from eCos master repository on 2000-06-16-07:47:03-BST diff --git a/host/libcdl/ChangeLog b/host/libcdl/ChangeLog --- a/host/libcdl/ChangeLog +++ b/host/libcdl/ChangeLog @@ -1,3 +1,9 @@ +2000-06-15 John Dallaway + + * cdl.dsp: + Build libCDL to v:\cdl rather than v:\ide. Build debug versions + against tcl82d.lib rather than tcl82.lib. + 2000-06-02 Bart Veer * config.cxx (load_package): diff --git a/host/libcdl/cdl.dsp b/host/libcdl/cdl.dsp --- a/host/libcdl/cdl.dsp +++ b/host/libcdl/cdl.dsp @@ -38,8 +38,8 @@ MTL=midl.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "V:\ide\Release\cdl" -# PROP Intermediate_Dir "V:\ide\Release\cdl\build" +# PROP Output_Dir "V:\cdl\Release" +# PROP Intermediate_Dir "V:\cdl\Release\build" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "cdl - Win32 Debug" @@ -51,8 +51,8 @@ MTL=midl.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "V:\ide\Debug\cdl" -# PROP Intermediate_Dir "V:\ide\Debug\cdl\build" +# PROP Output_Dir "V:\cdl\Debug" +# PROP Intermediate_Dir "V:\cdl\Debug\build" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "cdl - Win32 ANSI Debug" @@ -64,8 +64,8 @@ MTL=midl.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "V:\ide\Debug\cdl" -# PROP Intermediate_Dir "V:\ide\Debug\cdl\build" +# PROP Output_Dir "V:\cdl\Debug" +# PROP Intermediate_Dir "V:\cdl\Debug\build" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "cdl - Win32 ANSI Release" @@ -77,8 +77,8 @@ MTL=midl.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "V:\ide\Release\cdl" -# PROP Intermediate_Dir "V:\ide\Release\cdl\build" +# PROP Output_Dir "V:\cdl\Release" +# PROP Intermediate_Dir "V:\cdl\Release\build" # PROP Target_Dir "" !ENDIF @@ -116,8 +116,8 @@ SOURCE=.\ChangeLog !IF "$(CFG)" == "cdl - Win32 Release" # Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\ide\Release\cdl\build -OutDir=V:\ide\Release\cdl +IntDir=V:\cdl\Release\build +OutDir=V:\cdl\Release InputPath=.\ChangeLog BuildCmds= \ @@ -137,12 +137,12 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "cdl - Win32 Debug" # Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\ide\Debug\cdl\build -OutDir=V:\ide\Debug\cdl +IntDir=V:\cdl\Debug\build +OutDir=V:\cdl\Debug InputPath=.\ChangeLog BuildCmds= \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | cygtclsh80`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82 --enable-debug --enable-maintainer-mode" \ + if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | cygtclsh80`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82d --enable-debug --enable-maintainer-mode" \ cd $(IntDir) \ v: \ make --unix install \ @@ -158,12 +158,12 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "cdl - Win32 ANSI Debug" # Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\ide\Debug\cdl\build -OutDir=V:\ide\Debug\cdl +IntDir=V:\cdl\Debug\build +OutDir=V:\cdl\Debug InputPath=.\ChangeLog BuildCmds= \ - if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | cygtclsh80`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82 --enable-debug --enable-maintainer-mode" \ + if not exist $(IntDir)\tools\configtool\standalone\common\Makefile sh -c "ECOSHOST=`echo ""puts [ file attributes [ pwd ] -shortname ]"" | cygtclsh80`/.. ; echo ""ECOSHOST=$ECOSHOST"" ; echo ""TCLHOME=$TCLHOME"" ; mkdir -p `cygpath -u ""$(IntDir)""` ; cd `cygpath -u ""$(IntDir)""` && CC=cl CXX=cl `cygpath -u ""$ECOSHOST""`/configure --prefix=`cygpath -u ""$(OutDir)""` --with-tcl=`cygpath -u ""$TCLHOME""` --with-tcl_version=82d --enable-debug --enable-maintainer-mode" \ cd $(IntDir) \ v: \ make --unix install \ @@ -179,8 +179,8 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "cdl - Win32 ANSI Release" # Begin Custom Build - Performing Custom Build Step for libCDL -IntDir=V:\ide\Release\cdl\build -OutDir=V:\ide\Release\cdl +IntDir=V:\cdl\Release\build +OutDir=V:\cdl\Release InputPath=.\ChangeLog BuildCmds= \ diff --git a/host/tools/configtool/ChangeLog b/host/tools/configtool/ChangeLog --- a/host/tools/configtool/ChangeLog +++ b/host/tools/configtool/ChangeLog @@ -1,3 +1,24 @@ +2000-06-15 John Dallaway + + * standalone/win32/ConfigToolDoc.cpp: + + Modify RunTests() to check for simulator platforms and + inhibit prompting for hardware reset as appropriate. + + + * standalone/win32/Configtool.dsp, + standalone/win32/ecosconfig.dsp: + + Link debug builds against tcl82d.lib rather than + tcl82.lib. + + Look for libCDL in v:\cdl rather than v:\ide. + + * standalone/win32/Configtool.rc: + + Point to the eCos Product web page rather than the + obsolete eCos Services web page. + 2000-04-17 John Dallaway * standalone/common/cdl_exec.cxx: diff --git a/host/tools/configtool/standalone/win32/ConfigToolDoc.cpp b/host/tools/configtool/standalone/win32/ConfigToolDoc.cpp --- a/host/tools/configtool/standalone/win32/ConfigToolDoc.cpp +++ b/host/tools/configtool/standalone/win32/ConfigToolDoc.cpp @@ -554,6 +554,11 @@ void CConfigToolDoc::RunTests() int nTests=GetTestExeNames(ar,arTestsMissing); CRunTestsSheet sheet(_T("Run Tests"), NULL, 0, 0); sheet.SetTarget(strTarget); + const CeCosTestPlatform * etPlatform = CeCosTestPlatform::Get(strTarget); + ASSERT (NULL != etPlatform); + if (-1 != CString (etPlatform->GdbCmds ()).Find (_T("cyg_test_is_simulator"))) { // if a simulator target + sheet.SetResetNone(); // disable 'reset hardware' message box + } sheet.HideRemoteControls(); if(arTestsMissing.GetSize()){ if(IDYES==CUtils::MessageBoxFT(MB_YESNO,_T("Not all tests are built. Do you wish to build them now?"))){ diff --git a/host/tools/configtool/standalone/win32/Configtool.dsp b/host/tools/configtool/standalone/win32/Configtool.dsp --- a/host/tools/configtool/standalone/win32/Configtool.dsp +++ b/host/tools/configtool/standalone/win32/Configtool.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /I "V:\ide\Release\cdl\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "NDEBUG" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /I "V:\cdl\Release\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "NDEBUG" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.2 /subsystem:windows /incremental:yes /debug /machine:I386 /libpath:"V:\ide\Release\cdl\lib" +# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.3 /subsystem:windows /incremental:yes /debug /machine:I386 /libpath:"V:\cdl\Release\lib" # SUBTRACT LINK32 /map !ELSEIF "$(CFG)" == "Configtool - Win32 ANSI Debug" @@ -72,7 +72,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /ZI /Od /I "V:\ide\Debug\cdl\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "_DEBUG" /D "_THERMOMETER" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /ZI /Od /I "V:\cdl\Debug\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "_DEBUG" /D "_THERMOMETER" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" @@ -82,7 +82,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.2 /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"V:\ide\Debug\cdl\lib" +# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82d.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.3 /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"V:\cdl\Debug\lib" # SUBTRACT LINK32 /incremental:no /map /nodefaultlib !ELSEIF "$(CFG)" == "Configtool - Win32 Debug" @@ -100,7 +100,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "V:\ide\Debug\cdl\include" /I "." /I "..\src-mlt" /I "..\..\..\libnotcdl" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest\win32" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest\win32\testtool" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_THERMOMETER" /FR /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /ZI /Od /I "V:\ide\Debug\cdl\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "_DEBUG" /D "_UNICODE" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MDd /W4 /Gm /GR /GX /ZI /Od /I "V:\cdl\Debug\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "_DEBUG" /D "_UNICODE" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL" @@ -111,7 +111,7 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 wsock32.lib wininet.lib cyginfra.lib tcl81.lib /nologo /version:1.2 /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"V:\ide\Debug\cdl\lib" # SUBTRACT BASE LINK32 /nodefaultlib -# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.2 /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"V:\ide\Debug\cdl\lib" +# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82d.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.3 /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"V:\cdl\Debug\lib" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "Configtool - Win32 Release" @@ -129,7 +129,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W4 /GX /Zi /O2 /I "V:\ide\Release\cdl\include" /I "." /I "..\src-mlt" /I "..\..\..\libnotcdl" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest\win32" /I "..\..\..\..\..\..\..\..\devo\ide\src\tools\ecostest\win32\testtool" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /FR /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /I "V:\ide\Release\cdl\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "NDEBUG" /D "_UNICODE" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W4 /GR /GX /Zi /O2 /I "V:\cdl\Release\include" /I "..\..\common\win32" /I "..\..\standalone\win32" /I "..\..\..\ecostest\common" /I "..\..\..\testtool\win32" /I "..\..\..\Utils\common" /I "..\..\common\common" /I "..\..\..\..\..\doc\htmlhelp" /I "..\..\..\pkgadmin\win32" /I "..\..\..\utils\win32" /D "NDEBUG" /D "_UNICODE" /D "MLTVIEW" /D "ECOS_CT" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D _WIN32_IE=0x0400 /FR /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL" @@ -139,7 +139,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 wsock32.lib wininet.lib cyginfra.lib tcl81.lib /nologo /version:1.2 /subsystem:windows /map /debug /machine:I386 /libpath:"V:\ide\Release\cdl\lib" -# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.2 /entry:"wWinMainCRTStartup" /subsystem:windows /incremental:yes /debug /machine:I386 /libpath:"V:\ide\Release\cdl\lib" +# ADD LINK32 wsock32.lib wininet.lib cyginfra.lib tcl82.lib cdl.lib shlwapi.lib htmlhelp.lib /nologo /version:1.3 /entry:"wWinMainCRTStartup" /subsystem:windows /incremental:yes /debug /machine:I386 /libpath:"V:\cdl\Release\lib" # SUBTRACT LINK32 /pdb:none !ENDIF @@ -1096,7 +1096,7 @@ SOURCE=..\..\..\..\..\doc\eCos.hhp !IF "$(CFG)" == "Configtool - Win32 ANSI Release" # Begin Custom Build -InputDir=\e\cvs\devo\ecos\doc +InputDir=\CVSroot\devo\ecos\doc OutDir=v:\ConfigTool\ANSIRelease InputPath=..\..\..\..\..\doc\eCos.hhp @@ -1119,7 +1119,7 @@ InputPath=..\..\..\..\..\doc\eCos.hhp !ELSEIF "$(CFG)" == "Configtool - Win32 ANSI Debug" # Begin Custom Build -InputDir=\e\cvs\devo\ecos\doc +InputDir=\CVSroot\devo\ecos\doc OutDir=v:\ConfigTool\ANSIDebug InputPath=..\..\..\..\..\doc\eCos.hhp @@ -1142,7 +1142,7 @@ InputPath=..\..\..\..\..\doc\eCos.hhp !ELSEIF "$(CFG)" == "Configtool - Win32 Debug" # Begin Custom Build -InputDir=\e\cvs\devo\ecos\doc +InputDir=\CVSroot\devo\ecos\doc OutDir=v:\configtool\debug InputPath=..\..\..\..\..\doc\eCos.hhp @@ -1165,7 +1165,7 @@ InputPath=..\..\..\..\..\doc\eCos.hhp !ELSEIF "$(CFG)" == "Configtool - Win32 Release" # Begin Custom Build -InputDir=\e\cvs\devo\ecos\doc +InputDir=\CVSroot\devo\ecos\doc OutDir=v:\ConfigTool\release InputPath=..\..\..\..\..\doc\eCos.hhp diff --git a/host/tools/configtool/standalone/win32/Configtool.rc b/host/tools/configtool/standalone/win32/Configtool.rc --- a/host/tools/configtool/standalone/win32/Configtool.rc +++ b/host/tools/configtool/standalone/win32/Configtool.rc @@ -455,7 +455,7 @@ BEGIN "Select the internal HTML help mechanism to display HTML-based help." IDC_PANECOMBO "Selects a window for which the font is to be changed." IDC_FONT "Changes the font of the chosen window." - IDS_ECOS_HOME_URL "http://www.cygnus.com/ecos" + IDS_ECOS_HOME_URL "http://www.redhat.com/products/ecos" IDS_ECOS_SOURCEWARE_URL "http://sourceware.cygnus.com/ecos" IDS_RED_HAT_HOME_URL "http://www.redhat.com" IDS_UITRON_HOME_URL "http://www.itron.gr.jp/" @@ -503,7 +503,7 @@ BEGIN "Opens the GNUPro documentation page\nGNUPro Documentation Page" ID_HELP_ECOS "Opens the eCos net release page\neCos Net Release Page" ID_HELP_UITRON "Opens the µITRON specification page\nµITRON Specification" - ID_HELP_ECOSHOME "Opens the eCos services page\neCos Services Page" + ID_HELP_ECOSHOME "Opens the eCos product page\neCos Product Page" ID_BUILD_CLEAN "Deletes intermediate and output files (performs a Make Clean)\nBuild clean" ID_TOOLS_SHELL "Invokes a command shell\nCommand shell" ID_VIEW_RULES "Displays current state of consistency rules\nConsistency rules" diff --git a/host/tools/configtool/standalone/win32/ecosconfig.dsp b/host/tools/configtool/standalone/win32/ecosconfig.dsp --- a/host/tools/configtool/standalone/win32/ecosconfig.dsp +++ b/host/tools/configtool/standalone/win32/ecosconfig.dsp @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "v:\ide\Release\cdl\include" /I "..\..\common\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "v:\cdl\Release\include" /I "..\..\common\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl82.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "ecosconfig - Win32 Debug" @@ -65,16 +65,16 @@ LINK32=link.exe # PROP Intermediate_Dir "v:\ecosconfig\Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "v:\ide\Debug\cdl\include" /I "..\..\common\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "v:\cdl\Debug\include" /I "..\..\common\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl82.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tcl82d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF diff --git a/host/tools/ecostest/ChangeLog b/host/tools/ecostest/ChangeLog --- a/host/tools/ecostest/ChangeLog +++ b/host/tools/ecostest/ChangeLog @@ -1,3 +1,15 @@ +2000-06-15 John Dallaway + + * common/eCosTest.cpp: + + Modify CeCosTest construvtor to use GetEnvironmentVariable() + rather than _tgetenv() under Win32. For some unknown reason, + _tgetenv() is not returning the correct version of PATH. + + * common/eCosTestPlatform.cpp: + + Modify SaveToRegistry() to save all test platform attributes. + 2000-05-03 Bart Veer * common/permtest.cxx (find_ptest): diff --git a/host/tools/ecostest/common/eCosTest.cpp b/host/tools/ecostest/common/eCosTest.cpp --- a/host/tools/ecostest/common/eCosTest.cpp +++ b/host/tools/ecostest/common/eCosTest.cpp @@ -97,10 +97,22 @@ CeCosTest::CeCosTest(const ExecutionPara // By recording the path now, we ensure processes are always run in the context in which the test instance // is created (important for the ConfigTool to be able to call PrepareEnvironment). + +#ifdef _WIN32 + // for some reason _tgetenv() doesn't return the PATH set + // by PrepareEnvironment() so use GetEnvironmentVariable() instead + // JLD - 2000-06-09 + String strPath; + int nSize=GetEnvironmentVariable(_T("PATH"), NULL, 0); + GetEnvironmentVariable(_T("PATH"), strPath.GetBuffer(nSize), nSize); + strPath.ReleaseBuffer(); + m_strPath=strPath; +#else LPCTSTR pszPath=_tgetenv(_T("PATH")); if(pszPath){ m_strPath=pszPath; } +#endif ENTERCRITICAL; InstanceCount++; diff --git a/host/tools/ecostest/common/eCosTestDownloadFilter.cpp b/host/tools/ecostest/common/eCosTestDownloadFilter.cpp --- 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.13 2000/06/07 14:10:34 jlarmour Exp $" +#define DL_FILTER_VER "$Id: eCosTestDownloadFilter.cpp,v 1.14 2000/06/16 16:44:01 jlarmour Exp $" #include "eCosTestDownloadFilter.h" CeCosTestDownloadFilter::CeCosTestDownloadFilter(): diff --git a/host/tools/ecostest/common/eCosTestMonitorFilter.cpp b/host/tools/ecostest/common/eCosTestMonitorFilter.cpp --- 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.12 2000/06/07 14:10:34 jlarmour Exp $" +#define SER_FILTER_VER "$Id: eCosTestMonitorFilter.cpp,v 1.13 2000/06/16 16:44:01 jlarmour Exp $" #include "eCosTestMonitorFilter.h" CeCosTestMonitorFilter::CeCosTestMonitorFilter(): diff --git a/host/tools/ecostest/common/eCosTestPlatform.cpp b/host/tools/ecostest/common/eCosTestPlatform.cpp --- a/host/tools/ecostest/common/eCosTestPlatform.cpp +++ b/host/tools/ecostest/common/eCosTestPlatform.cpp @@ -105,8 +105,14 @@ bool CeCosTestPlatform::SaveToRegistry(H if(rc){ LPCTSTR pszPrefix=ti.Prefix(); LPCTSTR pszGdb =ti.GdbCmds(); + LPCTSTR pszInferior=ti.Inferior(); + LPCTSTR pszPrompt=ti.Prompt(); + DWORD dwServerSideGdb=ti.ServerSideGdb()?1l:0l; rc&=(ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Prefix"),0,REG_SZ, (CONST BYTE *)pszPrefix,(1+_tcslen(pszPrefix))*sizeof TCHAR)) && - (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("GdbCmd"),0,REG_SZ, (CONST BYTE *)pszGdb,(1+_tcslen(pszGdb))*sizeof TCHAR)); + (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Commands"),0,REG_SZ, (CONST BYTE *)pszGdb,(1+_tcslen(pszGdb))*sizeof TCHAR)) && + (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Inferior"),0,REG_SZ, (CONST BYTE *)pszInferior,(1+_tcslen(pszInferior))*sizeof TCHAR)) && + (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("Prompt"),0,REG_SZ, (CONST BYTE *)pszPrompt,(1+_tcslen(pszPrompt))*sizeof TCHAR)) && + (ERROR_SUCCESS==RegSetValueEx(hKey2,_T("ServerSideGdb"),0,REG_DWORD, (CONST BYTE *)&dwServerSideGdb,sizeof DWORD)); } RegCloseKey(hKey2); } diff --git a/host/tools/ecostest/common/eCosTestSerialFilter.cpp b/host/tools/ecostest/common/eCosTestSerialFilter.cpp --- 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.13 2000/06/07 14:10:34 jlarmour Exp $" +#define SER_FILTER_VER "$Id: eCosTestSerialFilter.cpp,v 1.14 2000/06/16 16:44:01 jlarmour Exp $" #include "eCosTestSerialFilter.h" #include "eCosThreadUtils.h" diff --git a/host/tools/pkgadmin/ChangeLog b/host/tools/pkgadmin/ChangeLog --- a/host/tools/pkgadmin/ChangeLog +++ b/host/tools/pkgadmin/ChangeLog @@ -1,3 +1,12 @@ +2000-06-15 John Dallaway + + * win32/PkgAdmin.dsp: + + Link debug builds against tcl82d.lib rather than + tcl82.lib. + + Look for libCDL in v:\cdl rather than v:\ide. + 2000-03-29 John Dallaway * win32/PkgAdmin.rc: diff --git a/host/tools/pkgadmin/win32/PkgAdmin.dsp b/host/tools/pkgadmin/win32/PkgAdmin.dsp --- a/host/tools/pkgadmin/win32/PkgAdmin.dsp +++ b/host/tools/pkgadmin/win32/PkgAdmin.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W4 /GX /O2 /I "v:\ide\Release\cdl\include" /I "..\..\utils\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W4 /GX /O2 /I "v:\cdl\Release\include" /I "..\..\utils\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_UNICODE" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL" @@ -55,7 +55,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 -# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /machine:I386 +# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /version:1.3 /entry:"wWinMainCRTStartup" /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "PkgAdmin - Win32 Debug" @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "v:\ide\Debug\cdl\include" /I "..\..\utils\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_UNICODE" /FR /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "v:\cdl\Debug\include" /I "..\..\utils\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_UNICODE" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL" @@ -81,7 +81,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 tcl82d.lib htmlhelp.lib shlwapi.lib /nologo /version:1.3 /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "PkgAdmin - Win32 ANSI Debug" @@ -98,7 +98,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "v:\ide\Debug\cdl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "v:\ide\Debug\cdl\include" /I "..\..\utils\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W4 /Gm /GX /ZI /Od /I "v:\cdl\Debug\include" /I "..\..\utils\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL" @@ -108,7 +108,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 tcl81.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 tcl82d.lib htmlhelp.lib shlwapi.lib /nologo /version:1.3 /subsystem:windows /debug /machine:I386 /pdbtype:sept !ELSEIF "$(CFG)" == "PkgAdmin - Win32 ANSI Release" @@ -125,7 +125,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "v:\ide\Release\cdl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W4 /GX /O2 /I "v:\ide\Release\cdl\include" /I "..\..\utils\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W4 /GX /O2 /I "v:\cdl\Release\include" /I "..\..\utils\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL" @@ -135,7 +135,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 tcl81.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 tcl82.lib htmlhelp.lib shlwapi.lib /nologo /version:1.3 /subsystem:windows /machine:I386 !ENDIF diff --git a/host/tools/testtool/ChangeLog b/host/tools/testtool/ChangeLog --- a/host/tools/testtool/ChangeLog +++ b/host/tools/testtool/ChangeLog @@ -1,3 +1,22 @@ +2000-06-15 John Dallaway + + * win32/RunTestsSheet.cpp: + + Modify the CRunTestsSheet constructor to set the download + timeout type to TIMEOUT_SPECIFIED and server side GDB + flag to FALSE by default. + + Modify OnRun() to specify a default timeout of 900 seconds. + + * win32/RunTestsSheet.h: + + Add SetResetNone() inline function. + + * win32/TestTool.rc: + + Modify the IDD_TT_PLATFORM dialog to accept CR chars in + the GDB commands edit box and to correct the tab order. + 2000-04-11 Simon FitzMaurice * win32\ExecutionPage.cpp win32\ExecutionPage.h diff --git a/host/tools/testtool/win32/RunTestsSheet.cpp b/host/tools/testtool/win32/RunTestsSheet.cpp --- a/host/tools/testtool/win32/RunTestsSheet.cpp +++ b/host/tools/testtool/win32/RunTestsSheet.cpp @@ -69,7 +69,8 @@ CRunTestsSheet::CRunTestsSheet(LPCTSTR p m_nTimeout(900), m_nDownloadTimeout(120), m_nTimeoutType(TIMEOUT_AUTOMATIC), - m_nDownloadTimeoutType(TIMEOUT_AUTOMATIC), + m_nDownloadTimeoutType(TIMEOUT_SPECIFIED), + m_bRemote(false), m_bSerial(true), m_strPort(_T("COM1")), m_nBaud(38400), @@ -288,7 +289,7 @@ void CRunTestsSheet::OnRun() m_ep=CeCosTest::ExecutionParameters( CeCosTest::ExecutionParameters::RUN, m_strTarget, - TIMEOUT_NONE==m_nTimeoutType?0x7fffffff:TIMEOUT_AUTOMATIC==m_nTimeoutType?0:1000*m_nTimeout, + TIMEOUT_NONE==m_nTimeoutType?0x7fffffff:TIMEOUT_AUTOMATIC==m_nTimeoutType?900000:1000*m_nTimeout, TIMEOUT_NONE==m_nDownloadTimeoutType?0x7fffffff:TIMEOUT_AUTOMATIC==m_nDownloadTimeoutType?0:1000*m_nDownloadTimeout); if(m_bRemote){ CTestResource::SetResourceServer(CeCosSocket::HostPort(m_strResourceHost,m_nResourcePort)); diff --git a/host/tools/testtool/win32/RunTestsSheet.h b/host/tools/testtool/win32/RunTestsSheet.h --- a/host/tools/testtool/win32/RunTestsSheet.h +++ b/host/tools/testtool/win32/RunTestsSheet.h @@ -33,6 +33,7 @@ ///////////////////////////////////////////////////////////////////////////// // CRunTestsSheet +#include "stdafx.h" #include "ExecutionPage.h" #include "OutputPage.h" #include "SummaryPage.h" @@ -76,6 +77,7 @@ protected: // Operations public: void SetTarget(LPCTSTR pszTarget); + void SetResetNone() { m_nReset = RESET_NONE; }; // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CRunTestsSheet) diff --git a/host/tools/testtool/win32/TestTool.rc b/host/tools/testtool/win32/TestTool.rc --- a/host/tools/testtool/win32/TestTool.rc +++ b/host/tools/testtool/win32/TestTool.rc @@ -220,21 +220,21 @@ CAPTION "New Platform" FONT 8, "MS Sans Serif" BEGIN LTEXT "Platform &name:",IDC_STATIC,7,7,48,8 + EDITTEXT IDC_TT_NEW_PLATFORM,81,7,143,14,ES_AUTOHSCROLL LTEXT "Command &prefix:",IDC_STATIC,7,27,53,8 + COMBOBOX IDC_TT_NEW_PLATFORM_PREFIX,81,27,143,74,CBS_DROPDOWN | + CBS_SORT | WS_VSCROLL | WS_TABSTOP LTEXT "Arguments for &GDB:",IDC_STATIC,7,45,64,8 EDITTEXT IDC_TT_NEW_PLATFORM_GDB,81,45,143,70,ES_MULTILINE | - WS_VSCROLL | WS_HSCROLL - DEFPUSHBUTTON "OK",IDOK,115,193,50,14 - PUSHBUTTON "Cancel",IDCANCEL,174,193,50,14 - EDITTEXT IDC_TT_NEW_PLATFORM,81,7,143,14,ES_AUTOHSCROLL - COMBOBOX IDC_TT_NEW_PLATFORM_PREFIX,81,27,143,74,CBS_DROPDOWN | - CBS_SORT | WS_VSCROLL | WS_TABSTOP + ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL LTEXT "Inferior:",IDC_STATIC,7,121,24,8 EDITTEXT IDC_INFERIOR,81,121,143,14,ES_AUTOHSCROLL LTEXT "Prompt:",IDC_STATIC,7,141,25,8 EDITTEXT IDC_PROMPT,81,141,143,14,ES_AUTOHSCROLL CONTROL "Server-side GDB",IDC_SERVER_SIDE_GDB,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,81,161,69,10 + DEFPUSHBUTTON "OK",IDOK,115,193,50,14 + PUSHBUTTON "Cancel",IDCANCEL,174,193,50,14 END IDD_TT_NEW_PLATFORM DIALOG DISCARDABLE 0, 0, 168, 50 diff --git a/packages/compat/uitron/current/ChangeLog b/packages/compat/uitron/current/ChangeLog --- a/packages/compat/uitron/current/ChangeLog +++ b/packages/compat/uitron/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-15 Gary Thomas + + * include/uit_ifnc.h (CYGPRI_UITRON_SET_RETCODE): Always return + 'HANDLED'. This fixes some confusion when interrupt chaining. + 2000-05-15 Hugo Tyson * include/uit_ifnc.h (cyg_uitron_dsr): make this be extern "C" diff --git a/packages/compat/uitron/current/include/uit_ifnc.h b/packages/compat/uitron/current/include/uit_ifnc.h --- a/packages/compat/uitron/current/include/uit_ifnc.h +++ b/packages/compat/uitron/current/include/uit_ifnc.h @@ -106,7 +106,7 @@ ER isnd_msg ( ID mbxid, T_MSG *pk_m #define CYGPRI_UITRON_SET_RETCODE( _z_ ) do { \ extern volatile int cyg_uit_dsr_actions_head; \ extern volatile int cyg_uit_dsr_actions_tail; \ - (_z_) = (cyg_uit_dsr_actions_head == cyg_uit_dsr_actions_tail) ? 0 : 3; \ + (_z_) = (cyg_uit_dsr_actions_head == cyg_uit_dsr_actions_tail) ? 1 : 3; \ } while ( 0 ) //void ret_wup ( ID tskid ); diff --git a/packages/devs/eth/arm/ebsa285/current/ChangeLog b/packages/devs/eth/arm/ebsa285/current/ChangeLog --- a/packages/devs/eth/arm/ebsa285/current/ChangeLog +++ b/packages/devs/eth/arm/ebsa285/current/ChangeLog @@ -1,3 +1,27 @@ +2000-06-14 Hugo Tyson + + * cdl/ebsa285_eth_drivers.cdl: Add option to control statistics + keeping. + + * include/ebsa285_info.h: Act on it. + +2000-06-13 Hugo Tyson + + * cdl/ebsa285_eth_drivers.cdl: Properly include the new header + file and define symbols to allow client code to get at it without + knowing the particular device driver name. + + * include/ebsa285_info.h: New file: export various statistics + information about the driver for use by monitoring and + network-management systems. This requires exposing the + (otherwise) internal structures of the driver. + + * src/if_ebsa285.c: remove a lot of structure definitions &c that + are now necessarily in the new header; add a couple of new + routines which provide status and update statistics from the + device into memory; tidy up control of whether stats-keeping is + enabled. + 2000-06-06 Hugo Tyson * cdl/ebsa285_eth_drivers.cdl (define_proc): Add #define of diff --git a/packages/devs/eth/arm/ebsa285/current/cdl/ebsa285_eth_drivers.cdl b/packages/devs/eth/arm/ebsa285/current/cdl/ebsa285_eth_drivers.cdl --- a/packages/devs/eth/arm/ebsa285/current/cdl/ebsa285_eth_drivers.cdl +++ b/packages/devs/eth/arm/ebsa285/current/cdl/ebsa285_eth_drivers.cdl @@ -55,16 +55,18 @@ cdl_package CYGPKG_DEVS_ETH_ARM_EBSA285 implements CYGHWR_NET_DRIVERS include_dir cyg/devs/eth - # none exported about the *device* but this one is used by other tests: - include_files tests/test_net_realtime.h + # SNMP demands to know stuff; this sadly makes us break the neat + # abstraction of the device having nothing exported. + # The other one is used by other tests: + include_files tests/test_net_realtime.h include/ebsa285_info.h # and tell them that it is available define_proc { puts $::cdl_header \ "#define CYGTST_DEVS_ETH_TEST_NET_REALTIME " - puts $::cdl_header \ - "#define CYGDAT_DEVS_ETH_DESCRIPTION \"Intel EtherPro 10/100+ for EBSA285 (i82559/PCI)\"" puts $::cdl_system_header \ "#define CYGBLD_DEVS_ETH_DEVICE_H " + puts $::cdl_header \ + "#define CYGBLD_DEVS_ETH_INFO_H " } description "Ethernet driver for Intel EBSA285 with PRO/100+ boards." @@ -81,6 +83,17 @@ cdl_package CYGPKG_DEVS_ETH_ARM_EBSA285 connection." } + cdl_option CYGDBG_DEVS_ETH_ARM_EBSA285_KEEP_STATISTICS { + display "Keep Ethernet statistics" + default_value 1 + description " + The ethernet device can maintain statistics about the network, + specifically a great variety of error rates which are useful + for network management. SNMP for example uses this + information. There is some performance cost in maintaining + this information; disable this option to recoup that." + } + cdl_component CYGPKG_DEVS_ETH_ARM_EBSA285_WRITE_EEPROM { display "SIOCSIFHWADDR records MAC address in EEPROM" default_value 0 diff --git a/packages/devs/eth/arm/ebsa285/current/include/ebsa285_info.h b/packages/devs/eth/arm/ebsa285/current/include/ebsa285_info.h new file mode 100644 --- /dev/null +++ b/packages/devs/eth/arm/ebsa285/current/include/ebsa285_info.h @@ -0,0 +1,293 @@ +#ifndef CYGONCE_DEVS_ETH_ARM_EBSA285_EBSA285_INFO_H +#define CYGONCE_DEVS_ETH_ARM_EBSA285_EBSA285_INFO_H +/*========================================================================== +// +// ebsa285_info.h +// +// +//========================================================================== +//####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): hmt +// Contributors: hmt +// Date: 2000-05-03 +// Description: +// +//####DESCRIPTIONEND#### +*/ + +#include + +#ifdef CYGDBG_DEVS_ETH_ARM_EBSA285_KEEP_STATISTICS +# define KEEP_STATISTICS +# define nDISPLAY_STATISTICS +# define nDISPLAY_82559_STATISTICS +#else +# define nKEEP_STATISTICS +# define nDISPLAY_STATISTICS +# define nDISPLAY_82559_STATISTICS +#endif + + +// ------------------------------------------------------------------------ +// +// STATISTICAL COUNTER STRUCTURE +// +// ------------------------------------------------------------------------ +#ifdef KEEP_STATISTICS +typedef struct { +/* 0 */ cyg_uint32 tx_good; +/* 4 */ cyg_uint32 tx_max_collisions; +/* 8 */ cyg_uint32 tx_late_collisions; +/* 12 */ cyg_uint32 tx_underrun; +/* 16 */ cyg_uint32 tx_carrier_loss; +/* 20 */ cyg_uint32 tx_deferred; +/* 24 */ cyg_uint32 tx_single_collisions; +/* 28 */ cyg_uint32 tx_mult_collisions; +/* 32 */ cyg_uint32 tx_total_collisions; +/* 36 */ cyg_uint32 rx_good; +/* 40 */ cyg_uint32 rx_crc_errors; +/* 44 */ cyg_uint32 rx_align_errors; +/* 48 */ cyg_uint32 rx_resource_errors; +/* 52 */ cyg_uint32 rx_overrun_errors; +/* 56 */ cyg_uint32 rx_collisions; // Always 0 +/* 60 */ cyg_uint32 rx_short_frames; +// In this setup; can also be flow-control counts after. +// If these are to be used, a config command (as in set promiscuous mode) +// must be issued at start, to let those stats escape. Params are in +// comments around the config command setup... +/* 64 */ cyg_uint32 done; +} I82559_COUNTERS; + + +typedef struct { + cyg_uint32 interrupts; + cyg_uint32 rx_count; + cyg_uint32 rx_deliver; + cyg_uint32 rx_resource; + cyg_uint32 rx_restart; + cyg_uint32 tx_count; + cyg_uint32 tx_complete; + cyg_uint32 tx_dropped; +} STATISTICS; + + +extern STATISTICS statistics[2]; +extern I82559_COUNTERS i82559_counters[2]; + +#endif // KEEP_STATISTICS + +// ------------------------------------------------------------------------ +// +// DEVICES AND PACKET QUEUES +// +// ------------------------------------------------------------------------ +// The system seems to work OK with as few as 8 of RX and TX descriptors. +// It limps very painfully with only 4. +// Performance is better with more than 8. +// But the size of non-cached (so useless for anything else) +// memory window is 1Mb, so we might as well use it all. +// +// 128 for these uses the whole 1Mb, near enough. + +#ifndef MAX_RX_DESCRIPTORS +#define MAX_RX_DESCRIPTORS 128 // number of Rx descriptors +#endif +#ifndef MAX_TX_DESCRIPTORS +#define MAX_TX_DESCRIPTORS 128 // number of Tx descriptors +#endif + + +typedef struct i82559 { + cyg_uint8 // (split up for atomic byte access) + found:1, // was hardware discovered? + mac_addr_ok:1, // can we bring up? + active:1, // has this if been brung up? + spare1:5; + cyg_uint8 + spare2:8; + cyg_uint8 + tx_in_progress:1, // transmit in progress flag + tx_queue_full:1, // all Tx descriptors used flag + spare3:6; + cyg_uint8 index; // 0 or 1 or whatever + cyg_uint32 devid; // PCI device id + cyg_uint32 memory_address; // PCI memory address + cyg_uint32 io_address; // memory mapped I/O address + cyg_uint8 mac_address[6]; // mac (hardware) address + void *ndp; // Network Device Pointer + + int next_rx_descriptor; // descriptor index for RFDs + struct rfd *rx_ring[MAX_RX_DESCRIPTORS]; // location of Rx descriptors + + int tx_descriptor_add; // descriptor index for additions + int tx_descriptor_active; // descriptor index for active tx + int tx_descriptor_remove; // descriptor index for remove + + struct txcb *tx_ring[MAX_TX_DESCRIPTORS]; // location of Tx descriptors + unsigned long tx_keys[MAX_TX_DESCRIPTORS]; + // keys for tx q management + + // Interrupt handling stuff + cyg_vector_t vector; // interrupt vector + cyg_handle_t interrupt_handle; // handle for int.handler + cyg_interrupt interrupt_object; + +#ifdef KEEP_STATISTICS + void *p_statistics; // pointer to statistical counters +#endif + +} I82559; + + + +// ------------------------------------------------------------------------ +// +// 82559 GENERAL STATUS REGISTER +// +// ------------------------------------------------------------------------ +#define GEN_STATUS_FDX 0x04 // 1 = full duplex, 0 = half +#define GEN_STATUS_100MBPS 0x02 // 1 = 100 Mbps, 0 = 10 Mbps +#define GEN_STATUS_LINK 0x01 // 1 = link up, 0 = link down + +extern int i82559_status( struct eth_drv_sc *sc ); + +// ------------------------------------------------------------------------ + +#ifdef KEEP_STATISTICS +void update_statistics(struct i82559* p_i82559); +#endif + + +#ifdef KEEP_STATISTICS +#define ETH_STATS_INIT( p ) \ + int _tmp; \ + update_statistics( (struct i82559 *)((p)->driver_private) ) + +#else +#define ETH_STATS_INIT( p ) int _tmp // otherwise do nothing +#endif + +#define CYGDAT_DEVS_ETH_DESCRIPTION "Intel EtherPRO 10/100+ (i82559)" + +//#define ETH_DEV_IFTYPE( p ) // handled in if.c + +//#define ETH_DEV_IFMTU( p ) // handled in if.c + +// 100,000,000 or 10,000,000 - or twice that if duplex +#define ETH_DEV_IFSPEED( p ) \ +(_tmp = i82559_status((p)), \ + ((GEN_STATUS_100MBPS & _tmp) ? 100 : 10) * 1000000) + +#define ETH_DEV_FULLDUPLEX( p ) \ +(_tmp = i82559_status((p)), \ + ((GEN_STATUS_FDX & _tmp) ? 1 : 0) ) + +#define ETH_DEV_IFADMINSTATUS( p ) \ +(_tmp = i82559_status((p)), \ + (((GEN_STATUS_LINK & _tmp) ? 1 : 2)) ) // 1 is up, 2 is down + +#define ETH_DEV_IFOPERSTATUS( p ) \ +(_tmp = i82559_status((p)), \ + (((GEN_STATUS_LINK & _tmp) ? 1 : 2)) ) // 1 is up, 2 is down + +#define ETH_DEV_IFOUTQLEN( p ) MAX_TX_DESCRIPTORS + +#ifdef KEEP_STATISTICS + +#define ETH_DEV_IFOUTDISCARDS( p ) \ + (statistics[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_dropped) + +#define ETH_DEV_STATSALIGNMENTERRORS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].rx_align_errors) + +#define ETH_DEV_STATSFCSERRORS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].rx_crc_errors) + +#define ETH_DEV_STATSSINGLECOLLISIONFRAMES( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_single_collisions) + +#define ETH_DEV_STATSMULTIPLECOLLISIONFRAMES( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_mult_collisions) + +//#define ETH_DEV_STATSSQETESTERRORS( p ) \ +// (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ +// ].) + +#define ETH_DEV_STATSDEFERREDTRANSMISSIONS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_deferred) + +#define ETH_DEV_STATSLATECOLLISIONS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_late_collisions) + +#define ETH_DEV_STATSEXCESSIVECOLLISIONS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_max_collisions) + +#define ETH_DEV_STATSINTERNALMACTRANSMITERRORS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_underrun) // TX UNDERRUNS listed here + +#define ETH_DEV_STATSCARRIERSENSEERRORS( p ) \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].tx_carrier_loss) + +//#define ETH_DEV_STATSFRAMETOOLONGS( p ) \ +// (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ +// ].) + +#define ETH_DEV_STATSINTERNALMACRECEIVEERRORS( p ) ( \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].rx_overrun_errors) + \ + (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ + ].rx_resource_errors) ) // RX OVERRUNS + RX RESOURCE ERRORS counted + +//#define ETH_DEV_STATSSYMBOLERRORS( p ) \ +// (i82559_counters[ ((struct i82559 *)((p)->driver_private))->index \ +// ].) + + +#endif // KEEP_STATISTICS + +// This identifies the chip (as best we can; there is no number for 82559 +// yet, so I claim to be an 82558 pro tem. +// This is { dot3ChipSetIntel 5 } == { dot3ChipSets 2 5 } == { dot3 8 2 5} +// dot3 is { transmission 7 }. + +#define ETH_DEV_DOT3STATSETHERCHIPSET 1,3,6,1,2,1,10,7,8,2,5 + +#endif /* ifndef CYGONCE_DEVS_ETH_ARM_EBSA285_EBSA285_INFO_H */ + +/* EOF ebsa285_info.h */ + diff --git a/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c b/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c --- a/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c +++ b/packages/devs/eth/arm/ebsa285/current/src/if_ebsa285.c @@ -70,6 +70,8 @@ #error "Need PCI package here" #endif +#include CYGBLD_DEVS_ETH_INFO_H // some state we must export + // ------------------------------------------------------------------------ #ifdef CYGDBG_DEVS_ETH_ARM_EBSA285_CHATTER @@ -78,9 +80,6 @@ #define DEBUG_EE // Some EEPROM specific retries &c #endif -#define nKEEP_STATISTICS -#define nDISPLAY_STATISTICS -#define nDISPLAY_82559_STATISTICS #define os_printf diag_printf @@ -166,16 +165,6 @@ static inline cyg_uint32 bus_to_virt(cyg // ------------------------------------------------------------------------ // -// 82559 GENERAL STATUS REGISTER -// -// ------------------------------------------------------------------------ -#define GEN_STATUS_FDX 0x04 // 1 = full duplex, 0 = half -#define GEN_STATUS_100MBPS 0x02 // 1 = 100 Mbps, 0 = 10 Mbps -#define GEN_STATUS_LINK 0x01 // 1 = link up, 0 = link down - - -// ------------------------------------------------------------------------ -// // 82559 EEPROM INTERFACE // // ------------------------------------------------------------------------ @@ -282,7 +271,7 @@ typedef struct rfd { #define RFD_RX_TCO 0x00000001 // TCO indication -typedef struct { +typedef struct rbd { volatile cyg_uint32 count:14, // bytes used in buffer f:1, // buffer has been used (filled) eof:1; // last receive buffer in frame @@ -298,7 +287,7 @@ typedef struct { // TRANSMIT FRAME DESCRIPTORS // // ------------------------------------------------------------------------ -typedef struct { +typedef struct txcb { volatile cyg_uint32 status:16, // result of transmit operation command:16; // transmit command volatile cyg_uint32 link; // offset from RU base to next RFD @@ -349,107 +338,19 @@ typedef struct { // // ------------------------------------------------------------------------ #ifdef KEEP_STATISTICS -typedef struct { - cyg_uint32 tx_good; - cyg_uint32 tx_max_collisions; - cyg_uint32 tx_late_collisions; - cyg_uint32 tx_underrun; - cyg_uint32 tx_carrier_loss; - cyg_uint32 tx_deferred; - cyg_uint32 tx_single_collisions; - cyg_uint32 tx_mult_collisions; - cyg_uint32 tx_total_collisions; - cyg_uint32 rx_good; - cyg_uint32 rx_crc_errors; - cyg_uint32 rx_align_errors; - cyg_uint32 rx_resource_errors; - cyg_uint32 rx_overrun_errors; - cyg_uint32 rx_collisions; - cyg_uint32 rx_short_frames; - cyg_uint32 done; -} I82559_COUNTERS; - - -typedef struct { - cyg_uint32 interrupts; - cyg_uint32 rx_count; - cyg_uint32 rx_deliver; - cyg_uint32 rx_resource; - cyg_uint32 rx_restart; - cyg_uint32 tx_count; - cyg_uint32 tx_complete; - cyg_uint32 tx_dropped; -} STATISTICS; - - STATISTICS statistics[2]; I82559_COUNTERS i82559_counters[2]; - #endif // KEEP_STATISTICS // ------------------------------------------------------------------------ +// +// DEVICES AND PACKET QUEUES +// +// ------------------------------------------------------------------------ #define MAX_RX_PACKET_SIZE 1536 // maximum Rx packet size #define MAX_TX_PACKET_SIZE 1536 // maximum Tx packet size -// The system seems to work OK with as few as 8 of RX and TX descriptors. -// It limps very painfully with only 4. -// Performance is better with more than 8. -// But the size of non-cached (so useless for anything else) -// memory window is 1Mb, so we might as well use it all. -// -// 128 for these uses the whole 1Mb, near enough. - -#ifndef MAX_RX_DESCRIPTORS -#define MAX_RX_DESCRIPTORS 128 // number of Rx descriptors -#endif -#ifndef MAX_TX_DESCRIPTORS -#define MAX_TX_DESCRIPTORS 128 // number of Tx descriptors -#endif - - - -typedef struct i82559 { - cyg_uint8 // (split up for atomic byte access) - found:1, // was hardware discovered? - mac_addr_ok:1, // can we bring up? - active:1, // has this if been brung up? - spare1:5; - cyg_uint8 - spare2:8; - cyg_uint8 - tx_in_progress:1, // transmit in progress flag - tx_queue_full:1, // all Tx descriptors used flag - spare3:6; - cyg_uint8 index; // 0 or 1 or whatever - cyg_uint32 devid; // PCI device id - cyg_uint32 memory_address; // PCI memory address - cyg_uint32 io_address; // memory mapped I/O address - cyg_uint8 mac_address[6]; // mac (hardware) address - void *ndp; // Network Device Pointer - - int next_rx_descriptor; // descriptor index for RFDs - RFD *rx_ring[MAX_RX_DESCRIPTORS]; // location of Rx descriptors - - int tx_descriptor_add; // descriptor index for additions - int tx_descriptor_active; // descriptor index for active tx - int tx_descriptor_remove; // descriptor index for remove - - TxCB *tx_ring[MAX_TX_DESCRIPTORS]; // location of Tx descriptors - unsigned long tx_keys[MAX_TX_DESCRIPTORS]; - // keys for tx q management - - // Interrupt handling stuff - cyg_vector_t vector; // interrupt vector - cyg_handle_t interrupt_handle; // handle for int.handler - cyg_interrupt interrupt_object; - -#ifdef KEEP_STATISTICS - void *p_statistics; // pointer to statistical counters -#endif - -} I82559; - // This is encapsulated here so that a change to > 2 interfaces can // easily be accommodated. @@ -552,6 +453,7 @@ static int eth_set_promiscuous_mode(stru // debugging/logging only: void dump_txcb(TxCB *p_txcb); void DisplayStatistics(void); +void update_statistics(struct i82559* p_i82559); void dump_rfd(RFD *p_rfd, int anyway ); void dump_all_rfds( int intf ); void dump_packet(cyg_uint8 *p_buffer, int length); @@ -1002,10 +904,8 @@ static void i82559_start( struct eth_drv struct i82559 *p_i82559; cyg_uint32 ioaddr; #ifdef KEEP_STATISTICS -#ifdef DISPLAY_82559_STATISTICS void *p_statistics; #endif -#endif p_i82559 = (struct i82559 *)sc->driver_private; @@ -1031,7 +931,6 @@ static void i82559_start( struct eth_drv ioaddr = p_i82559->io_address; // get 82559's I/O address #ifdef KEEP_STATISTICS -#ifdef DISPLAY_82559_STATISTICS p_i82559->p_statistics = p_statistics = pciwindow_mem_alloc(sizeof(I82559_COUNTERS)); memset(p_statistics, 0xFFFFFFFF, sizeof(I82559_COUNTERS)); @@ -1043,7 +942,6 @@ static void i82559_start( struct eth_drv wait_for_cmd_done(ioaddr); // make sure no command operating OUTW(SCB_M | CU_DUMPSTATS, ioaddr + SCBCmd); // start register dump #endif -#endif // Set the base address wait_for_cmd_done(ioaddr); @@ -1064,8 +962,7 @@ static void i82559_start( struct eth_drv } #ifdef DEBUG { - int status; - status = INB(ioaddr + SCBGenStatus); + int status = i82559_status( sc ); os_printf("i82559_start %d flg %x Link = %s, %s Mbps, %s Duplex\n", p_i82559->index, *(int *)p_i82559, @@ -1078,6 +975,32 @@ static void i82559_start( struct eth_drv // ------------------------------------------------------------------------ // +// Function : i82559_status +// +// ------------------------------------------------------------------------ +int i82559_status( struct eth_drv_sc *sc ) +{ + int status; + struct i82559 *p_i82559; + cyg_uint32 ioaddr; + p_i82559 = (struct i82559 *)sc->driver_private; + + IF_BAD_82559( p_i82559 ) { +#ifdef DEBUG + os_printf( "i82559_status: Bad device pointer %x\n", p_i82559 ); +#endif + return 0; + } + + ioaddr = p_i82559->io_address; // get 82559's I/O address + + status = INB(ioaddr + SCBGenStatus); + + return status; +} + +// ------------------------------------------------------------------------ +// // Function : BringDown82559 // // ------------------------------------------------------------------------ @@ -2016,18 +1939,18 @@ static int eth_set_promiscuous_mode(stru ccs->config_bytes[3]=0x0; ccs->config_bytes[4]=0x0; ccs->config_bytes[5]=0x0; - ccs->config_bytes[6]=0xb2; - ccs->config_bytes[7]=0x0; - ccs->config_bytes[8]=0x0; + ccs->config_bytes[6]=0xb2; // (promisc ? 0x80 : 0) | 0x32 for small stats, + ccs->config_bytes[7]=0x0; // \ ditto | 0x12 for stats with PAUSE stats + ccs->config_bytes[8]=0x0; // \ ditto | 0x16 for PAUSE + TCO stats ccs->config_bytes[9]=0x0; ccs->config_bytes[10]=0x28; ccs->config_bytes[11]=0x0; ccs->config_bytes[12]=0x60; - ccs->config_bytes[13]=0x0; // arp - ccs->config_bytes[14]=0x0; // arp + ccs->config_bytes[13]=0x0; // arp + ccs->config_bytes[14]=0x0; // arp - ccs->config_bytes[15]=0x81; // promiscuous mode set - + ccs->config_bytes[15]=0x81; // promiscuous mode set + // \ or 0x80 for normal mode. ccs->config_bytes[16]=0x0; ccs->config_bytes[17]=0x40; ccs->config_bytes[18]=0x70; @@ -2376,6 +2299,46 @@ static int i82559_ioctl(struct eth_drv_s // ------------------------------------------------------------------------ // +// Statistics update... +// +// ------------------------------------------------------------------------ + +#ifdef KEEP_STATISTICS +void update_statistics(struct i82559* p_i82559) +{ + I82559_COUNTERS *p_statistics; + cyg_uint32 *p_counter; + cyg_uint32 *p_register; + int reg_count; + + Mask82559Interrupt(p_i82559); + + // This points to the sthared memory stats area/command block + p_statistics = (I82559_COUNTERS *)(p_i82559->p_statistics); + + if ( (p_statistics->done & 0xFFFF) == 0xA007 ) { + p_counter = (cyg_uint32 *)&i82559_counters[ p_i82559->index ]; + p_register = (cyg_uint32 *)p_statistics; + for ( reg_count = 0; + reg_count < sizeof( I82559_COUNTERS ) / sizeof( cyg_uint32 ) - 1; + reg_count++ ) { + *p_counter += *p_register; + p_counter++; + p_register++; + } + p_statistics->done = 0; + // make sure no command operating + wait_for_cmd_done(p_i82559->io_address); + // start register dump + OUTW(CU_DUMPSTATS, p_i82559->io_address + SCBCmd); + } + Acknowledge82559Interrupt(p_i82559); + UnMask82559Interrupt(p_i82559); +} +#endif // KEEP_STATISTICS + +// ------------------------------------------------------------------------ +// // // CODE FOR DEBUGGING PURPOSES ONLY // diff --git a/packages/devs/serial/arm/pid/current/ChangeLog b/packages/devs/serial/arm/pid/current/ChangeLog --- a/packages/devs/serial/arm/pid/current/ChangeLog +++ b/packages/devs/serial/arm/pid/current/ChangeLog @@ -1,3 +1,10 @@ +2000-06-09 Jesper Skov + + * src/pid_serial_with_ints.c: + * src/pid_serial.h: + Cleaned up defines and made DSR handle all received characters. + (Dave Airlie (airlied at parthus dot com)) + 2000-04-11 Hugo Tyson * cdl/ser_arm_pid.cdl: Change the parent from CYGPKG_IO_SERIAL diff --git a/packages/devs/serial/arm/pid/current/src/pid_serial.h b/packages/devs/serial/arm/pid/current/src/pid_serial.h --- a/packages/devs/serial/arm/pid/current/src/pid_serial.h +++ b/packages/devs/serial/arm/pid/current/src/pid_serial.h @@ -47,35 +47,35 @@ // Description of serial ports on ARM PID7T struct serial_port { - unsigned char _byte[32]; + volatile unsigned char _byte[32]; }; // Little-endian version #if (CYG_BYTEORDER == CYG_LSBFIRST) -#define reg(n) _byte[n*4] +#define REG(n) _byte[n*4] #else // Big-endian version -#define reg(n) _byte[(n*4)^3] +#define REG(n) _byte[(n*4)^3] #endif -// Receive control registers -#define rhr reg(0) // Receive holding register -#define isr reg(2) // Interrupt status register -#define lsr reg(5) // Line status register -#define msr reg(6) // Modem status register -#define scr reg(7) // Scratch register +// Receive control Registers +#define REG_rhr REG(0) // Receive holding register +#define REG_isr REG(2) // Interrupt status register +#define REG_lsr REG(5) // Line status register +#define REG_msr REG(6) // Modem status register +#define REG_scr REG(7) // Scratch register -// Transmit control registers -#define thr reg(0) // Transmit holding register -#define ier reg(1) // Interrupt enable register -#define fcr reg(2) // FIFO control register -#define lcr reg(3) // Line control register -#define mcr reg(4) // Modem control register -#define ldl reg(0) // LSB of baud rate -#define mdl reg(1) // MSB of baud rate +// Transmit control Registers +#define REG_thr REG(0) // Transmit holding register +#define REG_ier REG(1) // Interrupt enable register +#define REG_fcr REG(2) // FIFO control register +#define REG_lcr REG(3) // Line control register +#define REG_mcr REG(4) // Modem control register +#define REG_ldl REG(0) // LSB of baud rate +#define REG_mdl REG(1) // MSB of baud rate // Interrupt Enable Register #define IER_RCV 0x01 @@ -107,7 +107,7 @@ struct serial_port { #define MCR_RTS 0x02 #define MCR_INT 0x08 // Enable interrupts -// Interrupt status register +// Interrupt status Register #define ISR_Tx 0x02 #define ISR_Rx 0x04 #define ISR_RxTO 0x0C diff --git a/packages/devs/serial/arm/pid/current/src/pid_serial_with_ints.c b/packages/devs/serial/arm/pid/current/src/pid_serial_with_ints.c --- a/packages/devs/serial/arm/pid/current/src/pid_serial_with_ints.c +++ b/packages/devs/serial/arm/pid/current/src/pid_serial_with_ints.c @@ -168,26 +168,26 @@ pid_serial_config_port(serial_channel *c unsigned short baud_divisor = select_baud[new_config->baud]; unsigned char _lcr, _ier; if (baud_divisor == 0) return false; // Invalid configuration - _ier = port->ier; - port->ier = 0; // Disable port interrupts while changing hardware + _ier = port->REG_ier; + port->REG_ier = 0; // Disable port interrupts while changing hardware _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] | select_stop_bits[new_config->stop] | select_parity[new_config->parity]; - port->lcr = _lcr; - port->lcr |= LCR_DL; - port->mdl = baud_divisor >> 8; - port->ldl = baud_divisor & 0xFF; - port->lcr &= ~LCR_DL; + port->REG_lcr = _lcr; + port->REG_lcr |= LCR_DL; + port->REG_mdl = baud_divisor >> 8; + port->REG_ldl = baud_divisor & 0xFF; + port->REG_lcr &= ~LCR_DL; if (init) { - port->fcr = 0x07; // Enable and clear FIFO + port->REG_fcr = 0x07; // Enable and clear FIFO if (chan->out_cbuf.len != 0) { - port->ier = IER_RCV; + port->REG_ier = IER_RCV; } else { - port->ier = 0; + port->REG_ier = 0; } - port->mcr = MCR_INT|MCR_DTR|MCR_RTS; // Master interrupt enable + port->REG_mcr = MCR_INT|MCR_DTR|MCR_RTS; // Master interrupt enable } else { - port->ier = _ier; + port->REG_ier = _ier; } if (new_config != &chan->config) { chan->config = *new_config; @@ -238,9 +238,9 @@ pid_serial_putc(serial_channel *chan, un { pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - if (port->lsr & LSR_THE) { + if (port->REG_lsr & LSR_THE) { // Transmit buffer is empty - port->thr = c; + port->REG_thr = c; return true; } else { // No space @@ -255,8 +255,8 @@ pid_serial_getc(serial_channel *chan) unsigned char c; pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - while ((port->lsr & LSR_RSR) == 0) ; // Wait for char - c = port->rhr; + while ((port->REG_lsr & LSR_RSR) == 0) ; // Wait for char + c = port->REG_rhr; return c; } @@ -273,7 +273,7 @@ pid_serial_start_xmit(serial_channel *ch { pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - port->ier |= IER_XMT; // Enable xmit interrupt + port->REG_ier |= IER_XMT; // Enable xmit interrupt } // Disable the transmitter on the device @@ -282,7 +282,7 @@ pid_serial_stop_xmit(serial_channel *cha { pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; - port->ier &= ~IER_XMT; // Disable xmit interrupt + port->REG_ier &= ~IER_XMT; // Disable xmit interrupt } // Serial I/O - low level interrupt handler (ISR) @@ -304,13 +304,12 @@ pid_serial_DSR(cyg_vector_t vector, cyg_ pid_serial_info *pid_chan = (pid_serial_info *)chan->dev_priv; volatile struct serial_port *port = (volatile struct serial_port *)pid_chan->base; unsigned char isr; - while ((isr = port->isr & 0x0E) != 0) { + while ((isr = port->REG_isr & 0x0E) != 0) { if (isr == ISR_Tx) { (chan->callbacks->xmt_char)(chan); - } else if (isr == ISR_RxTO) { - (chan->callbacks->rcv_char)(chan, port->rhr); - } else if (isr == ISR_Rx) { - (chan->callbacks->rcv_char)(chan, port->rhr); + } else if (isr == ISR_RxTO || isr == ISR_Rx) { + while(port->REG_lsr & LSR_RSR) + (chan->callbacks->rcv_char)(chan, port->REG_rhr); } } cyg_drv_interrupt_unmask(pid_chan->int_num); diff --git a/packages/hal/arm/arch/current/ChangeLog b/packages/hal/arm/arch/current/ChangeLog --- a/packages/hal/arm/arch/current/ChangeLog +++ b/packages/hal/arm/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-06-04 Gary Thomas * src/vectors.S: Add support for platform specific "vectors" diff --git a/packages/hal/arm/arch/current/include/hal_arch.h b/packages/hal/arm/arch/current/include/hal_arch.h --- a/packages/hal/arm/arch/current/include/hal_arch.h +++ b/packages/hal/arm/arch/current/include/hal_arch.h @@ -313,6 +313,12 @@ externC void hal_idle_thread_action(cyg_ (CYGNUM_HAL_STACK_SIZE_MINIMUM + \ 16 * CYGNUM_HAL_STACK_FRAME_SIZE) +//-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_ARCH_H diff --git a/packages/hal/common/current/ChangeLog b/packages/hal/common/current/ChangeLog --- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,65 @@ +2000-06-15 Jesper Skov + + * include/hal_if.h: Added console-include decision logic. + +2000-06-14 Jesper Skov + + * src/hal_stub.c: Added O-packetizer used by GDB stubs for virtual + vector table configs. + + * src/hal_misc.c (hal_default_isr): Check Ctrlc for both CTRLC + or BREAK options. + + * src/hal_if.c: + * include/hal_if.h: + Define console wrappers when necessary. Platform HALs can use + these by providing raw IO functions and some config data. + +2000-06-09 Jesper Skov + + * src/hal_if.c: Implemented most of the remaining services. Some + just don't have an eCos equivalent at the moment. + + * cdl/hal.cdl: Allow virtual_vector options to have sensible + default values depending on when the platform HAL port was + written. + + * src/hal_misc.c (cyg_hal_user_break): Also expect CygMon to + provide the breakpoint service. + + * src/stubrom/stubrom.c (cyg_start): Reverted change. Now handled + by hal_if_init. + + * cdl/hal.cdl: Added option for controlling use of diag services + in the virtual vector table. + +2000-06-08 Jesper Skov + + * src/stubrom/stubrom.c: Call hal_diag_init to ensure IF table + entries related to diag IO get initialized. + + * src/hal_stub.c (cyg_hal_gdb_interrupt): save/restore GP so it + can be used by MIPS platforms. + Use reset function in ROM if available. + + * src/hal_misc.c: + * include/hal_misc.h: Functions shared between HALs. More + functions are likely to be moved here if appropriate. + + * src/hal_if.c: Interfacing related functions: table init code and + function wrappers. + + * include/hal_if.h: ROM/RAM calling interface table + definitions. The layout is a combination of libbsp and vectors + already in use by some eCos platforms. + + + * cdl/hal.cdl: Added CYGxxx_HAL_VIRTUAL_VECTOR_SUPPORT + options. These are used to control whether a platform uses the new + ROM/RAM calling interface. All platforms will be converted to use + this, but piecemeal over a period of time, thus the requirement + for selecting behavior. + 2000-06-04 Gary Thomas * cdl/hal.cdl: Support variant 'pkgconf' headers. This will allow diff --git a/packages/hal/common/current/cdl/hal.cdl b/packages/hal/common/current/cdl/hal.cdl --- a/packages/hal/common/current/cdl/hal.cdl +++ b/packages/hal/common/current/cdl/hal.cdl @@ -132,6 +132,51 @@ cdl_package CYGPKG_HAL { platform-dependent." + + cdl_interface CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT { + display "Target has virtual vector support" + no_define + } + + + cdl_interface CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_GUARANTEED { + display "The platform port was written with vector support" + no_define + description " + Many platform HALs have adopted the virtual vector support + after its introduction. On those platforms, old ROM + monitors will not provide the necessary services - and + so the use of these services should be disabled per default. + Newer ports, however, guarantee to provide the necessary + services in all ROM monitors, and so default to use the + services." + } + + cdl_component CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT { + display "Enable use of virtual vector calling interface" + active_if CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT + calculated 1 + description " + Virtual vector support allows the HAL to let the ROM + monitor handle certain operations. The virtual vector table + defines a calling interface between applications running in + RAM and the ROM monitor." + compile hal_if.c hal_misc.c + + cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_DIAG { + display "Do diagnostic IO via virtual vector table" + default_value { CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_GUARANTEED } + description " + The virtual vector table provides functions for + diagnostic IO. Using these both reduce the application + size a bit, and allow the ROM monitor to control which + communication intererface to use. Careful when enabling + this option as it may cause output to disappear (if + the ROM monitor does not provide the necessary + services)." + } + } + cdl_option CYGBLD_BUILD_COMMON_GDB_STUBS { display "Build common GDB stub ROM image" default_value 0 diff --git a/packages/hal/common/current/include/hal_if.h b/packages/hal/common/current/include/hal_if.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/include/hal_if.h @@ -0,0 +1,345 @@ +#ifndef CYGONCE_HAL_HAL_IF_H +#define CYGONCE_HAL_HAL_IF_H + +//============================================================================= +// +// hal_if.h +// +// HAL header for ROM/RAM calling interface. +// +//============================================================================= +//####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-06-07 +// Purpose: HAL RAM/ROM calling interface +// Description: ROM/RAM calling interface table definitions. The layout is a +// combination of libbsp and vectors already in use by some +// eCos platforms. +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include // types & externC +#include +#include + + +//-------------------------------------------------------------------------- +typedef int (*bsp_handler_t)(int __irq_nr, void *__regs); + +//-------------------------------------------------------------------------- +// Communication interface table. CYGNUM_CALL_IF_CONSOLE_PROCS and +// CYGNUM_CALL_IF_DEBUG_PROCS point to instances (possibly the same) +// of this table. + +typedef enum { + /* + * For serial ports, the control function may be used to set and get the + * current baud rate. Usage: + * + * err = (*__control)(COMMCTL_SETBAUD, int bits_per_second); + * err => Zero if successful, -1 if error. + * + * baud = (*__control)(COMMCTL_GETBAUD); + * baud => -1 if error, current baud otherwise. + */ + __COMMCTL_SETBAUD=0, + __COMMCTL_GETBAUD, + + /* + * Install and remove debugger interrupt handlers. These are the receiver + * interrupt routines which are used to change control from a running + * program to the debugger stub. + */ + __COMMCTL_INSTALL_DBG_ISR, + __COMMCTL_REMOVE_DBG_ISR, + + /* + * Disable comm port interrupt. Returns TRUE if interrupt was enabled, + * FALSE otherwise. + */ + __COMMCTL_IRQ_DISABLE, + + /* + * Enable comm port interrupt. + */ + __COMMCTL_IRQ_ENABLE, +} __comm_control_cmd_t; + + +#define CYGNUM_COMM_IF_CH_DATA 0 +#define CYGNUM_COMM_IF_WRITE 1 +#define CYGNUM_COMM_IF_READ 2 +#define CYGNUM_COMM_IF_PUTC 3 +#define CYGNUM_COMM_IF_GETC 4 +#define CYGNUM_COMM_IF_CONTROL 5 + +#define CYGNUM_COMM_IF_TABLE_SIZE 8 + +typedef CYG_ADDRWORD hal_virtual_comm_table_t[CYGNUM_COMM_IF_TABLE_SIZE]; + +// The below is a (messy) attempt at adding some type safety to the +// above array. At the same time, the accessors allow the +// implementation to be easily changed in the future (both tag->data +// table and structure implementations have been suggested). + +typedef void* __comm_if_ch_data_t; +#define CYGACC_COMM_IF_CH_DATA(_t_) \ + ((__comm_if_ch_data_t)(((_t_))[CYGNUM_COMM_IF_CH_DATA])) +#define CYGACC_COMM_IF_CH_DATA_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_CH_DATA]=(CYG_ADDRWORD)(_x_) + +typedef void (*__comm_if_write_t)(void* __ch_data, const cyg_uint8* __buf, + cyg_uint32 __len); +#define CYGACC_COMM_IF_WRITE(_t_) \ + ((__comm_if_write_t)(((_t_))[CYGNUM_COMM_IF_WRITE])) +#define CYGACC_COMM_IF_WRITE_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_WRITE]=(CYG_ADDRWORD)(_x_) + +typedef int (*__comm_if_read_t)(void* __ch_data, cyg_uint8* __buf, + cyg_uint32 __len); +#define CYGACC_COMM_IF_READ(_t_) \ + ((__comm_if_read_t)(((_t_))[CYGNUM_COMM_IF_READ])) +#define CYGACC_COMM_IF_READ_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_READ]=(CYG_ADDRWORD)(_x_) + +typedef void (*__comm_if_putc_t)(void* __ch_data, cyg_uint8 __ch); +#define CYGACC_COMM_IF_PUTC(_t_) \ + ((__comm_if_putc_t)(((_t_))[CYGNUM_COMM_IF_PUTC])) +#define CYGACC_COMM_IF_PUTC_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_PUTC]=(CYG_ADDRWORD)(_x_) + +typedef cyg_uint8 (*__comm_if_getc_t)(void* __ch_data); +#define CYGACC_COMM_IF_GETC(_t_) \ + ((__comm_if_getc_t)(((_t_))[CYGNUM_COMM_IF_GETC])) +#define CYGACC_COMM_IF_GETC_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_GETC]=(CYG_ADDRWORD)(_x_) + +typedef int (*__comm_if_control_t)(void *__ch_data, + __comm_control_cmd_t __func, ...); +#define CYGACC_COMM_IF_CONTROL(_t_) \ + ((__comm_if_control_t)(((_t_))[CYGNUM_COMM_IF_CONTROL])) +#define CYGACC_COMM_IF_CONTROL_SET(_t_, _x_) \ + (_t_)[CYGNUM_COMM_IF_CONTROL]=(CYG_ADDRWORD)(_x_) + + +//-------------------------------------------------------------------------- +// Main calling interface table. Will be assigned a location by the +// linker script. Both ROM and RAM startup applications will know about +// the location. +#define CYGNUM_CALL_IF_VERSION 0 +#define CYGNUM_CALL_IF_ICTRL_TABLE 1 +#define CYGNUM_CALL_IF_EXC_TABLE 2 +#define CYGNUM_CALL_IF_DBG_VECTOR 3 +#define CYGNUM_CALL_IF_KILL_VECTOR 4 +#define CYGNUM_CALL_IF_CONSOLE_PROCS 5 +#define CYGNUM_CALL_IF_DEBUG_PROCS 6 +#define CYGNUM_CALL_IF_FLUSH_DCACHE 7 +#define CYGNUM_CALL_IF_FLUSH_ICACHE 8 +#define CYGNUM_CALL_IF_CPU_DATA 9 +#define CYGNUM_CALL_IF_BOARD_DATA 10 +#define CYGNUM_CALL_IF_SYSINFO 11 +#define CYGNUM_CALL_IF_SET_DEBUG_COMM 12 +#define CYGNUM_CALL_IF_SET_CONSOLE_COMM 13 +#define CYGNUM_CALL_IF_SET_SERIAL_BAUD 14 +#define CYGNUM_CALL_IF_DBG_DATA 15 +#define CYGNUM_CALL_IF_DBG_SYSCALL 15 // conflict! +#define CYGNUM_CALL_IF_RESET 16 +#define CYGNUM_CALL_IF_CONSOLE_INTERRUPT_FLAG 17 + +#define CYGNUM_CALL_IF_LAST_ENTRY CYGNUM_CALL_IF_CONSOLE_INTERRUPT_FLAG + +#define CYGNUM_CALL_IF_INSTALL_BPT_FN 35 + +#define CYGNUM_CALL_IF_TABLE_SIZE 64 + +externC CYG_ADDRWORD hal_virtual_vector_table[CYGNUM_CALL_IF_TABLE_SIZE]; + +// Table version is simply the number of the last active entry in the table +// (except INSTALL_BPT_FN since it's so high). +#define CYGNUM_CALL_IF_TABLE_VERSION CYGNUM_CALL_IF_LAST_ENTRY + +// The below is a (messy) attempt at adding some type safety to the +// above array. At the same time, the accessors allow the +// implementation to be easily changed in the future (both tag->data +// table and structure implementations have been suggested). + +typedef int __call_if_version_t; +#define CYGACC_CALL_IF_VERSION() \ + ((__call_if_version_t)hal_virtual_vector_table[CYGNUM_CALL_IF_VERSION]) +#define CYGACC_CALL_IF_VERSION_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_VERSION]=(CYG_ADDRWORD)(_x_) + +typedef void* __call_if_ictrl_table_t; +#define CYGACC_CALL_IF_ICTRL_TABLE() \ + ((__call_if_ictrl_table_t)hal_virtual_vector_table[CYGNUM_CALL_IF_ICTRL_TABLE]) +#define CYGACC_CALL_IF_ICTRL_TABLE_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_ICTRL_TABLE]=(CYG_ADDRWORD)(_x_) + +typedef void* __call_if_exc_table_t; +#define CYGACC_CALL_IF_EXC_TABLE() \ + ((__call_if_exc_table_t)hal_virtual_vector_table[CYGNUM_CALL_IF_EXC_TABLE]) +#define CYGACC_CALL_IF_EXC_TABLE_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_EXC_TABLE]=(CYG_ADDRWORD)(_x_) + +typedef bsp_handler_t *__call_if_dbg_vector_t; +#define CYGACC_CALL_IF_DBG_VECTOR() \ + ((__call_if_dbg_vector_t)hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_VECTOR]) +#define CYGACC_CALL_IF_DBG_VECTOR_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_VECTOR]=(CYG_ADDRWORD)(_x_) + +typedef bsp_handler_t __call_if_kill_vector_t; +#define CYGACC_CALL_IF_KILL_VECTOR() \ + ((__call_if_kill_vector_t)hal_virtual_vector_table[CYGNUM_CALL_IF_KILL_VECTOR]) +#define CYGACC_CALL_IF_KILL_VECTOR_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_KILL_VECTOR]=(CYG_ADDRWORD)(_x_) + +typedef hal_virtual_comm_table_t *__call_if_console_procs_t; +#define CYGACC_CALL_IF_CONSOLE_PROCS() \ + ((__call_if_console_procs_t)hal_virtual_vector_table[CYGNUM_CALL_IF_CONSOLE_PROCS]) +#define CYGACC_CALL_IF_CONSOLE_PROCS_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_CONSOLE_PROCS]=(CYG_ADDRWORD)(_x_) + +typedef hal_virtual_comm_table_t *__call_if_debug_procs_t; +#define CYGACC_CALL_IF_DEBUG_PROCS() \ + ((__call_if_debug_procs_t)hal_virtual_vector_table[CYGNUM_CALL_IF_DEBUG_PROCS]) +#define CYGACC_CALL_IF_DEBUG_PROCS_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_DEBUG_PROCS]=(CYG_ADDRWORD)(_x_) + +typedef void (*__call_if_flush_dcache_t)(void *__p, int __nbytes); +#define CYGACC_CALL_IF_FLUSH_DCACHE() \ + ((__call_if_flush_dcache_t)hal_virtual_vector_table[CYGNUM_CALL_IF_FLUSH_DCACHE]) +#define CYGACC_CALL_IF_FLUSH_DCACHE_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_FLUSH_DCACHE]=(CYG_ADDRWORD)(_x_) + +typedef void (*__call_if_flush_icache_t)(void *__p, int __nbytes); +#define CYGACC_CALL_IF_FLUSH_ICACHE() \ + ((__call_if_flush_icache_t)hal_virtual_vector_table[CYGNUM_CALL_IF_FLUSH_ICACHE]) +#define CYGACC_CALL_IF_FLUSH_ICACHE_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_FLUSH_ICACHE]=(CYG_ADDRWORD)(_x_) + +typedef void* __call_if_cpu_data_t; +#define CYGACC_CALL_IF_CPU_DATA() \ + ((__call_if_cpu_data_t)hal_virtual_vector_table[CYGNUM_CALL_IF_CPU_DATA]) +#define CYGACC_CALL_IF_CPU_DATA_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_CPU_DATA]=(CYG_ADDRWORD)(_x_) + +typedef void* __call_if_board_data_t; +#define CYGACC_CALL_IF_BOARD_DATA() \ + ((__call_if_board_data_t)hal_virtual_vector_table[CYGNUM_CALL_IF_BOARD_DATA]) +#define CYGACC_CALL_IF_BOARD_DATA_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_BOARD_DATA]=(CYG_ADDRWORD)(_x_) + +typedef int (*__call_if_sysinfo_t)(int __id, void* __ap); +//typedef int (*__call_if_sysinfo_t)(enum bsp_info_id __id, va_list __ap); +#define CYGACC_CALL_IF_SYSINFO() \ + ((__call_if_sysinfo_t)hal_virtual_vector_table[CYGNUM_CALL_IF_SYSINFO]) +#define CYGACC_CALL_IF_SYSINFO_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_SYSINFO]=(CYG_ADDRWORD)(_x_) + +typedef int (*__call_if_set_debug_comm_t)(int __comm_id); +#define CYGACC_CALL_IF_SET_DEBUG_COMM() \ + ((__call_if_set_debug_comm_t)hal_virtual_vector_table[CYGNUM_CALL_IF_SET_DEBUG_COMM]) +#define CYGACC_CALL_IF_SET_DEBUG_COMM_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_SET_DEBUG_COMM]=(CYG_ADDRWORD)(_x_) + +typedef int (*__call_if_set_console_comm_t)(int __comm_id); +#define CYGACC_CALL_IF_SET_CONSOLE_COMM() \ + ((__call_if_set_console_comm_t)hal_virtual_vector_table[CYGNUM_CALL_IF_SET_CONSOLE_COMM]) +#define CYGACC_CALL_IF_SET_CONSOLE_COMM_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_SET_CONSOLE_COMM]=(CYG_ADDRWORD)(_x_) + +typedef int (*__call_if_set_serial_baud_t)(int __comm_id, int __baud); +#define CYGACC_CALL_IF_SET_SERIAL_BAUD() \ + ((__call_if_set_serial_baud_t)hal_virtual_vector_table[CYGNUM_CALL_IF_SET_SERIAL_BAUD]) +#define CYGACC_CALL_IF_SET_SERIAL_BAUD_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_SET_SERIAL_BAUD]=(CYG_ADDRWORD)(_x_) + +typedef void* __call_if_dbg_data_t; +#define CYGACC_CALL_IF_DBG_DATA() \ + ((__call_if_dbg_data_t)hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_DATA]) +#define CYGACC_CALL_IF_DBG_DATA_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_DATA]=(CYG_ADDRWORD)(_x_) + +typedef int (*__call_if_dbg_syscall_t) (enum dbg_syscall_ids id, + union dbg_thread_syscall_parms *p ); +#define CYGACC_CALL_IF_DBG_SYSCALL() \ + ((__call_if_dbg_syscall_t)hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_SYSCALL]) +#define CYGACC_CALL_IF_DBG_SYSCALL_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_SYSCALL]=(CYG_ADDRWORD)(_x_) + +typedef void (*__call_if_reset_t)(void); +#define CYGACC_CALL_IF_RESET() \ + ((__call_if_reset_t)hal_virtual_vector_table[CYGNUM_CALL_IF_RESET]) +#define CYGACC_CALL_IF_RESET_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_RESET]=(CYG_ADDRWORD)(_x_) + +typedef int __call_if_console_interrupt_flag_t; +#define CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG() \ + ((__call_if_console_interrupt_flag_t)hal_virtual_vector_table[CYGNUM_CALL_IF_CONSOLE_INTERRUPT_FLAG]) +#define CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_CONSOLE_INTERRUPT_FLAG]=(CYG_ADDRWORD)(_x_) + +typedef void (*__call_if_install_bpt_fn_t)(void *__epc); +#define CYGACC_CALL_IF_INSTALL_BPT_FN() \ + ((__call_if_install_bpt_fn_t)hal_virtual_vector_table[CYGNUM_CALL_IF_INSTALL_BPT_FN]) +#define CYGACC_CALL_IF_INSTALL_BPT_FN_SET(_x_) \ + hal_virtual_vector_table[CYGNUM_CALL_IF_INSTALL_BPT_FN]=(CYG_ADDRWORD)(_x_) + + +//-------------------------------------------------------------------------- +// Functions provided by the HAL interface. +externC void hal_if_init(void); + + +//-------------------------------------------------------------------------- +// Diag wrappers. +externC void hal_if_diag_init(void); +externC void hal_if_diag_write_char(char c); +externC void hal_if_diag_read_char(char *c); + +//-------------------------------------------------------------------------- +// Determining if console code needs to be included, or if it will be +// provided by via the vector table: +// +// The console channel is already handled if (a) stubs are included and the +// console and debug channels are the same, or (b) the console channel is +// the same as the ROM monitor debug channel. +#if (defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) \ + && (CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL)) \ + || (defined(CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs) \ + && (CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == CYGNUM_HAL_VIRTUAL_VECTOR_ROM_DEBUG_CHANNEL)) +# define CYGPRI_CONSOLE_PROCS_HANDLED +#endif + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_IF_H +// End of hal_if.h diff --git a/packages/hal/common/current/include/hal_misc.h b/packages/hal/common/current/include/hal_misc.h new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/include/hal_misc.h @@ -0,0 +1,54 @@ +#ifndef CYGONCE_HAL_HAL_MISC_H +#define CYGONCE_HAL_HAL_MISC_H + +//============================================================================= +// +// hal_misc.h +// +// HAL header for miscellaneous helper routines +// +//============================================================================= +//####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-06-08 +// Purpose: Miscellaneous routines shared between HALs +// Usage: #include +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include // types & externC + +externC cyg_bool cyg_hal_is_break(char *buf, int size); +externC void cyg_hal_user_break( CYG_ADDRWORD *regs ); + +//----------------------------------------------------------------------------- +#endif // CYGONCE_HAL_HAL_MISC_H +// End of hal_misc.h diff --git a/packages/hal/common/current/src/hal_if.c b/packages/hal/common/current/src/hal_if.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/hal_if.c @@ -0,0 +1,455 @@ +//============================================================================= +// +// hal_if.c +// +// ROM/RAM interfacing functions +// +//============================================================================= +//####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-06-07 +// +//####DESCRIPTIONEND#### +// +//============================================================================= + +#include + +#include // assertions + +#include // set/restore GP + +#include // IO macros +#include // our interface + +#include // Diag IO + +#include // stub functionality +#include // reset entry - FIXME, should be moved + + +//-------------------------------------------------------------------------- + +externC void patch_dbg_syscalls(void * vector); +externC void init_thread_syscall(void * vector); + +externC CYG_ADDRWORD hal_interrupt_handlers[]; +externC CYG_ADDRWORD hal_vsr_table[]; + + +//-------------------------------------------------------------------------- +// Configuration control for the services in this feil. +#if defined(CYG_HAL_STARTUP_ROM) || \ + ( defined(CYG_HAL_STARTUP_RAM) && \ + !defined(CYGSEM_HAL_USE_ROM_MONITOR)) +# define CYGPRI_IMPLEMENTS_IF_SERVICES +#endif + +//-------------------------------------------------------------------------- +// Implementations and function wrappers for monitor services +#ifdef CYGPRI_IMPLEMENTS_IF_SERVICES + +static void +reset(void) +{ + // With luck, the platform defines some magic that will cause a hardware + // reset. + HAL_STUB_PLATFORM_RESET(); + +#ifdef HAL_STUB_PLATFORM_RESET_ENTRY + // If that's not the case (above is an empty statement) there may + // be defined an address we can jump to - and effectively + // reinitialize the system. Not quite as good as a reset, but it + // is often enough. + goto *HAL_STUB_PLATFORM_RESET_ENTRY; + +#else +#error " no RESET_ENTRY" +#endif +} + +// This is the system's default kill signal routine. Unless overridden +// by the application, it will cause a board reset when GDB quits the +// connection. (The user can avoid the reset by using the GDB 'detach' +// command instead of 'kill' or 'quit'). +static int +kill_by_reset(int __irq_nr, void* __regs) +{ + reset(); + return 0; +} + +static int +nop_service(void) +{ + // This is the default service. It always returns false (0), and + // _does_ not trigger any assertions. Clients must either cope + // with the service failure or assert. + return 0; +} + +//---------------------------------- +// Comm controls + +static hal_virtual_comm_table_t comm_channels[CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS]; + +static int +set_debug_comm(int __comm_id) +{ + static int __selected_id; + + CYG_ASSERT(-1 == __comm_id + || __comm_id < CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS, + "Invalid channel"); + + if (-1 == __comm_id) + return __selected_id; + + __selected_id = __comm_id; + + CYGACC_CALL_IF_DEBUG_PROCS_SET(comm_channels[__comm_id]); + + return 1; +} + +static int +set_console_comm(int __comm_id) +{ + static int __selected_id; + + CYG_ASSERT(-1 == __comm_id + || __comm_id < CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS, + "Invalid channel"); + + if (-1 == __comm_id) + return __selected_id; + + __selected_id = __comm_id; + + CYGACC_CALL_IF_CONSOLE_PROCS_SET(comm_channels[__comm_id]); + + return 1; +} + + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +//---------------------------------- +// eCos debug procedure wrappers +static void +debug_write(void* __ch_data, const cyg_uint8* __buf, cyg_uint32 __len) +{ + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + HAL_STUB_PLATFORM_PUT_CHAR(*__buf++); + + CYGARC_HAL_RESTORE_GP(); +} + +static void +debug_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len) +{ + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + *__buf++ = HAL_STUB_PLATFORM_GET_CHAR(); + + CYGARC_HAL_RESTORE_GP(); +} + + +static void +debug_putc(void* __ch_data, cyg_uint8 __ch) +{ + CYGARC_HAL_SAVE_GP(); + + HAL_STUB_PLATFORM_PUT_CHAR(__ch); + + CYGARC_HAL_RESTORE_GP(); +} + +static cyg_uint8 +debug_getc(void* __ch_data) +{ + cyg_uint8 __ch; + CYGARC_HAL_SAVE_GP(); + + __ch = HAL_STUB_PLATFORM_GET_CHAR(); + + CYGARC_HAL_RESTORE_GP(); + return __ch; +} + +static int +debug_control(void *__ch_data, __comm_control_cmd_t __func, ...) +{ + // Do nothing (yet). + return 0; +} +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + +//---------------------------------- +// Cache functions + +static void +flush_icache(void *__p, int __nbytes) +{ +#ifdef HAL_ICACHE_FLUSH + HAL_ICACHE_FLUSH( __p , __nbytes ); +#elif defined(HAL_ICACHE_INVALIDATE) + HAL_ICACHE_INVALIDATE(); +#endif +} + +static void +flush_dcache(void *__p, int __nbytes) +{ +#ifdef HAL_DCACHE_FLUSH + HAL_DCACHE_FLUSH( __p , __nbytes ); +#elif defined(HAL_DCACHE_INVALIDATE) + HAL_DCACHE_INVALIDATE(); +#endif +} + +#endif + +#if !defined(CYGPRI_CONSOLE_PROCS_HANDLED) \ + && defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) +// -------------------- +// Console wrapper functions. These are used for pumping data to the device +// via low-level functions provided by the platform HAL. Mangling has +// happened (if applicable) by the time the stream hits this code. +static void +console_write(void* __ch_data, const cyg_uint8* __buf, cyg_uint32 __len) +{ + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + HAL_PLF_DIAG_RAW_WRITE_CHAR(*__buf++); + + CYGARC_HAL_RESTORE_GP(); +} + +static void +console_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len) +{ + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + HAL_PLF_DIAG_RAW_READ_CHAR(*__buf++); + + CYGARC_HAL_RESTORE_GP(); +} + + +static void +console_putc(void* __ch_data, cyg_uint8 __ch) +{ + CYGARC_HAL_SAVE_GP(); + + HAL_PLF_DIAG_RAW_WRITE_CHAR(__ch); + + CYGARC_HAL_RESTORE_GP(); +} + +static cyg_uint8 +console_getc(void* __ch_data) +{ + cyg_uint8 __ch; + CYGARC_HAL_SAVE_GP(); + + HAL_PLF_DIAG_RAW_READ_CHAR(__ch); + + CYGARC_HAL_RESTORE_GP(); + return __ch; +} + +static int +console_control(void *__ch_data, __comm_control_cmd_t __func, ...) +{ + // Do nothing (yet). + return 0; +} +#endif + +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) +//----------------------------------------------------------------------------- +// Console IO functions that adhere to the virtual vector table semantics in +// order to ensure proper debug agent mangling when required. +// +// The platform HAL must specify the channel used, and provide raw IO +// routines for that channel. The platform HAL also has the necessary +// information to determine if the channel is already initialized by +// a debug agent (either builtin or in ROM). +void +hal_if_diag_init(void) +{ +#ifndef CYGPRI_CONSOLE_PROCS_HANDLED + // Set up console procs for the channel and initialize it. + hal_virtual_comm_table_t* comm; + // Hook console wrappers up on the diag channel + CYGACC_CALL_IF_SET_CONSOLE_COMM()(CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL); + comm = CYGACC_CALL_IF_CONSOLE_PROCS(); + + CYGACC_COMM_IF_WRITE_SET(*comm, console_write); + CYGACC_COMM_IF_READ_SET(*comm, console_read); + CYGACC_COMM_IF_PUTC_SET(*comm, console_putc); + CYGACC_COMM_IF_GETC_SET(*comm, console_getc); + CYGACC_COMM_IF_CONTROL_SET(*comm, console_control); + + // Init device. + HAL_PLF_DIAG_RAW_INIT(); +#endif +} + +void +hal_if_diag_write_char(char c) +{ + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + + if (__chan) + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, c); + else { + __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, c); + } +} + +void +hal_if_diag_read_char(char *c) +{ + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_CONSOLE_PROCS(); + + if (__chan) + *c = CYGACC_COMM_IF_GETC(*__chan)(*__chan); + else { + __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + *c = CYGACC_COMM_IF_GETC(*__chan)(*__chan); + } +} +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG + +//-------------------------------------------------------------------------- +// Init function. It should be called from the platform initialization code. +// For monitor configurations it will initialize the calling interface table, +// for client configurations it will patch the existing table as per +// configuration. +void +hal_if_init(void) +{ + // Set up services provided by monitors +#ifdef CYGPRI_IMPLEMENTS_IF_SERVICES + { + hal_virtual_comm_table_t* comm; + int i, j; + // Initialize tables with the NOP service. + // This should only be done for service routine entries - data + // pointers should be NULLed. + for (i = 0; i < CYGNUM_CALL_IF_TABLE_SIZE; i++) + hal_virtual_vector_table[i] = (CYG_ADDRWORD) &nop_service; + + for (j = 0; j < CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS; j++) + for (i = 0; i < CYGNUM_COMM_IF_TABLE_SIZE; i++) + comm_channels[j][i] = (CYG_ADDRWORD) &nop_service; + + + // Fill in supported services. + + // Version number + CYGACC_CALL_IF_VERSION_SET(CYGNUM_CALL_IF_TABLE_VERSION); + + // ICTRL and EXC tables - I assume these to be the equivalents of + // ISR and VSR tables. + CYGACC_CALL_IF_ICTRL_TABLE_SET(hal_interrupt_handlers); + CYGACC_CALL_IF_EXC_TABLE_SET(hal_vsr_table); + + // Reset and kill vector + CYGACC_CALL_IF_RESET_SET(reset); + CYGACC_CALL_IF_KILL_VECTOR_SET(kill_by_reset); + + // Comm controls + CYGACC_CALL_IF_SET_DEBUG_COMM_SET(set_debug_comm); + CYGACC_CALL_IF_SET_CONSOLE_COMM_SET(set_console_comm); + + // Cache functions + CYGACC_CALL_IF_FLUSH_ICACHE_SET(flush_icache); + CYGACC_CALL_IF_FLUSH_DCACHE_SET(flush_dcache); + + // Clear console procs entry. If platform has been to + // configured to use a separate console port, it will be set + // up later (hal_diag_init). Alternatively (if this is a stub) + // it will be initialized with the output mangler + // (O-packetizer for GDB) which uses the debug comms. + CYGACC_CALL_IF_CONSOLE_PROCS_SET(0); + +#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + // Hook debug wrappers up on the debug channel + set_debug_comm(CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL); + comm = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGACC_COMM_IF_WRITE_SET(*comm, debug_write); + CYGACC_COMM_IF_READ_SET(*comm, debug_read); + CYGACC_COMM_IF_PUTC_SET(*comm, debug_putc); + CYGACC_COMM_IF_GETC_SET(*comm, debug_getc); + CYGACC_COMM_IF_CONTROL_SET(*comm, debug_control); +#endif + + // Data entries not currently supported in eCos + CYGACC_CALL_IF_CPU_DATA_SET(0); + CYGACC_CALL_IF_BOARD_DATA_SET(0); + CYGACC_CALL_IF_DBG_DATA_SET(0); + } +#endif + + // Set up services provided by clients +#if defined(CYGFUN_HAL_COMMON_KERNEL_SUPPORT) && \ + ( defined(CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs) \ + || defined(CYGSEM_HAL_USE_ROM_MONITOR_CygMon)) + + patch_dbg_syscalls( (void *)(hal_virtual_vector_table) ); +#endif + + // Init client services +#if !defined(CYGPKG_KERNEL) && defined(CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT) + // Only include this code if we do not have a kernel. Otherwise + // the kernel supplies the functionality for the app we are linked + // with. + + // Prepare for application installation of thread info function in + // vector table. + init_thread_syscall( (void *)&hal_virtual_vector_table[CYGNUM_CALL_IF_DBG_SYSCALL] ); +#endif + + // Finally, install async breakpoint handler if it is configured in. + // FIXME: this should probably check for STUBS instead (but code is + // conditional on BREAK for now) +#if defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + // Install async breakpoint handler into vector table. + CYGACC_CALL_IF_INSTALL_BPT_FN_SET(&cyg_hal_gdb_interrupt); +#endif +} diff --git a/packages/hal/common/current/src/hal_misc.c b/packages/hal/common/current/src/hal_misc.c new file mode 100644 --- /dev/null +++ b/packages/hal/common/current/src/hal_misc.c @@ -0,0 +1,147 @@ +//========================================================================== +// +// hal_misc.c +// +// Common HAL miscellaneous functions +// +//========================================================================== +//####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, jskov +// Date: 2000-06-08 +// Purpose: HAL miscellaneous functions +// Description: This file contains miscellaneous functions provided by the +// HAL. +// +//####DESCRIPTIONEND#### +// +//========================================================================*/ + +#include + +#include +#include + +#include +#include // our header + +#include // Base types +#include // tracing macros +#include // assertion macros + +//-------------------------------------------------------------------------- + +//-------------------------------------------------------------------------- +// Macro for finding return address. +#ifndef CYGARC_HAL_GET_RETURN_ADDRESS + +#define CYGARC_HAL_GET_RETURN_ADDRESS(_x_) \ + (_x_) = (CYG_ADDRWORD)&&__backup_return_address + +#define CYGARC_HAL_GET_RETURN_ADDRESS_BACKUP() \ +__backup_return_address: + +#endif + +//-------------------------------------------------------------------------- +// Functions to support the detection and execution of a user provoked +// program break. These are usually called from interrupt routines. + +cyg_bool +cyg_hal_is_break(char *buf, int size) +{ + while( size ) + if( buf[--size] == 0x03 ) return true; + + return false; +} + +void +cyg_hal_user_break( CYG_ADDRWORD *regs ) +{ +#if defined(CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs) \ + || defined(CYGSEM_HAL_USE_ROM_MONITOR_CygMon) \ + || defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) + + CYG_ADDRWORD __ra; + CYG_WORD32 __pc; + HAL_SavedRegisters *sreg = (HAL_SavedRegisters *)regs; + + CYGARC_HAL_GET_RETURN_ADDRESS(__ra); + + if( regs == NULL ) __pc = __ra; + else __pc = sreg->pc; + + CYGACC_CALL_IF_INSTALL_BPT_FN()((void *)__pc); + + CYGARC_HAL_GET_RETURN_ADDRESS_BACKUP(); + +#else + + HAL_BREAKPOINT(breakinst); + +#endif +} + + +//-------------------------------------------------------------------------- +// The system default interrupt ISR. It calls the architecture default +// ISR as well if necessary. +externC cyg_uint32 hal_arch_default_isr(CYG_ADDRWORD vector, + CYG_ADDRWORD data); + +cyg_uint32 +hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + cyg_uint32 result; + +#if (defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)) && \ + defined(CYGHWR_HAL_GDB_PORT_VECTOR) && \ + defined(HAL_CTRLC_ISR) + +#ifndef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN + if( vector == CYGHWR_HAL_GDB_PORT_VECTOR ) +#endif + { + result = HAL_CTRLC_ISR( vector, data ); + if( 0 != result ) return result; + } +#endif + + result = hal_arch_default_isr (vector, data); + if( 0 != result) return result; + + CYG_TRACE1(true, "Interrupt: %d", vector); + CYG_FAIL("Spurious Interrupt!!!"); + return 0; +} + + +//-------------------------------------------------------------------------- +// End of hal_misc.c diff --git a/packages/hal/common/current/src/hal_stub.c b/packages/hal/common/current/src/hal_stub.c --- a/packages/hal/common/current/src/hal_stub.c +++ b/packages/hal/common/current/src/hal_stub.c @@ -56,11 +56,13 @@ #include // HAL_xCACHE_x #include // interrupt disable/restore +#include // ROM calling interface +#include // Helper functions + #ifdef CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT #include // dbg_currthread_id #endif - //----------------------------------------------------------------------------- // Extra eCos data. @@ -103,7 +105,10 @@ extern char ecos_bsp_console_getc(void); void putDebugChar (int c) { -#ifdef CYGPKG_CYGMON +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + __call_if_debug_procs_t __debug_procs = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGACC_COMM_IF_PUTC(*__debug_procs)(__debug_procs, c); +#elif defined(CYGPKG_CYGMON) ecos_bsp_console_putc(c); #else HAL_STUB_PLATFORM_PUT_CHAR(c); @@ -114,7 +119,10 @@ putDebugChar (int c) int getDebugChar (void) { -#ifdef CYGPKG_CYGMON +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + __call_if_debug_procs_t __debug_procs = CYGACC_CALL_IF_DEBUG_PROCS(); + return CYGACC_COMM_IF_GETC(*__debug_procs)(__debug_procs); +#elif defined(CYGPKG_CYGMON) return ecos_bsp_console_getc(); #else return HAL_STUB_PLATFORM_GET_CHAR(); @@ -125,7 +133,10 @@ getDebugChar (void) void __set_baud_rate (int baud) { -#ifdef CYGPKG_CYGMON +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + __call_if_debug_procs_t __debug_procs = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGACC_COMM_IF_CONTROL(*__debug_procs)(__debug_procs, __COMMCTL_SETBAUD, baud); +#elif defined(CYGPKG_CYGMON) // FIXME! #else HAL_STUB_PLATFORM_SET_BAUD_RATE(baud); @@ -168,6 +179,8 @@ cyg_hal_gdb_place_break (target_register void cyg_hal_gdb_interrupt (target_register_t pc) { + CYGARC_HAL_SAVE_GP(); + // Clear flag that we Continued instead of Stepping cyg_hal_gdb_running_step = 0; // and override existing break? So that a ^C takes effect... @@ -182,6 +195,8 @@ cyg_hal_gdb_interrupt (target_register_t __data_cache(CACHE_FLUSH); __instruction_cache(CACHE_FLUSH); } + + CYGARC_HAL_RESTORE_GP(); } int @@ -240,6 +255,135 @@ interruptible(int state) } } +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT +//----------------------------------------------------------------------------- +// GDB O-packetizer function. + +// This gets called via the virtual vector debug comms entry and +// handles O-packetization. The debug comms entries are used for the +// actual device IO. + +static cyg_uint8 +cyg_hal_gdb_diag_getc(void* __ch_data) +{ + cyg_uint8 __ch; + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGARC_HAL_SAVE_GP(); + + __ch = CYGACC_COMM_IF_GETC(*__chan)(*__chan); + + CYGARC_HAL_RESTORE_GP(); + + return __ch; +} + + +static void +cyg_hal_gdb_diag_putc(void* __ch_data, cyg_uint8 c) +{ + static char line[100]; + static int pos = 0; + CYGARC_HAL_SAVE_GP(); + + // No need to send CRs + if( c == '\r' ) return; + + line[pos++] = c; + + if( c == '\n' || pos == sizeof(line) ) + { + CYG_INTERRUPT_STATE old; + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + + // Disable interrupts. This prevents GDB trying to interrupt us + // while we are in the middle of sending a packet. The serial + // receive interrupt will be seen when we re-enable interrupts + // later. + CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old); + + while(1) + { + static const char hex[] = "0123456789ABCDEF"; + cyg_uint8 csum = 0, c1; + int i; + + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, '$'); + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, 'O'); + csum += 'O'; + for( i = 0; i < pos; i++ ) + { + char ch = line[i]; + char h = hex[(ch>>4)&0xF]; + char l = hex[ch&0xF]; + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, h); + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, l); + csum += h; + csum += l; + } + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, '#'); + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, hex[(csum>>4)&0xF]); + CYGACC_COMM_IF_PUTC(*__chan)(*__chan, hex[csum&0xF]); + + c1 = CYGACC_COMM_IF_GETC(*__chan)(*__chan); + if( c1 == '+' ) break; + + if( cyg_hal_is_break( &c1 , 1 ) ) { + // Caller's responsibility to react on this. + CYGACC_CALL_IF_CONSOLE_INTERRUPT_FLAG_SET(1); + break; + } + } + + pos = 0; + // And re-enable interrupts + CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old); + } + + CYGARC_HAL_RESTORE_GP(); +} + +static void +cyg_hal_gdb_diag_write(void* __ch_data, const cyg_uint8* __buf, + cyg_uint32 __len) +{ + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + cyg_hal_gdb_diag_putc(__ch_data, *__buf++); + + CYGARC_HAL_RESTORE_GP(); +} + +static void +cyg_hal_gdb_diag_read(void* __ch_data, cyg_uint8* __buf, cyg_uint32 __len) +{ + hal_virtual_comm_table_t* __chan = CYGACC_CALL_IF_DEBUG_PROCS(); + CYGARC_HAL_SAVE_GP(); + + while(__len-- > 0) + *__buf++ = CYGACC_COMM_IF_GETC(*__chan)(*__chan); + + CYGARC_HAL_RESTORE_GP(); +} + +static int +cyg_hal_gdb_diag_control(void *__ch_data, __comm_control_cmd_t __func, ...) +{ + // Do nothing (yet). + return 0; +} + +hal_virtual_comm_table_t cyg_hal_gdb_console_procs = { + 0, + (CYG_ADDRWORD) &cyg_hal_gdb_diag_write, + (CYG_ADDRWORD) &cyg_hal_gdb_diag_read, + (CYG_ADDRWORD) &cyg_hal_gdb_diag_putc, + (CYG_ADDRWORD) &cyg_hal_gdb_diag_getc, + (CYG_ADDRWORD) &cyg_hal_gdb_diag_control}; + +#endif + + //----------------------------------------------------------------------------- // eCos stub entry and exit magic. @@ -281,10 +425,7 @@ handle_exception_cleanup( void ) // FIXME: (there may be a better way to do this) // If we hit a breakpoint set by the gdb interrupt stub, make it // seem like an interrupt rather than having hit a breakpoint. - if (cyg_hal_gdb_remove_break(get_register (PC))) - cyg_hal_gdb_break = 1; - else - cyg_hal_gdb_break = 0; + cyg_hal_gdb_break = cyg_hal_gdb_remove_break(get_register (PC)); #endif } @@ -338,24 +479,36 @@ initHardware (void) { static int initialized = 0; - if (!initialized) { - initialized = 1; + if (initialized++) + return; #if !defined(CYGPKG_CYGMON) #ifdef HAL_STUB_PLATFORM_INIT - // If the platform defines any initialization code, call it here. - HAL_STUB_PLATFORM_INIT(); + // If the platform defines any initialization code, call it here. + HAL_STUB_PLATFORM_INIT(); #endif - // Get serial port initialized. - HAL_STUB_PLATFORM_INIT_SERIAL(); + // Get serial port initialized. + HAL_STUB_PLATFORM_INIT_SERIAL(); +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + // This should really be done during handle_exception_init (at + // stub exit), but that makes it impossible a stub to be included + // in the application without breaking things. So do it here + // instead - stub initialization happens after + // constructors/hal_diag_init anyway. + if (NULL == CYGACC_CALL_IF_CONSOLE_PROCS()) + CYGACC_CALL_IF_CONSOLE_PROCS_SET(cyg_hal_gdb_console_procs); +#endif + +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT - // Get interrupt handler initialized. - HAL_STUB_PLATFORM_INIT_BREAK_IRQ(); + // Get interrupt handler initialized. + HAL_STUB_PLATFORM_INIT_BREAK_IRQ(); #endif +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT #endif // CYGPKG_CYGMON - } + } // Reset the board. @@ -363,8 +516,14 @@ void __reset (void) { #if !defined(CYGPKG_CYGMON) +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + __call_if_reset_t __rom_reset = CYGACC_CALL_IF_RESET(); + if (__rom_reset) + __rom_reset(); +#else HAL_STUB_PLATFORM_RESET(); #endif +#endif } //----------------------------------------------------------------------------- diff --git a/packages/hal/common/current/src/stubrom/stubrom.c b/packages/hal/common/current/src/stubrom/stubrom.c --- a/packages/hal/common/current/src/stubrom/stubrom.c +++ b/packages/hal/common/current/src/stubrom/stubrom.c @@ -46,12 +46,9 @@ void cyg_start (void) { - initialize_stub(); for(;;) breakpoint(); - - } // End of stubrom.c diff --git a/packages/hal/i386/arch/current/ChangeLog b/packages/hal/i386/arch/current/ChangeLog --- a/packages/hal/i386/arch/current/ChangeLog +++ b/packages/hal/i386/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-03-27 Jonathan Larmour * include/basetype.h: Let cyg_halbool revert to the system default diff --git a/packages/hal/i386/arch/current/include/hal_arch.h b/packages/hal/i386/arch/current/include/hal_arch.h --- a/packages/hal/i386/arch/current/include/hal_arch.h +++ b/packages/hal/i386/arch/current/include/hal_arch.h @@ -268,5 +268,11 @@ externC void hal_idle_thread_action(cyg_ 15 * (CYGNUM_HAL_STACK_FRAME_SIZE+(16*4))) //-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + +//-------------------------------------------------------------------------- #endif // CYGONCE_HAL_HAL_ARCH_H // End of hal_arch.h diff --git a/packages/hal/mips/arch/current/ChangeLog b/packages/hal/mips/arch/current/ChangeLog --- a/packages/hal/mips/arch/current/ChangeLog +++ b/packages/hal/mips/arch/current/ChangeLog @@ -1,3 +1,15 @@ +2000-06-08 Jesper Skov + + * src/hal_misc.c (hal_arch_default_isr): Removed what's now a + generic C-c check in the common HAL. + + * include/hal_arch.h (CYGARC_HAL_GET_RETURN_ADDRESS): Defined. + +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-05-25 Jesper Skov * include/basetype.h: diff --git a/packages/hal/mips/arch/current/include/hal_arch.h b/packages/hal/mips/arch/current/include/hal_arch.h --- a/packages/hal/mips/arch/current/include/hal_arch.h +++ b/packages/hal/mips/arch/current/include/hal_arch.h @@ -369,5 +369,28 @@ externC void hal_idle_thread_action(cyg_ #endif //-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() \ + CYG_MACRO_START \ + register CYG_ADDRWORD __gp_save; \ + asm volatile ( "move %0,$28;" \ + ".extern _gp;" \ + "la $gp,_gp;" \ + : "=r"(__gp_save)) + +#define CYGARC_HAL_RESTORE_GP() \ + asm volatile ( "move $gp,%0;" :: "r"(__gp_save) ); \ + CYG_MACRO_END + + +//-------------------------------------------------------------------------- +// Macro for finding return address. +#define CYGARC_HAL_GET_RETURN_ADDRESS(_x_) \ + asm volatile ( "move %0,$31;" : "=r" (_x_) ) + +#define CYGARC_HAL_GET_RETURN_ADDRESS_BACKUP() + +//-------------------------------------------------------------------------- #endif // CYGONCE_HAL_HAL_ARCH_H // End of hal_arch.h diff --git a/packages/hal/mips/arch/current/src/hal_misc.c b/packages/hal/mips/arch/current/src/hal_misc.c --- a/packages/hal/mips/arch/current/src/hal_misc.c +++ b/packages/hal/mips/arch/current/src/hal_misc.c @@ -126,6 +126,7 @@ externC cyg_uint32 cyg_hal_exception_han /*------------------------------------------------------------------------*/ /* default ISR */ +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) { #if defined(CYGDBG_HAL_MIPS_DEBUG_GDB_CTRLC_SUPPORT) && \ @@ -158,6 +159,32 @@ externC cyg_uint32 hal_default_isr(CYG_A return 0; } +#else // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + +externC cyg_uint32 hal_arch_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ +#if defined(CYGDBG_HAL_MIPS_DEBUG_GDB_CTRLC_SUPPORT) && \ + defined(CYGHWR_HAL_GDB_PORT_VECTOR) && \ + defined(HAL_CTRLC_ISR) + +#if defined(CYGSEM_HAL_USE_ROM_MONITOR_CygMon) +#if defined(HAL_DIAG_IRQ_CHECK) + { + cyg_uint32 ret; + /* let ROM monitor handle unexpected interrupts */ + HAL_DIAG_IRQ_CHECK(vector, ret); + if (ret<=0) + return ret; + } +#endif // def HAL_DIAG_IRQ_CHECK +#endif // def CYGSEM_HAL_USE_ROM_MONITOR_CygMon +#endif + + return 0; +} + +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + /*------------------------------------------------------------------------*/ /* data copy and bss zero functions */ diff --git a/packages/hal/mn10300/arch/current/ChangeLog b/packages/hal/mn10300/arch/current/ChangeLog --- a/packages/hal/mn10300/arch/current/ChangeLog +++ b/packages/hal/mn10300/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-03-20 Jonathan Larmour * src/vectors.S (__default_interrupt_vsr): Pass variant-specific PC diff --git a/packages/hal/mn10300/arch/current/include/hal_arch.h b/packages/hal/mn10300/arch/current/include/hal_arch.h --- a/packages/hal/mn10300/arch/current/include/hal_arch.h +++ b/packages/hal/mn10300/arch/current/include/hal_arch.h @@ -291,5 +291,11 @@ externC void hal_idle_thread_action(cyg_ #endif //-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + +//-------------------------------------------------------------------------- #endif // CYGONCE_HAL_HAL_ARCH_H // EOF hal_arch.h diff --git a/packages/hal/powerpc/arch/current/ChangeLog b/packages/hal/powerpc/arch/current/ChangeLog --- a/packages/hal/powerpc/arch/current/ChangeLog +++ b/packages/hal/powerpc/arch/current/ChangeLog @@ -1,3 +1,21 @@ +2000-06-15 Jesper Skov + + * include/hal_intr.h: Added HAL_DEFAULT_ISR. + +2000-06-13 Jesper Skov + + * src/powerpc.ld (hal_virtual_vector_table): Added. + + * src/hal_misc.c (hal_arch_default_isr): Added, replacing + hal_default_isr which was moved to common HAL. + + * src/vectors.S: Changes to support ctrlC via virtual vector table. + +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-04-14 Jesper Skov * src/hal_misc.c (hal_idle_thread_action): Moved some of the code diff --git a/packages/hal/powerpc/arch/current/include/hal_arch.h b/packages/hal/powerpc/arch/current/include/hal_arch.h --- a/packages/hal/powerpc/arch/current/include/hal_arch.h +++ b/packages/hal/powerpc/arch/current/include/hal_arch.h @@ -328,6 +328,15 @@ externC void hal_idle_thread_action(cyg_ (CYGNUM_HAL_STACK_SIZE_MINIMUM + \ 30 * (CYGNUM_HAL_STACK_FRAME_SIZE+(16*4))) +//-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). + +// Should be defined like for MIPS, saving/restoring R2 - but is it +// actually used? I've never seen app code use R2. Something to investigate. +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_ARCH_H // End of hal_arch.h diff --git a/packages/hal/powerpc/arch/current/include/hal_intr.h b/packages/hal/powerpc/arch/current/include/hal_intr.h --- a/packages/hal/powerpc/arch/current/include/hal_intr.h +++ b/packages/hal/powerpc/arch/current/include/hal_intr.h @@ -158,11 +158,15 @@ externC volatile CYG_ADDRESS hal_vsr_ //-------------------------------------------------------------------------- // Default ISRs +// The #define is used to test whether this routine exists, and to allow +// us to call it. externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); externC cyg_uint32 hal_default_decrementer_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); +#define HAL_DEFAULT_ISR hal_default_isr + //-------------------------------------------------------------------------- // Interrupt state storage diff --git a/packages/hal/powerpc/arch/current/src/hal_misc.c b/packages/hal/powerpc/arch/current/src/hal_misc.c --- a/packages/hal/powerpc/arch/current/src/hal_misc.c +++ b/packages/hal/powerpc/arch/current/src/hal_misc.c @@ -203,6 +203,7 @@ cyg_hal_exception_handler(HAL_SavedRegis //--------------------------------------------------------------------------- // Default ISRs +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) { @@ -211,6 +212,12 @@ hal_default_isr(CYG_ADDRWORD vector, CYG CYG_FAIL("Spurious Interrupt!!!"); return 0; } +#else +externC cyg_uint32 +hal_arch_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ +} +#endif // The decrementer default ISR has to do nothing. The reason is that // decrementer interrupts cannot be disabled - if a kernel configuration diff --git a/packages/hal/powerpc/arch/current/src/powerpc.ld b/packages/hal/powerpc/arch/current/src/powerpc.ld --- a/packages/hal/powerpc/arch/current/src/powerpc.ld +++ b/packages/hal/powerpc/arch/current/src/powerpc.ld @@ -140,6 +140,7 @@ GROUP(libtarget.a libgcc.a) #include #include CYGHWR_MEMORY_LAYOUT_LDI -// Define VSR table to reside at fixed address. +// Define VSR and virtual tables to reside at fixed addresses. #include CYGBLD_HAL_TARGET_H hal_vsr_table = CYGHWR_HAL_VSR_TABLE; +hal_virtual_vector_table = CYGHWR_HAL_VIRTUAL_VECTOR_TABLE; diff --git a/packages/hal/powerpc/arch/current/src/vectors.S b/packages/hal/powerpc/arch/current/src/vectors.S --- a/packages/hal/powerpc/arch/current/src/vectors.S +++ b/packages/hal/powerpc/arch/current/src/vectors.S @@ -347,6 +347,11 @@ 2: # Variant HALs may need to do something special before we continue bl hal_variant_init +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this _check_ should go away + # Platform initialization + bl hal_platform_init +#endif + # MMU and cache are controlled by the same option since caching # on the PPC does not make sense without the MMU to mark regions # which should not be cached. @@ -373,7 +378,14 @@ 2: #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS bl initialize_stub #endif - +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this _check_ should go away +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + .extern hal_ctrlc_isr_init + bl hal_ctrlc_isr_init +#endif +#endif + bl cyg_start # call cyg_start 9: b 9b # if we return, loop @@ -645,6 +657,7 @@ 2: stwu r14,-4(sp) hal_intc_decode r15,r14 # get table index +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this should go away #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT .extern cyg_hal_gdb_isr lwz r3,CYGARC_PPCREG_PC(r14) # for serial receive irq. @@ -655,6 +668,21 @@ 2: stwu r14,-4(sp) 1: #endif +#else // the below should remain + +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + # If we are supporting Ctrl-C interrupts from GDB, we must squirrel + # away a pointer to the save interrupt state here so that we can + # plant a breakpoint at some later time. + + .extern hal_saved_interrupt_state + lwi r3,hal_saved_interrupt_state + stw r14,0(r3) + +#endif +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + #ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING #ifdef CYGPKG_HAL_POWERPC_MPC8xx @@ -679,11 +707,13 @@ 1: bctrl # branch to ctr reg and link +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this should go away #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT # If interrupt was caused by GDB, the ISR call above # is skipped by jumping here. 2: #endif +#endif #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK diff --git a/packages/hal/powerpc/cogent/current/ChangeLog b/packages/hal/powerpc/cogent/current/ChangeLog --- a/packages/hal/powerpc/cogent/current/ChangeLog +++ b/packages/hal/powerpc/cogent/current/ChangeLog @@ -1,3 +1,7 @@ +2000-06-13 Jesper Skov + + * include/plf_intr.h: Added. + 2000-04-04 Jesper Skov * src/hal_diag.c (hal_diag_write_char): Add GDB critical IO region diff --git a/packages/hal/powerpc/cogent/current/include/plf_intr.h b/packages/hal/powerpc/cogent/current/include/plf_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/cogent/current/include/plf_intr.h @@ -0,0 +1,55 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// Cogent/CMA28x platform specific interrupt definitions +// +//========================================================================== +//####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-06-13 +// Purpose: Define platform specific interrupt support +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// Empty for now + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h diff --git a/packages/hal/powerpc/fads/current/ChangeLog b/packages/hal/powerpc/fads/current/ChangeLog --- a/packages/hal/powerpc/fads/current/ChangeLog +++ b/packages/hal/powerpc/fads/current/ChangeLog @@ -1,3 +1,19 @@ +2000-06-15 Jesper Skov + + * src/hal_diag.c: + * src/hal_aux.c: + * include/pkgconf/mlt_powerpc_fads_ram.ldi: + * include/pkgconf/mlt_powerpc_fads_ram.mlt: + * include/plf_stub.h: + * include/hal_diag.h: + * cdl/hal_powerpc_fads.cdl: + Some changes towards virtual vector table support. Still needs + ctrlc support before it can be enabled. + +2000-06-13 Jesper Skov + + * include/plf_intr.h: Added. + 2000-03-06 Jesper Skov * src/hal_diag.c (hal_diag_write_char): fix typo. diff --git a/packages/hal/powerpc/fads/current/cdl/hal_powerpc_fads.cdl b/packages/hal/powerpc/fads/current/cdl/hal_powerpc_fads.cdl --- a/packages/hal/powerpc/fads/current/cdl/hal_powerpc_fads.cdl +++ b/packages/hal/powerpc/fads/current/cdl/hal_powerpc_fads.cdl @@ -52,6 +52,9 @@ cdl_package CYGPKG_HAL_POWERPC_FADS { compile hal_diag.c hal_aux.c fads.S quicc_smc2.c + # FIXME: Cannot enable this yet since too much support is missing. + # implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT + define_proc { puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H " puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H " @@ -72,6 +75,49 @@ cdl_package CYGPKG_HAL_POWERPC_FADS { that the image will be downloaded via the Motorola MPC8BUG tool." } + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { + display "Number of communication channels on the board" + flavor data + calculated 1 + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL { + display "Debug serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The FADS board has only one serial port. This option + chooses which port will be used to connect to a host + running GDB." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL { + display "Diagnostic serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The FADS board has only one serial port. This option + chooses which port will be used for diagnostic output." + } + + # This option is only used when USE_ROM_MONITOR is enabled - but + # it cannot be a sub-option to that option, since the code uses the + # definition in a preprocessor comparison. + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_ROM_DEBUG_CHANNEL { + display "Debug serial port used by ROM monitor" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The FADS board has only one serial port. This + option tells the code which port is in use by the ROM + monitor. It should only be necessary to change this + option if a non-standard configurated eCos GDB stub is + used." + } + # Real-time clock/counter specifics cdl_component CYGNUM_HAL_RTC_CONSTANTS { display "Real-time clock constants." diff --git a/packages/hal/powerpc/fads/current/include/hal_diag.h b/packages/hal/powerpc/fads/current/include/hal_diag.h --- a/packages/hal/powerpc/fads/current/include/hal_diag.h +++ b/packages/hal/powerpc/fads/current/include/hal_diag.h @@ -69,6 +69,23 @@ #include +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) + +#include +#include + +#define HAL_DIAG_INIT() hal_if_diag_init() +#define HAL_DIAG_WRITE_CHAR(_c_) hal_if_diag_write_char(_c_) +#define HAL_DIAG_READ_CHAR(_c_) hal_if_diag_read_char(&_c_) + +#ifndef CYGPRI_CONSOLE_PROCS_HANDLED +# define HAL_PLF_DIAG_RAW_INIT() cyg_smc2_init(9600) +# define HAL_PLF_DIAG_RAW_WRITE_CHAR(_c_) cyg_smc2_putchar(_c_) +# define HAL_PLF_DIAG_RAW_READ_CHAR(_c_) (_c_) = cyg_smc2_getchar() +#endif + +#else // everything by steam + //----------------------------------------------------------------------------- // functions implemented in hal_diag.c @@ -86,6 +103,8 @@ externC void hal_diag_read_char(char *c) #define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG + //----------------------------------------------------------------------------- // end of hal_diag.h #endif // CYGONCE_HAL_HAL_DIAG_H diff --git a/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.ldi b/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.ldi --- a/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.ldi +++ b/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.ldi @@ -38,7 +38,8 @@ SECTIONS SECTIONS_BEGIN __reserved_vectors = 0; . = __reserved_vectors + 0x3000; __reserved_vsr_table = ALIGN (0x1); . = __reserved_vsr_table + 0x200; - __reserved_for_rom = ALIGN (0x1); . = __reserved_for_rom + 0xce00; + __reserved_virtual_table = ALIGN (0x1); . = __reserved_virtual_table + 0x100; + __reserved_for_rom = ALIGN (0x1); . = __reserved_for_rom + 0xcd00; SECTION_vectors (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) diff --git a/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.mlt b/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.mlt --- a/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.mlt +++ b/packages/hal/powerpc/fads/current/include/pkgconf/mlt_powerpc_fads_ram.mlt @@ -1,7 +1,9 @@ version 0 region ram 0 800000 0 ! section reserved_vectors 3000 1 0 0 1 1 1 1 0 0 reserved_vsr_table reserved_vsr_table ! -section reserved_vsr_table 200 1 0 0 0 1 0 1 vectors vectors ! +section reserved_vsr_table 200 1 0 0 1 1 1 1 0 0 reserved_virtual_table reserved_virtual_table ! +section reserved_virtual_table 100 1 0 0 1 1 1 1 0 0 reserved_for_rom reserved_for_rom ! +section reserved_for_rom cd00 1 0 0 0 1 0 1 vectors vectors ! section vectors 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 rodata1 rodata1 ! diff --git a/packages/hal/powerpc/fads/current/include/plf_intr.h b/packages/hal/powerpc/fads/current/include/plf_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/fads/current/include/plf_intr.h @@ -0,0 +1,55 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// FADS platform specific interrupt definitions +// +//========================================================================== +//####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-06-13 +// Purpose: Define platform specific interrupt support +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +// Empty for now + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h diff --git a/packages/hal/powerpc/fads/current/include/plf_stub.h b/packages/hal/powerpc/fads/current/include/plf_stub.h --- a/packages/hal/powerpc/fads/current/include/plf_stub.h +++ b/packages/hal/powerpc/fads/current/include/plf_stub.h @@ -67,11 +67,13 @@ // Stub initializer. #define HAL_STUB_PLATFORM_INIT() CYG_EMPTY_STATEMENT +#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + //---------------------------------------------------------------------------- // Reset. #define HAL_STUB_PLATFORM_RESET() CYG_EMPTY_STATEMENT -#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +#define HAL_STUB_PLATFORM_RESET_ENTRY 0xfff00100 //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_PLF_STUB_H diff --git a/packages/hal/powerpc/fads/current/src/hal_aux.c b/packages/hal/powerpc/fads/current/src/hal_aux.c --- a/packages/hal/powerpc/fads/current/src/hal_aux.c +++ b/packages/hal/powerpc/fads/current/src/hal_aux.c @@ -43,6 +43,7 @@ #include #include // HAL memory definitions +#include // hal_if_init // The memory map is weakly defined, allowing the application to redefine // it if necessary. The regions defined below are the minimum requirements. @@ -56,5 +57,10 @@ CYGARC_MEMDESC_TABLE CYGBLD_ATTRIB_WEAK CYGARC_MEMDESC_TABLE_END }; +void +hal_platform_init(void) +{ + hal_if_init(); +} // EOF hal_aux.c diff --git a/packages/hal/powerpc/fads/current/src/hal_diag.c b/packages/hal/powerpc/fads/current/src/hal_diag.c --- a/packages/hal/powerpc/fads/current/src/hal_diag.c +++ b/packages/hal/powerpc/fads/current/src/hal_diag.c @@ -64,6 +64,8 @@ #include +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_DIAG + #include // base types #include // tracing macros #include // assertion macros @@ -120,4 +122,4 @@ void hal_diag_read_char(char *c) } #endif - +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG diff --git a/packages/hal/powerpc/mbx/current/ChangeLog b/packages/hal/powerpc/mbx/current/ChangeLog --- a/packages/hal/powerpc/mbx/current/ChangeLog +++ b/packages/hal/powerpc/mbx/current/ChangeLog @@ -1,3 +1,47 @@ +2000-06-15 Jesper Skov + + * include/pkgconf/mlt_powerpc_mbx_rom.h: + * include/pkgconf/mlt_powerpc_mbx_ram.h: + * include/pkgconf/mlt_powerpc_mbx_ram.ldi: + * include/pkgconf/mlt_powerpc_mbx_ram.mlt: + Updated. + + * src/hal_aux.c: Fix warning. + + * include/hal_diag.h: Fix typo. Moved diag-inclusion decision + expression to common HAL. + Only define HAL_PLF_DIAG routines when necessary. + + * cdl/hal_powerpc_mbx.cdl: Last CDL tweaks. + +2000-06-14 Jesper Skov + + * include/plf_stub.h: Move reset stuff out of INCLUDE_STUBS + config. It really should live in the platform equivalent of + hal_arch.h... + + * include/hal_diag.h: + * src/hal_diag.c: + Changes to use the common virtual vector code for diagnostics. + +2000-06-13 Jesper Skov + + * include/plf_stub.h (HAL_STUB_PLATFORM_RESET_ENTRY): Use an + absolute address. + + * src/hal_aux.c (hal_platform_init): Added. + + * include/plf_stub.h: Cleaned up reset definitions. + + * include/pkgconf/mlt_powerpc_mbx_rom.ldi: + * include/pkgconf/mlt_powerpc_mbx_rom.mlt: + * include/pkgconf/mlt_powerpc_mbx_ram.ldi: + * include/pkgconf/mlt_powerpc_mbx_ram.mlt: + Reserve space for virtual table. + + * cdl/hal_powerpc_mbx.cdl: Added support for virtual + vectors. Change stub requirements accordingly. + 2000-03-13 Jesper Skov * include/plf_stub.h (HAL_STUB_PLATFORM_RESET): Jump to stub diff --git a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl --- a/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl +++ b/packages/hal/powerpc/mbx/current/cdl/hal_powerpc_mbx.cdl @@ -54,6 +54,7 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { implements CYGINT_HAL_DEBUG_GDB_STUBS implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK + implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT define_proc { puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H " @@ -98,6 +99,49 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { or stub ROMs." } + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS { + display "Number of communication channels on the board" + flavor data + calculated 1 + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL { + display "Debug serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The MBX board has only one serial port. This option + chooses which port will be used to connect to a host + running GDB." + } + + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL { + display "Diagnostic serial port" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The MBX board has only one serial port. This option + chooses which port will be used for diagnostic output." + } + + # This option is only used when USE_ROM_MONITOR is enabled - but + # it cannot be a sub-option to that option, since the code uses the + # definition in a preprocessor comparison. + cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_ROM_DEBUG_CHANNEL { + display "Debug serial port used by ROM monitor" + flavor data + legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1 + default_value 0 + description " + The MBX board has only one serial port. This + option tells the code which port is in use by the ROM + monitor. It should only be necessary to change this + option if a non-standard configurated eCos GDB stub is + used." + } + # Real-time clock/counter specifics cdl_component CYGNUM_HAL_RTC_CONSTANTS { display "Real-time clock constants." @@ -171,8 +215,8 @@ cdl_package CYGPKG_HAL_POWERPC_MBX { requires CYGSEM_HAL_ROM_MONITOR requires CYGBLD_BUILD_COMMON_GDB_STUBS requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS - requires ! CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT - requires ! CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT + requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM no_define diff --git a/packages/hal/powerpc/mbx/current/include/hal_diag.h b/packages/hal/powerpc/mbx/current/include/hal_diag.h --- a/packages/hal/powerpc/mbx/current/include/hal_diag.h +++ b/packages/hal/powerpc/mbx/current/include/hal_diag.h @@ -69,6 +69,22 @@ #include +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) + +#include + +#define HAL_DIAG_INIT() hal_if_diag_init() +#define HAL_DIAG_WRITE_CHAR(_c_) hal_if_diag_write_char(_c_) +#define HAL_DIAG_READ_CHAR(_c_) hal_if_diag_read_char(&_c_) + +#ifndef CYGPRI_CONSOLE_PROCS_HANDLED +# define HAL_PLF_DIAG_RAW_INIT() cyg_quicc_init_smc1() +# define HAL_PLF_DIAG_RAW_WRITE_CHAR(_c_) cyg_quicc_smc1_uart_putchar(_c_) +# define HAL_PLF_DIAG_RAW_READ_CHAR(_c_) (_c_) = cyg_quicc_smc1_uart_rcvchar() +#endif + +#else // everything by steam + //----------------------------------------------------------------------------- // functions implemented in hal_diag.c @@ -86,6 +102,8 @@ externC void hal_diag_read_char(char *c) #define HAL_DIAG_READ_CHAR(_c_) hal_diag_read_char(&_c_) +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG + //----------------------------------------------------------------------------- // end of hal_diag.h #endif // CYGONCE_HAL_HAL_DIAG_H diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.h b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.h --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.h +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.h @@ -1,10 +1,22 @@ -// eCos memory layout - Wed Nov 24 11:47:54 1999 - -// This is a generated file - changes will be lost if ConfigTool(MLT) is run - -#include -#include - -#define CYGMEM_REGION_ram (0x0) -#define CYGMEM_REGION_ram_SIZE (0x400000) -#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) +// eCos memory layout - Thu Jun 15 15:44:21 2000 + +// This is a generated file - do not edit + +#include +#include + +#define CYGMEM_REGION_ram (0) +#define CYGMEM_REGION_ram_SIZE (0x400000) +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) +extern char CYG_LABEL_NAME (_reserved_vectors) []; +#define CYGMEM_SECTION_reserved_vectors (CYG_LABEL_NAME (_reserved_vectors)) +#define CYGMEM_SECTION_reserved_vectors_SIZE (0x3000) +extern char CYG_LABEL_NAME (_reserved_vsr_table) []; +#define CYGMEM_SECTION_reserved_vsr_table (CYG_LABEL_NAME (_reserved_vsr_table)) +#define CYGMEM_SECTION_reserved_vsr_table_SIZE (0x200) +extern char CYG_LABEL_NAME (_reserved_virtual_table) []; +#define CYGMEM_SECTION_reserved_virtual_table (CYG_LABEL_NAME (_reserved_virtual_table)) +#define CYGMEM_SECTION_reserved_virtual_table_SIZE (0x100) +extern char CYG_LABEL_NAME (_reserved_for_rom) []; +#define CYGMEM_SECTION_reserved_for_rom (CYG_LABEL_NAME (_reserved_for_rom)) +#define CYGMEM_SECTION_reserved_for_rom_SIZE (0xcd00) diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.ldi b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.ldi --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.ldi +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.ldi @@ -1,53 +1,28 @@ -//=========================================================================== -// -// RAM startup linker control script -// -//=========================================================================== -//####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#### -//=========================================================================== - -MEMORY -{ - ram : ORIGIN = 0x00000000, LENGTH = 0x400000 -} - -SECTIONS -{ - SECTIONS_BEGIN - __reserved_vectors = 0; . = __reserved_vectors + 0x3000; - __reserved_vsr_table = ALIGN (0x1); . = __reserved_vsr_table + 0x200; - __reserved_for_rom = ALIGN (0x1); . = __reserved_for_rom + 0xce00; - SECTION_vectors (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA) - SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA) - SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) - SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA) - SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA) - SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA) - SECTIONS_END -} +// eCos memory layout - Thu Jun 15 15:44:21 2000 + +// This is a generated file - do not edit + +MEMORY +{ + ram : ORIGIN = 0, LENGTH = 0x400000 +} + +SECTIONS +{ + SECTIONS_BEGIN + __reserved_vectors = 0; . = __reserved_vectors + 0x3000; + __reserved_vsr_table = ALIGN (0x10); . = __reserved_vsr_table + 0x200; + __reserved_virtual_table = ALIGN (0x10); . = __reserved_virtual_table + 0x100; + __reserved_for_rom = ALIGN (0x10); . = __reserved_for_rom + 0xcd00; + SECTION_vectors (ram, ALIGN (0x10), LMA_EQ_VMA) + SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_rodata1 (ram, ALIGN (0x8), LMA_EQ_VMA) + SECTION_rodata (ram, ALIGN (0x8), LMA_EQ_VMA) + SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_gcc_except_table (ram, ALIGN (0x1), LMA_EQ_VMA) + SECTION_data (ram, ALIGN (0x8), LMA_EQ_VMA) + SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA) + SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA) + SECTIONS_END +} diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.mlt b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.mlt --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.mlt +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_ram.mlt @@ -1,15 +1,16 @@ -version 0 -region ram 0 400000 0 ! -section reserved_vectors 3000 1 0 0 1 1 1 1 0 0 reserved_vsr_table reserved_vsr_table ! -section reserved_vsr_table 200 1 0 0 0 1 0 1 reserved_for_rom reserved_for_rom ! -section reserved_for_rom ce00 1 0 0 0 1 0 1 vectors vectors ! -section vectors 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 rodata1 rodata1 ! -section rodata1 0 8 0 1 0 1 0 1 rodata rodata ! -section rodata 0 8 0 1 0 1 0 1 fixup fixup ! -section fixup 0 4 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 8 0 1 0 1 0 1 sbss sbss ! -section sbss 0 4 0 1 0 1 0 1 bss bss ! -section bss 0 10 0 1 0 0 0 0 ! +version 0 +region ram 0 400000 0 ! +section reserved_vectors 3000 1 0 0 1 1 1 1 0 0 reserved_vsr_table reserved_vsr_table ! +section reserved_vsr_table 200 10 0 0 0 1 0 1 reserved_virtual_table reserved_virtual_table ! +section reserved_virtual_table 100 10 0 0 0 1 0 1 reserved_for_rom reserved_for_rom ! +section reserved_for_rom cd00 10 0 0 0 1 0 1 vectors vectors ! +section vectors 0 10 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 rodata1 rodata1 ! +section rodata1 0 8 0 1 0 1 0 1 rodata rodata ! +section rodata 0 8 0 1 0 1 0 1 fixup fixup ! +section fixup 0 4 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 8 0 1 0 1 0 1 sbss sbss ! +section sbss 0 4 0 1 0 1 0 1 bss bss ! +section bss 0 10 0 1 0 0 0 0 ! diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.h b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.h --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.h +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.h @@ -1,13 +1,22 @@ -// eCos memory layout - Wed Nov 24 11:49:32 1999 - -// This is a generated file - changes will be lost if ConfigTool(MLT) is run - -#include -#include - -#define CYGMEM_REGION_ram (0x0) -#define CYGMEM_REGION_ram_SIZE (0x400000) -#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) -#define CYGMEM_REGION_rom (0xfe000000) -#define CYGMEM_REGION_rom_SIZE (0x800000) -#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R) +// eCos memory layout - Thu Jun 15 15:46:43 2000 + +// This is a generated file - do not edit + +#include +#include + +#define CYGMEM_REGION_ram (0) +#define CYGMEM_REGION_ram_SIZE (0x400000) +#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W) +#define CYGMEM_REGION_rom (0xfe000000) +#define CYGMEM_REGION_rom_SIZE (0x800000) +#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R) +extern char CYG_LABEL_NAME (_reserved_vectors) []; +#define CYGMEM_SECTION_reserved_vectors (CYG_LABEL_NAME (_reserved_vectors)) +#define CYGMEM_SECTION_reserved_vectors_SIZE (0x3000) +extern char CYG_LABEL_NAME (_reserved_vsr_table) []; +#define CYGMEM_SECTION_reserved_vsr_table (CYG_LABEL_NAME (_reserved_vsr_table)) +#define CYGMEM_SECTION_reserved_vsr_table_SIZE (0x200) +extern char CYG_LABEL_NAME (_reserved_virtual_table) []; +#define CYGMEM_SECTION_reserved_virtual_table (CYG_LABEL_NAME (_reserved_virtual_table)) +#define CYGMEM_SECTION_reserved_virtual_table_SIZE (0x100) diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.ldi b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.ldi --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.ldi +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.ldi @@ -46,6 +46,7 @@ SECTIONS SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA) __reserved_vectors = 0; . = __reserved_vectors + 0x3000; __reserved_vsr_table = ALIGN (0x1); . = __reserved_vsr_table + 0x200; + __reserved_virtual_table = ALIGN (0x1); . = __reserved_virtual_table + 0x100; SECTION_data (ram, ALIGN (0x10), FOLLOWING (.gcc_except_table)) SECTION_sbss (ram, ALIGN (0x4), LMA_EQ_VMA) SECTION_bss (ram, ALIGN (0x10), LMA_EQ_VMA) diff --git a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.mlt b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.mlt --- a/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.mlt +++ b/packages/hal/powerpc/mbx/current/include/pkgconf/mlt_powerpc_mbx_rom.mlt @@ -2,7 +2,8 @@ version 0 region ram 0 400000 0 ! region rom fe000000 800000 1 ! section reserved_vectors 3000 1 0 0 1 1 1 1 0 0 reserved_vsr_table reserved_vsr_table ! -section reserved_vsr_table 200 4 0 0 0 1 0 1 data data ! +section reserved_vsr_table 200 4 0 0 0 1 0 1 reserved_virtual_table reserved_virtual_table ! +section reserved_virtual_table 100 4 0 0 0 1 0 1 data data ! section data 0 10 0 1 0 1 0 1 sbss sbss ! section sbss 0 4 0 1 0 1 0 1 bss bss ! section bss 0 10 0 1 0 0 0 0 ! diff --git a/packages/hal/powerpc/mbx/current/include/plf_intr.h b/packages/hal/powerpc/mbx/current/include/plf_intr.h new file mode 100644 --- /dev/null +++ b/packages/hal/powerpc/mbx/current/include/plf_intr.h @@ -0,0 +1,63 @@ +#ifndef CYGONCE_HAL_PLF_INTR_H +#define CYGONCE_HAL_PLF_INTR_H + +//========================================================================== +// +// plf_intr.h +// +// MBX platform specific interrupt definitions +// +//========================================================================== +//####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-06-13 +// Purpose: Define platform specific interrupt support +// +// Usage: +// #include +// ... +// +// +//####DESCRIPTIONEND#### +// +//========================================================================== + +#include + +#include + +//-------------------------------------------------------------------------- +// Control-C support. + +// Defined by the quicc driver +#include + +//-------------------------------------------------------------------------- +#endif // ifndef CYGONCE_HAL_PLF_INTR_H +// End of plf_intr.h diff --git a/packages/hal/powerpc/mbx/current/include/plf_stub.h b/packages/hal/powerpc/mbx/current/include/plf_stub.h --- a/packages/hal/powerpc/mbx/current/include/plf_stub.h +++ b/packages/hal/powerpc/mbx/current/include/plf_stub.h @@ -53,8 +53,6 @@ #include // architecture stub support -#include // QUICC serial IO support - //---------------------------------------------------------------------------- // Define serial stuff. All comes from the quicc_smc1.c file. @@ -65,7 +63,8 @@ #define HAL_STUB_PLATFORM_PUT_CHAR(c) cyg_quicc_smc1_uart_putchar((c)) #define HAL_STUB_PLATFORM_SET_BAUD_RATE(baud) CYG_UNUSED_PARAM(int, (baud)) - +#define HAL_STUB_PLATFORM_INIT_BREAK_IRQ() CYG_EMPTY_STATEMENT +#define HAL_STUB_PLATFORM_INTERRUPTIBLE 0 //---------------------------------------------------------------------------- // Stub initializer. externC void hal_mbx_set_led( int val ); @@ -74,25 +73,16 @@ externC void hal_mbx_set_led( int val ); // to distinguish eCos stub ROM ready state from either CygMon or app. #endif -//---------------------------------------------------------------------------- -#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT -#define HAL_STUB_PLATFORM_INIT_BREAK_IRQ() CYG_EMPTY_STATEMENT -#endif +#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS //---------------------------------------------------------------------------- // Reset. -#ifdef CYGSEM_HAL_ROM_MONITOR -// Just call the ROM's entry point. Not as safe as a reset, but the MBX -// doesn't have a watchdog, so this'll have to do. -externC void _start(void); -#define HAL_STUB_PLATFORM_RESET() _start() -#else + +// The MBX does not have a watchdog (not one we can easily use for this +// purpose anyway). #define HAL_STUB_PLATFORM_RESET() CYG_EMPTY_STATEMENT -#endif -#define HAL_STUB_PLATFORM_INTERRUPTIBLE 0 - -#endif // ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS +#define HAL_STUB_PLATFORM_RESET_ENTRY 0xfe000100 //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_PLF_STUB_H diff --git a/packages/hal/powerpc/mbx/current/src/hal_aux.c b/packages/hal/powerpc/mbx/current/src/hal_aux.c --- a/packages/hal/powerpc/mbx/current/src/hal_aux.c +++ b/packages/hal/powerpc/mbx/current/src/hal_aux.c @@ -46,6 +46,7 @@ #include #include #include +#include // hal_if_init // The memory map is weakly defined, allowing the application to redefine // it if necessary. The regions defined below are the minimum requirements. @@ -300,4 +301,12 @@ int return 0; } +//-------------------------------------------------------------------------- +// Platform init code. +void +hal_platform_init(void) +{ + hal_if_init(); +} + // EOF hal_aux.c diff --git a/packages/hal/powerpc/mbx/current/src/hal_diag.c b/packages/hal/powerpc/mbx/current/src/hal_diag.c --- a/packages/hal/powerpc/mbx/current/src/hal_diag.c +++ b/packages/hal/powerpc/mbx/current/src/hal_diag.c @@ -58,6 +58,8 @@ #include #include +#if !defined(CYGSEM_HAL_VIRTUAL_VECTOR_DIAG) + //----------------------------------------------------------------------------- // Select default diag channel to use @@ -239,4 +241,6 @@ void hal_diag_read_char(char *c) #endif // CYG_KERNEL_DIAG_SERIAL +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_DIAG + // EOF hal_diag.c diff --git a/packages/hal/powerpc/mpc8xx/current/ChangeLog b/packages/hal/powerpc/mpc8xx/current/ChangeLog --- a/packages/hal/powerpc/mpc8xx/current/ChangeLog +++ b/packages/hal/powerpc/mpc8xx/current/ChangeLog @@ -1,3 +1,12 @@ +2000-06-14 Jesper Skov + + * cdl/hal_powerpc_mpc8xx.cdl: Proper ROM_MONITOR hack. + +2000-06-13 Jesper Skov + + * include/var_intr.h: Include quicc definitions for ctrlc + support. + 2000-04-14 Jesper Skov * src/var_misc.c (hal_variant_init): Moved serialization disable diff --git a/packages/hal/powerpc/mpc8xx/current/cdl/hal_powerpc_mpc8xx.cdl b/packages/hal/powerpc/mpc8xx/current/cdl/hal_powerpc_mpc8xx.cdl --- a/packages/hal/powerpc/mpc8xx/current/cdl/hal_powerpc_mpc8xx.cdl +++ b/packages/hal/powerpc/mpc8xx/current/cdl/hal_powerpc_mpc8xx.cdl @@ -57,6 +57,7 @@ cdl_package CYGPKG_HAL_POWERPC_MPC8xx { cdl_interface CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED { display "ROM monitor configuration is unsupported" + no_define } cdl_option CYGSEM_HAL_USE_ROM_MONITOR { display "Work with a ROM monitor" @@ -76,9 +77,20 @@ cdl_package CYGPKG_HAL_POWERPC_MPC8xx { exception handling to the ROM monitor." } + + # FIXME: the option above should be adjusted to select between monitor + # variants + cdl_option CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs { + display "Bad CDL workaround" + calculated 1 + active_if CYGSEM_HAL_USE_ROM_MONITOR + } + + # Note: This should be sub-variant specific to reduce memory use. define_proc { puts $cdl_header "#define CYGHWR_HAL_VSR_TABLE (CYGHWR_HAL_POWERPC_VECTOR_BASE + 0x3000)" + puts $cdl_header "#define CYGHWR_HAL_VIRTUAL_VECTOR_TABLE (CYGHWR_HAL_VSR_TABLE + 0x200)" } cdl_component CYGPKG_HAL_POWERPC_MPC823 { diff --git a/packages/hal/powerpc/mpc8xx/current/include/var_intr.h b/packages/hal/powerpc/mpc8xx/current/include/var_intr.h --- a/packages/hal/powerpc/mpc8xx/current/include/var_intr.h +++ b/packages/hal/powerpc/mpc8xx/current/include/var_intr.h @@ -49,6 +49,8 @@ #include +#include + #include // types #include // register definitions diff --git a/packages/hal/powerpc/ppc60x/current/ChangeLog b/packages/hal/powerpc/ppc60x/current/ChangeLog --- a/packages/hal/powerpc/ppc60x/current/ChangeLog +++ b/packages/hal/powerpc/ppc60x/current/ChangeLog @@ -1,3 +1,7 @@ +2000-06-13 Jesper Skov + + * cdl/hal_powerpc_ppc60x.cdl: Add vector table location definition. + 2000-04-13 Jesper Skov * src/var_misc.c (hal_variant_idle_thread_action): Added. diff --git a/packages/hal/powerpc/ppc60x/current/cdl/hal_powerpc_ppc60x.cdl b/packages/hal/powerpc/ppc60x/current/cdl/hal_powerpc_ppc60x.cdl --- a/packages/hal/powerpc/ppc60x/current/cdl/hal_powerpc_ppc60x.cdl +++ b/packages/hal/powerpc/ppc60x/current/cdl/hal_powerpc_ppc60x.cdl @@ -53,6 +53,7 @@ cdl_package CYGPKG_HAL_POWERPC_PPC60x { # Note: This should be sub-variant specific to reduce memory use. define_proc { puts $cdl_header "#define CYGHWR_HAL_VSR_TABLE (CYGHWR_HAL_POWERPC_VECTOR_BASE + 0x3000)" + puts $cdl_header "#define CYGHWR_HAL_VIRTUAL_VECTOR_TABLE (CYGHWR_HAL_VSR_TABLE + 0x200)" } cdl_component CYGPKG_HAL_POWERPC_PPC603 { diff --git a/packages/hal/powerpc/quicc/current/ChangeLog b/packages/hal/powerpc/quicc/current/ChangeLog --- a/packages/hal/powerpc/quicc/current/ChangeLog +++ b/packages/hal/powerpc/quicc/current/ChangeLog @@ -1,3 +1,9 @@ +2000-06-13 Jesper Skov + + * src/quicc_smc1.c: + * include/quicc_smc1.h: + Added ctrlc handling for use via virtual vector table. + 2000-03-03 Gary Thomas * src/quicc_smc1.c: Use common CPM defines (now in ppc8xx.h). diff --git a/packages/hal/powerpc/quicc/current/include/quicc_smc1.h b/packages/hal/powerpc/quicc/current/include/quicc_smc1.h --- a/packages/hal/powerpc/quicc/current/include/quicc_smc1.h +++ b/packages/hal/powerpc/quicc/current/include/quicc_smc1.h @@ -49,4 +49,17 @@ extern void cyg_quicc_smc1_uart_putchar( extern int cyg_quicc_smc1_uart_rcvchar(void); extern void cyg_quicc_init_smc1(void); +//-------------------------------------------------------------------------- +// Control-C support. + +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + +#define CYGHWR_HAL_GDB_PORT_VECTOR CYGNUM_HAL_INTERRUPT_CPM_SMC1 +externC cyg_uint32 hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); + +# define HAL_CTRLC_ISR hal_ctrlc_isr + +#endif + #endif /* CYGONCE_HAL_PPC_QUICC_SMC1_H */ diff --git a/packages/hal/powerpc/quicc/current/src/quicc_smc1.c b/packages/hal/powerpc/quicc/current/src/quicc_smc1.c --- a/packages/hal/powerpc/quicc/current/src/quicc_smc1.c +++ b/packages/hal/powerpc/quicc/current/src/quicc_smc1.c @@ -56,9 +56,13 @@ #include -#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT +#if defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) #include // target_register_t #include // HAL_INTERRUPT_UNMASK(...) +#include // Calling interface definitions +#include // Helper functions +#include // CYG_ISR_HANDLED #endif #define UART_BIT_RATE(n) (((int)(CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/n) @@ -181,9 +185,11 @@ init_smc1_uart(void) eppc->smc_regs[0].smc_smcmr = 0x4820; eppc->smc_regs[0].smc_smcmr = 0x4823; +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // remove below #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT HAL_INTERRUPT_UNMASK( CYGNUM_HAL_INTERRUPT_CPM_SMC1 ); #endif +#endif } @@ -320,6 +326,9 @@ cyg_quicc_init_smc1(void) init_smc1_uart(); } +#ifndef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // the below should be removed + + #ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT // This ISR is called from the interrupt handler. This should only // happen when there is no real serial driver, so the code shouldn't @@ -362,5 +371,55 @@ int cyg_hal_gdb_isr( target_register_t p } #endif // CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT + +#else // the below stays + +#if defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) + +struct Hal_SavedRegisters *hal_saved_interrupt_state; + +void +hal_ctrlc_isr_init(void) +{ + HAL_INTERRUPT_UNMASK(CYGHWR_HAL_GDB_PORT_VECTOR); +} + +cyg_uint32 +hal_ctrlc_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + EPPC *eppc = eppc_base(); + struct cp_bufdesc *bd; + char ch; + + eppc->smc_regs[0].smc_smce = 0xff; + + /* rx buffer descriptors */ + bd = (struct cp_bufdesc *)((char *)eppc_base() + Rxbd); + + if ((bd->ctrl & QUICC_BD_CTL_Ready) == 0) { + + // then there be a character waiting + ch = bd->buffer[0]; + bd->length = 1; + bd->ctrl = QUICC_BD_CTL_Ready | QUICC_BD_CTL_Wrap | QUICC_BD_CTL_Int; + + if( cyg_hal_is_break( &ch , 1 ) ) + cyg_hal_user_break( (CYG_ADDRWORD *)hal_saved_interrupt_state ); + + // Interrupt handled. Acknowledge it. + eppc->cpmi_cisr = 0x10; + return CYG_ISR_HANDLED; + } + + eppc->cpmi_cisr = 0x10; // acknowledge the Rx event anyway + // in case it was left over from polled reception + + // Not a serial interrupt + return 0; +} +#endif +#endif // CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT + #endif // CYGPKG_HAL_POWERPC_MPC860 // EOF quicc_smc1.c diff --git a/packages/hal/sh/arch/current/ChangeLog b/packages/hal/sh/arch/current/ChangeLog --- a/packages/hal/sh/arch/current/ChangeLog +++ b/packages/hal/sh/arch/current/ChangeLog @@ -1,3 +1,24 @@ +2000-06-15 Jesper Skov + + * include/hal_intr.h: Added HAL_DEFAULT_ISR. + +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + + * include/mod_7708.h: + * include/mod_7709a.h: + * src/vectors.S: + Minor config change to get rid of growing list of variant checks. + +2000-06-08 Jesper Skov + + * include/mod_7707a.h: + * src/vectors.S: + * cdl/hal_sh.cdl: + Added first level of support for 7707A variant. + 2000-06-06 Jesper Skov * src/vectors.S: INTEVT2 is not defined on all variants. Protect diff --git a/packages/hal/sh/arch/current/cdl/hal_sh.cdl b/packages/hal/sh/arch/current/cdl/hal_sh.cdl --- a/packages/hal/sh/arch/current/cdl/hal_sh.cdl +++ b/packages/hal/sh/arch/current/cdl/hal_sh.cdl @@ -91,6 +91,22 @@ cdl_package CYGPKG_HAL_SH { @rm target.tmp } + cdl_option CYGPKG_HAL_SH_7707A { + display "SH 7707A microprocessor" + implements CYGINT_HAL_SH_VARIANT + default_value 0 + no_define + define -file=system.h CYGPKG_HAL_SH_7707A + description " + The SH3 7707A microprocessor. This is an embedded part that in + addition to the SH3 processor core has built in peripherals + such as memory controllers, serial ports, LCD controller and + timers/counters." + define_proc { + puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H " + } + } + cdl_option CYGPKG_HAL_SH_7708 { display "SH 7708 microprocessor" implements CYGINT_HAL_SH_VARIANT diff --git a/packages/hal/sh/arch/current/include/hal_arch.h b/packages/hal/sh/arch/current/include/hal_arch.h --- a/packages/hal/sh/arch/current/include/hal_arch.h +++ b/packages/hal/sh/arch/current/include/hal_arch.h @@ -293,6 +293,12 @@ externC void hal_idle_thread_action(cyg_ (CYGNUM_HAL_STACK_SIZE_MINIMUM + \ 30 * (CYGNUM_HAL_STACK_FRAME_SIZE+(16*4))) +//-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_ARCH_H // End of hal_arch.h diff --git a/packages/hal/sh/arch/current/include/hal_intr.h b/packages/hal/sh/arch/current/include/hal_intr.h --- a/packages/hal/sh/arch/current/include/hal_intr.h +++ b/packages/hal/sh/arch/current/include/hal_intr.h @@ -225,9 +225,13 @@ externC volatile CYG_ADDRESS hal_vsr_ //-------------------------------------------------------------------------- // Default ISR +// The #define is used to test whether this routine exists, and to allow +// us to call it. externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); +#define HAL_DEFAULT_ISR hal_default_isr + //-------------------------------------------------------------------------- // Interrupt state storage diff --git a/packages/hal/sh/arch/current/include/mod_7708.h b/packages/hal/sh/arch/current/include/mod_7708.h --- a/packages/hal/sh/arch/current/include/mod_7708.h +++ b/packages/hal/sh/arch/current/include/mod_7708.h @@ -70,4 +70,8 @@ // Writing zero to both forces a flush of the line if it is dirty. #define CYGARC_SH_MOD_CAC_ADDRESS_FLUSH 0x00000000 +//----------------------------------------------------------------------------- +// Extra details for interrupt handling +#define CYGARC_SH_SOFTWARE_IP_UPDATE + #endif // CYGONCE_HAL_MOD_77xx_H diff --git a/packages/hal/sh/arch/current/include/mod_7709a.h b/packages/hal/sh/arch/current/include/mod_7709a.h --- a/packages/hal/sh/arch/current/include/mod_7709a.h +++ b/packages/hal/sh/arch/current/include/mod_7709a.h @@ -73,4 +73,8 @@ // Writing zero to both forces a flush of the line if it is dirty. #define CYGARC_SH_MOD_CAC_ADDRESS_FLUSH 0x00000000 +//----------------------------------------------------------------------------- +// Extra details for interrupt handling +#define CYGARC_SH_SOFTWARE_IP_UPDATE + #endif // CYGONCE_HAL_MOD_77xx_H diff --git a/packages/hal/sh/arch/current/src/vectors.S b/packages/hal/sh/arch/current/src/vectors.S --- a/packages/hal/sh/arch/current/src/vectors.S +++ b/packages/hal/sh/arch/current/src/vectors.S @@ -691,7 +691,7 @@ 2: #ifdef CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING -#if defined(CYGPKG_HAL_SH_7708) || defined(CYGPKG_HAL_SH_7709A) +#if defined(CYGARC_SH_SOFTWARE_IP_UPDATE) # 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. @@ -1077,11 +1077,9 @@ 2: nop # The rest of the table consists of programmable levels, maintained # by the HAL_INTERRUPT_SET_LEVEL macro. -#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_7708 || CYGPKG_HAL_SH_7709A #endif // CYGSEM_HAL_COMMON_INTERRUPTS_ALLOW_NESTING #--------------------------------------------------------------------------- diff --git a/packages/hal/sparclite/arch/current/ChangeLog b/packages/hal/sparclite/arch/current/ChangeLog --- a/packages/hal/sparclite/arch/current/ChangeLog +++ b/packages/hal/sparclite/arch/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-02-16 Jesper Skov * src/vectors.S: diff --git a/packages/hal/sparclite/arch/current/include/hal_arch.h b/packages/hal/sparclite/arch/current/include/hal_arch.h --- a/packages/hal/sparclite/arch/current/include/hal_arch.h +++ b/packages/hal/sparclite/arch/current/include/hal_arch.h @@ -344,6 +344,12 @@ CYG_MACRO_END #define CYGNUM_HAL_STACK_SIZE_TYPICAL \ (CYGNUM_HAL_STACK_SIZE_MINIMUM + 8 * CYGNUM_HAL_STACK_FRAME_SIZE) +//-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + //----------------------------------------------------------------------------- #endif // CYGONCE_HAL_ARCH_H diff --git a/packages/hal/v85x/arch/current/ChangeLog b/packages/hal/v85x/arch/current/ChangeLog --- a/packages/hal/v85x/arch/current/ChangeLog +++ b/packages/hal/v85x/arch/current/ChangeLog @@ -1,3 +1,24 @@ +2000-06-15 Gary Thomas + + * src/hal_mk_defs.c: + * src/vectors.S: + * src/hal_misc.c (hal_default_isr): Update for new debug + vector support. + + * include/hal_intr.h: + * src/vectors.S (do_interrupt): Proper handling of chained + interrupts. + +2000-06-12 Gary Thomas + + * src/vectors.S (return_from_exception_or_interrupt): Revert + reorg change (05-26) which broke GDB breakpoints. + +2000-06-08 Jesper Skov + + * include/hal_arch.h (CYGARC_HAL_SAVE_GP, CYGARC_HAL_RESTORE_GP): + Added. + 2000-05-26 Gary Thomas * src/vectors.S: Slight reorg of trap vectors (more readable). diff --git a/packages/hal/v85x/arch/current/include/hal_arch.h b/packages/hal/v85x/arch/current/include/hal_arch.h --- a/packages/hal/v85x/arch/current/include/hal_arch.h +++ b/packages/hal/v85x/arch/current/include/hal_arch.h @@ -265,5 +265,11 @@ externC void hal_idle_thread_action(cyg_ #endif //-------------------------------------------------------------------------- +// Macros for switching context between two eCos instances (jump from +// code in ROM to code in RAM or vice versa). +#define CYGARC_HAL_SAVE_GP() +#define CYGARC_HAL_RESTORE_GP() + +//-------------------------------------------------------------------------- #endif // CYGONCE_HAL_HAL_ARCH_H // End of hal_arch.h diff --git a/packages/hal/v85x/arch/current/include/hal_intr.h b/packages/hal/v85x/arch/current/include/hal_intr.h --- a/packages/hal/v85x/arch/current/include/hal_intr.h +++ b/packages/hal/v85x/arch/current/include/hal_intr.h @@ -63,12 +63,12 @@ // Static data used by HAL // ISR tables -externC volatile CYG_ADDRESS hal_interrupt_handlers[CYGNUM_HAL_ISR_COUNT]; -externC volatile CYG_ADDRWORD hal_interrupt_data[CYGNUM_HAL_ISR_COUNT]; -externC volatile CYG_ADDRESS hal_interrupt_objects[CYGNUM_HAL_ISR_COUNT]; +externC CYG_ADDRESS hal_interrupt_handlers[CYGNUM_HAL_ISR_COUNT]; +externC CYG_ADDRWORD hal_interrupt_data[CYGNUM_HAL_ISR_COUNT]; +externC CYG_ADDRESS hal_interrupt_objects[CYGNUM_HAL_ISR_COUNT]; // VSR table -externC volatile CYG_ADDRESS hal_vsr_table[CYGNUM_HAL_VSR_COUNT]; +externC CYG_ADDRESS hal_vsr_table[CYGNUM_HAL_VSR_COUNT]; //-------------------------------------------------------------------------- // Default ISR @@ -147,6 +147,19 @@ externC void hal_interrupt_stack_call_pe // are passed. For unchained interrupts we have a vector per interrupt. // Note: this hardware does not have/support chained interrupts. +//-------------------------------------------------------------------------- +// Vector translation. +// For chained interrupts we only have a single vector though which all +// are passed. For unchained interrupts we have a vector per interrupt. + +#ifndef HAL_TRANSLATE_VECTOR +#if defined(CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN) +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = 0 +#else +#define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = (_vector_-CYGNUM_HAL_ISR_MIN) +#endif +#endif + #ifndef HAL_TRANSLATE_VECTOR #define HAL_TRANSLATE_VECTOR(_vector_,_index_) (_index_) = (_vector_-CYGNUM_HAL_ISR_MIN) #endif diff --git a/packages/hal/v85x/arch/current/src/hal_misc.c b/packages/hal/v85x/arch/current/src/hal_misc.c --- a/packages/hal/v85x/arch/current/src/hal_misc.c +++ b/packages/hal/v85x/arch/current/src/hal_misc.c @@ -137,6 +137,18 @@ cyg_hal_invoke_constructors (void) /*------------------------------------------------------------------------*/ /* default ISR */ +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT +externC cyg_uint32 +hal_arch_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) +{ + CYG_TRACE1(true, "Interrupt: %d", vector); + + diag_printf("Spurious Interrupt!!! - vector: %d, data: %x\n", vector, + data); + CYG_FAIL("Spurious Interrupt!!!"); + return 0; +} +#else externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data) { @@ -158,6 +170,7 @@ hal_default_isr(CYG_ADDRWORD vector, CYG CYG_FAIL("Spurious Interrupt!!!"); return 0; } +#endif /*------------------------------------------------------------------------*/ /* Idle thread action */ diff --git a/packages/hal/v85x/arch/current/src/hal_mk_defs.c b/packages/hal/v85x/arch/current/src/hal_mk_defs.c --- a/packages/hal/v85x/arch/current/src/hal_mk_defs.c +++ b/packages/hal/v85x/arch/current/src/hal_mk_defs.c @@ -51,6 +51,9 @@ # include # include #endif +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT) +#include +#endif /* * This program is used to generate definitions needed by @@ -154,6 +157,10 @@ main(void) DEFINE(RAISE_INTR, CYG_INSTRUMENT_CLASS_INTR|CYG_INSTRUMENT_EVENT_INTR_RAISE); #endif +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT) + DEFINE(CYGNUM_CALL_IF_TABLE_SIZE, CYGNUM_CALL_IF_TABLE_SIZE); +#endif + // Variant definitions - want these to be included instead. } diff --git a/packages/hal/v85x/arch/current/src/vectors.S b/packages/hal/v85x/arch/current/src/vectors.S --- a/packages/hal/v85x/arch/current/src/vectors.S +++ b/packages/hal/v85x/arch/current/src/vectors.S @@ -172,7 +172,14 @@ 10: st.w r8,0[r6] bne 10b #endif jarl _initialize_stub,r31 +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this _check_ should go away +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + .extern hal_ctrlc_isr_init + jarl _hal_ctrlc_isr_init,r31 #endif +#endif +#endif // CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS // Run through static constructors jarl _cyg_hal_invoke_constructors,r31 @@ -344,9 +351,26 @@ 10: jarl _cyg_instrument,r31 #endif +#ifdef CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT // this _check_ should go away +#if defined(CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT) \ + || defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT) + // If we are supporting Ctrl-C interrupts from GDB, we must squirrel + // away a pointer to the save interrupt state here so that we can + // plant a breakpoint at some later time. + + .extern _hal_saved_interrupt_state + lea _hal_saved_interrupt_state,r8 + st.w ep,0[r8] +#endif +#endif + +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + mov r0,r8 // vector # (overloaded by kernel) +#else ld.w CYGARC_REG_VECTOR[ep],r6 // vector # addi -CYGNUM_HAL_ISR_MIN,r6,r8 shl 2,r8 +#endif lea _hal_interrupt_objects,r1 add r8,r1 ld.w 0[r1],r29 // save object handle @@ -357,6 +381,9 @@ 10: add r8,r1 mov ep,r8 // pointer to saved registers ld.w 0[r1],r1 // handler routine +#ifdef CYGIMP_KERNEL_INTERRUPTS_CHAIN + ld.w CYGARC_REG_VECTOR[ep],r6 // vector # +#endif jarl call_via_r1,r31 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK @@ -465,6 +492,14 @@ call_via_r1: .rept CYGNUM_HAL_ISR_COUNT .word do_interrupt .endr + +#if defined(CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT) + .balign 64 +_hal_virtual_vector_table: + .rept CYGNUM_CALL_IF_TABLE_SIZE + .word 0 + .endr +#endif #endif // Initial stack diff --git a/packages/hal/v85x/ceb_v850/current/cdl/hal_v85x_ceb_v850.cdl b/packages/hal/v85x/ceb_v850/current/cdl/hal_v85x_ceb_v850.cdl --- a/packages/hal/v85x/ceb_v850/current/cdl/hal_v85x_ceb_v850.cdl +++ b/packages/hal/v85x/ceb_v850/current/cdl/hal_v85x_ceb_v850.cdl @@ -205,7 +205,7 @@ cdl_package CYGPKG_HAL_V85X_V850_CEB { cdl_option CYGSEM_HAL_USE_ROM_MONITOR { display "Work with a ROM monitor" flavor booldata - legal_values { "Generic" "GDB_stubs" "PMON" } + legal_values { "Generic" "GDB_stubs" } default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 } parent CYGPKG_HAL_ROM_MONITOR requires { CYG_HAL_STARTUP == "RAM" } @@ -220,9 +220,7 @@ cdl_package CYGPKG_HAL_V85X_V850_CEB { the most basic support which is likely to be common to most implementations of ROM monitor. \"GDB_stubs\" provides support when GDB stubs are included in - the ROM monitor or boot ROM. - And finally, \"PMON\" allows the program to co-operate with - the PMON ROM monitor when fitted to the board." + the ROM monitor or boot ROM." } cdl_option CYGSEM_HAL_ROM_MONITOR { diff --git a/packages/hal/v85x/v850/current/ChangeLog b/packages/hal/v85x/v850/current/ChangeLog --- a/packages/hal/v85x/v850/current/ChangeLog +++ b/packages/hal/v85x/v850/current/ChangeLog @@ -1,3 +1,13 @@ +2000-06-12 Gary Thomas + + * src/v850_misc.c (hal_interrupt_unmask): Remove [extra] + debug message. + +2000-06-09 Gary Thomas + + * src/v850_misc.c: Make interrupt handling routines safe. + Also add asserts to verify. + 2000-05-25 Gary Thomas * src/v85x_v850.ld: Add platform specifics. In particular the diff --git a/packages/hal/v85x/v850/current/src/v850_misc.c b/packages/hal/v85x/v850/current/src/v850_misc.c --- a/packages/hal/v85x/v850/current/src/v850_misc.c +++ b/packages/hal/v85x/v850/current/src/v850_misc.c @@ -74,8 +74,13 @@ void hal_interrupt_mask(int vector) { volatile unsigned char *ctl; + CYG_ASSERT(vector >= CYGNUM_HAL_ISR_MIN, "invalid interrupt vector [< MIN]"); + CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX, "invalid interrupt vector [> MAX]"); ctl = interrupt_control_registers[vector-CYGNUM_HAL_ISR_MIN]; - *ctl |= INT_CONTROL_DISABLE; + CYG_ASSERT((void *)ctl != 0, "invalid interrupt vector [not defined]"); + if (ctl ) { + *ctl |= INT_CONTROL_DISABLE; + } } // @@ -85,8 +90,13 @@ void hal_interrupt_unmask(int vector) { volatile unsigned char *ctl; + CYG_ASSERT(vector >= CYGNUM_HAL_ISR_MIN, "invalid interrupt vector [< MIN]"); + CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX, "invalid interrupt vector [> MAX]"); ctl = interrupt_control_registers[vector-CYGNUM_HAL_ISR_MIN]; - *ctl &= ~INT_CONTROL_DISABLE; + CYG_ASSERT((void *)ctl != 0, "invalid interrupt vector [not defined]"); + if (ctl ) { + *ctl &= ~INT_CONTROL_DISABLE; + } } // @@ -96,8 +106,13 @@ void hal_interrupt_acknowledge(int vector) { volatile unsigned char *ctl; + CYG_ASSERT(vector >= CYGNUM_HAL_ISR_MIN, "invalid interrupt vector [< MIN]"); + CYG_ASSERT(vector <= CYGNUM_HAL_ISR_MAX, "invalid interrupt vector [> MAX]"); ctl = interrupt_control_registers[vector-CYGNUM_HAL_ISR_MIN]; - *ctl &= ~INT_CONTROL_PENDING; + CYG_ASSERT((void *)ctl != 0, "invalid interrupt vector [not defined]"); + if (ctl ) { + *ctl &= ~INT_CONTROL_PENDING; + } } static void @@ -107,7 +122,9 @@ init_interrupts(void) volatile unsigned char *ctl; for (i = CYGNUM_HAL_ISR_MIN; i <= CYGNUM_HAL_ISR_MAX; i++) { ctl = interrupt_control_registers[i-CYGNUM_HAL_ISR_MIN]; - *ctl = INT_CONTROL_DEFAULT; + if (ctl) { + *ctl = INT_CONTROL_DEFAULT; + } } } diff --git a/packages/kernel/current/ChangeLog b/packages/kernel/current/ChangeLog --- a/packages/kernel/current/ChangeLog +++ b/packages/kernel/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Jesper Skov + + * src/debug/dbg-thread-demux.c: Use generic HAL feature to allow + ROM/RAM intercalling. + 2000-05-30 Gary Thomas * tests/dhrystone.c: Increase number of test loops for faster @@ -25,11 +30,23 @@ 2000-04-26 Jesper Skov + + * tests/clockcnv.cxx: + * tests/dhrystone.c: + Renamed 850 HAL package. + 2000-04-25 Jesper Skov * tests/kcache1.c: Fixed cache check to also look for unified caches. +2000-04-19 Jesper Skov + + * tests/clockcnv.cxx: + * tests/dhrystone.c: + Only a few laps around the block on the v850... + 2000-04-12 Gary Thomas * src/common/kapi.cxx (cyg_scheduler_safe_lock): diff --git a/packages/kernel/current/src/debug/dbg-thread-demux.c b/packages/kernel/current/src/debug/dbg-thread-demux.c --- a/packages/kernel/current/src/debug/dbg-thread-demux.c +++ b/packages/kernel/current/src/debug/dbg-thread-demux.c @@ -41,6 +41,7 @@ // //========================================================================*/ +#include /* This file implements system calls out from the ROM debug stub into the operating environment. @@ -84,78 +85,53 @@ static int dbg_thread_syscall_rmt( union dbg_thread_syscall_parms * p ) { - switch (id) + int ret; + CYGARC_HAL_SAVE_GP(); + switch (id) { - case dbg_null_func : return 1 ; /* test the syscall apparatus */ + case dbg_null_func : + ret = 1 ; /* test the syscall apparatus */ + break; #ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT case dbg_capabilities_func : - return dbg_thread_capabilities(p->cap_parms.abilities) ; - break ; + ret = dbg_thread_capabilities(p->cap_parms.abilities) ; + break ; case dbg_currthread_func : - return dbg_currthread(p->currthread_parms.ref) ; - break ; + ret = dbg_currthread(p->currthread_parms.ref) ; + break ; case dbg_threadlist_func : - return dbg_threadlist(p->threadlist_parms.startflag, - p->threadlist_parms.lastid, - p->threadlist_parms.nextthreadid) ; - break ; + ret = dbg_threadlist(p->threadlist_parms.startflag, + p->threadlist_parms.lastid, + p->threadlist_parms.nextthreadid) ; + break ; case dbg_threadinfo_func : - return dbg_threadinfo(p->info_parms.ref, - p->info_parms.info - ) ; - break ; + ret = dbg_threadinfo(p->info_parms.ref, + p->info_parms.info ) ; + break ; case dbg_getthreadreg_func : - return dbg_getthreadreg(p->reg_parms.thread, - p->reg_parms.regcount, - p->reg_parms.registers) ; - break ; + ret = dbg_getthreadreg(p->reg_parms.thread, + p->reg_parms.regcount, + p->reg_parms.registers) ; + break ; case dbg_setthreadreg_func : - return dbg_setthreadreg(p->reg_parms.thread, - p->reg_parms.regcount, - p->reg_parms.registers) ; - break ; + ret = dbg_setthreadreg(p->reg_parms.thread, + p->reg_parms.regcount, + p->reg_parms.registers) ; + break ; case dbg_scheduler_func : - return dbg_scheduler(p->scheduler_parms.thread, - p->scheduler_parms.lock, - p->scheduler_parms.mode) ; - break ; + ret = dbg_scheduler(p->scheduler_parms.thread, + p->scheduler_parms.lock, + p->scheduler_parms.mode) ; + break ; #endif /* CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT */ default : - return 0 ; /* failure due to non-implementation */ + ret = 0 ; /* failure due to non-implementation */ } + CYGARC_HAL_RESTORE_GP(); + return ret; } -// ------------------------------------------------------------------------- -// When Cygmon calls us on the MIPS It has its own value in GP. We need to -// save that and set our own before proceeding. - -#ifdef CYGPKG_HAL_MIPS -static int dbg_thread_syscall_rmt_1( - enum dbg_syscall_ids id, - union dbg_thread_syscall_parms * p - ) -{ - - register long gp_save; - int r; - asm volatile ( "move %0,$28;" - ".extern _gp;" - "la $gp,_gp;" - : "=r"(gp_save) - ); - - r = dbg_thread_syscall_rmt( id, p ); - - asm volatile ( "move $gp,%0;" :: "r"(gp_save) ); - - return r; - -} -#endif - -// ------------------------------------------------------------------------- - #define DBG_SYSCALL_THREAD_VEC_NUM 15 #ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT @@ -179,11 +155,7 @@ void patch_dbg_syscalls(void * vector) #ifdef CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT -#ifdef CYGPKG_HAL_MIPS - f[DBG_SYSCALL_THREAD_VEC_NUM] = dbg_thread_syscall_rmt_1 ; -#else f[DBG_SYSCALL_THREAD_VEC_NUM] = dbg_thread_syscall_rmt ; -#endif #endif diff --git a/packages/kernel/current/tests/clockcnv.cxx b/packages/kernel/current/tests/clockcnv.cxx --- a/packages/kernel/current/tests/clockcnv.cxx +++ b/packages/kernel/current/tests/clockcnv.cxx @@ -167,6 +167,9 @@ static void entry0( CYG_ADDRWORD data ) j += 30; // test fewer values /* tr.b..m..k.. */ +#ifdef CYGPKG_HAL_V85X_V850_CEB + j += 30; // test fewer values +#endif for ( delay = j; delay < 1000000000000ll; delay *= 10 ) { // get the converted result diff --git a/packages/kernel/current/tests/dhrystone.c b/packages/kernel/current/tests/dhrystone.c --- a/packages/kernel/current/tests/dhrystone.c +++ b/packages/kernel/current/tests/dhrystone.c @@ -66,6 +66,8 @@ dtime(void) #define PASSES 1000000 #elif defined(CYGPKG_HAL_ARM_CMA230) #define PASSES 100000 +#elif defined(CYGPKG_HAL_V85X_V850_CEB) +#define PASSES 20000 #elif defined(CYGPKG_HAL_POWERPC_MPC8xx) #define PASSES 250000 #else diff --git a/packages/net/tcpip/current/ChangeLog b/packages/net/tcpip/current/ChangeLog --- a/packages/net/tcpip/current/ChangeLog +++ b/packages/net/tcpip/current/ChangeLog @@ -1,3 +1,8 @@ +2000-06-08 Hugo Tyson + + * include/netinet/ip_var.h: Export ipforwarding as well as + ip_defttl for monitoring applications. + 2000-05-31 Hugo Tyson * src/lib/network_support.c (init_all_network_interfaces): Make diff --git a/packages/net/tcpip/current/include/bootp.h b/packages/net/tcpip/current/include/bootp.h --- a/packages/net/tcpip/current/include/bootp.h +++ b/packages/net/tcpip/current/include/bootp.h @@ -80,7 +80,7 @@ SOFTWARE. /* * Bootstrap Protocol (BOOTP). RFC951 and RFC1395. * - * $Id: bootp.h,v 1.2 2000/06/07 14:10:35 jlarmour Exp $ + * $Id: bootp.h,v 1.3 2000/06/16 16:44:25 jlarmour Exp $ * * * This file specifies the "implementation-independent" BOOTP protocol diff --git a/packages/net/tcpip/current/include/netinet/ip_auth.h b/packages/net/tcpip/current/include/netinet/ip_auth.h --- a/packages/net/tcpip/current/include/netinet/ip_auth.h +++ b/packages/net/tcpip/current/include/netinet/ip_auth.h @@ -61,7 +61,7 @@ * provided that this notice is preserved and due credit is given * to the original author and the contributors. * - * $Id: ip_auth.h,v 1.2 2000/06/07 14:10:35 jlarmour Exp $ + * $Id: ip_auth.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ * */ diff --git a/packages/net/tcpip/current/include/netinet/ip_fil.h b/packages/net/tcpip/current/include/netinet/ip_fil.h --- a/packages/net/tcpip/current/include/netinet/ip_fil.h +++ b/packages/net/tcpip/current/include/netinet/ip_fil.h @@ -62,7 +62,7 @@ * to the original author and the contributors. * * @(#)ip_fil.h 1.35 6/5/96 - * $Id: ip_fil.h,v 1.2 2000/06/07 14:10:35 jlarmour Exp $ + * $Id: ip_fil.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_FIL_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_fil_compat.h b/packages/net/tcpip/current/include/netinet/ip_fil_compat.h --- a/packages/net/tcpip/current/include/netinet/ip_fil_compat.h +++ b/packages/net/tcpip/current/include/netinet/ip_fil_compat.h @@ -62,7 +62,7 @@ * to the original author and the contributors. * * @(#)ip_compat.h 1.8 1/14/96 - * $Id: ip_fil_compat.h,v 1.2 2000/06/07 14:10:35 jlarmour Exp $ + * $Id: ip_fil_compat.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_COMPAT_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_frag.h b/packages/net/tcpip/current/include/netinet/ip_frag.h --- a/packages/net/tcpip/current/include/netinet/ip_frag.h +++ b/packages/net/tcpip/current/include/netinet/ip_frag.h @@ -62,7 +62,7 @@ * to the original author and the contributors. * * @(#)ip_frag.h 1.5 3/24/96 - * $Id: ip_frag.h,v 1.2 2000/06/07 14:10:36 jlarmour Exp $ + * $Id: ip_frag.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_FRAG_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_nat.h b/packages/net/tcpip/current/include/netinet/ip_nat.h --- a/packages/net/tcpip/current/include/netinet/ip_nat.h +++ b/packages/net/tcpip/current/include/netinet/ip_nat.h @@ -62,7 +62,7 @@ * to the original author and the contributors. * * @(#)ip_nat.h 1.5 2/4/96 - * $Id: ip_nat.h,v 1.2 2000/06/07 14:10:36 jlarmour Exp $ + * $Id: ip_nat.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_NAT_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_proxy.h b/packages/net/tcpip/current/include/netinet/ip_proxy.h --- a/packages/net/tcpip/current/include/netinet/ip_proxy.h +++ b/packages/net/tcpip/current/include/netinet/ip_proxy.h @@ -61,7 +61,7 @@ * provided that this notice is preserved and due credit is given * to the original author and the contributors. * - * $Id: ip_proxy.h,v 1.2 2000/06/07 14:10:36 jlarmour Exp $ + * $Id: ip_proxy.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_PROXY_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_state.h b/packages/net/tcpip/current/include/netinet/ip_state.h --- a/packages/net/tcpip/current/include/netinet/ip_state.h +++ b/packages/net/tcpip/current/include/netinet/ip_state.h @@ -62,7 +62,7 @@ * to the original author and the contributors. * * @(#)ip_state.h 1.3 1/12/96 (C) 1995 Darren Reed - * $Id: ip_state.h,v 1.2 2000/06/07 14:10:36 jlarmour Exp $ + * $Id: ip_state.h,v 1.3 2000/06/16 16:44:26 jlarmour Exp $ */ #ifndef _NETINET_IP_STATE_H__ diff --git a/packages/net/tcpip/current/include/netinet/ip_var.h b/packages/net/tcpip/current/include/netinet/ip_var.h --- a/packages/net/tcpip/current/include/netinet/ip_var.h +++ b/packages/net/tcpip/current/include/netinet/ip_var.h @@ -219,7 +219,8 @@ struct ipstat { struct ipstat ipstat; LIST_HEAD(ipqhead, ipq) ipq; /* ip reass. queue */ -int ip_defttl; /* default IP ttl */ +extern int ip_defttl; /* default IP ttl */ +extern int ipforwarding; /* IPforwarding state */ int ip_ctloutput __P((int, struct socket *, int, int, struct mbuf **)); int ip_dooptions __P((struct mbuf *));