]> git.sur5r.net Git - freertos/commitdiff
RISC-V-RV32_SiFive_HiFive1_GCC project is now also building the FreeRTOS kernel code...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 10 Oct 2019 17:54:56 +0000 (17:54 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 10 Oct 2019 17:54:56 +0000 (17:54 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2734 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/.cproject
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/.project
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/FreeRTOSConfig.h [new file with mode: 0644]
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/main.c [new file with mode: 0644]
FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/src/sifive-welcome.c

index 1c18fb8ef543aa1299796be642528396d17ed834..2d226af017c1072356f0c6b293c2d73992fe3540 100644 (file)
                                        <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.206163480." name="/" resourcePath="">\r
                                                <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1023181676" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">\r
                                                        <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1119183919" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>\r
                                        <folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.206163480." name="/" resourcePath="">\r
                                                <toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.1023181676" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">\r
                                                        <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1119183919" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>\r
-                                                       <builder buildPath="${workspace_loc:/RTOSDemo}/Debug" id="cdt.managedbuild.builder.gnu.cross.1388532167" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>\r
+                                                       <builder buildPath="${workspace_loc:/RTOSDemo}/Debug" id="cdt.managedbuild.builder.gnu.cross.1388532167" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="cdt.managedbuild.builder.gnu.cross"/>\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.c.compiler.1469975065" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">\r
                                                                <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.440219377" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.debugging.level.1721555429" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.dialect.std.1648189865" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.include.paths.1720192082" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.c.compiler.1469975065" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">\r
                                                                <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.440219377" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.debugging.level.1721555429" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.dialect.std.1648189865" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>\r
                                                                <option id="gnu.c.compiler.option.include.paths.1720192082" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V}&quot;"/>\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/include}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freedom-metal}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/bsp/install/include}&quot;"/>\r
                                                                </option>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/freedom-metal}&quot;"/>\r
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/bsp/install/include}&quot;"/>\r
                                                                </option>\r
                                                        <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.2105463183" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"/>\r
                                                        <tool id="cdt.managedbuild.tool.gnu.cross.archiver.424513814" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.assembler.825438707" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">\r
                                                        <tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.2105463183" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"/>\r
                                                        <tool id="cdt.managedbuild.tool.gnu.cross.archiver.424513814" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>\r
                                                        <tool command="riscv64-unknown-elf-gcc.exe" id="cdt.managedbuild.tool.gnu.cross.assembler.825438707" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">\r
-                                                               <option id="gnu.both.asm.option.flags.1946908814" name="Assembler flags" superClass="gnu.both.asm.option.flags" useByScannerDiscovery="false" value="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -c" valueType="string"/>\r
+                                                               <option id="gnu.both.asm.option.flags.1946908814" name="Assembler flags" superClass="gnu.both.asm.option.flags" useByScannerDiscovery="false" value="-march=rv32imac -mabi=ilp32 -mcmodel=medlow -c -DportasmHANDLE_INTERRUPT=handle_trap" valueType="string"/>\r
+                                                               <option id="gnu.both.asm.option.include.paths.1448234506" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath">\r
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/FreeRTOS_Source/portable/GCC/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions}&quot;"/>\r
+                                                               </option>\r
                                                                <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1723023894" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
                                                        </tool>\r
                                                </toolChain>\r
                                                                <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1723023894" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
                                                        </tool>\r
                                                </toolChain>\r
@@ -71,5 +78,9 @@
        </storageModule>\r
        <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
        <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
        </storageModule>\r
        <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
        <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
-       <storageModule moduleId="refreshScope"/>\r
+       <storageModule moduleId="refreshScope" versionNumber="2">\r
+               <configuration configurationName="Debug">\r
+                       <resource resourceType="PROJECT" workspacePath="/RTOSDemo"/>\r
+               </configuration>\r
+       </storageModule>\r
 </cproject>\r
 </cproject>\r
index 1ee79134ee2831ad20293744ff368d644478864f..a9213bc29500c31b8afa32d333c985bd7fe9e79b 100644 (file)
                <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
                <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
        </natures>\r
                <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>\r
                <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>\r
        </natures>\r
