diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-06-04 10:01:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-06-04 10:01:16 +0200 |
commit | 2e4ead3c9d0bd27299efa8ed84c2182a40cc6b53 (patch) | |
tree | 46aa72c783831a266c62db3ec24801877410ed1d | |
parent | Merge branch 'upstream' (diff) | |
parent | libtests/block05: Fix warnings (diff) | |
download | rtems-2e4ead3c9d0bd27299efa8ed84c2182a40cc6b53.tar.bz2 |
Merge branch 'upstream'
144 files changed, 1397 insertions, 931 deletions
diff --git a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c index bf4d276fb9..07ab130304 100644 --- a/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c +++ b/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/io_fcsr.c @@ -121,7 +121,7 @@ bool _FCSR_readSectors (u32 sector, u32 numSectors, void* buffer) int i; bool flagSramSector = false; int readLength = numSectors * BYTES_PER_READ; - u8* src;; + u8* src; u8* dst; // Find which region this read is in diff --git a/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c b/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c index d47d5d04f5..7cde3811e7 100644 --- a/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c +++ b/c/src/lib/libbsp/arm/nds/libnds/source/common/card.c @@ -44,7 +44,7 @@ void cardWriteCommand(const uint8 * command) { //--------------------------------------------------------------------------------- void cardPolledTransfer(uint32 flags, uint32 * destination, uint32 length, const uint8 * command) { //--------------------------------------------------------------------------------- - u32 data;; + u32 data; cardWriteCommand(command); CARD_CR2 = flags; uint32 * target = destination + length; @@ -68,7 +68,7 @@ void cardStartTransfer(const uint8 * command, uint32 * destination, int channel, // Set up a DMA channel to transfer a word every time the card makes one DMA_SRC(channel) = (uint32)&CARD_DATA_RD; DMA_DEST(channel) = (uint32)destination; - DMA_CR(channel) = DMA_ENABLE | DMA_START_CARD | DMA_32_BIT | DMA_REPEAT | DMA_SRC_FIX | 0x0001;; + DMA_CR(channel) = DMA_ENABLE | DMA_START_CARD | DMA_32_BIT | DMA_REPEAT | DMA_SRC_FIX | 0x0001; CARD_CR2 = flags; } diff --git a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c index fccff711a0..4e17fea580 100644 --- a/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c +++ b/c/src/lib/libbsp/bfin/TLL6527M/startup/bspstart.c @@ -140,7 +140,7 @@ void Init_PLL (void) *((uint32_t*)SIC_IWR) = 0x1; /* Configure PLL registers */ - *((uint16_t*)PLL_DIV) = ssel;; + *((uint16_t*)PLL_DIV) = ssel; msel = msel<<9; *((uint16_t*)PLL_CTL) = msel; diff --git a/c/src/lib/libbsp/m68k/av5282/network/network.c b/c/src/lib/libbsp/m68k/av5282/network/network.c index 02a0522a55..8045ef4e78 100644 --- a/c/src/lib/libbsp/m68k/av5282/network/network.c +++ b/c/src/lib/libbsp/m68k/av5282/network/network.c @@ -442,7 +442,7 @@ fec_rxDaemon (void *arg) * FIXME: Packet filtering hook could be done here. */ struct ether_header *eh; - int len = rxBd->length - sizeof(uint32_t);; + int len = rxBd->length - sizeof(uint32_t); /* * Invalidate the cache and push the packet up. diff --git a/c/src/lib/libbsp/m68k/mcf5235/network/network.c b/c/src/lib/libbsp/m68k/mcf5235/network/network.c index 110da2084d..ed98b4defa 100644 --- a/c/src/lib/libbsp/m68k/mcf5235/network/network.c +++ b/c/src/lib/libbsp/m68k/mcf5235/network/network.c @@ -423,7 +423,7 @@ fec_rxDaemon (void *arg) * FIXME: Packet filtering hook could be done here. */ struct ether_header *eh; - int len = rxBd->length - sizeof(uint32_t);; + int len = rxBd->length - sizeof(uint32_t); /* * Invalidate the cache and push the packet up. diff --git a/c/src/lib/libbsp/m68k/mcf5329/network/network.c b/c/src/lib/libbsp/m68k/mcf5329/network/network.c index 79e7fa98d5..acc36abbdd 100644 --- a/c/src/lib/libbsp/m68k/mcf5329/network/network.c +++ b/c/src/lib/libbsp/m68k/mcf5329/network/network.c @@ -415,7 +415,7 @@ static void fec_rxDaemon(void *arg) * FIXME: Packet filtering hook could be done here. */ struct ether_header *eh; - int len = rxBd->length - sizeof(uint32_t);; + int len = rxBd->length - sizeof(uint32_t); m = sc->rxMbuf[rxBdIndex]; diff --git a/c/src/lib/libbsp/m68k/uC5282/network/network.c b/c/src/lib/libbsp/m68k/uC5282/network/network.c index c890c90770..475ab22de7 100644 --- a/c/src/lib/libbsp/m68k/uC5282/network/network.c +++ b/c/src/lib/libbsp/m68k/uC5282/network/network.c @@ -479,7 +479,7 @@ fec_rxDaemon (void *arg) * FIXME: Packet filtering hook could be done here. */ struct ether_header *eh; - int len = rxBd->length - sizeof(uint32_t);; + int len = rxBd->length - sizeof(uint32_t); m = sc->rxMbuf[rxBdIndex]; #ifdef RTEMS_MCF5282_BSP_ENABLE_DATA_CACHE diff --git a/c/src/lib/libbsp/powerpc/beatnik/flash/flashcfg.c b/c/src/lib/libbsp/powerpc/beatnik/flash/flashcfg.c index 3dc76c504d..b5ba08f334 100644 --- a/c/src/lib/libbsp/powerpc/beatnik/flash/flashcfg.c +++ b/c/src/lib/libbsp/powerpc/beatnik/flash/flashcfg.c @@ -143,7 +143,7 @@ unsigned char hwp = 0, swp; if ( enbl ) { *p |= swp; } else { - *p &= ~swp;; + *p &= ~swp; } } return 0; diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.gwlcfm b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.gwlcfm index 42e6bb2aca..3f1bd3d9e4 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.gwlcfm +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.gwlcfm @@ -22,5 +22,6 @@ REGION_ALIAS ("REGION_RWEXTRA", RAM_EXT); REGION_ALIAS ("REGION_WORK", RAM_EXT); REGION_ALIAS ("REGION_STACK", RAM); REGION_ALIAS ("REGION_NOCACHE", NOCACHE); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NOCACHE); INCLUDE linkcmds.mpc55xx diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5566evb b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5566evb index c8bbb59d58..1989473d3d 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5566evb +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5566evb @@ -22,5 +22,6 @@ REGION_ALIAS ("REGION_RWEXTRA", RAM_EXT); REGION_ALIAS ("REGION_WORK", RAM_EXT); REGION_ALIAS ("REGION_STACK", RAM); REGION_ALIAS ("REGION_NOCACHE", NOCACHE); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NOCACHE); INCLUDE linkcmds.mpc55xx diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5674fevb b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5674fevb index 49362b8979..cb7c1ed7b0 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5674fevb +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.mpc5674fevb @@ -22,5 +22,6 @@ REGION_ALIAS ("REGION_RWEXTRA", RAM_EXT); REGION_ALIAS ("REGION_WORK", RAM_EXT); REGION_ALIAS ("REGION_STACK", RAM); REGION_ALIAS ("REGION_NOCACHE", NOCACHE); +REGION_ALIAS ("REGION_NOCACHE_LOAD", ROM); INCLUDE linkcmds.mpc55xx diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.phycore_mpc5554 b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.phycore_mpc5554 index 450193b9bf..18a0e8f44d 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.phycore_mpc5554 +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.phycore_mpc5554 @@ -31,5 +31,6 @@ REGION_ALIAS ("REGION_RWEXTRA", RAM_EXT); REGION_ALIAS ("REGION_WORK", RAM_EXT); REGION_ALIAS ("REGION_STACK", RAM); REGION_ALIAS ("REGION_NOCACHE", NOCACHE); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NOCACHE); INCLUDE linkcmds.mpc55xx diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb index 72d3762da3..98cc0bc78a 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/linkcmds.xkt564levb @@ -27,5 +27,6 @@ REGION_ALIAS ("REGION_RWEXTRA", RAM_0); REGION_ALIAS ("REGION_WORK", RAM_1); REGION_ALIAS ("REGION_STACK", RAM_1); REGION_ALIAS ("REGION_NOCACHE", NOCACHE); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NOCACHE); INCLUDE linkcmds.mpc55xx diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-early.c b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-early.c index 62cf8f58d7..daffc22ac1 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-early.c +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start-early.c @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. + * Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 @@ -23,6 +23,14 @@ #include <bsp.h> #include <bsp/start.h> #include <bsp/mpc55xx-config.h> +#include <bsp/linker-symbols.h> + +/* This function is defined in start.S */ +BSP_START_TEXT_SECTION void mpc55xx_start_load_section( + void *dst, + const void *src, + size_t n +); static BSP_START_TEXT_SECTION void mpc55xx_start_mmu(void) { @@ -53,6 +61,19 @@ static BSP_START_TEXT_SECTION void mpc55xx_start_internal_ram(void) #endif } +static BSP_START_TEXT_SECTION void mpc55xx_start_load_nocache_section(void) +{ + mpc55xx_start_load_section( + bsp_section_nocache_begin, + bsp_section_nocache_load_begin, + (size_t) bsp_section_nocache_size + ); + rtems_cache_flush_multiple_data_lines( + bsp_section_nocache_begin, + (size_t) bsp_section_nocache_size + ); +} + static BSP_START_TEXT_SECTION void mpc55xx_start_mode_change(void) { #ifdef MPC55XX_HAS_MODE_CONTROL @@ -167,6 +188,7 @@ BSP_START_TEXT_SECTION void mpc55xx_start_early(void) mpc55xx_start_cache(); #endif mpc55xx_start_internal_ram(); + mpc55xx_start_load_nocache_section(); mpc55xx_start_mmu(); mpc55xx_start_mode_change(); mpc55xx_start_siu(); diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S index f05e2c7f1c..0b54b75734 100644 --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/startup/start.S @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2008-2011 embedded brains GmbH. All rights reserved. + * Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 @@ -21,7 +21,7 @@ */ #include <bspopts.h> - +#include <bsp/linker-symbols.h> #include <libcpu/powerpc-utility.h> #if MPC55XX_CHIP_TYPE / 10 != 551 @@ -41,20 +41,12 @@ .extern __eabi .extern boot_card .extern bsp_ram_start - .extern bsp_section_data_begin - .extern bsp_section_data_load_begin - .extern bsp_section_data_size - .extern bsp_section_fast_data_begin - .extern bsp_section_fast_data_load_begin - .extern bsp_section_fast_data_size - .extern bsp_section_fast_text_begin - .extern bsp_section_fast_text_load_begin - .extern bsp_section_fast_text_size .extern mpc55xx_start_config_mmu_early .extern mpc55xx_start_config_mmu_early_count .extern mpc55xx_start_early .globl _start + .globl mpc55xx_start_load_section .globl mpc55xx_start_mmu_apply_config #ifdef MPC55XX_BOOTFLAGS @@ -225,15 +217,15 @@ zero_intermediate_stack_loop: LA r3, bsp_section_fast_text_begin LA r4, bsp_section_fast_text_load_begin LA r5, bsp_section_fast_text_size - bl load_section + bl mpc55xx_start_load_section LA r3, bsp_section_fast_data_begin LA r4, bsp_section_fast_data_load_begin LA r5, bsp_section_fast_data_size - bl load_section + bl mpc55xx_start_load_section LA r3, bsp_section_data_begin LA r4, bsp_section_data_load_begin LA r5, bsp_section_data_size - bl load_section + bl mpc55xx_start_load_section /* Set up EABI and SYSV environment */ bl __eabi @@ -270,7 +262,7 @@ mmu_init_loop: bdnz mmu_init_loop blr -load_section: +mpc55xx_start_load_section: cmpw cr7, r3, r4 beqlr cr7 b memcpy diff --git a/c/src/lib/libbsp/powerpc/qoriq/configure.ac b/c/src/lib/libbsp/powerpc/qoriq/configure.ac index 7b82c1dd53..75ad02735d 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/configure.ac +++ b/c/src/lib/libbsp/powerpc/qoriq/configure.ac @@ -17,6 +17,9 @@ RTEMS_BSPOPTS_HELP_DATA_CACHE_ENABLED RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1]) RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED +RTEMS_BSPOPTS_SET([BSP_USE_DATA_CACHE_BLOCK_TOUCH],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_USE_DATA_CACHE_BLOCK_TOUCH],[if defined use dcbt instruction]) + RTEMS_BSPOPTS_SET([BSP_CONSOLE_BAUD],[*],[115200]) RTEMS_BSPOPTS_HELP([BSP_CONSOLE_BAUD],[default baud for console and other serial devices]) diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/bspopts.h.in b/c/src/lib/libbsp/powerpc/qoriq/include/bspopts.h.in index 917596f028..2a9909d414 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/include/bspopts.h.in +++ b/c/src/lib/libbsp/powerpc/qoriq/include/bspopts.h.in @@ -27,6 +27,9 @@ /* If defined, reset the board when the application exits. */ #undef BSP_RESET_BOARD_AT_EXIT +/* if defined use dcbt instruction */ +#undef BSP_USE_DATA_CACHE_BLOCK_TOUCH + /* enable usage of interrupts for the UART modules */ #undef BSP_USE_UART_INTERRUPTS diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_0 b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_0 index 7940cd46f0..d30d1c8f92 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_0 +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_0 @@ -25,7 +25,8 @@ REGION_ALIAS ("REGION_BSS", HIGH); REGION_ALIAS ("REGION_RWEXTRA", HIGH); REGION_ALIAS ("REGION_WORK", HIGH); REGION_ALIAS ("REGION_STACK", HIGH); -REGION_ALIAS ("REGION_NOCACHE", HIGH); +REGION_ALIAS ("REGION_NOCACHE", NIRVANA); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NIRVANA); bsp_section_robarrier_align = 0x1000000; bsp_section_rwbarrier_align = 0x1000000; diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_1 b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_1 index b9001a7054..1bc021d2a5 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_1 +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_core_1 @@ -24,7 +24,8 @@ REGION_ALIAS ("REGION_BSS", RAM); REGION_ALIAS ("REGION_RWEXTRA", RAM); REGION_ALIAS ("REGION_WORK", RAM); REGION_ALIAS ("REGION_STACK", RAM); -REGION_ALIAS ("REGION_NOCACHE", RAM); +REGION_ALIAS ("REGION_NOCACHE", NIRVANA); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NIRVANA); bsp_section_robarrier_align = 0x1000000; bsp_section_rwbarrier_align = 0x1000000; diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb index 6e73fec23b..3543414a79 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/linkcmds.qoriq_p1020rdb @@ -25,7 +25,8 @@ REGION_ALIAS ("REGION_BSS", HIGH); REGION_ALIAS ("REGION_RWEXTRA", HIGH); REGION_ALIAS ("REGION_WORK", HIGH); REGION_ALIAS ("REGION_STACK", HIGH); -REGION_ALIAS ("REGION_NOCACHE", HIGH); +REGION_ALIAS ("REGION_NOCACHE", NIRVANA); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NIRVANA); bsp_section_robarrier_align = 0x1000000; bsp_section_rwbarrier_align = 0x1000000; diff --git a/c/src/lib/libbsp/powerpc/shared/flash/spansionFlash.c b/c/src/lib/libbsp/powerpc/shared/flash/spansionFlash.c index 06f6f8548e..70af0a87ac 100644 --- a/c/src/lib/libbsp/powerpc/shared/flash/spansionFlash.c +++ b/c/src/lib/libbsp/powerpc/shared/flash/spansionFlash.c @@ -179,7 +179,7 @@ volatile union bconv *p; uint32_t rval; if ( 1 == b->width ) - off <<= 1;; + off <<= 1; a = ADDR32(b, a, off); diff --git a/c/src/lib/libbsp/powerpc/shared/include/linker-symbols.h b/c/src/lib/libbsp/powerpc/shared/include/linker-symbols.h index 87c9532728..80f54bd4b9 100644 --- a/c/src/lib/libbsp/powerpc/shared/include/linker-symbols.h +++ b/c/src/lib/libbsp/powerpc/shared/include/linker-symbols.h @@ -96,6 +96,8 @@ LINKER_SYMBOL(bsp_section_stack_size) LINKER_SYMBOL(bsp_section_nocache_begin) LINKER_SYMBOL(bsp_section_nocache_end) LINKER_SYMBOL(bsp_section_nocache_size) +LINKER_SYMBOL(bsp_section_nocache_load_begin) +LINKER_SYMBOL(bsp_section_nocache_load_end) #define BSP_FAST_TEXT_SECTION __attribute__((section(".bsp_fast_text"))) diff --git a/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c b/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c index 2a91ef1fd8..ca7feae0bd 100644 --- a/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c +++ b/c/src/lib/libbsp/powerpc/shared/irq/irq_init.c @@ -233,7 +233,7 @@ loop_exit: tmp = ELCRS_INT9_LVL | ELCRS_INT10_LVL | ELCRS_INT11_LVL; outb(tmp, ISA8259_S_ELCR); tmp = ELCRM_INT5_LVL; - outb(tmp, ISA8259_M_ELCR);; + outb(tmp, ISA8259_M_ELCR); /* * Set the Interrupt inputs to non-inverting level interrupt */ diff --git a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base index 24cee144f4..95453a9457 100644 --- a/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base +++ b/c/src/lib/libbsp/powerpc/shared/startup/linkcmds.base @@ -328,8 +328,10 @@ SECTIONS { bsp_section_nocache_begin = .; *(.bsp_nocache) bsp_section_nocache_end = .; - } > REGION_NOCACHE AT > REGION_NOCACHE + } > REGION_NOCACHE AT > REGION_NOCACHE_LOAD bsp_section_nocache_size = bsp_section_nocache_end - bsp_section_nocache_begin; + bsp_section_nocache_load_begin = LOADADDR (.nocache); + bsp_section_nocache_load_end = bsp_section_nocache_load_begin + bsp_section_nocache_size; /* FIXME */ RamBase = ORIGIN (REGION_WORK); diff --git a/c/src/lib/libbsp/powerpc/t32mppc/startup/linkcmds.t32mppc b/c/src/lib/libbsp/powerpc/t32mppc/startup/linkcmds.t32mppc index 88e3b4390a..b4f6e98997 100644 --- a/c/src/lib/libbsp/powerpc/t32mppc/startup/linkcmds.t32mppc +++ b/c/src/lib/libbsp/powerpc/t32mppc/startup/linkcmds.t32mppc @@ -18,6 +18,7 @@ REGION_ALIAS ("REGION_BSS", RAM); REGION_ALIAS ("REGION_RWEXTRA", RAM); REGION_ALIAS ("REGION_WORK", RAM); REGION_ALIAS ("REGION_STACK", RAM); -REGION_ALIAS ("REGION_NOCACHE", RAM); +REGION_ALIAS ("REGION_NOCACHE", NIRVANA); +REGION_ALIAS ("REGION_NOCACHE_LOAD", NIRVANA); INCLUDE linkcmds.base diff --git a/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c b/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c index 309ec00f7b..a80f534663 100644 --- a/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c +++ b/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c @@ -1458,7 +1458,7 @@ vmeUniverseDmaStartXX(volatile LERegister *base, int channel, uint32_t pci_addr, { /* help the compiler allocate registers */ - register volatile LERegister *b=base;; + register volatile LERegister *b=base; register unsigned long dgcsoff=UNIV_REGOFF_DGCS,dgcs; dgcs=READ_LE(b, dgcsoff); diff --git a/c/src/lib/libcpu/bfin/serial/uart.c b/c/src/lib/libcpu/bfin/serial/uart.c index 3747425741..36ea3497bd 100644 --- a/c/src/lib/libcpu/bfin/serial/uart.c +++ b/c/src/lib/libcpu/bfin/serial/uart.c @@ -531,7 +531,7 @@ void uart_exit(void) */ rtems_device_driver bfin_uart_open(rtems_device_major_number major, rtems_device_minor_number minor, void *arg) { - rtems_status_code sc = RTEMS_NOT_DEFINED;; + rtems_status_code sc = RTEMS_NOT_DEFINED; rtems_libio_open_close_args_t *args = NULL; /** diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup.c b/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup.c index 0eba0b7c9e..07b9fd2d50 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup.c @@ -233,7 +233,7 @@ unsigned pvr; * for use by assembly code. * Therefore, we compute it here and store it in memory... */ - _CPU_altivec_ctxt_off = (uint32_t) &((Context_Control*)0)->altivec; + _CPU_altivec_ctxt_off = offsetof(ppc_context, altivec); /* * Add space possibly needed for alignment */ diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup_asm.S b/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup_asm.S index 6b78c0b5eb..1a5c906de3 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup_asm.S +++ b/c/src/lib/libcpu/powerpc/mpc6xx/altivec/vec_sup_asm.S @@ -623,17 +623,6 @@ _CPU_load_altivec_volatile: #endif blr - .global _CPU_Context_restore_altivec -_CPU_Context_restore_altivec: - /* Restore is like 'switch' but we don't have - * to save an old context. - * Move argument to second arg and load NULL pointer - * to first one, then jump to 'switch' routine. - */ - mr r4, r3 - li r3, 0 - b _CPU_Context_switch_altivec - .global _CPU_Context_switch_altivec _CPU_Context_switch_altivec: diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_async_normal.S b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_async_normal.S index 3165d6b625..dd6f694cc8 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_async_normal.S +++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_async_normal.S @@ -78,14 +78,14 @@ ppc_exc_wrap_async_normal: mr FRAME_REGISTER, r1 /* Load ISR nest level and thread dispatch disable level */ - PPC_EXC_GPR_STORE ISR_NEST_HADDR_REGISTER, ISR_NEST_HADDR_OFFSET(r1) + PPC_GPR_STORE ISR_NEST_HADDR_REGISTER, ISR_NEST_HADDR_OFFSET(r1) lis ISR_NEST_HADDR_REGISTER, ISR_NEST_LEVEL@ha - PPC_EXC_GPR_STORE ISR_NEST_REGISTER, ISR_NEST_OFFSET(r1) + PPC_GPR_STORE ISR_NEST_REGISTER, ISR_NEST_OFFSET(r1) lwz ISR_NEST_REGISTER, ISR_NEST_LEVEL@l(ISR_NEST_HADDR_REGISTER) - PPC_EXC_GPR_STORE DISPATCH_LEVEL_REGISTER, DISPATCH_LEVEL_OFFSET(r1) + PPC_GPR_STORE DISPATCH_LEVEL_REGISTER, DISPATCH_LEVEL_OFFSET(r1) lwz DISPATCH_LEVEL_REGISTER, _Thread_Dispatch_disable_level@sdarel(r13) - PPC_EXC_GPR_STORE SCRATCH_0_REGISTER, SCRATCH_0_OFFSET(r1) + PPC_GPR_STORE SCRATCH_0_REGISTER, SCRATCH_0_OFFSET(r1) #ifdef __SPE__ /* @@ -96,7 +96,7 @@ ppc_exc_wrap_async_normal: stw SCRATCH_0_REGISTER, VECTOR_OFFSET(r1) #endif - PPC_EXC_GPR_STORE HANDLER_REGISTER, HANDLER_OFFSET(r1) + PPC_GPR_STORE HANDLER_REGISTER, HANDLER_OFFSET(r1) /* * Load the handler address. Get the handler table index from the @@ -109,11 +109,11 @@ ppc_exc_wrap_async_normal: ori HANDLER_REGISTER, HANDLER_REGISTER, ppc_exc_handler_table@l lwzx HANDLER_REGISTER, HANDLER_REGISTER, SCRATCH_0_REGISTER - PPC_EXC_GPR_STORE SCRATCH_1_REGISTER, SCRATCH_1_OFFSET(r1) - PPC_EXC_GPR_STORE SCRATCH_2_REGISTER, SCRATCH_2_OFFSET(r1) - PPC_EXC_GPR_STORE SCRATCH_3_REGISTER, SCRATCH_3_OFFSET(r1) - PPC_EXC_GPR_STORE SCRATCH_4_REGISTER, SCRATCH_4_OFFSET(r1) - PPC_EXC_GPR_STORE SCRATCH_5_REGISTER, SCRATCH_5_OFFSET(r1) + PPC_GPR_STORE SCRATCH_1_REGISTER, SCRATCH_1_OFFSET(r1) + PPC_GPR_STORE SCRATCH_2_REGISTER, SCRATCH_2_OFFSET(r1) + PPC_GPR_STORE SCRATCH_3_REGISTER, SCRATCH_3_OFFSET(r1) + PPC_GPR_STORE SCRATCH_4_REGISTER, SCRATCH_4_OFFSET(r1) + PPC_GPR_STORE SCRATCH_5_REGISTER, SCRATCH_5_OFFSET(r1) /* Save SRR0, SRR1, CR, CTR, XER, and LR */ mfsrr0 SCRATCH_0_REGISTER @@ -197,35 +197,35 @@ thread_dispatching_done: lwz SCRATCH_4_REGISTER, EXC_XER_OFFSET(r1) lwz SCRATCH_5_REGISTER, EXC_LR_OFFSET(r1) - PPC_EXC_GPR_LOAD VECTOR_REGISTER, VECTOR_OFFSET(r1) - PPC_EXC_GPR_LOAD ISR_NEST_HADDR_REGISTER, ISR_NEST_HADDR_OFFSET(r1) - PPC_EXC_GPR_LOAD ISR_NEST_REGISTER, ISR_NEST_OFFSET(r1) + PPC_GPR_LOAD VECTOR_REGISTER, VECTOR_OFFSET(r1) + PPC_GPR_LOAD ISR_NEST_HADDR_REGISTER, ISR_NEST_HADDR_OFFSET(r1) + PPC_GPR_LOAD ISR_NEST_REGISTER, ISR_NEST_OFFSET(r1) #ifdef __SPE__ /* Restore SPEFSCR */ mtspr FSL_EIS_SPEFSCR, DISPATCH_LEVEL_REGISTER #endif - PPC_EXC_GPR_LOAD DISPATCH_LEVEL_REGISTER, DISPATCH_LEVEL_OFFSET(r1) + PPC_GPR_LOAD DISPATCH_LEVEL_REGISTER, DISPATCH_LEVEL_OFFSET(r1) #ifdef __SPE__ /* Restore ACC */ evmra HANDLER_REGISTER, HANDLER_REGISTER #endif - PPC_EXC_GPR_LOAD HANDLER_REGISTER, HANDLER_OFFSET(r1) + PPC_GPR_LOAD HANDLER_REGISTER, HANDLER_OFFSET(r1) /* Restore SRR0, SRR1, CR, CTR, XER, and LR */ mtsrr0 SCRATCH_0_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_0_REGISTER, SCRATCH_0_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_0_REGISTER, SCRATCH_0_OFFSET(r1) mtsrr1 SCRATCH_1_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_1_REGISTER, SCRATCH_1_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_1_REGISTER, SCRATCH_1_OFFSET(r1) mtcr SCRATCH_2_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_2_REGISTER, SCRATCH_2_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_2_REGISTER, SCRATCH_2_OFFSET(r1) mtctr SCRATCH_3_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_3_REGISTER, SCRATCH_3_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_3_REGISTER, SCRATCH_3_OFFSET(r1) mtxer SCRATCH_4_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_4_REGISTER, SCRATCH_4_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_4_REGISTER, SCRATCH_4_OFFSET(r1) mtlr SCRATCH_5_REGISTER - PPC_EXC_GPR_LOAD SCRATCH_5_REGISTER, SCRATCH_5_OFFSET(r1) + PPC_GPR_LOAD SCRATCH_5_REGISTER, SCRATCH_5_OFFSET(r1) /* Pop stack */ addi r1, r1, PPC_EXC_MINIMAL_FRAME_SIZE diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h index 8eda3a1aaa..1a071c27c3 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h +++ b/c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors.h @@ -142,23 +142,15 @@ extern "C" { /** @} */ #ifndef __SPE__ - #define PPC_EXC_GPR_TYPE unsigned - #define PPC_EXC_GPR_SIZE 4 - #define PPC_EXC_GPR_OFFSET(gpr) ((gpr) * PPC_EXC_GPR_SIZE + 36) + #define PPC_EXC_GPR_OFFSET(gpr) ((gpr) * PPC_GPR_SIZE + 36) #define PPC_EXC_VECTOR_PROLOGUE_OFFSET PPC_EXC_GPR_OFFSET(4) - #define PPC_EXC_GPR_LOAD lwz - #define PPC_EXC_GPR_STORE stw #define PPC_EXC_MINIMAL_FRAME_SIZE 96 #define PPC_EXC_FRAME_SIZE 176 #else - #define PPC_EXC_GPR_TYPE uint64_t - #define PPC_EXC_GPR_SIZE 8 #define PPC_EXC_SPEFSCR_OFFSET 36 #define PPC_EXC_ACC_OFFSET 40 - #define PPC_EXC_GPR_OFFSET(gpr) ((gpr) * PPC_EXC_GPR_SIZE + 48) + #define PPC_EXC_GPR_OFFSET(gpr) ((gpr) * PPC_GPR_SIZE + 48) #define PPC_EXC_VECTOR_PROLOGUE_OFFSET (PPC_EXC_GPR_OFFSET(4) + 4) - #define PPC_EXC_GPR_LOAD evldd - #define PPC_EXC_GPR_STORE evstdd #define PPC_EXC_MINIMAL_FRAME_SIZE 160 #define PPC_EXC_FRAME_SIZE 320 #endif @@ -268,38 +260,38 @@ typedef struct { uint32_t EXC_SPEFSCR; uint64_t EXC_ACC; #endif - PPC_EXC_GPR_TYPE GPR0; - PPC_EXC_GPR_TYPE GPR1; - PPC_EXC_GPR_TYPE GPR2; - PPC_EXC_GPR_TYPE GPR3; - PPC_EXC_GPR_TYPE GPR4; - PPC_EXC_GPR_TYPE GPR5; - PPC_EXC_GPR_TYPE GPR6; - PPC_EXC_GPR_TYPE GPR7; - PPC_EXC_GPR_TYPE GPR8; - PPC_EXC_GPR_TYPE GPR9; - PPC_EXC_GPR_TYPE GPR10; - PPC_EXC_GPR_TYPE GPR11; - PPC_EXC_GPR_TYPE GPR12; - PPC_EXC_GPR_TYPE GPR13; - PPC_EXC_GPR_TYPE GPR14; - PPC_EXC_GPR_TYPE GPR15; - PPC_EXC_GPR_TYPE GPR16; - PPC_EXC_GPR_TYPE GPR17; - PPC_EXC_GPR_TYPE GPR18; - PPC_EXC_GPR_TYPE GPR19; - PPC_EXC_GPR_TYPE GPR20; - PPC_EXC_GPR_TYPE GPR21; - PPC_EXC_GPR_TYPE GPR22; - PPC_EXC_GPR_TYPE GPR23; - PPC_EXC_GPR_TYPE GPR24; - PPC_EXC_GPR_TYPE GPR25; - PPC_EXC_GPR_TYPE GPR26; - PPC_EXC_GPR_TYPE GPR27; - PPC_EXC_GPR_TYPE GPR28; - PPC_EXC_GPR_TYPE GPR29; - PPC_EXC_GPR_TYPE GPR30; - PPC_EXC_GPR_TYPE GPR31; + PPC_GPR_TYPE GPR0; + PPC_GPR_TYPE GPR1; + PPC_GPR_TYPE GPR2; + PPC_GPR_TYPE GPR3; + PPC_GPR_TYPE GPR4; + PPC_GPR_TYPE GPR5; + PPC_GPR_TYPE GPR6; + PPC_GPR_TYPE GPR7; + PPC_GPR_TYPE GPR8; + PPC_GPR_TYPE GPR9; + PPC_GPR_TYPE GPR10; + PPC_GPR_TYPE GPR11; + PPC_GPR_TYPE GPR12; + PPC_GPR_TYPE GPR13; + PPC_GPR_TYPE GPR14; + PPC_GPR_TYPE GPR15; + PPC_GPR_TYPE GPR16; + PPC_GPR_TYPE GPR17; + PPC_GPR_TYPE GPR18; + PPC_GPR_TYPE GPR19; + PPC_GPR_TYPE GPR20; + PPC_GPR_TYPE GPR21; + PPC_GPR_TYPE GPR22; + PPC_GPR_TYPE GPR23; + PPC_GPR_TYPE GPR24; + PPC_GPR_TYPE GPR25; + PPC_GPR_TYPE GPR26; + PPC_GPR_TYPE GPR27; + PPC_GPR_TYPE GPR28; + PPC_GPR_TYPE GPR29; + PPC_GPR_TYPE GPR30; + PPC_GPR_TYPE GPR31; unsigned EXC_MSR; unsigned EXC_DAR; } BSP_Exception_frame; diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c index 1a346091eb..5c0f8d11cb 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c +++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c @@ -65,6 +65,7 @@ void _CPU_Context_Initialize( bool is_fp ) { + ppc_context *the_ppc_context; uint32_t msr_value; uint32_t sp; @@ -122,35 +123,10 @@ void _CPU_Context_Initialize( memset( the_context, 0, sizeof( *the_context ) ); - PPC_CONTEXT_SET_SP( the_context, sp ); - PPC_CONTEXT_SET_PC( the_context, (uint32_t) entry_point ); - PPC_CONTEXT_SET_MSR( the_context, msr_value ); - -#ifndef __SPE__ -#if (PPC_ABI == PPC_ABI_SVR4) - /* - * SVR4 says R2 is for 'system-reserved' use; it cannot hurt to - * propagate R2 to all task contexts. - */ - { uint32_t r2 = 0; - unsigned r13 = 0; - __asm__ volatile ("mr %0,2; mr %1,13" : "=r" ((r2)), "=r" ((r13))); - - the_context->gpr2 = r2; - the_context->gpr13 = r13; - } -#elif (PPC_ABI == PPC_ABI_EABI) - { uint32_t r2 = 0; - unsigned r13 = 0; - __asm__ volatile ("mr %0,2; mr %1,13" : "=r" ((r2)), "=r" ((r13))); - - the_context->gpr2 = r2; - the_context->gpr13 = r13; - } -#else -#error unsupported PPC_ABI -#endif -#endif /* __SPE__ */ + the_ppc_context = ppc_get_context( the_context ); + the_ppc_context->gpr1 = sp; + the_ppc_context->msr = msr_value; + the_ppc_context->lr = (uint32_t) entry_point; #ifdef __ALTIVEC__ _CPU_Context_initialize_altivec(the_context); diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S b/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S index 3568a0eb10..04fb8b163c 100644 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S +++ b/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S @@ -23,7 +23,7 @@ * COPYRIGHT (c) 1989-1997. * On-Line Applications Research Corporation (OAR). * - * Copyright (c) 2011 embedded brains GmbH. + * Copyright (c) 2011-2012 embedded brains GmbH. * * The license and distribution terms for this file may in * the file LICENSE in this distribution or at @@ -35,55 +35,33 @@ #include <rtems/score/cpu.h> #include <bspopts.h> -#if BSP_DATA_CACHE_ENABLED && PPC_CACHE_ALIGNMENT == 32 - #define DATA_CACHE_ALIGNMENT(reg) \ - li reg, PPC_CACHE_ALIGNMENT - #define DATA_CACHE_ZERO(rega, regb) \ - dcbz rega, regb +#if PPC_DEFAULT_CACHE_LINE_SIZE != 32 + #error "unexpected PPC_DEFAULT_CACHE_LINE_SIZE value" +#endif + +#ifdef BSP_USE_DATA_CACHE_BLOCK_TOUCH #define DATA_CACHE_TOUCH(rega, regb) \ - dcbt rega, regb - #define DATA_CACHE_ZERO_AND_TOUCH(reg, offset) \ - li reg, offset; dcbz reg, r3; dcbt reg, r4 + dcbt rega, regb #else - #define DATA_CACHE_ALIGNMENT(reg) - #define DATA_CACHE_ZERO(rega, regb) #define DATA_CACHE_TOUCH(rega, regb) +#endif + +#if BSP_DATA_CACHE_ENABLED && PPC_CACHE_ALIGNMENT == 32 #define DATA_CACHE_ZERO_AND_TOUCH(reg, offset) \ - li reg, offset + li reg, offset; dcbz reg, r3; DATA_CACHE_TOUCH(reg, r4) +#else + #define DATA_CACHE_ZERO_AND_TOUCH(reg, offset) #endif +#define PPC_CONTEXT_CACHE_LINE_0 32 +#define PPC_CONTEXT_CACHE_LINE_1 64 +#define PPC_CONTEXT_CACHE_LINE_2 96 +#define PPC_CONTEXT_CACHE_LINE_3 128 +#define PPC_CONTEXT_CACHE_LINE_4 160 + /* * Offsets for various Contexts */ - .set GP_1, 0 - .set GP_2, (GP_1 + 4) - .set GP_13, (GP_2 + 4) - .set GP_14, (GP_13 + 4) - - .set GP_15, (GP_14 + 4) - .set GP_16, (GP_15 + 4) - .set GP_17, (GP_16 + 4) - .set GP_18, (GP_17 + 4) - - .set GP_19, (GP_18 + 4) - .set GP_20, (GP_19 + 4) - .set GP_21, (GP_20 + 4) - .set GP_22, (GP_21 + 4) - - .set GP_23, (GP_22 + 4) - .set GP_24, (GP_23 + 4) - .set GP_25, (GP_24 + 4) - .set GP_26, (GP_25 + 4) - - .set GP_27, (GP_26 + 4) - .set GP_28, (GP_27 + 4) - .set GP_29, (GP_28 + 4) - .set GP_30, (GP_29 + 4) - - .set GP_31, (GP_30 + 4) - .set GP_CR, (GP_31 + 4) - .set GP_PC, (GP_CR + 4) - .set GP_MSR, (GP_PC + 4) #if (PPC_HAS_DOUBLE==1) .set FP_SIZE, 8 @@ -129,38 +107,6 @@ .set FP_31, (FP_30 + FP_SIZE) .set FP_FPSCR, (FP_31 + FP_SIZE) - .set IP_LINK, 0 - .set IP_0, (IP_LINK + 8) - .set IP_2, (IP_0 + 4) - - .set IP_3, (IP_2 + 4) - .set IP_4, (IP_3 + 4) - .set IP_5, (IP_4 + 4) - .set IP_6, (IP_5 + 4) - - .set IP_7, (IP_6 + 4) - .set IP_8, (IP_7 + 4) - .set IP_9, (IP_8 + 4) - .set IP_10, (IP_9 + 4) - - .set IP_11, (IP_10 + 4) - .set IP_12, (IP_11 + 4) - .set IP_13, (IP_12 + 4) - .set IP_28, (IP_13 + 4) - - .set IP_29, (IP_28 + 4) - .set IP_30, (IP_29 + 4) - .set IP_31, (IP_30 + 4) - .set IP_CR, (IP_31 + 4) - - .set IP_CTR, (IP_CR + 4) - .set IP_XER, (IP_CTR + 4) - .set IP_LR, (IP_XER + 4) - .set IP_PC, (IP_LR + 4) - - .set IP_MSR, (IP_PC + 4) - .set IP_END, (IP_MSR + 16) - BEGIN_CODE /* * _CPU_Context_save_fp_context @@ -300,111 +246,15 @@ PROC (_CPU_Context_restore_fp): #endif blr -/* _CPU_Context_switch - * - * This routine performs a normal non-FP context switch. - */ ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) PUBLIC_PROC (_CPU_Context_switch) PROC (_CPU_Context_switch): -#ifndef __SPE__ + +#ifdef BSP_USE_SYNC_IN_CONTEXT_SWITCH sync isync - /* This assumes that all the registers are in the given order */ - DATA_CACHE_ALIGNMENT(r5) - addi r9,r3,-4 - DATA_CACHE_ZERO(r5, r9) -#ifdef RTEMS_MULTIPROCESSING - /* - * We have to clear the reservation of the executing thread. See also - * Book E section 6.1.6.2 "Atomic Update Primitives". - */ - li r10, GP_1 + 4 - stwcx. r1, r9, r10 -#endif - stw r1, GP_1+4(r9) - stw r2, GP_2+4(r9) -#if (PPC_USE_MULTIPLE == 1) - addi r9, r9, GP_18+4 - DATA_CACHE_ZERO(r5, r9) - stmw r13, GP_13-GP_18(r9) -#else - stw r13, GP_13+4(r9) - stw r14, GP_14+4(r9) - stw r15, GP_15+4(r9) - stw r16, GP_16+4(r9) - stw r17, GP_17+4(r9) - stwu r18, GP_18+4(r9) - DATA_CACHE_ZERO(r5, r9) - stw r19, GP_19-GP_18(r9) - stw r20, GP_20-GP_18(r9) - stw r21, GP_21-GP_18(r9) - stw r22, GP_22-GP_18(r9) - stw r23, GP_23-GP_18(r9) - stw r24, GP_24-GP_18(r9) - stw r25, GP_25-GP_18(r9) - stw r26, GP_26-GP_18(r9) - stw r27, GP_27-GP_18(r9) - stw r28, GP_28-GP_18(r9) - stw r29, GP_29-GP_18(r9) - stw r30, GP_30-GP_18(r9) - stw r31, GP_31-GP_18(r9) -#endif - DATA_CACHE_TOUCH(r0, r4) - mfcr r6 - stw r6, GP_CR-GP_18(r9) - mflr r7 - stw r7, GP_PC-GP_18(r9) - mfmsr r8 - stw r8, GP_MSR-GP_18(r9) - -#ifdef __ALTIVEC__ - mr r14, r4 - EXTERN_PROC(_CPU_Context_switch_altivec) - bl _CPU_Context_switch_altivec - mr r4, r14 - DATA_CACHE_ALIGNMENT(r5) -#endif - - DATA_CACHE_TOUCH(r5, r4) - lwz r1, GP_1(r4) - lwz r2, GP_2(r4) -#if (PPC_USE_MULTIPLE == 1) - addi r4, r4, GP_19 - DATA_CACHE_TOUCH(r5, r4) - lmw r13, GP_13-GP_19(r4) -#else - lwz r13, GP_13(r4) - lwz r14, GP_14(r4) - lwz r15, GP_15(r4) - lwz r16, GP_16(r4) - lwz r17, GP_17(r4) - lwz r18, GP_18(r4) - lwzu r19, GP_19(r4) - DATA_CACHE_TOUCH(r5, r4) - lwz r20, GP_20-GP_19(r4) - lwz r21, GP_21-GP_19(r4) - lwz r22, GP_22-GP_19(r4) - lwz r23, GP_23-GP_19(r4) - lwz r24, GP_24-GP_19(r4) - lwz r25, GP_25-GP_19(r4) - lwz r26, GP_26-GP_19(r4) - lwz r27, GP_27-GP_19(r4) - lwz r28, GP_28-GP_19(r4) - lwz r29, GP_29-GP_19(r4) - lwz r30, GP_30-GP_19(r4) - lwz r31, GP_31-GP_19(r4) #endif - lwz r6, GP_CR-GP_19(r4) - lwz r7, GP_PC-GP_19(r4) - lwz r8, GP_MSR-GP_19(r4) - mtcrf 255, r6 - mtlr r7 - mtmsr r8 - isync - blr -#else /* __SPE__ */ /* Align to a cache line */ clrrwi r3, r3, 5 clrrwi r4, r4, 5 @@ -421,139 +271,115 @@ PROC (_CPU_Context_switch): /* * We have to clear the reservation of the executing thread. See also * Book E section 6.1.6.2 "Atomic Update Primitives". - * - * Here we assume PPC_CONTEXT_OFFSET_SP == PPC_CONTEXT_CACHE_LINE_0. */ + #if PPC_CONTEXT_OFFSET_GPR1 != PPC_CONTEXT_CACHE_LINE_0 \ + || !BSP_DATA_CACHE_ENABLED \ + || PPC_CACHE_ALIGNMENT != 32 + li r10, PPC_CONTEXT_OFFSET_GPR1 + #endif stwcx. r1, r3, r10 #endif - stw r1, PPC_CONTEXT_OFFSET_SP(r3) + stw r1, PPC_CONTEXT_OFFSET_GPR1(r3) stw r5, PPC_CONTEXT_OFFSET_MSR(r3) stw r6, PPC_CONTEXT_OFFSET_LR(r3) stw r7, PPC_CONTEXT_OFFSET_CR(r3) - evstdd r14, PPC_CONTEXT_OFFSET_GPR14(r3) - evstdd r15, PPC_CONTEXT_OFFSET_GPR15(r3) + PPC_GPR_STORE r14, PPC_CONTEXT_OFFSET_GPR14(r3) + PPC_GPR_STORE r15, PPC_CONTEXT_OFFSET_GPR15(r3) + +#if PPC_CONTEXT_OFFSET_GPR20 == PPC_CONTEXT_CACHE_LINE_2 + DATA_CACHE_ZERO_AND_TOUCH(r10, PPC_CONTEXT_CACHE_LINE_2) +#endif + + PPC_GPR_STORE r16, PPC_CONTEXT_OFFSET_GPR16(r3) + PPC_GPR_STORE r17, PPC_CONTEXT_OFFSET_GPR17(r3) +#if PPC_CONTEXT_OFFSET_GPR26 == PPC_CONTEXT_CACHE_LINE_2 DATA_CACHE_ZERO_AND_TOUCH(r10, PPC_CONTEXT_CACHE_LINE_2) +#endif - evstdd r16, PPC_CONTEXT_OFFSET_GPR16(r3) - evstdd r17, PPC_CONTEXT_OFFSET_GPR17(r3) - evstdd r18, PPC_CONTEXT_OFFSET_GPR18(r3) - evstdd r19, PPC_CONTEXT_OFFSET_GPR19(r3) + PPC_GPR_STORE r18, PPC_CONTEXT_OFFSET_GPR18(r3) + PPC_GPR_STORE r19, PPC_CONTEXT_OFFSET_GPR19(r3) +#if PPC_CONTEXT_OFFSET_GPR24 == PPC_CONTEXT_CACHE_LINE_3 DATA_CACHE_ZERO_AND_TOUCH(r10, PPC_CONTEXT_CACHE_LINE_3) +#endif - evstdd r20, PPC_CONTEXT_OFFSET_GPR20(r3) - evstdd r21, PPC_CONTEXT_OFFSET_GPR21(r3) - evstdd r22, PPC_CONTEXT_OFFSET_GPR22(r3) - evstdd r23, PPC_CONTEXT_OFFSET_GPR23(r3) + PPC_GPR_STORE r20, PPC_CONTEXT_OFFSET_GPR20(r3) + PPC_GPR_STORE r21, PPC_CONTEXT_OFFSET_GPR21(r3) + PPC_GPR_STORE r22, PPC_CONTEXT_OFFSET_GPR22(r3) + PPC_GPR_STORE r23, PPC_CONTEXT_OFFSET_GPR23(r3) +#if PPC_CONTEXT_OFFSET_GPR28 == PPC_CONTEXT_CACHE_LINE_4 DATA_CACHE_ZERO_AND_TOUCH(r10, PPC_CONTEXT_CACHE_LINE_4) +#endif - evstdd r24, PPC_CONTEXT_OFFSET_GPR24(r3) - evstdd r25, PPC_CONTEXT_OFFSET_GPR25(r3) - evstdd r26, PPC_CONTEXT_OFFSET_GPR26(r3) - evstdd r27, PPC_CONTEXT_OFFSET_GPR27(r3) + PPC_GPR_STORE r24, PPC_CONTEXT_OFFSET_GPR24(r3) + PPC_GPR_STORE r25, PPC_CONTEXT_OFFSET_GPR25(r3) + PPC_GPR_STORE r26, PPC_CONTEXT_OFFSET_GPR26(r3) + PPC_GPR_STORE r27, PPC_CONTEXT_OFFSET_GPR27(r3) - evstdd r28, PPC_CONTEXT_OFFSET_GPR28(r3) - evstdd r29, PPC_CONTEXT_OFFSET_GPR29(r3) - evstdd r30, PPC_CONTEXT_OFFSET_GPR30(r3) - evstdd r31, PPC_CONTEXT_OFFSET_GPR31(r3) + PPC_GPR_STORE r28, PPC_CONTEXT_OFFSET_GPR28(r3) + PPC_GPR_STORE r29, PPC_CONTEXT_OFFSET_GPR29(r3) + PPC_GPR_STORE r30, PPC_CONTEXT_OFFSET_GPR30(r3) + PPC_GPR_STORE r31, PPC_CONTEXT_OFFSET_GPR31(r3) /* Restore context from r4 */ restore_context: - lwz r1, PPC_CONTEXT_OFFSET_SP(r4) +#ifdef __ALTIVEC__ + mr r14, r4 + .extern _CPU_Context_switch_altivec + bl _CPU_Context_switch_altivec + mr r4, r14 +#endif + + lwz r1, PPC_CONTEXT_OFFSET_GPR1(r4) lwz r5, PPC_CONTEXT_OFFSET_MSR(r4) lwz r6, PPC_CONTEXT_OFFSET_LR(r4) lwz r7, PPC_CONTEXT_OFFSET_CR(r4) - evldd r14, PPC_CONTEXT_OFFSET_GPR14(r4) - evldd r15, PPC_CONTEXT_OFFSET_GPR15(r4) + PPC_GPR_LOAD r14, PPC_CONTEXT_OFFSET_GPR14(r4) + PPC_GPR_LOAD r15, PPC_CONTEXT_OFFSET_GPR15(r4) DATA_CACHE_TOUCH(r0, r1) - evldd r16, PPC_CONTEXT_OFFSET_GPR16(r4) - evldd r17, PPC_CONTEXT_OFFSET_GPR17(r4) - evldd r18, PPC_CONTEXT_OFFSET_GPR18(r4) - evldd r19, PPC_CONTEXT_OFFSET_GPR19(r4) + PPC_GPR_LOAD r16, PPC_CONTEXT_OFFSET_GPR16(r4) + PPC_GPR_LOAD r17, PPC_CONTEXT_OFFSET_GPR17(r4) + PPC_GPR_LOAD r18, PPC_CONTEXT_OFFSET_GPR18(r4) + PPC_GPR_LOAD r19, PPC_CONTEXT_OFFSET_GPR19(r4) - evldd r20, PPC_CONTEXT_OFFSET_GPR20(r4) - evldd r21, PPC_CONTEXT_OFFSET_GPR21(r4) - evldd r22, PPC_CONTEXT_OFFSET_GPR22(r4) - evldd r23, PPC_CONTEXT_OFFSET_GPR23(r4) + PPC_GPR_LOAD r20, PPC_CONTEXT_OFFSET_GPR20(r4) + PPC_GPR_LOAD r21, PPC_CONTEXT_OFFSET_GPR21(r4) + PPC_GPR_LOAD r22, PPC_CONTEXT_OFFSET_GPR22(r4) + PPC_GPR_LOAD r23, PPC_CONTEXT_OFFSET_GPR23(r4) - evldd r24, PPC_CONTEXT_OFFSET_GPR24(r4) - evldd r25, PPC_CONTEXT_OFFSET_GPR25(r4) - evldd r26, PPC_CONTEXT_OFFSET_GPR26(r4) - evldd r27, PPC_CONTEXT_OFFSET_GPR27(r4) + PPC_GPR_LOAD r24, PPC_CONTEXT_OFFSET_GPR24(r4) + PPC_GPR_LOAD r25, PPC_CONTEXT_OFFSET_GPR25(r4) + PPC_GPR_LOAD r26, PPC_CONTEXT_OFFSET_GPR26(r4) + PPC_GPR_LOAD r27, PPC_CONTEXT_OFFSET_GPR27(r4) - evldd r28, PPC_CONTEXT_OFFSET_GPR28(r4) - evldd r29, PPC_CONTEXT_OFFSET_GPR29(r4) - evldd r30, PPC_CONTEXT_OFFSET_GPR30(r4) - evldd r31, PPC_CONTEXT_OFFSET_GPR31(r4) + PPC_GPR_LOAD r28, PPC_CONTEXT_OFFSET_GPR28(r4) + PPC_GPR_LOAD r29, PPC_CONTEXT_OFFSET_GPR29(r4) + PPC_GPR_LOAD r30, PPC_CONTEXT_OFFSET_GPR30(r4) + PPC_GPR_LOAD r31, PPC_CONTEXT_OFFSET_GPR31(r4) mtcr r7 mtlr r6 mtmsr r5 +#ifdef BSP_USE_SYNC_IN_CONTEXT_SWITCH + isync +#endif + blr -#endif /* __SPE__ */ -/* - * _CPU_Context_restore - * - * This routine is generallu used only to restart self in an - * efficient manner. It may simply be a label in _CPU_Context_switch. - * - * NOTE: May be unnecessary to reload some registers. - */ -/* - * ACB: Don't worry about cache optimisation here - this is not THAT critical. - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) PUBLIC_PROC (_CPU_Context_restore) PROC (_CPU_Context_restore): -#ifndef __SPE__ - lwz r5, GP_CR(r3) - lwz r6, GP_PC(r3) - lwz r7, GP_MSR(r3) - mtcrf 255, r5 - mtlr r6 - mtmsr r7 - isync - lwz r1, GP_1(r3) - lwz r2, GP_2(r3) -#if (PPC_USE_MULTIPLE == 1) - lmw r13, GP_13(r3) -#else - lwz r13, GP_13(r3) - lwz r14, GP_14(r3) - lwz r15, GP_15(r3) - lwz r16, GP_16(r3) - lwz r17, GP_17(r3) - lwz r18, GP_18(r3) - lwz r19, GP_19(r3) - lwz r20, GP_20(r3) - lwz r21, GP_21(r3) - lwz r22, GP_22(r3) - lwz r23, GP_23(r3) - lwz r24, GP_24(r3) - lwz r25, GP_25(r3) - lwz r26, GP_26(r3) - lwz r27, GP_27(r3) - lwz r28, GP_28(r3) - lwz r29, GP_29(r3) - lwz r30, GP_30(r3) - lwz r31, GP_31(r3) -#endif -#ifdef __ALTIVEC__ - EXTERN_PROC(_CPU_Context_restore_altivec) - b _CPU_Context_restore_altivec -#endif - blr -#else /* __SPE__ */ /* Align to a cache line */ clrrwi r4, r3, 5 +#ifdef __ALTIVEC__ + li r3, 0 +#endif + b restore_context -#endif /* __SPE__ */ diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c index f7972aae5e..033a9ef41e 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c +++ b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c @@ -248,7 +248,7 @@ spiPollRead (int minor) { /* Wait for character */ - while ((port->LSR & LSR_RSR)==0);; + while ((port->LSR & LSR_RSR)==0); return port->RBR; } @@ -259,7 +259,7 @@ spiPollWrite(int minor, const char *buf, size_t len) { while (len-- > 0) { - while (!(port->LSR & LSR_THE));; + while (!(port->LSR & LSR_THE)); port->THR = *buf++; } return 0; diff --git a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c index 7a52950285..0733ddb0ba 100644 --- a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c +++ b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c @@ -212,7 +212,7 @@ tty0PollRead (int minor) { /* Wait for character */ - while ((tty0port->LSR & LSR_RSR)==0);; + while ((tty0port->LSR & LSR_RSR)==0); return tty0port->RBR; } @@ -223,7 +223,7 @@ tty0PollWrite(int minor, const char *buf, size_t len) { while (len-- > 0) { - while (!(tty0port->LSR & LSR_THE));; + while (!(tty0port->LSR & LSR_THE)); tty0port->THR = *buf++; } return 0; diff --git a/cpukit/libblock/include/rtems/bdbuf.h b/cpukit/libblock/include/rtems/bdbuf.h index 43a95dfe99..5275c13beb 100644 --- a/cpukit/libblock/include/rtems/bdbuf.h +++ b/cpukit/libblock/include/rtems/bdbuf.h @@ -46,7 +46,7 @@ extern "C" { * @ingroup rtems_libblock * * The Block Device Buffer Management implements a cache between the disk - * devices and file systems. The code provides read ahead and write queuing to + * devices and file systems. The code provides read-ahead and write queuing to * the drivers and fast cache look-up using an AVL tree. * * The block size used by a file system can be set at runtime and must be a @@ -152,10 +152,13 @@ extern "C" { * written. This would be a performance problem. * * The code performs multiple block reads and writes. Multiple block reads or - * read ahead increases performance with hardware that supports it. It also + * read-ahead increases performance with hardware that supports it. It also * helps with a large cache as the disk head movement is reduced. It however * is a speculative operation so excessive use can remove valuable and needed - * blocks from the cache. + * blocks from the cache. The read-ahead is triggered after two misses of + * ascending consecutive blocks or a read hit of a block read by the + * most-resent read-ahead transfer. The read-ahead works per disk, but all + * transfers are issued by the read-ahead task. * * The cache has the following lists of buffers: * - LRU: Accessed or transfered buffers released in least recently used @@ -379,6 +382,8 @@ typedef struct rtems_bdbuf_config { uint32_t buffer_max; /**< Maximum buffer size * supported. It is also the * allocation size. */ + rtems_task_priority read_ahead_priority; /**< Priority of the read-ahead + * task. */ } rtems_bdbuf_config; /** @@ -389,8 +394,8 @@ typedef struct rtems_bdbuf_config { extern const rtems_bdbuf_config rtems_bdbuf_configuration; /** - * The max_read_ahead_blocks value is altered if there are fewer buffers - * than this defined max. This stops thrashing in the cache. + * The default value for the maximum read-ahead blocks disables the read-ahead + * feature. */ #define RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT 0 @@ -426,6 +431,12 @@ extern const rtems_bdbuf_config rtems_bdbuf_configuration; RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT /** + * Default read-ahead task priority. The same as the swap-out task. + */ +#define RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT \ + RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT + +/** * Default task stack size for swap-out and worker tasks. */ #define RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT RTEMS_MINIMUM_STACK_SIZE @@ -621,7 +632,7 @@ rtems_bdbuf_syncdev (rtems_disk_device *dd); /** * @brief Purges all buffers corresponding to the disk device @a dd. * - * This may result in loss of data. + * This may result in loss of data. The read-ahead state of this device is reset. * * Before you can use this function, the rtems_bdbuf_init() routine must be * called at least once to initialize the cache, otherwise a fatal error will @@ -635,7 +646,8 @@ rtems_bdbuf_purge_dev (rtems_disk_device *dd); /** * @brief Sets the block size of a disk device. * - * This will set the block size derived fields of the disk device. + * This will set the block size derived fields of the disk device. The + * read-ahead state of this device is reset. * * Before you can use this function, the rtems_bdbuf_init() routine must be * called at least once to initialize the cache, otherwise a fatal error will diff --git a/cpukit/libblock/include/rtems/diskdevs.h b/cpukit/libblock/include/rtems/diskdevs.h index fe931f8a94..0b194096a5 100644 --- a/cpukit/libblock/include/rtems/diskdevs.h +++ b/cpukit/libblock/include/rtems/diskdevs.h @@ -16,6 +16,7 @@ #include <rtems.h> #include <rtems/libio.h> +#include <rtems/chain.h> #include <stdlib.h> #ifdef __cplusplus @@ -55,6 +56,37 @@ typedef int (*rtems_block_device_ioctl)( ); /** + * @brief Trigger value to disable further read-ahead requests. + */ +#define RTEMS_DISK_READ_AHEAD_NO_TRIGGER ((rtems_blkdev_bnum) -1) + +/** + * @brief Read-ahead control. + */ +typedef struct { + /** + * @brief Chain node for the read-ahead request queue of the read-ahead task. + */ + rtems_chain_node node; + + /** + * @brief Block value to trigger the read-ahead request. + * + * A value of @ref RTEMS_DISK_READ_AHEAD_NO_TRIGGER will disable further + * read-ahead requests since no valid block can have this value. + */ + rtems_blkdev_bnum trigger; + + /** + * @brief Start block for the next read-ahead request. + * + * In case the trigger value is out of range of valid blocks, this value my + * be arbitrary. + */ + rtems_blkdev_bnum next; +} rtems_disk_read_ahread; + +/** * @brief Description of a disk device (logical and physical disks). * * An array of pointer tables to rtems_disk_device structures is maintained. @@ -168,6 +200,11 @@ struct rtems_disk_device { * releases this disk. */ bool deleted; + + /** + * @brief Read-ahead control for this disk. + */ + rtems_disk_read_ahread read_ahead; }; /** diff --git a/cpukit/libblock/src/bdbuf.c b/cpukit/libblock/src/bdbuf.c index 82c442fe28..424b9a3481 100644 --- a/cpukit/libblock/src/bdbuf.c +++ b/cpukit/libblock/src/bdbuf.c @@ -134,6 +134,9 @@ typedef struct rtems_bdbuf_cache size_t group_count; /**< The number of groups. */ rtems_bdbuf_group* groups; /**< The groups. */ + rtems_id read_ahead_task; /**< Read-ahead task */ + rtems_chain_control read_ahead_chain; /**< Read-ahead request chain */ + bool read_ahead_enabled; /**< Read-ahead enabled */ bool initialised; /**< Initialised state. */ } rtems_bdbuf_cache; @@ -180,6 +183,7 @@ typedef struct rtems_bdbuf_cache #define RTEMS_BLKDEV_FATAL_BDBUF_STATE_0 RTEMS_BLKDEV_FATAL_ERROR(28) #define RTEMS_BLKDEV_FATAL_BDBUF_STATE_1 RTEMS_BLKDEV_FATAL_ERROR(29) #define RTEMS_BLKDEV_FATAL_BDBUF_STATE_2 RTEMS_BLKDEV_FATAL_ERROR(30) +#define RTEMS_BLKDEV_FATAL_BDBUF_RA_WAKE_UP RTEMS_BLKDEV_FATAL_ERROR(31) /** * The events used in this code. These should be system events rather than @@ -187,6 +191,7 @@ typedef struct rtems_bdbuf_cache */ #define RTEMS_BDBUF_TRANSFER_SYNC RTEMS_EVENT_1 #define RTEMS_BDBUF_SWAPOUT_SYNC RTEMS_EVENT_2 +#define RTEMS_BDBUF_READ_AHEAD_WAKE_UP RTEMS_EVENT_1 /** * Lock semaphore attributes. This is used for locking type mutexes. @@ -219,11 +224,10 @@ typedef struct rtems_bdbuf_cache (TOD_MICROSECONDS_TO_TICKS (20000000)) #endif -/* - * The swap out task. - */ static rtems_task rtems_bdbuf_swapout_task(rtems_task_argument arg); +static rtems_task rtems_bdbuf_read_ahead_task(rtems_task_argument arg); + /** * The Buffer Descriptor cache. */ @@ -1365,6 +1369,7 @@ rtems_bdbuf_init (void) rtems_chain_initialize_empty (&bdbuf_cache.lru); rtems_chain_initialize_empty (&bdbuf_cache.modified); rtems_chain_initialize_empty (&bdbuf_cache.sync); + rtems_chain_initialize_empty (&bdbuf_cache.read_ahead_chain); /* * Create the locks for the cache. @@ -1486,12 +1491,28 @@ rtems_bdbuf_init (void) if (sc != RTEMS_SUCCESSFUL) goto error; + if (bdbuf_config.max_read_ahead_blocks > 0) + { + bdbuf_cache.read_ahead_enabled = true; + sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'), + bdbuf_config.read_ahead_priority, + RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT, + rtems_bdbuf_read_ahead_task, + 0, + &bdbuf_cache.read_ahead_task); + if (sc != RTEMS_SUCCESSFUL) + goto error; + } + rtems_bdbuf_unlock_cache (); return RTEMS_SUCCESSFUL; error: + if (bdbuf_cache.read_ahead_task != 0) + rtems_task_delete (bdbuf_cache.read_ahead_task); + if (bdbuf_cache.swapout != 0) rtems_task_delete (bdbuf_cache.swapout); @@ -1852,81 +1873,6 @@ rtems_bdbuf_transfer_done (void* arg, rtems_status_code status) rtems_event_send (req->io_task, RTEMS_BDBUF_TRANSFER_SYNC); } -static void -rtems_bdbuf_create_read_request (const rtems_disk_device *dd, - rtems_blkdev_bnum media_block, - rtems_blkdev_request *req, - rtems_bdbuf_buffer **bd_ptr) -{ - rtems_bdbuf_buffer *bd = NULL; - rtems_blkdev_bnum media_block_end = dd->start + dd->size; - rtems_blkdev_bnum media_block_count = dd->block_to_media_block_shift >= 0 ? - 1U << dd->block_to_media_block_shift - : dd->block_size / dd->media_block_size; - uint32_t block_size = dd->block_size; - uint32_t transfer_index = 1; - uint32_t transfer_count = bdbuf_config.max_read_ahead_blocks + 1; - - if (media_block_end - media_block < transfer_count) - transfer_count = media_block_end - media_block; - - req->req = RTEMS_BLKDEV_REQ_READ; - req->req_done = rtems_bdbuf_transfer_done; - req->done_arg = req; - req->io_task = rtems_task_self (); - req->status = RTEMS_RESOURCE_IN_USE; - req->bufnum = 0; - - bd = rtems_bdbuf_get_buffer_for_access (dd, media_block); - - *bd_ptr = bd; - - req->bufs [0].user = bd; - req->bufs [0].block = media_block; - req->bufs [0].length = block_size; - req->bufs [0].buffer = bd->buffer; - - if (rtems_bdbuf_tracer) - rtems_bdbuf_show_users ("read", bd); - - switch (bd->state) - { - case RTEMS_BDBUF_STATE_CACHED: - case RTEMS_BDBUF_STATE_MODIFIED: - return; - case RTEMS_BDBUF_STATE_EMPTY: - rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER); - break; - default: - rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_1); - break; - } - - while (transfer_index < transfer_count) - { - media_block += media_block_count; - - bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block); - - if (bd == NULL) - break; - - rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER); - - req->bufs [transfer_index].user = bd; - req->bufs [transfer_index].block = media_block; - req->bufs [transfer_index].length = block_size; - req->bufs [transfer_index].buffer = bd->buffer; - - if (rtems_bdbuf_tracer) - rtems_bdbuf_show_users ("read-ahead", bd); - - ++transfer_index; - } - - req->bufnum = transfer_index; -} - static rtems_status_code rtems_bdbuf_execute_transfer_request (const rtems_disk_device *dd, rtems_blkdev_request *req, @@ -1989,15 +1935,16 @@ rtems_bdbuf_execute_transfer_request (const rtems_disk_device *dd, return RTEMS_IO_ERROR; } -rtems_status_code -rtems_bdbuf_read (rtems_disk_device *dd, - rtems_blkdev_bnum block, - rtems_bdbuf_buffer **bd_ptr) +static rtems_status_code +rtems_bdbuf_execute_read_request (const rtems_disk_device *dd, + rtems_bdbuf_buffer *bd, + uint32_t transfer_count) { - rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_blkdev_request *req = NULL; - rtems_bdbuf_buffer *bd = NULL; - rtems_blkdev_bnum media_block; + rtems_blkdev_bnum media_block = bd->block; + uint32_t media_blocks_per_block = dd->media_blocks_per_block; + uint32_t block_size = dd->block_size; + uint32_t transfer_index = 1; /* * TODO: This type of request structure is wrong and should be removed. @@ -2005,8 +1952,113 @@ rtems_bdbuf_read (rtems_disk_device *dd, #define bdbuf_alloc(size) __builtin_alloca (size) req = bdbuf_alloc (sizeof (rtems_blkdev_request) + - sizeof (rtems_blkdev_sg_buffer) * - (bdbuf_config.max_read_ahead_blocks + 1)); + sizeof (rtems_blkdev_sg_buffer) * transfer_count); + + req->req = RTEMS_BLKDEV_REQ_READ; + req->req_done = rtems_bdbuf_transfer_done; + req->done_arg = req; + req->io_task = rtems_task_self (); + req->status = RTEMS_RESOURCE_IN_USE; + req->bufnum = 0; + + rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER); + + req->bufs [0].user = bd; + req->bufs [0].block = media_block; + req->bufs [0].length = block_size; + req->bufs [0].buffer = bd->buffer; + + if (rtems_bdbuf_tracer) + rtems_bdbuf_show_users ("read", bd); + + while (transfer_index < transfer_count) + { + media_block += media_blocks_per_block; + + bd = rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block); + + if (bd == NULL) + break; + + rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER); + + req->bufs [transfer_index].user = bd; + req->bufs [transfer_index].block = media_block; + req->bufs [transfer_index].length = block_size; + req->bufs [transfer_index].buffer = bd->buffer; + + if (rtems_bdbuf_tracer) + rtems_bdbuf_show_users ("read", bd); + + ++transfer_index; + } + + req->bufnum = transfer_index; + + return rtems_bdbuf_execute_transfer_request (dd, req, true); +} + +static bool +rtems_bdbuf_is_read_ahead_active (const rtems_disk_device *dd) +{ + return !rtems_chain_is_node_off_chain (&dd->read_ahead.node); +} + +static void +rtems_bdbuf_read_ahead_cancel (rtems_disk_device *dd) +{ + if (rtems_bdbuf_is_read_ahead_active (dd)) + { + rtems_chain_extract_unprotected (&dd->read_ahead.node); + rtems_chain_set_off_chain (&dd->read_ahead.node); + } +} + +static void +rtems_bdbuf_read_ahead_reset (rtems_disk_device *dd) +{ + rtems_bdbuf_read_ahead_cancel (dd); + dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER; +} + +static void +rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd, + rtems_blkdev_bnum block) +{ + if (dd->read_ahead.trigger == block + && !rtems_bdbuf_is_read_ahead_active (dd)) + { + rtems_status_code sc; + rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain; + + rtems_chain_append_unprotected (chain, &dd->read_ahead.node); + sc = rtems_event_send (bdbuf_cache.read_ahead_task, + RTEMS_BDBUF_READ_AHEAD_WAKE_UP); + if (sc != RTEMS_SUCCESSFUL) + rtems_fatal_error_occurred (RTEMS_BLKDEV_FATAL_BDBUF_RA_WAKE_UP); + } +} + +static void +rtems_bdbuf_set_read_ahead_trigger (rtems_disk_device *dd, + rtems_blkdev_bnum block) +{ + if (dd->read_ahead.trigger != block) + { + rtems_bdbuf_read_ahead_cancel (dd); + dd->read_ahead.trigger = block + 1; + dd->read_ahead.next = block + 2; + } +} + +rtems_status_code +rtems_bdbuf_read (rtems_disk_device *dd, + rtems_blkdev_bnum block, + rtems_bdbuf_buffer **bd_ptr) +{ + rtems_status_code sc = RTEMS_SUCCESSFUL; + rtems_bdbuf_buffer *bd = NULL; + rtems_blkdev_bnum media_block; rtems_bdbuf_lock_cache (); @@ -2017,42 +2069,33 @@ rtems_bdbuf_read (rtems_disk_device *dd, printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n", media_block + dd->start, block, (unsigned) dd->dev); - rtems_bdbuf_create_read_request (dd, media_block, req, &bd); - - if (req->bufnum > 0) - { - sc = rtems_bdbuf_execute_transfer_request (dd, req, true); - if (sc == RTEMS_SUCCESSFUL) - { - rtems_chain_extract_unprotected (&bd->link); - rtems_bdbuf_group_obtain (bd); - } - } - - if (sc == RTEMS_SUCCESSFUL) + rtems_bdbuf_check_read_ahead_trigger (dd, block); + bd = rtems_bdbuf_get_buffer_for_access (dd, media_block); + switch (bd->state) { - switch (bd->state) - { - case RTEMS_BDBUF_STATE_CACHED: + case RTEMS_BDBUF_STATE_CACHED: + rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); + break; + case RTEMS_BDBUF_STATE_MODIFIED: + rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); + break; + case RTEMS_BDBUF_STATE_EMPTY: + rtems_bdbuf_set_read_ahead_trigger (dd, block); + sc = rtems_bdbuf_execute_read_request (dd, bd, 1); + if (sc == RTEMS_SUCCESSFUL) + { rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED); - break; - case RTEMS_BDBUF_STATE_MODIFIED: - rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED); - break; - default: - rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4); - break; - } - - if (rtems_bdbuf_tracer) - { - rtems_bdbuf_show_users ("read", bd); - rtems_bdbuf_show_usage (); - } - } - else - { - bd = NULL; + rtems_chain_extract_unprotected (&bd->link); + rtems_bdbuf_group_obtain (bd); + } + else + { + bd = NULL; + } + break; + default: + rtems_bdbuf_fatal (bd->state, RTEMS_BLKDEV_FATAL_BDBUF_STATE_4); + break; } } @@ -2701,7 +2744,7 @@ rtems_bdbuf_swapout_task (rtems_task_argument arg) { rtems_bdbuf_swapout_transfer transfer; uint32_t period_in_ticks; - const uint32_t period_in_msecs = bdbuf_config.swapout_period;; + const uint32_t period_in_msecs = bdbuf_config.swapout_period; uint32_t timer_delta; transfer.write_req = rtems_bdbuf_swapout_writereq_alloc (); @@ -2884,6 +2927,7 @@ rtems_bdbuf_purge_dev (rtems_disk_device *dd) rtems_chain_initialize_empty (&purge_list); rtems_bdbuf_lock_cache (); + rtems_bdbuf_read_ahead_reset (dd); rtems_bdbuf_gather_for_purge (&purge_list, dd); rtems_bdbuf_purge_list (&purge_list); rtems_bdbuf_unlock_cache (); @@ -2919,6 +2963,8 @@ rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size) dd->media_blocks_per_block = media_blocks_per_block; dd->block_to_media_block_shift = block_to_media_block_shift; dd->bds_per_group = bds_per_group; + + rtems_bdbuf_read_ahead_reset (dd); } else { @@ -2934,3 +2980,62 @@ rtems_bdbuf_set_block_size (rtems_disk_device *dd, uint32_t block_size) return sc; } + +static rtems_task +rtems_bdbuf_read_ahead_task (rtems_task_argument arg) +{ + rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain; + + while (bdbuf_cache.read_ahead_enabled) + { + rtems_chain_node *node; + + rtems_bdbuf_wait_for_event (RTEMS_BDBUF_READ_AHEAD_WAKE_UP); + rtems_bdbuf_lock_cache (); + + while ((node = rtems_chain_get_unprotected (chain)) != NULL) + { + rtems_disk_device *dd = (rtems_disk_device *) + ((char *) node - offsetof (rtems_disk_device, read_ahead.node)); + rtems_blkdev_bnum block = dd->read_ahead.next; + rtems_blkdev_bnum media_block = 0; + rtems_status_code sc = + rtems_bdbuf_get_media_block (dd, block, &media_block); + + rtems_chain_set_off_chain (&dd->read_ahead.node); + + if (sc == RTEMS_SUCCESSFUL) + { + rtems_bdbuf_buffer *bd = + rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block); + + if (bd != NULL) + { + uint32_t transfer_count = dd->block_count - block; + uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks; + + if (transfer_count >= max_transfer_count) + { + transfer_count = max_transfer_count; + dd->read_ahead.trigger += max_transfer_count / 2 + 1; + dd->read_ahead.next += max_transfer_count; + } + else + { + dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER; + } + + rtems_bdbuf_execute_read_request (dd, bd, transfer_count); + } + } + else + { + dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER; + } + } + + rtems_bdbuf_unlock_cache (); + } + + rtems_task_delete (RTEMS_SELF); +} diff --git a/cpukit/libblock/src/diskdevs-init.c b/cpukit/libblock/src/diskdevs-init.c index ccf954a49a..5ec96b250c 100644 --- a/cpukit/libblock/src/diskdevs-init.c +++ b/cpukit/libblock/src/diskdevs-init.c @@ -36,6 +36,7 @@ rtems_status_code rtems_disk_init_phys( dd->media_block_size = block_size; dd->ioctl = handler; dd->driver_data = driver_data; + dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER; if (block_count > 0) { if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) != 0) { @@ -67,6 +68,7 @@ rtems_status_code rtems_disk_init_log( dd->media_block_size = phys_dd->media_block_size; dd->ioctl = phys_dd->ioctl; dd->driver_data = phys_dd->driver_data; + dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER; if (phys_dd->phys_dev == phys_dd) { rtems_blkdev_bnum phys_block_count = phys_dd->size; diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c index b6a466e265..88f8e5b571 100644 --- a/cpukit/libfs/src/dosfs/fat_file.c +++ b/cpukit/libfs/src/dosfs/fat_file.c @@ -552,9 +552,10 @@ fat_file_extend( /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) - *a_length = new_length - - ((cls2add - cls_added - 1) << fs_info->vol.bpc_log2) - - (bytes2add & (fs_info->vol.bpc - 1)); + { + new_length -= bytes2add & (fs_info->vol.bpc - 1); + new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; + } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) @@ -603,6 +604,7 @@ fat_file_extend( } } + *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c index 9fdda6df16..ed791ee3e1 100644 --- a/cpukit/libfs/src/dosfs/msdos_misc.c +++ b/cpukit/libfs/src/dosfs/msdos_misc.c @@ -800,7 +800,7 @@ msdos_set_first_char4file_name( { uint32_t sec = (fat_cluster_num_to_sector_num(mt_entry, start.cln) + (start.ofs >> fs_info->fat.vol.sec_log2)); - uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));; + uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1)); ret = _fat_block_write(mt_entry, sec, byte + MSDOS_FILE_NAME_OFFSET, 1, &fchar); diff --git a/cpukit/libi2c/libi2c.c b/cpukit/libi2c/libi2c.c index c3aee7dbd6..88f87993ca 100644 --- a/cpukit/libi2c/libi2c.c +++ b/cpukit/libi2c/libi2c.c @@ -450,7 +450,7 @@ rtems_libi2c_register_bus (const char *name, rtems_libi2c_bus_t * bus) /* initialization failed */ i = -err; } else { - busses[i].name = nmcpy;; + busses[i].name = nmcpy; nmcpy = 0; } diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c index 43e3c390a3..9f068f96fa 100644 --- a/cpukit/libmisc/capture/capture.c +++ b/cpukit/libmisc/capture/capture.c @@ -1047,7 +1047,7 @@ rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp __attribu } else { - capture_extension_index = rtems_object_id_get_index (capture_id);; + capture_extension_index = rtems_object_id_get_index (capture_id); } /* diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 4e43a27f45..0f804ee7cc 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -1241,6 +1241,10 @@ rtems_fs_init_functions_t rtems_fs_init_helper = #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \ RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT #endif + #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY + #define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \ + RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT + #endif #ifdef CONFIGURE_INIT const rtems_bdbuf_config rtems_bdbuf_configuration = { CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, @@ -1253,11 +1257,14 @@ rtems_fs_init_functions_t rtems_fs_init_helper = CONFIGURE_BDBUF_TASK_STACK_SIZE, CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, CONFIGURE_BDBUF_BUFFER_MIN_SIZE, - CONFIGURE_BDBUF_BUFFER_MAX_SIZE + CONFIGURE_BDBUF_BUFFER_MAX_SIZE, + CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY }; #endif - #define CONFIGURE_LIBBLOCK_TASKS (1 + CONFIGURE_SWAPOUT_WORKER_TASKS) + #define CONFIGURE_LIBBLOCK_TASKS \ + (1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \ + (CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0)) #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \ (CONFIGURE_LIBBLOCK_TASKS * \ diff --git a/cpukit/score/cpu/powerpc/cpu.c b/cpukit/score/cpu/powerpc/cpu.c index b12deae57b..a1ede940db 100644 --- a/cpukit/score/cpu/powerpc/cpu.c +++ b/cpukit/score/cpu/powerpc/cpu.c @@ -10,6 +10,43 @@ */ #ifdef HAVE_CONFIG_H -#include "config.h" + #include "config.h" #endif +#include <rtems/system.h> +#include <rtems/score/cpu.h> + +#define PPC_ASSERT_OFFSET(field, off) \ + RTEMS_STATIC_ASSERT( \ + offsetof(ppc_context, field) + PPC_DEFAULT_CACHE_LINE_SIZE \ + == PPC_CONTEXT_OFFSET_ ## off, \ + ppc_context_offset_ ## field \ + ) + +PPC_ASSERT_OFFSET(gpr1, GPR1); +PPC_ASSERT_OFFSET(msr, MSR); +PPC_ASSERT_OFFSET(lr, LR); +PPC_ASSERT_OFFSET(cr, CR); +PPC_ASSERT_OFFSET(gpr14, GPR14); +PPC_ASSERT_OFFSET(gpr15, GPR15); +PPC_ASSERT_OFFSET(gpr16, GPR16); +PPC_ASSERT_OFFSET(gpr17, GPR17); +PPC_ASSERT_OFFSET(gpr18, GPR18); +PPC_ASSERT_OFFSET(gpr19, GPR19); +PPC_ASSERT_OFFSET(gpr20, GPR20); +PPC_ASSERT_OFFSET(gpr21, GPR21); +PPC_ASSERT_OFFSET(gpr22, GPR22); +PPC_ASSERT_OFFSET(gpr23, GPR23); +PPC_ASSERT_OFFSET(gpr24, GPR24); +PPC_ASSERT_OFFSET(gpr25, GPR25); +PPC_ASSERT_OFFSET(gpr26, GPR26); +PPC_ASSERT_OFFSET(gpr27, GPR27); +PPC_ASSERT_OFFSET(gpr28, GPR28); +PPC_ASSERT_OFFSET(gpr29, GPR29); +PPC_ASSERT_OFFSET(gpr30, GPR30); +PPC_ASSERT_OFFSET(gpr31, GPR31); + +RTEMS_STATIC_ASSERT( + sizeof(Context_Control) % PPC_DEFAULT_CACHE_LINE_SIZE == 0, + ppc_context_size +); diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h index 3ed76dffb7..e845362266 100644 --- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h +++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h @@ -23,7 +23,7 @@ * * Copyright (c) 2001 Surrey Satellite Technology Limited (SSTL). * - * Copyright (c) 2010-2011 embedded brains GmbH. + * Copyright (c) 2010-2012 embedded brains GmbH. * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -249,159 +249,110 @@ extern "C" { * a debugger such as gdb. But that is another problem. */ -#ifndef ASM - -typedef struct { - #ifndef __SPE__ - uint32_t gpr1; /* Stack pointer for all */ - uint32_t gpr2; /* Reserved SVR4, section ptr EABI + */ - uint32_t gpr13; /* Section ptr SVR4/EABI */ - uint32_t gpr14; /* Non volatile for all */ - uint32_t gpr15; /* Non volatile for all */ - uint32_t gpr16; /* Non volatile for all */ - uint32_t gpr17; /* Non volatile for all */ - uint32_t gpr18; /* Non volatile for all */ - uint32_t gpr19; /* Non volatile for all */ - uint32_t gpr20; /* Non volatile for all */ - uint32_t gpr21; /* Non volatile for all */ - uint32_t gpr22; /* Non volatile for all */ - uint32_t gpr23; /* Non volatile for all */ - uint32_t gpr24; /* Non volatile for all */ - uint32_t gpr25; /* Non volatile for all */ - uint32_t gpr26; /* Non volatile for all */ - uint32_t gpr27; /* Non volatile for all */ - uint32_t gpr28; /* Non volatile for all */ - uint32_t gpr29; /* Non volatile for all */ - uint32_t gpr30; /* Non volatile for all */ - uint32_t gpr31; /* Non volatile for all */ - uint32_t cr; /* PART of the CR is non volatile for all */ - uint32_t pc; /* Program counter/Link register */ - uint32_t msr; /* Initial interrupt level */ - #ifdef __ALTIVEC__ - /* - * 12 non-volatile vector registers, cache-aligned area for vscr/vrsave - * and padding to ensure cache-alignment. Unfortunately, we can't verify - * the cache line size here in the cpukit but altivec support code will - * produce an error if this is ever different from 32 bytes. - * - * Note: it is the BSP/CPU-support's responsibility to save/restore - * volatile vregs across interrupts and exceptions. - */ - uint8_t altivec[16*12 + 32 + 32]; - #endif - #else - /* Non-volatile context according to E500ABIUG and EABI */ - uint32_t context [ - 8 /* Cache line padding */ - + 1 /* Stack pointer */ - + 1 /* MSR */ - + 1 /* LR */ - + 1 /* CR */ - + 18 * 2 /* GPR 14 to GPR 31 */ - ]; - #endif -} Context_Control; -#endif /* ASM */ - #ifndef __SPE__ - #define PPC_CONTEXT_SET_SP( _context, _sp ) \ - do { \ - (_context)->gpr1 = _sp; \ - } while (0) + #define PPC_GPR_TYPE uint32_t + #define PPC_GPR_SIZE 4 + #define PPC_GPR_LOAD lwz + #define PPC_GPR_STORE stw +#else + #define PPC_GPR_TYPE uint64_t + #define PPC_GPR_SIZE 8 + #define PPC_GPR_LOAD evldd + #define PPC_GPR_STORE evstdd +#endif - #define PPC_CONTEXT_GET_CR( _context ) \ - (_context)->cr +#define PPC_DEFAULT_CACHE_LINE_SIZE 32 - #define PPC_CONTEXT_GET_MSR( _context ) \ - (_context)->msr +#ifndef ASM - #define PPC_CONTEXT_SET_MSR( _context, _msr ) \ - do { \ - (_context)->msr = _msr; \ - } while (0) +/* Non-volatile context according to E500ABIUG and EABI */ +typedef struct { + uint32_t gpr1; + uint32_t msr; + uint32_t lr; + uint32_t cr; + PPC_GPR_TYPE gpr14; + PPC_GPR_TYPE gpr15; + PPC_GPR_TYPE gpr16; + PPC_GPR_TYPE gpr17; + PPC_GPR_TYPE gpr18; + PPC_GPR_TYPE gpr19; + PPC_GPR_TYPE gpr20; + PPC_GPR_TYPE gpr21; + PPC_GPR_TYPE gpr22; + PPC_GPR_TYPE gpr23; + PPC_GPR_TYPE gpr24; + PPC_GPR_TYPE gpr25; + PPC_GPR_TYPE gpr26; + PPC_GPR_TYPE gpr27; + PPC_GPR_TYPE gpr28; + PPC_GPR_TYPE gpr29; + PPC_GPR_TYPE gpr30; + PPC_GPR_TYPE gpr31; + #ifdef __ALTIVEC__ + /* + * 12 non-volatile vector registers, cache-aligned area for vscr/vrsave + * and padding to ensure cache-alignment. Unfortunately, we can't verify + * the cache line size here in the cpukit but altivec support code will + * produce an error if this is ever different from 32 bytes. + * + * Note: it is the BSP/CPU-support's responsibility to save/restore + * volatile vregs across interrupts and exceptions. + */ + uint8_t altivec[16*12 + 32 + PPC_DEFAULT_CACHE_LINE_SIZE]; + #endif +} ppc_context; - #define PPC_CONTEXT_FIRST_SAVED_GPR 13 +typedef struct { + uint8_t context [ + PPC_DEFAULT_CACHE_LINE_SIZE + + sizeof(ppc_context) + + (sizeof(ppc_context) % PPC_DEFAULT_CACHE_LINE_SIZE == 0 + ? 0 + : PPC_DEFAULT_CACHE_LINE_SIZE + - sizeof(ppc_context) % PPC_DEFAULT_CACHE_LINE_SIZE) + ]; +} Context_Control; - #define PPC_CONTEXT_GET_FIRST_SAVED( _context ) \ - (_context)->gpr13 +static inline ppc_context *ppc_get_context( Context_Control *context ) +{ + uintptr_t clsz = PPC_DEFAULT_CACHE_LINE_SIZE; + uintptr_t mask = clsz - 1; + uintptr_t addr = (uintptr_t) context; - #define PPC_CONTEXT_GET_PC( _context ) \ - (_context)->pc + return (ppc_context *) ((addr & ~mask) + clsz); +} - #define PPC_CONTEXT_SET_PC( _context, _pc ) \ - do { \ - (_context)->pc = _pc; \ - } while (0) +#define _CPU_Context_Get_SP( _context ) \ + ppc_get_context(_context)->gpr1 +#endif /* ASM */ - #define _CPU_Context_Get_SP( _context ) \ - (_context)->gpr1 -#else - #define PPC_CONTEXT_CACHE_LINE_0 32 - #define PPC_CONTEXT_OFFSET_SP 32 - #define PPC_CONTEXT_OFFSET_MSR 36 - #define PPC_CONTEXT_OFFSET_LR 40 - #define PPC_CONTEXT_OFFSET_CR 44 - #define PPC_CONTEXT_OFFSET_GPR14 48 - #define PPC_CONTEXT_OFFSET_GPR15 56 - #define PPC_CONTEXT_CACHE_LINE_1 64 - #define PPC_CONTEXT_OFFSET_GPR16 64 - #define PPC_CONTEXT_OFFSET_GPR17 72 - #define PPC_CONTEXT_OFFSET_GPR18 80 - #define PPC_CONTEXT_OFFSET_GPR19 88 - #define PPC_CONTEXT_CACHE_LINE_2 96 - #define PPC_CONTEXT_OFFSET_GPR20 96 - #define PPC_CONTEXT_OFFSET_GPR21 104 - #define PPC_CONTEXT_OFFSET_GPR22 112 - #define PPC_CONTEXT_OFFSET_GPR23 120 - #define PPC_CONTEXT_CACHE_LINE_3 128 - #define PPC_CONTEXT_OFFSET_GPR24 128 - #define PPC_CONTEXT_OFFSET_GPR25 136 - #define PPC_CONTEXT_OFFSET_GPR26 144 - #define PPC_CONTEXT_OFFSET_GPR27 152 - #define PPC_CONTEXT_CACHE_LINE_4 160 - #define PPC_CONTEXT_OFFSET_GPR28 160 - #define PPC_CONTEXT_OFFSET_GPR29 168 - #define PPC_CONTEXT_OFFSET_GPR30 176 - #define PPC_CONTEXT_OFFSET_GPR31 184 - - #define PPC_CONTEXT_AREA( _context ) \ - ((uint32_t *) (((uintptr_t) (_context)) & ~0x1fU)) - - #define PPC_CONTEXT_FIELD( _context, _offset ) \ - PPC_CONTEXT_AREA( _context ) [(_offset) / 4] - - #define PPC_CONTEXT_SET_SP( _context, _sp ) \ - do { \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_SP ) = _sp; \ - } while (0) - - #define PPC_CONTEXT_GET_CR( _context ) \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_CR ) - - #define PPC_CONTEXT_GET_MSR( _context ) \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_MSR ) - - #define PPC_CONTEXT_SET_MSR( _context, _msr ) \ - do { \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_MSR ) = _msr; \ - } while (0) - - #define PPC_CONTEXT_FIRST_SAVED_GPR 14 - - #define PPC_CONTEXT_GET_FIRST_SAVED( _context ) \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_GPR14 ) - - #define PPC_CONTEXT_GET_PC( _context ) \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_LR ) - - #define PPC_CONTEXT_SET_PC( _context, _pc ) \ - do { \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_LR ) = _pc; \ - } while (0) - - #define _CPU_Context_Get_SP( _context ) \ - PPC_CONTEXT_FIELD( _context, PPC_CONTEXT_OFFSET_SP ) -#endif +#define PPC_CONTEXT_OFFSET_GPR1 32 +#define PPC_CONTEXT_OFFSET_MSR 36 +#define PPC_CONTEXT_OFFSET_LR 40 +#define PPC_CONTEXT_OFFSET_CR 44 + +#define PPC_CONTEXT_GPR_OFFSET( gpr ) \ + (((gpr) - 14) * PPC_GPR_SIZE + 48) + +#define PPC_CONTEXT_OFFSET_GPR14 PPC_CONTEXT_GPR_OFFSET( 14 ) +#define PPC_CONTEXT_OFFSET_GPR15 PPC_CONTEXT_GPR_OFFSET( 15 ) +#define PPC_CONTEXT_OFFSET_GPR16 PPC_CONTEXT_GPR_OFFSET( 16 ) +#define PPC_CONTEXT_OFFSET_GPR17 PPC_CONTEXT_GPR_OFFSET( 17 ) +#define PPC_CONTEXT_OFFSET_GPR18 PPC_CONTEXT_GPR_OFFSET( 18 ) +#define PPC_CONTEXT_OFFSET_GPR19 PPC_CONTEXT_GPR_OFFSET( 19 ) +#define PPC_CONTEXT_OFFSET_GPR20 PPC_CONTEXT_GPR_OFFSET( 20 ) +#define PPC_CONTEXT_OFFSET_GPR21 PPC_CONTEXT_GPR_OFFSET( 21 ) +#define PPC_CONTEXT_OFFSET_GPR22 PPC_CONTEXT_GPR_OFFSET( 22 ) +#define PPC_CONTEXT_OFFSET_GPR23 PPC_CONTEXT_GPR_OFFSET( 23 ) +#define PPC_CONTEXT_OFFSET_GPR24 PPC_CONTEXT_GPR_OFFSET( 24 ) +#define PPC_CONTEXT_OFFSET_GPR25 PPC_CONTEXT_GPR_OFFSET( 25 ) +#define PPC_CONTEXT_OFFSET_GPR26 PPC_CONTEXT_GPR_OFFSET( 26 ) +#define PPC_CONTEXT_OFFSET_GPR27 PPC_CONTEXT_GPR_OFFSET( 27 ) +#define PPC_CONTEXT_OFFSET_GPR28 PPC_CONTEXT_GPR_OFFSET( 28 ) +#define PPC_CONTEXT_OFFSET_GPR29 PPC_CONTEXT_GPR_OFFSET( 29 ) +#define PPC_CONTEXT_OFFSET_GPR30 PPC_CONTEXT_GPR_OFFSET( 30 ) +#define PPC_CONTEXT_OFFSET_GPR31 PPC_CONTEXT_GPR_OFFSET( 31 ) #ifndef ASM typedef struct { diff --git a/cpukit/score/src/coremsgflushsupp.c b/cpukit/score/src/coremsgflushsupp.c index 2f959f49d5..77f56d6fe7 100644 --- a/cpukit/score/src/coremsgflushsupp.c +++ b/cpukit/score/src/coremsgflushsupp.c @@ -85,7 +85,7 @@ uint32_t _CORE_message_queue_Flush_support( _ISR_Disable( level ); inactive_head = _Chain_Head( &the_message_queue->Inactive_messages ); - inactive_first = inactive_head->next;; + inactive_first = inactive_head->next; message_queue_first = _Chain_First( &the_message_queue->Pending_messages ); message_queue_last = _Chain_Last( &the_message_queue->Pending_messages ); diff --git a/cpukit/score/src/heapresizeblock.c b/cpukit/score/src/heapresizeblock.c index d085fc6b00..fb623194d1 100644 --- a/cpukit/score/src/heapresizeblock.c +++ b/cpukit/score/src/heapresizeblock.c @@ -44,7 +44,7 @@ static Heap_Resize_status _Heap_Resize_block_checked( Heap_Block *next_block = _Heap_Block_at( block, block_size ); uintptr_t next_block_size = _Heap_Block_size( next_block ); - bool next_block_is_free = _Heap_Is_free( next_block );; + bool next_block_is_free = _Heap_Is_free( next_block ); _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am index 1274f2637b..9747ad19c6 100644 --- a/testsuites/libtests/Makefile.am +++ b/testsuites/libtests/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = POSIX +SUBDIRS += block13 SUBDIRS += rbheap01 SUBDIRS += flashdisk01 diff --git a/testsuites/libtests/block05/init.c b/testsuites/libtests/block05/init.c index 3d221a98ab..dd5d646a41 100644 --- a/testsuites/libtests/block05/init.c +++ b/testsuites/libtests/block05/init.c @@ -151,11 +151,11 @@ static rtems_bdbuf_buffer *get(enum get_type type, enum blk_kind kind) rtems_bdbuf_buffer *bd = NULL; rtems_blkdev_bnum blk_index = 0; rtems_status_code (*get_bd)( - const rtems_disk_device *, + rtems_disk_device *, rtems_blkdev_bnum, rtems_bdbuf_buffer ** ) = NULL; - const rtems_disk_device *dd = NULL; + rtems_disk_device *dd = NULL; size_t bds_per_group = 0; switch (kind) { diff --git a/testsuites/libtests/block13/Makefile.am b/testsuites/libtests/block13/Makefile.am new file mode 100644 index 0000000000..9b4a76d0eb --- /dev/null +++ b/testsuites/libtests/block13/Makefile.am @@ -0,0 +1,19 @@ +rtems_tests_PROGRAMS = block13 +block13_SOURCES = init.c + +dist_rtems_tests_DATA = block13.scn block13.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(block13_OBJECTS) +LINK_LIBS = $(block13_LDLIBS) + +block13$(EXEEXT): $(block13_OBJECTS) $(block13_DEPENDENCIES) + @rm -f block13$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/libtests/block13/block13.doc b/testsuites/libtests/block13/block13.doc new file mode 100644 index 0000000000..04fc066ada --- /dev/null +++ b/testsuites/libtests/block13/block13.doc @@ -0,0 +1,11 @@ +This file describes the directives and concepts tested by this test set. + +test set name: block13 + +directives: + + TBD + +concepts: + + Tests the read-ahead feature of bdbuf. diff --git a/testsuites/libtests/block13/block13.scn b/testsuites/libtests/block13/block13.scn new file mode 100644 index 0000000000..8cce71806d --- /dev/null +++ b/testsuites/libtests/block13/block13.scn @@ -0,0 +1,11 @@ +*** TEST BLOCK 13 *** +0 2 3 4 5 6 7 8 +reset +8 +reset +7 +reset +6 7 +reset +5 6 8 +*** END OF TEST BLOCK 13 *** diff --git a/testsuites/libtests/block13/init.c b/testsuites/libtests/block13/init.c new file mode 100644 index 0000000000..43ce38860e --- /dev/null +++ b/testsuites/libtests/block13/init.c @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2012 embedded brains GmbH. All rights reserved. + * + * embedded brains GmbH + * Obere Lagerstr. 30 + * 82178 Puchheim + * Germany + * <rtems@embedded-brains.de> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "tmacros.h" + +#include <errno.h> +#include <string.h> + +#include <rtems/blkdev.h> +#include <rtems/bdbuf.h> + +#define BLOCK_COUNT 9 +#define READ_COUNT 19 + +static int block_access_counts [BLOCK_COUNT]; + +#define RESET_CACHE (-1) + +static const int action_sequence [READ_COUNT] = { + 0, 2, 3, 4, 5, 6, 7, 8, + RESET_CACHE, + 8, + RESET_CACHE, + 7, + RESET_CACHE, + 6, 7, + RESET_CACHE, + 5, 6, 8 +}; + +#define UNUSED_LINE { 0, 0, 0, 0, 0, 0, 0, 0, 0 } + +static int expected_block_access_counts [READ_COUNT] [BLOCK_COUNT] = { + { 1, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 1, 0, 0, 0, 0, 0, 0 }, + { 1, 0, 1, 1, 1, 1, 0, 0, 0 }, + { 1, 0, 1, 1, 1, 1, 0, 0, 0 }, + { 1, 0, 1, 1, 1, 1, 1, 1, 0 }, + { 1, 0, 1, 1, 1, 1, 1, 1, 0 }, + { 1, 0, 1, 1, 1, 1, 1, 1, 1 }, + { 1, 0, 1, 1, 1, 1, 1, 1, 1 }, + UNUSED_LINE, + { 0, 0, 0, 0, 0, 0, 0, 0, 1 }, + UNUSED_LINE, + { 0, 0, 0, 0, 0, 0, 0, 1, 0 }, + UNUSED_LINE, + { 0, 0, 0, 0, 0, 0, 1, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 1, 1 }, + UNUSED_LINE, + { 0, 0, 0, 0, 0, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 1, 1, 1, 1 }, + { 0, 0, 0, 0, 0, 1, 1, 1, 1 } +}; + +#define NO_TRIGGER RTEMS_DISK_READ_AHEAD_NO_TRIGGER + +#define TRIGGER_AFTER_RESET RTEMS_DISK_READ_AHEAD_NO_TRIGGER + +static const rtems_blkdev_bnum trigger [READ_COUNT] = { + 1, 3, 5, 5, 7, 7, NO_TRIGGER, NO_TRIGGER, + TRIGGER_AFTER_RESET, + 9, + TRIGGER_AFTER_RESET, + 8, + TRIGGER_AFTER_RESET, + 7, NO_TRIGGER, + TRIGGER_AFTER_RESET, + 6, 8, NO_TRIGGER +}; + +#define NOT_CHANGED_BY_RESET(i) (i) + +static const rtems_blkdev_bnum next [READ_COUNT] = { + 2, 4, 6, 6, 8, 8, 8, 8, + NOT_CHANGED_BY_RESET(8), + 10, + NOT_CHANGED_BY_RESET(10), + 9, + NOT_CHANGED_BY_RESET(9), + 8, 8, + NOT_CHANGED_BY_RESET(8), + 7, 9, 9 +}; + +static int test_disk_ioctl(rtems_disk_device *dd, uint32_t req, void *arg) +{ + int rv = 0; + + if (req == RTEMS_BLKIO_REQUEST) { + rtems_blkdev_request *breq = arg; + rtems_blkdev_sg_buffer *sg = breq->bufs; + uint32_t i; + + rtems_test_assert(breq->req == RTEMS_BLKDEV_REQ_READ); + + for (i = 0; i < breq->bufnum; ++i) { + rtems_blkdev_bnum block = sg [i].block; + + rtems_test_assert(block < BLOCK_COUNT); + + ++block_access_counts [block]; + } + + (*breq->req_done)(breq->done_arg, RTEMS_SUCCESSFUL); + } else { + errno = EINVAL; + rv = -1; + } + + return rv; +} + +static void test_read_ahead(rtems_disk_device *dd) +{ + int i; + + for (i = 0; i < READ_COUNT; ++i) { + int action = action_sequence [i]; + + if (action != RESET_CACHE) { + rtems_blkdev_bnum block = (rtems_blkdev_bnum) action; + rtems_status_code sc; + rtems_bdbuf_buffer *bd; + + printf("%i ", action); + + sc = rtems_bdbuf_read(dd, block, &bd); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_bdbuf_release(bd); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + rtems_test_assert( + memcmp( + block_access_counts, + expected_block_access_counts [i], + sizeof(block_access_counts) + ) == 0 + ); + } else { + printf("\nreset\n"); + + rtems_bdbuf_purge_dev(dd); + memset(&block_access_counts, 0, sizeof(block_access_counts)); + } + + rtems_test_assert(trigger [i] == dd->read_ahead.trigger); + rtems_test_assert(next [i] == dd->read_ahead.next); + } + + printf("\n"); +} + +static void test(void) +{ + rtems_status_code sc; + dev_t dev = 0; + rtems_disk_device *dd; + + sc = rtems_disk_io_initialize(); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_disk_create_phys( + dev, + 1, + BLOCK_COUNT, + test_disk_ioctl, + NULL, + NULL + ); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + dd = rtems_disk_obtain(dev); + rtems_test_assert(dd != NULL); + + test_read_ahead(dd); + + sc = rtems_disk_release(dd); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_disk_delete(dev); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); +} + +static void Init(rtems_task_argument arg) +{ + puts("\n\n*** TEST BLOCK 13 ***"); + + test(); + + puts("*** END OF TEST BLOCK 13 ***"); + + rtems_test_exit(0); +} + +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK + +#define CONFIGURE_BDBUF_BUFFER_MIN_SIZE 1 +#define CONFIGURE_BDBUF_BUFFER_MAX_SIZE 1 +#define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE BLOCK_COUNT +#define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS 2 +#define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY 1 + +#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#define CONFIGURE_RTEMS_INIT_TASKS_TABLE + +#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES +#define CONFIGURE_INIT_TASK_PRIORITY 2 + +#define CONFIGURE_INIT + +#include <rtems/confdefs.h> diff --git a/testsuites/libtests/configure.ac b/testsuites/libtests/configure.ac index f6af3b11cd..7df0520f87 100644 --- a/testsuites/libtests/configure.ac +++ b/testsuites/libtests/configure.ac @@ -41,6 +41,7 @@ AM_CONDITIONAL(NETTESTS,test "$rtems_cv_RTEMS_NETWORKING" = "yes") # Explicitly list all Makefiles here AC_CONFIG_FILES([Makefile +block13/Makefile rbheap01/Makefile syscall01/Makefile flashdisk01/Makefile diff --git a/testsuites/libtests/cpuuse/tswitch.c b/testsuites/libtests/cpuuse/tswitch.c index 5635014d28..6933f89ae6 100644 --- a/testsuites/libtests/cpuuse/tswitch.c +++ b/testsuites/libtests/cpuuse/tswitch.c @@ -29,7 +29,7 @@ */ struct taskSwitchLog taskSwitchLog[25]; int taskSwitchLogIndex; -volatile int testsFinished;; +volatile int testsFinished; void Task_switch( rtems_tcb *unused, diff --git a/testsuites/libtests/flashdisk01/init.c b/testsuites/libtests/flashdisk01/init.c index 5ca6614e0c..3c6ffae1af 100644 --- a/testsuites/libtests/flashdisk01/init.c +++ b/testsuites/libtests/flashdisk01/init.c @@ -227,7 +227,7 @@ static int flashdisk_blank( { int eno = 0; const uint8_t *current = get_data_pointer(sd, segment, offset); - const uint8_t *end = current + size;; + const uint8_t *end = current + size; while (eno == 0 && current != end) { if (*current != 0xff) { diff --git a/testsuites/libtests/termios04/termios_testdriver_intr.c b/testsuites/libtests/termios04/termios_testdriver_intr.c index 086bbb3a12..72a5f9e296 100644 --- a/testsuites/libtests/termios04/termios_testdriver_intr.c +++ b/testsuites/libtests/termios04/termios_testdriver_intr.c @@ -189,11 +189,11 @@ rtems_device_driver termios_test_driver_initialize( status = rtems_timer_create(rtems_build_name('T', 'M', 'R', 'X'), &Rx_Timer); if ( status ) - rtems_fatal_error_occurred(1);; + rtems_fatal_error_occurred(1); status = rtems_timer_create(rtems_build_name('T', 'M', 'T', 'X'), &Tx_Timer); if ( status ) - rtems_fatal_error_occurred(1);; + rtems_fatal_error_occurred(1); return RTEMS_SUCCESSFUL; } diff --git a/testsuites/psxtests/psxmsgq01/init.c b/testsuites/psxtests/psxmsgq01/init.c index 2591912127..00e5f29577 100644 --- a/testsuites/psxtests/psxmsgq01/init.c +++ b/testsuites/psxtests/psxmsgq01/init.c @@ -48,8 +48,7 @@ void verify_timed_receive(void); void wait_for_signal(sigset_t *waitset, int sec, int expect_signal); void verify_notify(void); void verify_with_threads(void); -void verify_timedout_mq_timedreceive( - char *task_name, int que, int is_blocking);; +void verify_timedout_mq_timedreceive(char *task_name, int que, int is_blocking); void verify_timedout_mq_timedsend(int que, int is_blocking); void verify_timed_receive(void); void validate_mq_setattr(void); diff --git a/testsuites/samples/base_mp/init.c b/testsuites/samples/base_mp/init.c index 24c6206f73..e2a9b84002 100644 --- a/testsuites/samples/base_mp/init.c +++ b/testsuites/samples/base_mp/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the application, the current time might be - * set by this task. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/** + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -26,6 +15,9 @@ #include "system.h" #include <stdio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/samples/base_sp/init.c b/testsuites/samples/base_sp/init.c index a8ac53921d..8ad2eedecf 100644 --- a/testsuites/samples/base_sp/init.c +++ b/testsuites/samples/base_sp/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the application, the current time might be - * set by this task. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2011. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -27,6 +16,9 @@ #include "tmacros.h" #include <stdio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define ARGUMENT 0 rtems_task Init( diff --git a/testsuites/samples/capture/init.c b/testsuites/samples/capture/init.c index 28eeb57934..67f87dd9d0 100644 --- a/testsuites/samples/capture/init.c +++ b/testsuites/samples/capture/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1997. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may in @@ -33,6 +22,12 @@ #include <rtems/monitor.h> #include <rtems/shell.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +#if !BSP_SMALL_MEMORY + static void notification(int fd, int seconds_remaining, void *arg); +#endif + volatile int can_proceed = 1; #if !BSP_SMALL_MEMORY diff --git a/testsuites/samples/cdtest/init.c b/testsuites/samples/cdtest/init.c index 3c1cf538e1..280de0cfbc 100644 --- a/testsuites/samples/cdtest/init.c +++ b/testsuites/samples/cdtest/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c index 92139e4569..75d16a4909 100644 --- a/testsuites/samples/fileio/init.c +++ b/testsuites/samples/fileio/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2011. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/samples/hello/init.c b/testsuites/samples/hello/init.c index 01b14b8111..8a44a88991 100644 --- a/testsuites/samples/hello/init.c +++ b/testsuites/samples/hello/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -27,6 +16,9 @@ #include <stdio.h> #include <stdlib.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/samples/loopback/init.c b/testsuites/samples/loopback/init.c index 0feccf573a..398dbe7f5c 100644 --- a/testsuites/samples/loopback/init.c +++ b/testsuites/samples/loopback/init.c @@ -1,3 +1,9 @@ +/* + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/testsuites/samples/minimum/init.c b/testsuites/samples/minimum/init.c index 584bd5b4ea..77cef53348 100644 --- a/testsuites/samples/minimum/init.c +++ b/testsuites/samples/minimum/init.c @@ -1,6 +1,11 @@ -/* Minimum Size Application Initialization +/** + * @file * - * COPYRIGHT (c) 1989-2008. + * Minimum Size Application Initialization + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +22,9 @@ #include <bsp.h> #include <rtems/score/thread.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/samples/nsecs/init.c b/testsuites/samples/nsecs/init.c index 3142bffe23..f94c672d0c 100644 --- a/testsuites/samples/nsecs/init.c +++ b/testsuites/samples/nsecs/init.c @@ -1,8 +1,11 @@ -/* +/** + * @file + * * Nanoseconds accuracy timestamp test */ -/* COPYRIGHT (c) 1989-2011. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/samples/paranoia/init.c b/testsuites/samples/paranoia/init.c index 9feb3d4526..bd23c33c0e 100644 --- a/testsuites/samples/paranoia/init.c +++ b/testsuites/samples/paranoia/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/samples/paranoia/paranoia.c b/testsuites/samples/paranoia/paranoia.c index 2620ca7226..400063167a 100644 --- a/testsuites/samples/paranoia/paranoia.c +++ b/testsuites/samples/paranoia/paranoia.c @@ -1471,7 +1471,7 @@ or 1/3 and 3/9 and 9/27 may disagree"); if ((CInvrse * Q) != ((CInvrse * Y) * S)) { UfThold = Y; BadCond (Failure, "Either accuracy deteriorates as numbers\n"); - printf ("approach a threshold = %.17e\n", UfThold);; + printf ("approach a threshold = %.17e\n", UfThold); printf (" coming down from %.17e\n", C); printf (" or else multiplication gets too many last digits wrong.\n"); } @@ -1526,7 +1526,7 @@ or 1/3 and 3/9 and 9/27 may disagree"); printf ("yet X - Z yields %.17e .\n", Z9); printf (" Should this NOT signal Underflow, "); printf ("this is a SERIOUS DEFECT\nthat causes "); - printf ("confusion when innocent statements like\n");; + printf ("confusion when innocent statements like\n"); printf (" if (X == Z) ... else"); printf (" ... (f(X) - f(Z)) / (X - Z) ...\n"); printf ("encounter Division by Zero although actually\n"); diff --git a/testsuites/samples/pppd/init.c b/testsuites/samples/pppd/init.c index a11f07b0e2..4519ad64aa 100644 --- a/testsuites/samples/pppd/init.c +++ b/testsuites/samples/pppd/init.c @@ -1,8 +1,16 @@ +/* + * COPYRIGHT (c) 1989-2012. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif - #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/testsuites/samples/ticker/init.c b/testsuites/samples/ticker/init.c index ca3442ea5e..d9366f8fa0 100644 --- a/testsuites/samples/ticker/init.c +++ b/testsuites/samples/ticker/init.c @@ -1,16 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2011. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be diff --git a/testsuites/samples/unlimited/init.c b/testsuites/samples/unlimited/init.c index 29446b6650..a4eb1676bc 100644 --- a/testsuites/samples/unlimited/init.c +++ b/testsuites/samples/unlimited/init.c @@ -1,20 +1,9 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is called from init_exec and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1997. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ diff --git a/testsuites/sptests/sp08/init.c b/testsuites/sptests/sp08/init.c index e4206b081d..48ec913f68 100644 --- a/testsuites/sptests/sp08/init.c +++ b/testsuites/sptests/sp08/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define PRIxModes_Control PRIx32 #define PRIxrtems_mode PRIxModes_Control diff --git a/testsuites/sptests/sp10/init.c b/testsuites/sptests/sp10/init.c index e71e66618b..547fd1fd4d 100644 --- a/testsuites/sptests/sp10/init.c +++ b/testsuites/sptests/sp10/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp18/init.c b/testsuites/sptests/sp18/init.c index eb84ecfd36..dc3f9f0c14 100644 --- a/testsuites/sptests/sp18/init.c +++ b/testsuites/sptests/sp18/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp2038/init.c b/testsuites/sptests/sp2038/init.c index 897aaf6da9..e0179e99a3 100644 --- a/testsuites/sptests/sp2038/init.c +++ b/testsuites/sptests/sp2038/init.c @@ -23,6 +23,9 @@ #include <rtems.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define TEST_APPLICABLE \ (CPU_TIMESTAMP_USE_INT64 == TRUE || CPU_TIMESTAMP_USE_INT64_INLINE == TRUE) diff --git a/testsuites/sptests/sp21/init.c b/testsuites/sptests/sp21/init.c index fefbfbc22c..84daaaddb5 100644 --- a/testsuites/sptests/sp21/init.c +++ b/testsuites/sptests/sp21/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,12 @@ #include <rtems/devzero.h> #include <rtems/libio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void do_test_io_manager(void); +void do_test_io_lookup_name(void); +void do_test_zero_driver(void); + #define PRIurtems_device_major_number PRIu32 #define STUB_DRIVER_MAJOR 0x2 diff --git a/testsuites/sptests/sp27/init.c b/testsuites/sptests/sp27/init.c index ffd202743e..9935f31e85 100644 --- a/testsuites/sptests/sp27/init.c +++ b/testsuites/sptests/sp27/init.c @@ -1,7 +1,7 @@ /* * Test for rtems_semaphore_flush * - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,12 +16,15 @@ #include <bsp.h> #include <tmacros.h> -void starttask(int arg); -rtems_task subtask(rtems_task_argument arg); - #include <stdio.h> #include <stdlib.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void starttask(int arg); +rtems_task subtask(rtems_task_argument arg); +void doTest(void); + #define NTASK 4 #if defined(USE_COUNTING_SEMAPHORE) diff --git a/testsuites/sptests/sp28/init.c b/testsuites/sptests/sp28/init.c index 5a564f9a53..bc24f35af4 100644 --- a/testsuites/sptests/sp28/init.c +++ b/testsuites/sptests/sp28/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,8 @@ #include <rtems/error.h> #include <stdio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); rtems_task subtask(rtems_task_argument arg); rtems_task Task_variable_deleter(rtems_task_argument ignored); void starttask(int arg); diff --git a/testsuites/sptests/sp32/init.c b/testsuites/sptests/sp32/init.c index 5a301c06d8..43f9f1ddf8 100644 --- a/testsuites/sptests/sp32/init.c +++ b/testsuites/sptests/sp32/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> /* includes bsp.h, stdio, etc... */ +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) { diff --git a/testsuites/sptests/sp40/init.c b/testsuites/sptests/sp40/init.c index 2f88d9c344..c16fd585e5 100644 --- a/testsuites/sptests/sp40/init.c +++ b/testsuites/sptests/sp40/init.c @@ -1,7 +1,7 @@ /* * IO Manager Dynamic Registration * - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * Copyright (c) 2009 embedded brains GmbH. @@ -19,6 +19,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + static rtems_device_driver test_open( rtems_device_major_number minor, rtems_device_minor_number major, diff --git a/testsuites/sptests/sp41/init.c b/testsuites/sptests/sp41/init.c index 3c4c0b1803..cadf7d58b6 100644 --- a/testsuites/sptests/sp41/init.c +++ b/testsuites/sptests/sp41/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,10 @@ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void iterator(Thread_Control *thread); + void iterator( Thread_Control *thread ) diff --git a/testsuites/sptests/sp49/init.c b/testsuites/sptests/sp49/init.c index d897eadabb..e07458c2aa 100644 --- a/testsuites/sptests/sp49/init.c +++ b/testsuites/sptests/sp49/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init(rtems_task_argument ignored) { rtems_status_code sc; diff --git a/testsuites/sptests/sp50/init.c b/testsuites/sptests/sp50/init.c index f19aa25f70..61f863277b 100644 --- a/testsuites/sptests/sp50/init.c +++ b/testsuites/sptests/sp50/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,10 +14,14 @@ #include <tmacros.h> #include "pritime.h" +/* forward declarations to avoid warnings */ +rtems_timer_service_routine Timer_Routine(rtems_id id, void *ignored); +rtems_task Init(rtems_task_argument argument); + volatile int Fired; volatile bool timerRan; -rtems_timer_service_routine Timer_Routine( rtems_id id, void *ignored ) +rtems_timer_service_routine Timer_Routine(rtems_id id, void *ignored) { rtems_status_code status; diff --git a/testsuites/sptests/sp51/init.c b/testsuites/sptests/sp51/init.c index 697e095f96..abc93cc4c3 100644 --- a/testsuites/sptests/sp51/init.c +++ b/testsuites/sptests/sp51/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sp52/init.c b/testsuites/sptests/sp52/init.c index 71a280f38d..b95fdce981 100644 --- a/testsuites/sptests/sp52/init.c +++ b/testsuites/sptests/sp52/init.c @@ -27,6 +27,13 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine TIMER_service_routine( + rtems_id ignored_id, + void *user_data +); + #define INITIAL_SECOND 10 volatile bool _timer_passage = FALSE; diff --git a/testsuites/sptests/sp54/init.c b/testsuites/sptests/sp54/init.c index ecf66a2f5d..8183fa7712 100644 --- a/testsuites/sptests/sp54/init.c +++ b/testsuites/sptests/sp54/init.c @@ -1,7 +1,12 @@ -/* Odd Id Cases where API configured but No Threads - * + Possibly Valid Id passed to directive +/** + * @@file * - * COPYRIGHT (c) 1989-2011. + * Odd Id Cases where API configured but No Threads + * + Possibly Valid Id passed to directive + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +20,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp55/init.c b/testsuites/sptests/sp55/init.c index 9ad14f2c02..5ba31e04b4 100644 --- a/testsuites/sptests/sp55/init.c +++ b/testsuites/sptests/sp55/init.c @@ -1,6 +1,11 @@ -/* Broadcast to a message queue with pending messages +/** + * @file * - * COPYRIGHT (c) 1989-2009. + * Broadcast to a message queue with pending messages + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +19,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp56/init.c b/testsuites/sptests/sp56/init.c index 4af621748c..d41d96a88e 100644 --- a/testsuites/sptests/sp56/init.c +++ b/testsuites/sptests/sp56/init.c @@ -1,6 +1,11 @@ -/* Extension create fails +/** + * @file * - * COPYRIGHT (c) 1989-2009. + * Extension create fails + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +19,10 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +bool task_create(Thread_Control *executing, Thread_Control *created); + bool task_create( Thread_Control *executing, Thread_Control *created diff --git a/testsuites/sptests/sp57/init.c b/testsuites/sptests/sp57/init.c index a616d02b37..c7827d8e2c 100644 --- a/testsuites/sptests/sp57/init.c +++ b/testsuites/sptests/sp57/init.c @@ -1,6 +1,11 @@ -/* Restart a task which is delaying +/* + * @file * - * COPYRIGHT (c) 1989-2011. + * Restart a task which is delaying + */ + +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +19,10 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Delay_task(rtems_task_argument ignored); + rtems_task Delay_task( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp58/init.c b/testsuites/sptests/sp58/init.c index a16472baab..3d16b60d6b 100644 --- a/testsuites/sptests/sp58/init.c +++ b/testsuites/sptests/sp58/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,11 @@ #include <rtems/score/timespec.h> #include <rtems/score/threadq.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void timespec_divide_by_zero(void); +void timespec_greater_than_lhs_sec_less(void); + void timespec_divide_by_zero(void) { struct timespec t1; diff --git a/testsuites/sptests/sp59/init.c b/testsuites/sptests/sp59/init.c index 966eaa0a2c..d03c83630d 100644 --- a/testsuites/sptests/sp59/init.c +++ b/testsuites/sptests/sp59/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,10 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Blocking_task(rtems_task_argument ignored); + #define ALLOC_SIZE 400 uint8_t Region_Memory[512] CPU_STRUCTURE_ALIGNMENT; rtems_id Region; diff --git a/testsuites/sptests/sp60/init.c b/testsuites/sptests/sp60/init.c index c823350ee8..9762e9cc7e 100644 --- a/testsuites/sptests/sp60/init.c +++ b/testsuites/sptests/sp60/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp62/init.c b/testsuites/sptests/sp62/init.c index 1f2033bb60..592458679f 100644 --- a/testsuites/sptests/sp62/init.c +++ b/testsuites/sptests/sp62/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,10 @@ #include <tmacros.h> #include <unistd.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Blocker(rtems_task_argument ignored); + rtems_id Region; uint32_t Region_Memory[256] CPU_STRUCTURE_ALIGNMENT; volatile bool case_hit; diff --git a/testsuites/sptests/sp63/init.c b/testsuites/sptests/sp63/init.c index fcbde5c2bb..040f510d75 100644 --- a/testsuites/sptests/sp63/init.c +++ b/testsuites/sptests/sp63/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,12 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void test_case_one(void); +void test_case_two(void); +void test_case_three(void); + #define MAX 256 uint32_t Memory[MAX]; Heap_Control Heap; diff --git a/testsuites/sptests/sp64/init.c b/testsuites/sptests/sp64/init.c index fa3e3a8edc..42b9c4581d 100644 --- a/testsuites/sptests/sp64/init.c +++ b/testsuites/sptests/sp64/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + uint32_t Area1[50] CPU_STRUCTURE_ALIGNMENT; uint32_t Area2[50] CPU_STRUCTURE_ALIGNMENT; diff --git a/testsuites/sptests/sp65/init.c b/testsuites/sptests/sp65/init.c index d633f5cf3d..046ceb620e 100644 --- a/testsuites/sptests/sp65/init.c +++ b/testsuites/sptests/sp65/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,10 @@ #include <tmacros.h> #include <unistd.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Task_1(rtems_task_argument arg); + #if defined(INHERIT_CEILING) #define TEST_NAME "66" #define TASK_PRIORITY 2 @@ -22,10 +26,6 @@ #define TASK_PRIORITY 1 #endif -rtems_task Task_1( - rtems_task_argument arg -); - rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sp67/init.c b/testsuites/sptests/sp67/init.c index 6a8fdea341..60f6c7bc39 100644 --- a/testsuites/sptests/sp67/init.c +++ b/testsuites/sptests/sp67/init.c @@ -16,6 +16,13 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine TIMER_service_routine( + rtems_id ignored_id, + void *user_data +); + /* * We have to extern this rather than use __RTEMS_VIOLATE_KERNEL_VISIBILITY__ * because this variable isn't actually in any .h. diff --git a/testsuites/sptests/sp68/init.c b/testsuites/sptests/sp68/init.c index b212402134..03401293db 100644 --- a/testsuites/sptests/sp68/init.c +++ b/testsuites/sptests/sp68/init.c @@ -25,6 +25,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define TIMER_COUNT 6 #define OBTAIN 0 diff --git a/testsuites/sptests/sp69/init.c b/testsuites/sptests/sp69/init.c index 5e1cc43c3a..a886929457 100644 --- a/testsuites/sptests/sp69/init.c +++ b/testsuites/sptests/sp69/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include <tmacros.h> #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sp70/init.c b/testsuites/sptests/sp70/init.c index 67980ea1fa..2d774b18a9 100644 --- a/testsuites/sptests/sp70/init.c +++ b/testsuites/sptests/sp70/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,11 @@ #include <tmacros.h> #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void create_helper(int task); +void delete_helper(int task); + rtems_id TaskID[10]; void create_helper(int task) @@ -32,7 +37,7 @@ void create_helper(int task) directive_failed( status, "rtems_task_create" ); } -void delete_helper( int task ) +void delete_helper(int task) { rtems_status_code status; diff --git a/testsuites/sptests/sp71/init.c b/testsuites/sptests/sp71/init.c index b330e89ffb..10c339ead7 100644 --- a/testsuites/sptests/sp71/init.c +++ b/testsuites/sptests/sp71/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,9 @@ #define PER_ALLOCATION 8000 +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sp72/init.c b/testsuites/sptests/sp72/init.c index d2e0f5557c..492aa5d03b 100644 --- a/testsuites/sptests/sp72/init.c +++ b/testsuites/sptests/sp72/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,10 @@ #include <tmacros.h> #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument argument); + rtems_id Semaphore_id; rtems_task Test_task( diff --git a/testsuites/sptests/sp73/init.c b/testsuites/sptests/sp73/init.c index 39fbe73371..3b5aba3e44 100644 --- a/testsuites/sptests/sp73/init.c +++ b/testsuites/sptests/sp73/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,10 @@ #include <inttypes.h> #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument argument); + rtems_id Task_id[ 4 ]; /* array of task ids */ rtems_name Task_name[ 4 ]; /* array of task names */ diff --git a/testsuites/sptests/sp74/init.c b/testsuites/sptests/sp74/init.c index 7661932be6..a6720dc7ac 100644 --- a/testsuites/sptests/sp74/init.c +++ b/testsuites/sptests/sp74/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument argument); rtems_task Test_task( rtems_task_argument index diff --git a/testsuites/sptests/sp75/init.c b/testsuites/sptests/sp75/init.c index 4b4a0b67ef..95ba2e0833 100644 --- a/testsuites/sptests/sp75/init.c +++ b/testsuites/sptests/sp75/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include <tmacros.h> #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sp76/init.c b/testsuites/sptests/sp76/init.c index 53788f89ed..e9c5304560 100644 --- a/testsuites/sptests/sp76/init.c +++ b/testsuites/sptests/sp76/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,10 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument index); + rtems_task Test_task( rtems_task_argument index ) diff --git a/testsuites/sptests/spassoc01/init.c b/testsuites/sptests/spassoc01/init.c index c61bbc8235..4a5f80c441 100644 --- a/testsuites/sptests/spassoc01/init.c +++ b/testsuites/sptests/spassoc01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -17,6 +17,9 @@ #include <stdio.h> #include <rtems/assoc.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + const rtems_assoc_t assoc_table_null[] = { { NULL , 0 , 0 }, diff --git a/testsuites/sptests/spcbssched03/tasks_periodic.c b/testsuites/sptests/spcbssched03/tasks_periodic.c index 684ecc8515..74d879d073 100644 --- a/testsuites/sptests/spcbssched03/tasks_periodic.c +++ b/testsuites/sptests/spcbssched03/tasks_periodic.c @@ -19,7 +19,10 @@ #include "system.h" -void overrun_handler_task_4 ( +/* forward declarations to avoid warnings */ +void overrun_handler_task_4(rtems_cbs_server_id server_id); + +void overrun_handler_task_4( rtems_cbs_server_id server_id ) { diff --git a/testsuites/sptests/spchain/init.c b/testsuites/sptests/spchain/init.c index 129d5a47c0..00e2d778b6 100644 --- a/testsuites/sptests/spchain/init.c +++ b/testsuites/sptests/spchain/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,9 @@ #include <tmacros.h> #include <rtems/chain.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define EVENT RTEMS_EVENT_13 #define TIMEOUT 1 diff --git a/testsuites/sptests/spclockget/init.c b/testsuites/sptests/spclockget/init.c index d828f1d6af..9776a6e4d7 100644 --- a/testsuites/sptests/spclockget/init.c +++ b/testsuites/sptests/spclockget/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,9 @@ #include <tmacros.h> #include "pritime.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/spcoverage/init.c b/testsuites/sptests/spcoverage/init.c index 850604028d..2ac51f10f7 100644 --- a/testsuites/sptests/spcoverage/init.c +++ b/testsuites/sptests/spcoverage/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,9 @@ #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/sperror01/init.c b/testsuites/sptests/sperror01/init.c index 3b6195f020..36e16b11fc 100644 --- a/testsuites/sptests/sperror01/init.c +++ b/testsuites/sptests/sperror01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,9 @@ #include "rtems/error.h" #include <errno.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sperror02/init.c b/testsuites/sptests/sperror02/init.c index c05856686d..02f9e79f44 100644 --- a/testsuites/sptests/sperror02/init.c +++ b/testsuites/sptests/sperror02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -16,6 +16,9 @@ #include <errno.h> #include <rtems/error.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/sperror03/init.c b/testsuites/sptests/sperror03/init.c index 373f76b35a..0b7533707c 100644 --- a/testsuites/sptests/sperror03/init.c +++ b/testsuites/sptests/sperror03/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,9 @@ #include <tmacros.h> #include "test_support.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/spfatal21/testcase.h b/testsuites/sptests/spfatal21/testcase.h index 80f7fca618..788f06be5e 100644 --- a/testsuites/sptests/spfatal21/testcase.h +++ b/testsuites/sptests/spfatal21/testcase.h @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,7 @@ #include <rtems/libcsupport.h> #include <rtems/malloc.h> +#include <unistd.h> /* Safe information on real heap */ extern rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers; diff --git a/testsuites/sptests/spfatal_support/consume_sems.c b/testsuites/sptests/spfatal_support/consume_sems.c index 5024eb666e..adb1901046 100644 --- a/testsuites/sptests/spfatal_support/consume_sems.c +++ b/testsuites/sptests/spfatal_support/consume_sems.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -13,6 +13,13 @@ #include <rtems.h> +/* forward declarations to avoid warnings */ +rtems_device_driver consume_semaphores_initialize( + rtems_device_major_number major __attribute__((unused)), + rtems_device_minor_number minor __attribute__((unused)), + void *pargp __attribute__((unused)) +); + #define MAXIMUM 20 rtems_id Semaphores[MAXIMUM]; diff --git a/testsuites/sptests/spfifo01/init.c b/testsuites/sptests/spfifo01/init.c index e0aa442801..e01204ede1 100644 --- a/testsuites/sptests/spfifo01/init.c +++ b/testsuites/sptests/spfifo01/init.c @@ -19,6 +19,9 @@ #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define FIFO_PATH "/fifo01" static void test_main(void) diff --git a/testsuites/sptests/spfifo02/init.c b/testsuites/sptests/spfifo02/init.c index 985f1bb52d..33c1a7910c 100644 --- a/testsuites/sptests/spfifo02/init.c +++ b/testsuites/sptests/spfifo02/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -21,6 +21,15 @@ #include <errno.h> #include <rtems/libcsupport.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void create_all_barriers(void); +void create_all_semaphores(void); +void delete_barrier(void); +void delete_semaphore(void); +void create_fifo(void); +void open_fifo(int expected, int flags); + #define MAXIMUM 10 #define NUM_OPEN_REQ 26 diff --git a/testsuites/sptests/spfifo03/init.c b/testsuites/sptests/spfifo03/init.c index 2c3fb1ac26..143bed8d97 100644 --- a/testsuites/sptests/spfifo03/init.c +++ b/testsuites/sptests/spfifo03/init.c @@ -1,15 +1,5 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility - * of invoking the test routine - * - * Input parameters: - * not_used - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. +/* + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -33,6 +23,11 @@ #include <rtems.h> #include <rtems/libio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task read_task(rtems_task_argument not_used); +void test_main(void); + #define SEND_RCV_BUFSIZ 12 rtems_id Barrier; @@ -91,8 +86,7 @@ rtems_task read_task(rtems_task_argument not_used) rtems_task_delete( RTEMS_SELF ); } - -void test_main(void) //Also acts as the write task +void test_main(void) /* Also acts as the write task */ { rtems_id readTaskID; diff --git a/testsuites/sptests/spfifo04/init.c b/testsuites/sptests/spfifo04/init.c index d20778cf33..e8f11c860d 100644 --- a/testsuites/sptests/spfifo04/init.c +++ b/testsuites/sptests/spfifo04/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -23,6 +23,9 @@ #include <rtems.h> #include <rtems/libio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define SEND_RCV_BUFSIZ 12 rtems_task Init( diff --git a/testsuites/sptests/spfifo05/init.c b/testsuites/sptests/spfifo05/init.c index 81ca4a474f..b9048de316 100644 --- a/testsuites/sptests/spfifo05/init.c +++ b/testsuites/sptests/spfifo05/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2010. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -24,6 +24,10 @@ #include <rtems.h> #include <rtems/libio.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task read_task(rtems_task_argument not_used); + #define SEND_RCV_BUFSIZ (PIPE_BUF+20) rtems_id rBarrier; @@ -32,7 +36,7 @@ rtems_id wBarrier; char recvBuf[SEND_RCV_BUFSIZ] = {0}; char sendBuf[SEND_RCV_BUFSIZ] = {0}; -rtems_task read_task( rtems_task_argument not_used ) +rtems_task read_task(rtems_task_argument not_used) { int fd = 0; int status = -1; @@ -117,8 +121,6 @@ rtems_task read_task( rtems_task_argument not_used ) rtems_task_delete( RTEMS_SELF ); } - - rtems_task Init( rtems_task_argument not_used ) diff --git a/testsuites/sptests/spintrcritical01/init.c b/testsuites/sptests/spintrcritical01/init.c index 6276c9bc81..7859a14a0e 100644 --- a/testsuites/sptests/spintrcritical01/init.c +++ b/testsuites/sptests/spintrcritical01/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2011. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,11 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +Thread_blocking_operation_States getState(void); + #if defined(FIFO_NO_TIMEOUT) #define TEST_NAME "01" #define TEST_STRING "FIFO/Without Timeout" diff --git a/testsuites/sptests/spintrcritical06/init.c b/testsuites/sptests/spintrcritical06/init.c index 408d9d95f6..d1cbe4da8b 100644 --- a/testsuites/sptests/spintrcritical06/init.c +++ b/testsuites/sptests/spintrcritical06/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,11 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +rtems_task Secondary_task(rtems_task_argument arg); + /* common parameters */ #define SEMAPHORE_ATTRIBUTES RTEMS_PRIORITY diff --git a/testsuites/sptests/spintrcritical08/init.c b/testsuites/sptests/spintrcritical08/init.c index a0be34ec3b..534cd06e1c 100644 --- a/testsuites/sptests/spintrcritical08/init.c +++ b/testsuites/sptests/spintrcritical08/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,11 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +rtems_rate_monotonic_period_states getState(void); + rtems_id Main_task; rtems_id Period; volatile bool case_hit; diff --git a/testsuites/sptests/spintrcritical09/init.c b/testsuites/sptests/spintrcritical09/init.c index 28d31fd9f8..c953799f0a 100644 --- a/testsuites/sptests/spintrcritical09/init.c +++ b/testsuites/sptests/spintrcritical09/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,11 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +Thread_blocking_operation_States getState(void); + rtems_id Main_task; rtems_id Semaphore; volatile bool case_hit; diff --git a/testsuites/sptests/spintrcritical10/init.c b/testsuites/sptests/spintrcritical10/init.c index 069d444955..66306cd966 100644 --- a/testsuites/sptests/spintrcritical10/init.c +++ b/testsuites/sptests/spintrcritical10/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -15,6 +15,9 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_id Main_task; rtems_task Init( diff --git a/testsuites/sptests/spintrcritical11/init.c b/testsuites/sptests/spintrcritical11/init.c index 4ade156e89..78226f32b3 100644 --- a/testsuites/sptests/spintrcritical11/init.c +++ b/testsuites/sptests/spintrcritical11/init.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2009. + * COPYRIGHT (c) 1989-2012. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,6 +14,10 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); + rtems_id Main_task; #if defined(EVENT_ANY) diff --git a/testsuites/sptests/spintrcritical13/init.c b/testsuites/sptests/spintrcritical13/init.c index 7cf1bcc3a7..c12b015909 100644 --- a/testsuites/sptests/spintrcritical13/init.c +++ b/testsuites/sptests/spintrcritical13/init.c @@ -26,9 +26,13 @@ #else #error "Test Mode not defined" - #endif +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +rtems_timer_service_routine TimerMethod(rtems_id timer, void *arg); + rtems_id Main_task; rtems_id Timer; diff --git a/testsuites/sptests/spintrcritical15/init.c b/testsuites/sptests/spintrcritical15/init.c index ec535ccbfd..18491def08 100644 --- a/testsuites/sptests/spintrcritical15/init.c +++ b/testsuites/sptests/spintrcritical15/init.c @@ -14,6 +14,10 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Secondary_task(rtems_task_argument ignored); + #define TEST_NAME "15" #define INIT_PRIORITY 2 #define BLOCKER_PRIORITY 1 @@ -29,7 +33,6 @@ rtems_task Secondary_task( rtems_status_code sc; while (1) { - sc = rtems_semaphore_obtain( Semaphore, RTEMS_DEFAULT_OPTIONS, 1 ); fatal_directive_status( sc, RTEMS_TIMEOUT, "rtems_semaphore_obtain" ); } diff --git a/testsuites/sptests/spintrcritical16/init.c b/testsuites/sptests/spintrcritical16/init.c index ab6f3a4f26..396445509d 100644 --- a/testsuites/sptests/spintrcritical16/init.c +++ b/testsuites/sptests/spintrcritical16/init.c @@ -15,6 +15,11 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_timer_service_routine test_release_from_isr(rtems_id timer, void *arg); +Thread_blocking_operation_States getState(void); + #define TEST_NAME "16" Thread_Control *Main_TCB; diff --git a/testsuites/sptests/spintrcritical17/init.c b/testsuites/sptests/spintrcritical17/init.c index bbcfea47b3..91d7b8de2e 100644 --- a/testsuites/sptests/spintrcritical17/init.c +++ b/testsuites/sptests/spintrcritical17/init.c @@ -18,6 +18,9 @@ #include <tmacros.h> #include <intrcritical.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define TIMER_COUNT 4 #define TIMER_TRIGGER 0 diff --git a/testsuites/sptests/spmountmgr01/init.c b/testsuites/sptests/spmountmgr01/init.c index ba0fdbd1ce..01308a58a3 100644 --- a/testsuites/sptests/spmountmgr01/init.c +++ b/testsuites/sptests/spmountmgr01/init.c @@ -17,8 +17,17 @@ #include <rtems/libio_.h> #include <rtems/libcsupport.h> -int fs_mount( rtems_filesystem_mount_table_entry_t *mt_entry, - const void *data ) +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +int fs_mount( + rtems_filesystem_mount_table_entry_t *mt_entry, + const void *data +); + +int fs_mount( + rtems_filesystem_mount_table_entry_t *mt_entry, + const void *data +) { return 0; } @@ -29,7 +38,7 @@ rtems_task Init( { int status = 0; void *alloc_ptr = (void *)0; - + puts( "\n\n*** TEST MOUNT MANAGER ROUTINE - 01 ***" ); puts( "Init - allocating most of heap -- OK" ); @@ -50,25 +59,24 @@ rtems_task Init( puts( "Init - attempt to make target(NULL) and mount - expect EINVAL" ); status = mount_and_make_target_path( - NULL, - NULL, - "fs", - 0, - NULL ); + NULL, + NULL, + "fs", + 0, + NULL ); rtems_test_assert( status == -1 ); rtems_test_assert( errno == EINVAL ); puts( "Init - attempt to make target and mount - expect EINVAL" ); status = mount_and_make_target_path( - NULL, - "/tmp", - "fs", - 2, - NULL ); + NULL, + "/tmp", + "fs", + 2, + NULL ); rtems_test_assert( status == -1 ); rtems_test_assert( errno == EINVAL ); - puts( "Init - register filesystem fs - expect EINVAL" ); status = rtems_filesystem_register( "fs", fs_mount ); rtems_test_assert( status == -1 ); @@ -82,7 +90,7 @@ rtems_task Init( status = rtems_filesystem_register( "bfs", fs_mount ); rtems_test_assert( status == -1 ); rtems_test_assert( errno == EINVAL ); - + puts( "Init - attempt to unregister with bad args - expect EINVAL" ); status = rtems_filesystem_unregister( NULL ); rtems_test_assert( status == -1 ); @@ -91,7 +99,7 @@ rtems_task Init( puts( "Init - attempt to unregister fs -- OK" ); status = rtems_filesystem_unregister( "fs" ); rtems_test_assert( status == 0 ); - + puts( "Init - attempt to unregister fs again - expect ENOENT" ); status = rtems_filesystem_unregister( "fs" ); rtems_test_assert( status == -1 ); @@ -100,7 +108,7 @@ rtems_task Init( puts( "Init - attempt to unregister bfs -- OK" ); status = rtems_filesystem_unregister( "bfs" ); rtems_test_assert( status == 0 ); - + puts( "Init - attempt to unregister bfs again - expect ENOENT" ); status = rtems_filesystem_unregister( "bfs" ); rtems_test_assert( status == -1 ); diff --git a/testsuites/sptests/spnotepad01/init.c b/testsuites/sptests/spnotepad01/init.c index b01b525397..464d4ef9d7 100644 --- a/testsuites/sptests/spnotepad01/init.c +++ b/testsuites/sptests/spnotepad01/init.c @@ -13,6 +13,9 @@ #include "tmacros.h" +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument ignored ) diff --git a/testsuites/sptests/spprintk/init.c b/testsuites/sptests/spprintk/init.c index 7b922f7709..e81212d88b 100644 --- a/testsuites/sptests/spprintk/init.c +++ b/testsuites/sptests/spprintk/init.c @@ -16,6 +16,13 @@ #include <tmacros.h> #include <rtems/bspIo.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +int test_getchar(void); +void do_getchark(void); +void do_putk(void); +void do_printk(void); + int test_getchar(void) { return 0x35; diff --git a/testsuites/sptests/spprivenv01/init.c b/testsuites/sptests/spprivenv01/init.c index fb0c1a4f51..609f85cae5 100644 --- a/testsuites/sptests/spprivenv01/init.c +++ b/testsuites/sptests/spprivenv01/init.c @@ -17,7 +17,11 @@ #include <rtems/malloc.h> #include <rtems/libcsupport.h> -rtems_task task_routine( rtems_task_argument not_used ) +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task task_routine(rtems_task_argument not_used); + +rtems_task task_routine(rtems_task_argument not_used) { rtems_status_code sc; @@ -39,8 +43,7 @@ rtems_task Init( rtems_id current_task_id; rtems_id task_id; rtems_name another_task_name; - Heap_Information_block Info; - + puts( "\n\n*** TEST USER ENVIRONMENT ROUTINE - 01 ***" ); puts( "Init - allocating most of heap -- OK" ); diff --git a/testsuites/sptests/sprbtree01/init.c b/testsuites/sptests/sprbtree01/init.c index f94a01030e..defd1bde91 100644 --- a/testsuites/sptests/sprbtree01/init.c +++ b/testsuites/sptests/sprbtree01/init.c @@ -13,6 +13,9 @@ #include <tmacros.h> #include <rtems/rbtree.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + int numbers[20] = { 52, 99, 0, 85, 43, 44, 10, 60, 50, 19, 8, 68, 48, 57, 17, 67, 90, 12, 77, 71}; diff --git a/testsuites/sptests/spsimplesched01/init.c b/testsuites/sptests/spsimplesched01/init.c index 0fd06ab6e2..4e34cb2044 100644 --- a/testsuites/sptests/spsimplesched01/init.c +++ b/testsuites/sptests/spsimplesched01/init.c @@ -13,6 +13,10 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument unused); + /* * Keep the names and IDs in global variables so another task can use them. */ diff --git a/testsuites/sptests/spsimplesched02/init.c b/testsuites/sptests/spsimplesched02/init.c index 9da34bc915..8b053b6917 100644 --- a/testsuites/sptests/spsimplesched02/init.c +++ b/testsuites/sptests/spsimplesched02/init.c @@ -1,4 +1,4 @@ -/* +/* * COPYRIGHT (c) 2011. * On-Line Applications Research Corporation (OAR). * @@ -13,6 +13,11 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +rtems_task Test_task(rtems_task_argument argument); +void ObtainRelease(bool suspendIdle); + /* * Keep the names and IDs in global variables so another task can use them. */ @@ -37,7 +42,7 @@ rtems_task Test_task( } } -void ObtainRelease( bool suspendIdle ) +void ObtainRelease( bool suspendIdle ) { rtems_status_code status; @@ -128,7 +133,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 3 +#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_MAXIMUM_SEMAPHORES 2 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/sptests/spsimplesched03/init.c b/testsuites/sptests/spsimplesched03/init.c index e189bcf7be..ac1991b2e2 100644 --- a/testsuites/sptests/spsimplesched03/init.c +++ b/testsuites/sptests/spsimplesched03/init.c @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + rtems_task Init( rtems_task_argument argument ) diff --git a/testsuites/sptests/spstkalloc/init.c b/testsuites/sptests/spstkalloc/init.c index ea71819ab6..e4d203f4ff 100644 --- a/testsuites/sptests/spstkalloc/init.c +++ b/testsuites/sptests/spstkalloc/init.c @@ -13,6 +13,9 @@ #include <tmacros.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + #define MAXIMUM_STACKS 3 typedef struct { diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c index 48124849e6..e03efe6f06 100644 --- a/testsuites/sptests/spthreadq01/init.c +++ b/testsuites/sptests/spthreadq01/init.c @@ -16,6 +16,13 @@ #include <sys/types.h> #include <rtems/score/threadq.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); +void threadq_first_empty( + const char *discipline_string, + Thread_queue_Disciplines discipline +); + void threadq_first_empty( const char *discipline_string, Thread_queue_Disciplines discipline diff --git a/testsuites/sptests/spwkspace/init.c b/testsuites/sptests/spwkspace/init.c index 52c1fde0fa..5d5fbabdcc 100644 --- a/testsuites/sptests/spwkspace/init.c +++ b/testsuites/sptests/spwkspace/init.c @@ -19,6 +19,9 @@ #include <rtems/score/wkspace.h> +/* forward declarations to avoid warnings */ +rtems_task Init(rtems_task_argument argument); + static void test_workspace_string_duplicate(void) { char a [] = "abcd"; |