+       <linkedResources>\r
+               <link>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>2</type>\r
+                       <locationURI>FREERTOS_ROOT/FreeRTOS/Source</locationURI>\r
+               </link>\r
+       </linkedResources>\r
+       <filteredResources>\r
+               <filter>\r
+                       <id>1570727806810</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-event_groups.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727806825</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-list.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727806841</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-queue.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727806841</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-stream_buffer.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727806841</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-timers.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727806856</id>\r
+                       <name>FreeRTOS_Source</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-tasks.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892841</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-event_groups.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892856</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-FreeRTOS.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892856</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-message_buffer.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892856</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-queue.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892872</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-semphr.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892872</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-stream_buffer.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892888</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-task.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727892888</id>\r
+                       <name>FreeRTOS_Source/include</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-timers.h</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727962643</id>\r
+                       <name>FreeRTOS_Source/portable</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-MemMang</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727962643</id>\r
+                       <name>FreeRTOS_Source/portable</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-GCC</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727992991</id>\r
+                       <name>FreeRTOS_Source/portable/GCC</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-RISC-V</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570727979500</id>\r
+                       <name>FreeRTOS_Source/portable/MemMang</name>\r
+                       <type>5</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-heap_4.c</arguments>\r
+                       </matcher>\r
+               </filter>\r
+               <filter>\r
+                       <id>1570728021983</id>\r
+                       <name>FreeRTOS_Source/portable/GCC/RISC-V/chip_specific_extensions</name>\r
+                       <type>9</type>\r
+                       <matcher>\r
+                               <id>org.eclipse.ui.ide.multiFilter</id>\r
+                               <arguments>1.0-name-matches-false-false-RV32I_CLINT_no_extensions</arguments>\r
+                       </matcher>\r
+               </filter>\r
+       </filteredResources>\r
+       <variableList>\r
+               <variable>\r
+                       <name>FREERTOS_ROOT</name>\r
+                       <value>$%7BPARENT-3-PROJECT_LOC%7D</value>\r
+               </variable>\r
+       </variableList>\r
 </projectDescription>\r
 </projectDescription>\r
diff --git a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/FreeRTOSConfig.h b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/FreeRTOSConfig.h
new file mode 100644 (file)
index 0000000..2f7b0e0
--- /dev/null
@@ -0,0 +1,163 @@
+/*\r
+    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
+\r
+    ***************************************************************************\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+    ***************************************************************************\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
+\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
+\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+\r
+#ifndef FREERTOS_CONFIG_H\r
+#define FREERTOS_CONFIG_H\r
+\r
+/*\r
+ * For some reason the standard demo timer demo/test tasks fail when executing\r
+ * in QEMU, although they pass on other RISC-V platforms.  This requires\r
+ * further investigation, but for now, defining _WINDOWS_ has the effect of\r
+ * using the wider timer test thresholds that are normally only used when the\r
+ * tests are used with the FreeRTOS Windows port (which is not deterministic\r
+ * and therefore requires wider margins).\r
+ */\r
+#define _WINDOWS_\r
+\r
+/*-----------------------------------------------------------\r
+ * Application specific definitions.\r
+ *\r
+ * These definitions should be adjusted for your particular hardware and\r
+ * application requirements.\r
+ *\r
+ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
+ *\r
+ * See http://www.freertos.org/a00110.html.\r
+ *----------------------------------------------------------*/\r
+#define CLINT_CTRL_ADDR                                ( 0x02000000UL )\r
+#define configCLINT_BASE_ADDRESS               CLINT_CTRL_ADDR\r
+#define configUSE_PREEMPTION                   1\r
+#define configUSE_IDLE_HOOK                            0\r
+#define configUSE_TICK_HOOK                            1\r
+#define configCPU_CLOCK_HZ                             ( 10000000 ) /*QEMU*/\r
+#define configTICK_RATE_HZ                             ( ( TickType_t ) 1000 )\r
+#define configMAX_PRIORITIES                   ( 7 )\r
+#define configMINIMAL_STACK_SIZE               ( ( unsigned short ) 70 )\r
+#define configTOTAL_HEAP_SIZE                  ( ( size_t ) 14100 )\r
+#define configMAX_TASK_NAME_LEN                        ( 16 )\r
+#define configUSE_TRACE_FACILITY               0\r
+#define configUSE_16_BIT_TICKS                 0\r
+#define configIDLE_SHOULD_YIELD                        0\r
+#define configUSE_MUTEXES                              1\r
+#define configQUEUE_REGISTRY_SIZE              8\r
+#define configCHECK_FOR_STACK_OVERFLOW 2\r
+#define configUSE_RECURSIVE_MUTEXES            1\r
+#define configUSE_MALLOC_FAILED_HOOK   1\r
+#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_COUNTING_SEMAPHORES  1\r
+#define configGENERATE_RUN_TIME_STATS  0\r
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
+\r
+/* Co-routine definitions. */\r
+#define configUSE_CO_ROUTINES                  0\r
+#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
+\r
+/* Software timer definitions. */\r
+#define configUSE_TIMERS                               1\r
+#define configTIMER_TASK_PRIORITY              ( configMAX_PRIORITIES - 1 )\r
+#define configTIMER_QUEUE_LENGTH               4\r
+#define configTIMER_TASK_STACK_DEPTH   ( 100 )\r
+\r
+/* Task priorities.  Allow these to be overridden. */\r
+#ifndef uartPRIMARY_PRIORITY\r
+       #define uartPRIMARY_PRIORITY            ( configMAX_PRIORITIES - 3 )\r
+#endif\r
+\r
+/* Set the following definitions to 1 to include the API function, or zero\r
+to exclude the API function. */\r
+#define INCLUDE_vTaskPrioritySet               1\r
+#define INCLUDE_uxTaskPriorityGet              1\r
+#define INCLUDE_vTaskDelete                            1\r
+#define INCLUDE_vTaskCleanUpResources  1\r
+#define INCLUDE_vTaskSuspend                   1\r
+#define INCLUDE_vTaskDelayUntil                        1\r
+#define INCLUDE_vTaskDelay                             1\r
+#define INCLUDE_eTaskGetState                  1\r
+#define INCLUDE_xTimerPendFunctionCall 1\r
+\r
+/* Normal assert() semantics without relying on the provision of an assert.h\r
+header file. */\r
+void vAssertCalled( void );\r
+#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
+\r
+/* Overwrite some of the stack sizes allocated to various test and demo tasks.\r
+Like all task stack sizes, the value is the number of words, not bytes. */\r
+#define bktBLOCK_TIME_TASK_STACK_SIZE 100\r
+#define notifyNOTIFIED_TASK_STACK_SIZE 120\r
+#define priSUSPENDED_RX_TASK_STACK_SIZE 90\r
+#define tmrTIMER_TEST_TASK_STACK_SIZE 100\r
+#define ebRENDESVOUS_TEST_TASK_STACK_SIZE 100\r
+#define ebEVENT_GROUP_SET_BITS_TEST_TASK_STACK_SIZE 115\r
+#define genqMUTEX_TEST_TASK_STACK_SIZE 90\r
+#define genqGENERIC_QUEUE_TEST_TASK_STACK_SIZE 100\r
+#define recmuRECURSIVE_MUTEX_TEST_TASK_STACK_SIZE 90\r
+\r
+#endif /* FREERTOS_CONFIG_H */\r
diff --git a/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/main.c b/FreeRTOS/Demo/RISC-V_RV32_SiFive_HiFive1_GCC/main.c
new file mode 100644 (file)
index 0000000..41d4100
--- /dev/null
@@ -0,0 +1,163 @@
+/*\r
+ * FreeRTOS Kernel V10.2.1\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://aws.amazon.com/freertos\r
+ *\r
+ * 1 tab == 4 spaces!\r
+ */\r
+\r
+/* FreeRTOS kernel includes. */\r
+#include <FreeRTOS.h>\r
+#include <task.h>\r
+\r
+/******************************************************************************\r
+ * This project provides two demo applications.  A simple blinky style project,\r
+ * and a more comprehensive test and demo application.  The\r
+ * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting (defined in this file) is used to\r
+ * select between the two.  The simply blinky demo is implemented and described\r
+ * in main_blinky.c.  The more comprehensive test and demo application is\r
+ * implemented and described in main_full.c.\r
+ *\r
+ * This file implements the code that is not demo specific, including the\r
+ * hardware setup and standard FreeRTOS hook functions.\r
+ *\r
+ * ENSURE TO READ THE DOCUMENTATION PAGE FOR THIS PORT AND DEMO APPLICATION ON\r
+ * THE http://www.FreeRTOS.org WEB SITE FOR FULL INFORMATION ON USING THIS DEMO\r
+ * APPLICATION, AND ITS ASSOCIATE FreeRTOS ARCHITECTURE PORT!\r
+ *\r
+ *\r
+ */\r
+\r
+#warning Also test in QEMU and add instructions above.\r
+\r
+\r
+/* Set mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to one to run the simple blinky demo,\r
+or 0 to run the more comprehensive test and demo application. */\r
+#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY     1\r
+\r
+/*\r
+ * main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
+ * main_full() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 0.\r
+ */\r
+#if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1\r
+       extern void main_blinky( void );\r
+#else\r
+       extern void main_full( void );\r
+#endif /* #if mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 */\r
+\r
+/* Prototypes for the standard FreeRTOS callback/hook functions implemented\r
+within this file.  See https://www.freertos.org/a00016.html */\r
+void vApplicationMallocFailedHook( void );\r
+void vApplicationIdleHook( void );\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
+void vApplicationTickHook( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void main_blinky( void )\r
+{\r
+#warning Not implemented yet.\r
+       for( ;; );\r
+}\r
+\r
+int main( void )\r
+{\r
+       /* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top\r
+       of this file. */\r
+       #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )\r
+       {\r
+               main_blinky();\r
+       }\r
+       #else\r
+       {\r
+               main_full();\r
+       }\r
+       #endif\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationMallocFailedHook( void )\r
+{\r
+       /* vApplicationMallocFailedHook() will only be called if\r
+       configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h.  It is a hook\r
+       function that will get called if a call to pvPortMalloc() fails.\r
+       pvPortMalloc() is called internally by the kernel whenever a task, queue,\r
+       timer or semaphore is created.  It is also called by various parts of the\r
+       demo application.  If heap_1.c or heap_2.c are used, then the size of the\r
+       heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in\r
+       FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used\r
+       to query the size of free heap space that remains (although it does not\r
+       provide information on how the remaining heap might be fragmented). */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+       /* vApplicationIdleHook() will only be called if configUSE_IDLE_HOOK is set\r
+       to 1 in FreeRTOSConfig.h.  It will be called on each iteration of the idle\r
+       task.  It is essential that code added to this hook function never attempts\r
+       to block in any way (for example, call xQueueReceive() with a block time\r
+       specified, or call vTaskDelay()).  If the application makes use of the\r
+       vTaskDelete() API function (as this demo application does) then it is also\r
+       important that vApplicationIdleHook() is permitted to return to its calling\r
+       function, because it is the responsibility of the idle task to clean up\r
+       memory allocated by the kernel to any task that has since been deleted. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )\r
+{\r
+       ( void ) pcTaskName;\r
+       ( void ) pxTask;\r
+\r
+       /* Run time stack overflow checking is performed if\r
+       configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2.  This hook\r
+       function is called if a stack overflow is detected. */\r
+       taskDISABLE_INTERRUPTS();\r
+       for( ;; );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationTickHook( void )\r
+{\r
+       /* The tests in the full demo expect some interaction with interrupts. */\r
+       #if( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY != 1 )\r
+       {\r
+               extern void vFullDemoTickHook( void );\r
+               vFullDemoTickHook();\r
+       }\r
+       #endif\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vAssertCalled( void )\r
+{\r
+volatile uint32_t ulSetTo1ToExitFunction = 0;\r
+\r
+       taskDISABLE_INTERRUPTS();\r
+       while( ulSetTo1ToExitFunction != 1 )\r
+       {\r
+               __asm volatile( "NOP" );\r
+       }\r
+}\r
index e23ece348d0ce3a9af78ed998341b257c33c25b6..c0e71172d4b7528ecb0357245fffbd6848a57e4e 100644 (file)
@@ -80,7 +80,7 @@ void wait_for_timer(struct metal_led *which_led) {
     metal_led_off(which_led);
 }
 
     metal_led_off(which_led);
 }
 
-int main (void)
+int original_main (void)
 {
     int rc, up_cnt, dn_cnt;
     struct metal_led *led0_red, *led0_green, *led0_blue;
 {
     int rc, up_cnt, dn_cnt;
     struct metal_led *led0_red, *led0_green, *led0_blue;