i386/px386: GDB use console drivers and add boot command line support.
Update the pc386 to use the BSP's console drivers. Fix the gdb stub support to allow connecting while running if the UART interrupts are usable. Add IO and memory support to the PCI UART drivers. Change the boot command line to use the full device path. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 1/3] i386/pc386: Add support for the gdb stub to use available console drivers.
Move the gdb stub from the i386 UART code to use the libchip drivers. Use any ports discovered during the probes. Add gdb control to the boot command line. Change the device naming to the full device path, not a partial path. For example /dev/com1. --- c/src/lib/libbsp/i386/pc386/Makefile.am| 5 +- c/src/lib/libbsp/i386/pc386/README | 23 ++- c/src/lib/libbsp/i386/pc386/configure.ac | 6 + c/src/lib/libbsp/i386/pc386/console/conscfg.c | 88 ++ .../libbsp/i386/pc386/console/console_control.c| 39 +++-- .../lib/libbsp/i386/pc386/console/console_select.c | 106 +++ c/src/lib/libbsp/i386/pc386/console/gdb_select.c | 169 ++ c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c | 135 +++--- c/src/lib/libbsp/i386/pc386/include/bsp.h | 3 +- c/src/lib/libbsp/i386/pc386/include/bspimpl.h | 12 +- c/src/lib/libbsp/i386/pc386/startup/bspstart.c | 29 ++- c/src/lib/libbsp/i386/pc386/startup/ldsegs.S | 2 +- c/src/lib/libbsp/i386/shared/comm/GDB.HOWTO| 134 +++--- c/src/lib/libbsp/i386/shared/comm/i386-stub-glue.c | 195 ++--- c/src/lib/libbsp/i386/shared/comm/i386-stub.c | 179 +++ c/src/lib/libbsp/shared/console.c | 43 - c/src/lib/libbsp/shared/console_private.h | 13 ++ 17 files changed, 754 insertions(+), 427 deletions(-) create mode 100644 c/src/lib/libbsp/i386/pc386/console/gdb_select.c diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am index d9af7dd..22d4bf1 100644 --- a/c/src/lib/libbsp/i386/pc386/Makefile.am +++ b/c/src/lib/libbsp/i386/pc386/Makefile.am @@ -132,6 +132,7 @@ libbsp_a_SOURCES += console/printk_support.c libbsp_a_SOURCES += console/exar17d15x.c libbsp_a_SOURCES += console/rtd316.c libbsp_a_SOURCES += console/uart_bus_pci.c +libbsp_a_SOURCES += console/gdb_select.c # gdb libbsp_a_SOURCES += ../../i386/shared/comm/i386-stub.c @@ -181,8 +182,8 @@ libbsp_a_SOURCES += ide/idecfg.c endif if HAS_SMP -libbsp_a_SOURCES += ../../i386/shared/smp/getcpuid.c -libbsp_a_SOURCES += ../../i386/shared/smp/smp-imps.c +libbsp_a_SOURCES += ../../i386/shared/smp/getcpuid.c +libbsp_a_SOURCES += ../../i386/shared/smp/smp-imps.c project_lib_DATA += appstart.$(OBJEXT) appcpustart.$(OBJEXT): start/start16.S diff --git a/c/src/lib/libbsp/i386/pc386/README b/c/src/lib/libbsp/i386/pc386/README index bfebf19..4ed8829 100644 --- a/c/src/lib/libbsp/i386/pc386/README +++ b/c/src/lib/libbsp/i386/pc386/README @@ -7,7 +7,7 @@ a Pentium or above, the TSC register is used for timing calibration purposes rather than relying entirely on the i8254. Partial support is implemented for more modern PCs which do not have -a complete complement of legacy peripherals. +a complete complement of legacy peripherals. Console/Printk Device Selection === @@ -19,9 +19,9 @@ in the following order of priority: + VGA and keyboard + COM1 through COM4aaa -+ Any COM devices on the PCI bus ++ Any COM devices on the PCI bus including IO and memory mapped. -Beyond the dynamic probing for device presence, a combination of +Beyond the dynamic probing for device presence, a combination of configure and boot time options are available. By default, all devices are enabled. The configure time options are: @@ -45,7 +45,7 @@ specify the console and kernel debug IO device. The --printk is then interpreted to specify the debug kernel IO device. For example, ---console=com1 --printk=vgacons +--console=/dev/com1 --printk=/dev/vgacons specifies that com1 is to be used for stdin, stdout, and stderr while the VGA console is to be used for kernel debug IO. @@ -55,8 +55,21 @@ the RTEMS device /dev/com1. The device name may be followed by a baud rate. The following example illustrates this: ---console=com1,19200 --printk=vgacons +--console=/dev/com1,19200 --printk=/dev/vgacons If the specified device is not present, then a suitable fallback device is selected. The fallback order is based upon the probe order listed earlier. + +PCI UART devices are /dev/pcicom1 etc as they are probed and found. + +GDB +=== + +GDB can be support using: + + --gdb=/dev/com1,115200 : where the device and baudrate are selectable. + --gdb-break : halt at a break point in the BSP and wait for GDB. + --gdb-remote-debug : Output the GDB remote protocol data to printk + +The GDB stub details and in shared/comm/GDB.HOWTO. diff --git a/c/src/lib/libbsp/i386/pc386/configure.ac b/c/src/lib/libbsp/i386/pc386/configure.ac index 17b7d02..d62a9b3 100644 --- a/c/src/lib/libbsp/i386/pc386/configure.ac +++ b/c/src/lib/libbsp/i386/pc386/configure.ac @@ -142,6 +142,12 @@ RTEMS_BSPOPTS_HELP([BSP_HAS_SMP], [Always defined when on a pc386 to enable the pc386 support for determining the CPU core number in an SMP configuration.]) +RTEMS_BSPOPTS_SET([BSP_GDB_STU
[PATCH 3/3] ibchip/ns16550: Minor optimisation.
--- c/src/libchip/serial/ns16550.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/c/src/libchip/serial/ns16550.c b/c/src/libchip/serial/ns16550.c index 12d220c..6473028 100644 --- a/c/src/libchip/serial/ns16550.c +++ b/c/src/libchip/serial/ns16550.c @@ -1,6 +1,6 @@ /** * @file - * + * * This file contains the TTY driver for the National Semiconductor NS16550. * * This part is widely cloned and second sourced. It is found in a number @@ -234,7 +234,7 @@ void ns16550_init(int minor) Console_Port_Data[minor].pDeviceContext=(void *)pns16550Context; pns16550Context->ucModemCtrl=SP_MODEM_IRQ; - pNS16550 = c->ulCtrlPort1; + pNS16550 = c->ulCtrlPort1; setReg = c->setRegister; getReg = c->getRegister; @@ -389,7 +389,7 @@ void ns16550_outch_polled(console_tbl *c, char out) void ns16550_write_polled(int minor, char out) { console_tbl *c = Console_Port_Tbl [minor]; - + ns16550_outch_polled( c, out ); } @@ -616,27 +616,28 @@ NS16550_STATIC void ns16550_process( int minor) NS16550Context *ctx = d->pDeviceContext; uint32_t port = c->ulCtrlPort1; getRegister_f get = c->getRegister; - int i = 0; + int i; char buf [SP_FIFO_SIZE]; /* Iterate until no more interrupts are pending */ do { /* Fetch received characters */ -for (i = 0; i < SP_FIFO_SIZE; ++i) { - if ((get( port, NS16550_LINE_STATUS) & SP_LSR_RDY) != 0) { -buf [i] = (char) get(port, NS16550_RECEIVE_BUFFER); - } else { -break; +i = 0; +while ((get(port, NS16550_LINE_STATUS) & SP_LSR_RDY) != 0) { + buf[i++] = (char) get(port, NS16550_RECEIVE_BUFFER); + if (i == SP_FIFO_SIZE) { +/* Enqueue fetched characters */ +rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); +i = 0; } } -/* Enqueue fetched characters */ -rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); +if (i > 0) + rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); /* Check if we can dequeue transmitted characters */ if (ctx->transmitFifoChars > 0 && (get( port, NS16550_LINE_STATUS) & SP_LSR_THOLD) != 0) { - /* Dequeue transmitted characters */ rtems_termios_dequeue_characters( d->termios_data, @@ -869,6 +870,6 @@ int ns16550_inch_polled( int ns16550_inbyte_nonblocking_polled(int minor) { console_tbl *c = Console_Port_Tbl [minor]; - + return ns16550_inch_polled( c ); } -- 2.4.6 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 2/3] i386/pc386: Add IO and memory support to PCI UART devices.
Use the BAR to determine IO and memory mapped support for PCI UART boards. --- c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c | 150 - 1 file changed, 113 insertions(+), 37 deletions(-) diff --git a/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c b/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c index 60d35e8..7b48248 100644 --- a/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c +++ b/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c @@ -36,6 +36,7 @@ #ifdef __rtems__ #include #include +#include #else #include __FBSDID("$FreeBSD$"); @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include + #endif #defineDEFAULT_RCLK1843200 @@ -225,11 +227,11 @@ DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); #ifdef __rtems__ #include -// #include +#include + #include #include -// #include #include #include #include @@ -242,36 +244,58 @@ DRIVER_MODULE(uart, pci, uart_pci_driver, uart_devclass, NULL, NULL); * Information saved from PCI scan */ typedef struct { - bool found; - uint32_t base; - uint8_t irq; - uint8_t bus; - uint8_t slot; - int ports; - uint32_t clock; + boolfound; + const char* desc; + uint32_tbase; + uint8_t irq; + uint8_t bus; + uint8_t slot; + int ports; + uint32_tclock; } port_instance_conf_t; /* - * Register Access Routines + * Memory Mapped Register Access Routines */ -static uint8_t pci_ns16550_get_register(uint32_t addr, uint8_t i) + +#define UART_PCI_IO (0) + +static uint8_t pci_ns16550_mem_get_register(uint32_t addr, uint8_t i) { uint8_t val = 0; volatile uint32_t *reg = (volatile uint32_t *)(addr + (i*4)); - val = *reg; - /* printk( "RD(%p -> 0x%02x) ", reg, val ); */ + if (UART_PCI_IO) +printk( "RD(%p -> 0x%02x) ", reg, val ); return val; } -static void pci_ns16550_set_register(uint32_t addr, uint8_t i, uint8_t val) +static void pci_ns16550_mem_set_register(uint32_t addr, uint8_t i, uint8_t val) { volatile uint32_t *reg = (volatile uint32_t *)(addr + (i*4)); - - /* printk( "WR(%p <- 0x%02x) ", reg, val ); */ + if (UART_PCI_IO) +printk( "WR(%p <- 0x%02x) ", reg, val ); *reg = val; } +/* + * IO Register Access Routines + */ +static uint8_t pci_ns16550_io_get_register(uint32_t addr, uint8_t i) +{ + uint8_t val = rtems_inb(addr + i); + if (UART_PCI_IO) +printk( "RD(%p -> 0x%02x) ", addr + i, val ); + return val; +} + +static void pci_ns16550_io_set_register(uint32_t addr, uint8_t i, uint8_t val) +{ + if (UART_PCI_IO) +printk( "WR(%p <- 0x%02x) ", addr + i, val ); + rtems_outb(addr + i, val); +} + void pci_uart_probe(void) { port_instance_conf_t conf[MAX_BOARDS]; @@ -316,27 +340,28 @@ void pci_uart_probe(void) if ( status == PCIB_ERR_SUCCESS ) { uint8_t irq; uint32_t base; + bool io; -boards++; -conf[instance].found = true; -conf[instance].clock = pci_ns8250_ids[i].rclk; -conf[instance].ports = 1; -total_ports += conf[instance].ports; - - pci_read_config_byte( bus, dev, fun, PCI_INTERRUPT_LINE, &irq ); pci_read_config_dword( bus, dev, fun, PCI_BASE_ADDRESS_0, &base ); - conf[instance].irq = irq; - conf[instance].base = base; - -printk( - "Found %s #%d at 0x%08x IRQ %d with %d clock\n", - pci_ns8250_ids[i].desc, - instance, - conf[instance].base, - conf[instance].irq, - conf[instance].clock -); + /* +* Reject memory mapped 64-bit boards. We need 2 BAR registers and the +* driver's base field is only 32-bits any way. +*/ + io = (base & 1) == 1; + if (io || (!io && (((base >> 1) & 3) != 2))) { + boards++; + conf[instance].found = true; + conf[instance].desc = pci_ns8250_ids[i].desc; + conf[instance].clock = pci_ns8250_ids[i].rclk; + conf[instance].ports = 1; + total_ports += conf[instance].ports; + + pci_read_config_byte( bus, dev, fun, PCI_INTERRUPT_LINE, &irq ); + + conf[instance].irq = irq; + conf[instance].base = base; + } } } } @@ -352,6 +377,10 @@ void pci_uart_probe(void) port_p = ports; device_instance = 1; for (b = 0; b < MAX_BOARDS; b++) { + uint32_t base = 0; + bool io; + const char* locatable = ""; + const char* prefectable = locatable; char name[32]; if ( conf[b].found == false ) continue; @@ -369,21 +398,68 @@ void pci_uart_probe(void) port_p->pDeviceFns= &ns16550_fns_polled; } + /* +* PCI BAR (http://wiki.osdev.org/PCI#Base_Address_Registers): +* +* Bit 0: 0 = memory, 1 = IO +* +* Memory: +* Bit 2-1 : 0 = any 32bit address, +* 1 = < 1M +* 2 = an
waf changes to libbsd.
Hi, Now makefile support has been removed from libbsd I would like to move the wscript to not be generated and to have it import the generated part. This will make maintaining the non-generated part easier because I do not need to edit python within python strings. OK? Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: I2C Driver Support
On 20/04/16 08:53, Chris Johns wrote: Three I2C driver variants exist * no framework drivers, This is difficult, since there is no clear search criterium. Examples are c/src/lib/libbsp/powerpc/gen5200/i2c/mpc5200mbus.c c/src/lib/libcpu/m68k/mcf5206/mbus/mcfmbus.c * libi2c drivers, and cpukit/libi2c/libi2c.c:#include c/src/libchip/display/disp_hcms29xx.c:#include c/src/libchip/i2c/spi-sd-card.h:#include c/src/libchip/i2c/i2c-ds1621.h:#include c/src/libchip/i2c/i2c-2b-eeprom.c:#include c/src/libchip/i2c/spi-sd-card.c:#include c/src/libchip/i2c/spi-flash-m25p40.c:#include c/src/libchip/i2c/spi-fram-fm25l256.c:#include c/src/libchip/i2c/i2c-2b-eeprom.h:#include c/src/libchip/i2c/i2c-sc620.h:#include c/src/libchip/i2c/spi-memdrv.c:#include c/src/libchip/i2c/i2c-ds1621.c:#include c/src/libchip/i2c/spi-memdrv.h:#include c/src/lib/libbsp/m68k/gen68360/spi/m360_spi.h:#include c/src/lib/libbsp/m68k/gen68360/spi/m360_spi.c:#include c/src/lib/libbsp/sparc/shared/include/i2cmst.h:#include c/src/lib/libbsp/sparc/shared/i2c/i2cmst.c:#include c/src/lib/libbsp/sparc/shared/spi/spictrl.c:#include c/src/lib/libbsp/powerpc/beatnik/marvell/gti2c_busdrv.h:#include c/src/lib/libbsp/powerpc/beatnik/marvell/gti2c.c:#include c/src/lib/libbsp/powerpc/beatnik/startup/i2c_init.c:#include c/src/lib/libbsp/powerpc/mvme3100/i2c/mpc8540_i2c.c:#include c/src/lib/libbsp/powerpc/mvme3100/i2c/i2c_init.c:#include c/src/lib/libbsp/powerpc/mvme3100/i2c/mpc8540_i2c_busdrv.h:#include c/src/lib/libbsp/powerpc/tqm8xx/spi/spi.h:#include c/src/lib/libbsp/powerpc/tqm8xx/spi/spi.c:#include c/src/lib/libbsp/powerpc/shared/motorola/vpd.c:#include c/src/lib/libbsp/arm/lpc24xx/include/ssp.h:#include c/src/lib/libbsp/arm/lpc24xx/include/i2c.h:#include c/src/lib/libbsp/arm/lm3s69xx/include/ssi.h:#include c/src/lib/libbsp/arm/raspberrypi/include/spi.h:#include c/src/lib/libcpu/powerpc/mpc55xx/include/dspi.h:#include c/src/lib/libcpu/powerpc/mpc83xx/i2c/mpc83xx_i2cdrv.h:#include c/src/lib/libcpu/powerpc/mpc83xx/i2c/mpc83xx_i2cdrv.c:#include c/src/lib/libcpu/powerpc/mpc83xx/spi/mpc83xx_spidrv.h:#include c/src/lib/libcpu/powerpc/mpc83xx/spi/mpc83xx_spidrv.c:#include c/src/lib/libcpu/bfin/serial/spi.c:#include * drivers using the Linux compatible API (all new BSPs should use this framework). cpukit/dev/include/dev/i2c/eeprom.h:#include cpukit/dev/include/dev/i2c/switch-nxp-pca9548a.h:#include cpukit/dev/include/dev/i2c/gpio-nxp-pca9535.h:#include cpukit/dev/i2c/i2c-bus.c:#include cpukit/dev/i2c/i2c-dev.c:#include c/src/lib/libbsp/arm/xilinx-zynq/i2c/cadence-i2c.c:#include c/src/lib/libbsp/arm/raspberrypi/include/i2c.h:#include testsuites/libtests/i2c01/init.c:#include Can we please get a list of each of the BSPs which fall in to each group? Are you able to provide a simple technical break down about each group, eg reusable, SMP, user support, etc? We should select the preferred model and then determine what we can do to move all code to that model. We lack support for a proper SPI driver framework. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: waf changes to libbsd.
On 20/04/16 09:48, Chris Johns wrote: Hi, Now makefile support has been removed from libbsd I would like to move the wscript to not be generated and to have it import the generated part. This will make maintaining the non-generated part easier because I do not need to edit python within python strings. OK? I am fine with everything. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] [libatomic] Add RTEMS support
Hello, I know that I am pretty late, but is there a chance to get this into the GCC 6.1 release? On 19/04/16 14:56, Sebastian Huber wrote: v2: Do not use architecture configuration due to broken ARM libatomic support. gcc/ * config/rtems.h (LIB_SPEC): Add -latomic. libatomic/ * configure.tgt (*-*-rtems*): New supported target. * config/rtems/host-config.h: New file. * config/rtems/lock.c: Likewise. -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH v2] [libatomic] Add RTEMS support
As the other RTEMS target maintainer. I second the request. --joel On Apr 20, 2016 7:35 AM, "Sebastian Huber" < sebastian.hu...@embedded-brains.de> wrote: > Hello, > > I know that I am pretty late, but is there a chance to get this into the > GCC 6.1 release? > > On 19/04/16 14:56, Sebastian Huber wrote: > >> v2: Do not use architecture configuration due to broken ARM libatomic >> support. >> >> gcc/ >> >> * config/rtems.h (LIB_SPEC): Add -latomic. >> >> libatomic/ >> >> * configure.tgt (*-*-rtems*): New supported target. >> * config/rtems/host-config.h: New file. >> * config/rtems/lock.c: Likewise. >> > > -- > Sebastian Huber, embedded brains GmbH > > Address : Dornierstr. 4, D-82178 Puchheim, Germany > Phone : +49 89 189 47 41-16 > Fax : +49 89 189 47 41-09 > E-Mail : sebastian.hu...@embedded-brains.de > PGP : Public key available on request. > > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 1/5] Introduce
Introduce for . Newlib targets may provide an own version of in their machine directory to add custom user types for . Signed-off-by: Sebastian Huber --- newlib/libc/include/machine/_user_types.h | 7 ++ newlib/libc/include/sys/types.h | 10 +- winsup/cygwin/include/cygwin/types.h| 129 ++ winsup/cygwin/include/machine/_user_types.h | 137 4 files changed, 154 insertions(+), 129 deletions(-) create mode 100644 newlib/libc/include/machine/_user_types.h create mode 100644 winsup/cygwin/include/machine/_user_types.h diff --git a/newlib/libc/include/machine/_user_types.h b/newlib/libc/include/machine/_user_types.h new file mode 100644 index 000..a5a64e6 --- /dev/null +++ b/newlib/libc/include/machine/_user_types.h @@ -0,0 +1,7 @@ +/* + * Newlib targets may provide an own version of this file in their machine + * directory to add custom user types for . + */ +#ifndef _SYS_TYPES_H +#error "must be included via " +#endif /* !_SYS_TYPES_H */ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index dbd6f2b..325fedc 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -253,7 +253,7 @@ typedef __int64_t sbintime_t; * pointers rather than structs to ensure maximum binary compatability with * previous releases. * This means that we don't use the types defined here, but rather in - * + * */ #if defined(_POSIX_THREADS) && !defined(__CYGWIN__) @@ -438,11 +438,7 @@ typedef struct { int is_initialized; /* is this structure initialized? */ int init_executed; /* has the initialization routine been run? */ } pthread_once_t; /* dynamic package initialization */ -#else -#if defined (__CYGWIN__) -#include -#endif -#endif /* defined(_POSIX_THREADS) */ +#endif /* defined(_POSIX_THREADS) && !defined(__CYGWIN__) */ /* POSIX Barrier Types */ @@ -476,6 +472,8 @@ typedef struct { #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ #endif /* __CYGWIN__ */ +#include + #endif /* !__need_inttypes */ #undef __need_inttypes diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index faf08bd..1268693 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -1,4 +1,4 @@ -/* types.h +/* cygwin/types.h Copyright 2001, 2002, 2003, 2005, 2006, 2010, 2011, 2012, 2015 Red Hat Inc. Written by Robert Collins @@ -12,128 +12,11 @@ details. */ #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H -#ifdef __cplusplus -extern "C" -{ -#endif +/* + * This file is provided for backward compatibility. It is no longer used in + * Newlib. Do not add new things to it. + */ -#include -#include -#include -#include - -#ifndef __timespec_t_defined -#define __timespec_t_defined -typedef struct timespec timespec_t; -#endif /*__timespec_t_defined*/ - -#ifndef __timestruc_t_defined -#define __timestruc_t_defined -typedef struct timespec timestruc_t; -#endif /*__timestruc_t_defined*/ - -typedef __loff_t loff_t; - -#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__) -struct __flock32 { - shortl_type;/* F_RDLCK, F_WRLCK, or F_UNLCK */ - shortl_whence; /* flag to choose starting offset */ - _off_t l_start; /* relative offset, in bytes */ - _off_t l_len; /* length, in bytes; 0 means lock to EOF */ - shortl_pid; /* returned with F_GETLK */ - shortl_xxx; /* reserved for future use */ -}; -#endif - -struct flock { - shortl_type;/* F_RDLCK, F_WRLCK, or F_UNLCK */ - shortl_whence; /* flag to choose starting offset */ - off_tl_start; /* relative offset, in bytes */ - off_tl_len; /* length, in bytes; 0 means lock to EOF */ - pid_tl_pid; /* returned with F_GETLK */ -}; - -#ifndef __BIT_TYPES_DEFINED -#define __BIT_TYPES_DEFINED__ 1 - -#ifndef __vm_offset_t_defined -#define __vm_offset_t_defined -typedef unsigned long vm_offset_t; -#endif /*__vm_offset_t_defined*/ - -#ifndef __vm_size_t_defined -#define __vm_size_t_defined -typedef unsigned long vm_size_t; -#endif /*__vm_size_t_defined*/ - -#ifndef __vm_object_t_defined -#define __vm_object_t_defined -typedef void *vm_object_t; -#endif /* __vm_object_t_defined */ - -#ifndef __register_t_defined -#define __register_t_defined -typedef __int32_t register_t; -#endif - -#ifndef __addr_t_defined -#define __addr_t_defined -typedef char *addr_t; -#endif - -#endif /*__BIT_TYPES_DEFINED*/ - -#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus) - -typedef struct __pthread_t {char __dummy;} *pthread_t; -typedef struct __pthread_mutex_t {char __dummy;} *pthread_mutex_t; - -typedef struct __pthread_key_t {char __dummy;} *pthread_key_t; -typedef struct __pthread_attr_t {char __dummy;} *pthread_attr_t; -typedef struct __pthread_mutexattr_t {char __dummy;} *pthread_mu
[PATCH v2 4/5] Always provide register_t via
Always provide register_t via for glibc and BSD compatibility. Define __BIT_TYPES_DEFINED__ to 1 like glibc for legacy header files. Signed-off-by: Sebastian Huber --- newlib/libc/include/sys/types.h | 6 ++ winsup/cygwin/include/machine/_user_types.h | 5 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 4224a98..db970df 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -36,6 +36,8 @@ typedef __uint32_tu_int32_t; #if ___int64_t_defined typedef __uint64_t u_int64_t; #endif +typedef int register_t; +#define __BIT_TYPES_DEFINED__ 1 #if defined(__rtems__) || defined(__XMK__) /* @@ -158,10 +160,6 @@ typedef__ino_t ino_t; /* inode number */ typedefchar * addr_t; typedef unsigned long vm_offset_t; typedef unsigned long vm_size_t; - -#define __BIT_TYPES_DEFINED__ - -typedef int32_t register_t; #endif /* __i386__ && (GO32 || __MSDOS__) */ /* diff --git a/winsup/cygwin/include/machine/_user_types.h b/winsup/cygwin/include/machine/_user_types.h index 2e0cf92..6007d2d 100644 --- a/winsup/cygwin/include/machine/_user_types.h +++ b/winsup/cygwin/include/machine/_user_types.h @@ -71,11 +71,6 @@ typedef unsigned long vm_size_t; typedef void *vm_object_t; #endif /* __vm_object_t_defined */ -#ifndef __register_t_defined -#define __register_t_defined -typedef __int32_t register_t; -#endif - #ifndef __addr_t_defined #define __addr_t_defined typedef char *addr_t; -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 2/5] Remove duplicate u_int*_t definitions
Signed-off-by: Sebastian Huber --- newlib/libc/include/sys/types.h | 4 1 file changed, 4 deletions(-) diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 325fedc..52349f4 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -162,13 +162,9 @@ typedef unsigned long vm_size_t; #define __BIT_TYPES_DEFINED__ typedef signed char int8_t; -typedef unsigned char u_int8_t; typedef short int16_t; -typedef unsigned short u_int16_t; typedef int int32_t; -typedef unsigned int u_int32_t; typedef long long int64_t; -typedef unsigned long long u_int64_t; typedef int32_t register_t; #endif /* __i386__ && (GO32 || __MSDOS__) */ -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 3/5] Remove duplicate int*_t definitions
Types are already available via included some lines above. Signed-off-by: Sebastian Huber --- newlib/libc/include/sys/types.h | 4 1 file changed, 4 deletions(-) diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 52349f4..4224a98 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -161,10 +161,6 @@ typedef unsigned long vm_size_t; #define __BIT_TYPES_DEFINED__ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; typedef int32_t register_t; #endif /* __i386__ && (GO32 || __MSDOS__) */ -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v2 5/5] Provide FreeBSD types for on RTEMS
Provide the following types via on RTEMS for FreeBSD compatibility if __BSD_VISIBLE * accmode_t, * cap_rights_t, * c_caddr_t, * cpulevel_t, * fixpt_t, * lwpid_t, * uintfptr_t, * vm_offset_t, * vm_ooffset_t, * vm_paddr_t, * vm_pindex_t, and * vm_size_t. Signed-off-by: Sebastian Huber --- newlib/libc/sys/rtems/include/machine/_types.h | 7 +++ .../libc/sys/rtems/include/machine/_user_types.h | 73 ++ 2 files changed, 80 insertions(+) create mode 100644 newlib/libc/sys/rtems/include/machine/_user_types.h diff --git a/newlib/libc/sys/rtems/include/machine/_types.h b/newlib/libc/sys/rtems/include/machine/_types.h index e5dece0..f003ce9 100644 --- a/newlib/libc/sys/rtems/include/machine/_types.h +++ b/newlib/libc/sys/rtems/include/machine/_types.h @@ -28,6 +28,13 @@ typedef unsigned long __ino_t; typedef__uint32_t __mode_t; #define__machine_mode_t_defined +typedefint __accmode_t;/* access permissions */ +typedef__uint32_t __fixpt_t; /* fixed point number */ +typedefint __lwpid_t; /* Thread ID (a.k.a. LWP) */ +typedef__int64_t __rlim_t; /* resource limit - intentionally */ + /* signed, because of legacy code */ + /* that uses -1 for RLIM_INFINITY */ + #ifdef _KERNEL typedefint boolean_t; typedefstruct device *device_t; diff --git a/newlib/libc/sys/rtems/include/machine/_user_types.h b/newlib/libc/sys/rtems/include/machine/_user_types.h new file mode 100644 index 000..52ff790 --- /dev/null +++ b/newlib/libc/sys/rtems/include/machine/_user_types.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2016 embedded brains GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_TYPES_H +#error "must be included via " +#endif /* !_SYS_TYPES_H */ + +#if __BSD_VISIBLE + +#ifndef _ACCMODE_T_DECLARED +typedef__accmode_t accmode_t; /* access permissions */ +#define_ACCMODE_T_DECLARED +#endif + +#ifndef _CAP_RIGHTS_T_DECLARED +#define_CAP_RIGHTS_T_DECLARED +struct cap_rights; + +typedefstruct cap_rights cap_rights_t; +#endif + +typedefconst char *c_caddr_t; /* core address, pointer to const */ + +typedefint cpulevel_t; +typedefint cpusetid_t; +typedefint cpuwhich_t; + +typedef__fixpt_t fixpt_t;/* fixed point number */ + +#ifndef _LWPID_T_DECLARED +typedef__lwpid_t lwpid_t;/* Thread ID (a.k.a. LWP) */ +#define_LWPID_T_DECLARED +#endif + +#ifndef _RLIM_T_DECLARED +typedef__rlim_trlim_t; /* resource limit */ +#define_RLIM_T_DECLARED +#endif + +typedef__uintptr_t segsz_t;/* segment size (in pages) */ + +typedef__uintptr_t uintfptr_t; + +typedef__intptr_t vm_ooffset_t; +typedef__uintptr_t vm_offset_t; +typedef__uintptr_t vm_paddr_t; +typedef__uintptr_t vm_pindex_t; +typedef__uintptr_t vm_size_t; + +#endif /* __BSD_VISIBLE */ -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: waf changes to libbsd.
Do it. On Wed, Apr 20, 2016 at 3:45 AM, Sebastian Huber < sebastian.hu...@embedded-brains.de> wrote: > > > On 20/04/16 09:48, Chris Johns wrote: > >> Hi, >> >> Now makefile support has been removed from libbsd I would like to move >> the wscript to not be generated and to have it import the generated part. >> This will make maintaining the non-generated part easier because I do not >> need to edit python within python strings. >> >> OK? >> > > I am fine with everything. > > -- > Sebastian Huber, embedded brains GmbH > > Address : Dornierstr. 4, D-82178 Puchheim, Germany > Phone : +49 89 189 47 41-16 > Fax : +49 89 189 47 41-09 > E-Mail : sebastian.hu...@embedded-brains.de > PGP : Public key available on request. > > Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. > > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
epiphany GCC ICE and tool update
Hi The epiphany 4.12 tools are using gcc 4.9.0 and giving an internal compiler error. Given that there have been multiple 4.9 dot releases and multiple major releases since then, I didn't want to report the internal compiler error with GCC before asking... should the epiphany tools be updated? Is there an issue I am not remembering for epiphany tools? They are really lagging behind and it would be great if we could get them to use the default versions. Help appreciated. Thanks. --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
New warning in shell/hexdump-odssyntax.c
Hi This is a new warning with the tool update. Anyone have any ideas? ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/hexdump-odsyntax.c:373:2: warning: implicit declaration of function 'asprintf' [-Wimplicit-function-declaration] ../../../../../../rtems/c/src/../../cpukit/libmisc/shell/hexdump-odsyntax.c:373:2: warning: nested extern declaration of 'asprintf' [-Wnested-externs] --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
New Warning in spsysinit01
Hi New warning in spsysinit01 that needs to be fixed: ../../../../../../../rtems/c/src/../../testsuites/sptests/spsysinit01/init.c:517:35: warning: passing argument 1 of '_Chain_Node_count_unprotected' from incompatible pointer type [-Wincompatible-pointer-types] ../../../../../../../rtems/c/src/../../testsuites/sptests/spsysinit01/init.c:525:37: warning: passing argument 1 of '_Chain_Node_count_unprotected' from incompatible pointer type [-Wincompatible-pointer-types] Thanks. --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 3/3] ibchip/ns16550: Minor optimisation.
These look good and almost all cosmetic. Apply. On Wed, Apr 20, 2016 at 2:20 AM, Chris Johns wrote: > --- > c/src/libchip/serial/ns16550.c | 27 ++- > 1 file changed, 14 insertions(+), 13 deletions(-) > > diff --git a/c/src/libchip/serial/ns16550.c > b/c/src/libchip/serial/ns16550.c > index 12d220c..6473028 100644 > --- a/c/src/libchip/serial/ns16550.c > +++ b/c/src/libchip/serial/ns16550.c > @@ -1,6 +1,6 @@ > /** > * @file > - * > + * > * This file contains the TTY driver for the National Semiconductor > NS16550. > * > * This part is widely cloned and second sourced. It is found in a > number > @@ -234,7 +234,7 @@ void ns16550_init(int minor) >Console_Port_Data[minor].pDeviceContext=(void *)pns16550Context; >pns16550Context->ucModemCtrl=SP_MODEM_IRQ; > > - pNS16550 = c->ulCtrlPort1; > + pNS16550 = c->ulCtrlPort1; >setReg = c->setRegister; >getReg = c->getRegister; > > @@ -389,7 +389,7 @@ void ns16550_outch_polled(console_tbl *c, char out) > void ns16550_write_polled(int minor, char out) > { >console_tbl *c = Console_Port_Tbl [minor]; > - > + >ns16550_outch_polled( c, out ); > } > > @@ -616,27 +616,28 @@ NS16550_STATIC void ns16550_process( int minor) >NS16550Context *ctx = d->pDeviceContext; >uint32_t port = c->ulCtrlPort1; >getRegister_f get = c->getRegister; > - int i = 0; > + int i; >char buf [SP_FIFO_SIZE]; > >/* Iterate until no more interrupts are pending */ >do { > /* Fetch received characters */ > -for (i = 0; i < SP_FIFO_SIZE; ++i) { > - if ((get( port, NS16550_LINE_STATUS) & SP_LSR_RDY) != 0) { > -buf [i] = (char) get(port, NS16550_RECEIVE_BUFFER); > - } else { > -break; > +i = 0; > +while ((get(port, NS16550_LINE_STATUS) & SP_LSR_RDY) != 0) { > + buf[i++] = (char) get(port, NS16550_RECEIVE_BUFFER); > + if (i == SP_FIFO_SIZE) { > +/* Enqueue fetched characters */ > +rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); > +i = 0; >} > } > > -/* Enqueue fetched characters */ > -rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); > +if (i > 0) > + rtems_termios_enqueue_raw_characters( d->termios_data, buf, i); > > /* Check if we can dequeue transmitted characters */ > if (ctx->transmitFifoChars > 0 > && (get( port, NS16550_LINE_STATUS) & SP_LSR_THOLD) != 0) { > - >/* Dequeue transmitted characters */ >rtems_termios_dequeue_characters( > d->termios_data, > @@ -869,6 +870,6 @@ int ns16550_inch_polled( > int ns16550_inbyte_nonblocking_polled(int minor) > { >console_tbl *c = Console_Port_Tbl [minor]; > - > + >return ns16550_inch_polled( c ); > } > -- > 2.4.6 > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/3] i386/pc386: Add IO and memory support to PCI UART devices.
On Wed, Apr 20, 2016 at 2:20 AM, Chris Johns wrote: > Use the BAR to determine IO and memory mapped support for PCI UART > boards. > --- > c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c | 150 > - > 1 file changed, 113 insertions(+), 37 deletions(-) > > diff --git a/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c > b/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c > index 60d35e8..7b48248 100644 > --- a/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c > +++ b/c/src/lib/libbsp/i386/pc386/console/uart_bus_pci.c > @@ -36,6 +36,7 @@ > #ifdef __rtems__ > #include > #include > +#include > #else > #include > __FBSDID("$FreeBSD$"); > @@ -54,6 +55,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > + > #endif > > #defineDEFAULT_RCLK1843200 > @@ -225,11 +227,11 @@ DRIVER_MODULE(uart, pci, uart_pci_driver, > uart_devclass, NULL, NULL); > #ifdef __rtems__ > > #include > -// #include > +#include > + > #include > #include > > -// #include > #include > #include > #include > @@ -242,36 +244,58 @@ DRIVER_MODULE(uart, pci, uart_pci_driver, > uart_devclass, NULL, NULL); > * Information saved from PCI scan > */ > typedef struct { > - bool found; > - uint32_t base; > - uint8_t irq; > - uint8_t bus; > - uint8_t slot; > - int ports; > - uint32_t clock; > + boolfound; > + const char* desc; > + uint32_tbase; > + uint8_t irq; > + uint8_t bus; > + uint8_t slot; > + int ports; > + uint32_tclock; > } port_instance_conf_t; > > /* > - * Register Access Routines > + * Memory Mapped Register Access Routines > */ > -static uint8_t pci_ns16550_get_register(uint32_t addr, uint8_t i) > + > +#define UART_PCI_IO (0) > + > +static uint8_t pci_ns16550_mem_get_register(uint32_t addr, uint8_t i) > { >uint8_t val = 0; >volatile uint32_t *reg = (volatile uint32_t *)(addr + (i*4)); > - >val = *reg; > - /* printk( "RD(%p -> 0x%02x) ", reg, val ); */ > + if (UART_PCI_IO) > +printk( "RD(%p -> 0x%02x) ", reg, val ); >return val; > } > > -static void pci_ns16550_set_register(uint32_t addr, uint8_t i, uint8_t > val) > +static void pci_ns16550_mem_set_register(uint32_t addr, uint8_t i, > uint8_t val) > { >volatile uint32_t *reg = (volatile uint32_t *)(addr + (i*4)); > - > - /* printk( "WR(%p <- 0x%02x) ", reg, val ); */ > + if (UART_PCI_IO) > +printk( "WR(%p <- 0x%02x) ", reg, val ); >*reg = val; > } > > +/* > + * IO Register Access Routines > + */ > +static uint8_t pci_ns16550_io_get_register(uint32_t addr, uint8_t i) > +{ > + uint8_t val = rtems_inb(addr + i); > + if (UART_PCI_IO) > +printk( "RD(%p -> 0x%02x) ", addr + i, val ); > + return val; > +} > + > +static void pci_ns16550_io_set_register(uint32_t addr, uint8_t i, uint8_t > val) > +{ > + if (UART_PCI_IO) > +printk( "WR(%p <- 0x%02x) ", addr + i, val ); > + rtems_outb(addr + i, val); > +} > + > Is it possible to use the same com access ports that are used for com1-com4? Or at least move to shared ones? They are in conscfg.c. It would be good if we could eliminate some code during this. :) > void pci_uart_probe(void) > { >port_instance_conf_t conf[MAX_BOARDS]; > @@ -316,27 +340,28 @@ void pci_uart_probe(void) >if ( status == PCIB_ERR_SUCCESS ) { > uint8_t irq; > uint32_t base; > + bool io; > > -boards++; > -conf[instance].found = true; > -conf[instance].clock = pci_ns8250_ids[i].rclk; > -conf[instance].ports = 1; > -total_ports += conf[instance].ports; > - > - pci_read_config_byte( bus, dev, fun, PCI_INTERRUPT_LINE, &irq ); > pci_read_config_dword( bus, dev, fun, PCI_BASE_ADDRESS_0, &base ); > > - conf[instance].irq = irq; > - conf[instance].base = base; > - > -printk( > - "Found %s #%d at 0x%08x IRQ %d with %d clock\n", > - pci_ns8250_ids[i].desc, > - instance, > - conf[instance].base, > - conf[instance].irq, > - conf[instance].clock > -); > + /* > +* Reject memory mapped 64-bit boards. We need 2 BAR registers and > the > +* driver's base field is only 32-bits any way. > +*/ > + io = (base & 1) == 1; > + if (io || (!io && (((base >> 1) & 3) != 2))) { > + boards++; > + conf[instance].found = true; > + conf[instance].desc = pci_ns8250_ids[i].desc; > + conf[instance].clock = pci_ns8250_ids[i].rclk; > + conf[instance].ports = 1; > + total_ports += conf[instance].ports; > + > + pci_read_config_byte( bus, dev, fun, PCI_INTERRUPT_LINE, &irq ); > + > + conf[instance].irq = irq; > + conf[instance].base = base; > + } >} > } >} > @@ -352,6 +377,10 @@ void pci_uart_probe(void) >port_p = ports; >device_instance = 1; >for (b = 0; b < MAX_BOARDS; b++) { > +
Re: [PATCH 1/3] i386/pc386: Add support for the gdb stub to use available console drivers.
On 21/04/2016 9:01 AM, Joel Sherrill wrote: > Console/Printk Device Selection > === > @@ -19,9 +19,9 @@ in the following order of priority: > + VGA and keyboard > + COM1 through COM4aaa > > What is the aaa? > No idea, must have been cat on the keyboard. > + > +if (comma) { > + option = comma + 1; > + baudrate = strtoul(option, 0, 10); > + switch (baudrate) { > +case 115200: > +case 57600: > +case 38400: > +case 19200: > +case 9600: > +case 4800: > + port->pDeviceParams = (void*) baudrate; > + BSPBaseBaud = baudrate; /* REMOVE ME */ > + break; > +default: > + printk("invalid option (--gdb): bad baudrate\n"); > + return; > + } > +} > > > Is there anyway the code parsing this option can be shared with that > for the com ports? Yes that could be done but I do not think so for this patch set. This is in code in shared/comm and the BSP code needs to be reorganised. Given the conversation with Sebastian about consoles this BSP needs some rework. Maybe this can happen then. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 1/3] i386/pc386: Add support for the gdb stub to use available console drivers.
On Wed, Apr 20, 2016 at 6:42 PM, Chris Johns wrote: > On 21/04/2016 9:01 AM, Joel Sherrill wrote: > > Console/Printk Device Selection > > === > > @@ -19,9 +19,9 @@ in the following order of priority: > > + VGA and keyboard > > + COM1 through COM4aaa > > > > What is the aaa? > > > > No idea, must have been cat on the keyboard. > > > + > > +if (comma) { > > + option = comma + 1; > > + baudrate = strtoul(option, 0, 10); > > + switch (baudrate) { > > +case 115200: > > +case 57600: > > +case 38400: > > +case 19200: > > +case 9600: > > +case 4800: > > + port->pDeviceParams = (void*) baudrate; > > + BSPBaseBaud = baudrate; /* REMOVE ME */ > > + break; > > +default: > > + printk("invalid option (--gdb): bad baudrate\n"); > > + return; > > + } > > +} > > > > > > Is there anyway the code parsing this option can be shared with that > > for the com ports? > > Yes that could be done but I do not think so for this patch set. This is > in code in shared/comm and the BSP code needs to be reorganised. > > Given the conversation with Sebastian about consoles this BSP needs some > rework. Maybe this can happen then. > > I am ok with letting it go. Opportunities for shared code have to be noted or they never happen. Fix the cat scratches and commit. :) > Chris > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/3] i386/pc386: Add IO and memory support to PCI UART devices.
On 21/04/2016 8:57 AM, Joel Sherrill wrote: > > +/* > + * IO Register Access Routines > + */ > +static uint8_t pci_ns16550_io_get_register(uint32_t addr, uint8_t i) > +{ > + uint8_t val = rtems_inb(addr + i); > + if (UART_PCI_IO) > +printk( "RD(%p -> 0x%02x) ", addr + i, val ); > + return val; > +} > + > +static void pci_ns16550_io_set_register(uint32_t addr, uint8_t i, > uint8_t val) > +{ > + if (UART_PCI_IO) > +printk( "WR(%p <- 0x%02x) ", addr + i, val ); > + rtems_outb(addr + i, val); > +} > + > > > Is it possible to use the same com access ports that are used for com1-com4? > Or at least move to shared ones? It could be done if want. > > They are in conscfg.c. It would be good if we could eliminate some code > during this. :) > I have not looked at the differences between the old driver and the new one Sebastian created. We need to move to that driver for SMP support. Maybe this all gets cleaned up then? Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/3] i386/pc386: Add IO and memory support to PCI UART devices.
On Wed, Apr 20, 2016 at 6:47 PM, Chris Johns wrote: > On 21/04/2016 8:57 AM, Joel Sherrill wrote: > > > > +/* > > + * IO Register Access Routines > > + */ > > +static uint8_t pci_ns16550_io_get_register(uint32_t addr, uint8_t i) > > +{ > > + uint8_t val = rtems_inb(addr + i); > > + if (UART_PCI_IO) > > +printk( "RD(%p -> 0x%02x) ", addr + i, val ); > > + return val; > > +} > > + > > +static void pci_ns16550_io_set_register(uint32_t addr, uint8_t i, > > uint8_t val) > > +{ > > + if (UART_PCI_IO) > > +printk( "WR(%p <- 0x%02x) ", addr + i, val ); > > + rtems_outb(addr + i, val); > > +} > > + > > > > > > Is it possible to use the same com access ports that are used for > com1-com4? > > Or at least move to shared ones? > > It could be done if want. > > Just pointing out common code possibilities. > > > > They are in conscfg.c. It would be good if we could eliminate some code > > during this. :) > > > > I have not looked at the differences between the old driver and the new > one Sebastian created. We need to move to that driver for SMP support. > Maybe this all gets cleaned up then? > > Sure. There is definitely SMP work on the x86. Add this to the list along with TLS, etc. > Chris > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
RKI Build Error
Hi, I am trying to build RKI for Raspberrypi but I have been getting this error message: arm-rtems4.12-gcc -Wa,-a=legacy-build/arm-rtems4.12-raspberrypi/task_cmd.lis -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a7 -D__ARM__ --pipe -B/home/dipupo/development/rtems/kernel/builds/b-rpi/arm-rtems4.12/raspberrypi/lib -specs bsp_specs -qrtems -Wall -I. -Iinclude/ -I. -g -O2 -c -o legacy-build/arm-rtems4.12-raspberrypi/task_cmd.o task_cmd.c task_cmd.c: In function 'get_ticks_per_second': task_cmd.c:23:10: warning: implicit declaration of function 'rtems_clock_get' [-Wimplicit-function-declaration] (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; ^~~ task_cmd.c:23:27: error: 'RTEMS_CLOCK_GET_TICKS_PER_SECOND' undeclared (first use in this function) (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; ^~~~ The line associated with this message in the task_cmd.c is { rtems_interval ticks_per_second; (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; } Any ideas on how I can fix this? Thanks. Best regards, Habeeb ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [civetweb] Interface for setting stack size and scheduler options
Hello, I'm currently try to replace our mongoose port with a current version of civetweb. Civetweb is a fork of the last MIT licensed version of mongoose that is still maintained under the MIT license. To reduce the number of patches that are necessary, I tried to clean up the patch that allows setting stack size and scheduler policy with a parameter and commit it to civetweb. In RTEMS I introduced the parameters with this patch back in 2012: https://git.rtems.org/rtems/commit/?id=54da7c3e55056efd93adece52076b720490258d6 The maintainer signalized, that he would integrate patches to improve the compatibility but he isn't really happy about setting the stack size and scheduling options using parameters. This parameters would be visible to users of the standalone version too and could lead to wrong configurations. Instead he suggests a interface that would be visible for the library only: https://groups.google.com/forum/#!topic/civetweb/_Mul9PxgpBE Eventually someone could add a few thoughts what would be a good solution? Thanks Christian Mauderer -- embedded brains GmbH Christian Mauderer Dornierstr. 4 D-82178 Puchheim Germany email: christian.maude...@embedded-brains.de Phone: +49-89-18 94 741 - 18 Fax: +49-89-18 94 741 - 08 PGP: Public key available on request. Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG. ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v3 1/3] Resurrect for
Resurrect for use in . Newlib targets may provide an own version of in their machine directory to add custom user types for . Check the _SYS_TYPES_H header guard to prevent a direct include of , since the file is a Newlib speciality. Signed-off-by: Sebastian Huber --- newlib/libc/include/machine/types.h | 14 ++-- newlib/libc/include/sys/types.h | 10 +-- winsup/cygwin/include/cygwin/types.h | 129 ++-- winsup/cygwin/include/machine/types.h | 137 ++ 4 files changed, 152 insertions(+), 138 deletions(-) create mode 100644 winsup/cygwin/include/machine/types.h diff --git a/newlib/libc/include/machine/types.h b/newlib/libc/include/machine/types.h index 669242b..a5a64e6 100644 --- a/newlib/libc/include/machine/types.h +++ b/newlib/libc/include/machine/types.h @@ -1,11 +1,7 @@ -#ifndef_MACHTYPES_H_ -#define_MACHTYPES_H_ - /* - * This file is provided for backward compatibility. It is no longer used in - * Newlib. Do not add new things to it. + * Newlib targets may provide an own version of this file in their machine + * directory to add custom user types for . */ - -#include - -#endif /* _MACHTYPES_H_ */ +#ifndef _SYS_TYPES_H +#error "must be included via " +#endif /* !_SYS_TYPES_H */ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index 067d650..bd7f287 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -245,7 +245,7 @@ typedef __int64_t sbintime_t; * pointers rather than structs to ensure maximum binary compatability with * previous releases. * This means that we don't use the types defined here, but rather in - * + * */ #if defined(_POSIX_THREADS) && !defined(__CYGWIN__) @@ -430,11 +430,7 @@ typedef struct { int is_initialized; /* is this structure initialized? */ int init_executed; /* has the initialization routine been run? */ } pthread_once_t; /* dynamic package initialization */ -#else -#if defined (__CYGWIN__) -#include -#endif -#endif /* defined(_POSIX_THREADS) */ +#endif /* defined(_POSIX_THREADS) && !defined(__CYGWIN__) */ /* POSIX Barrier Types */ @@ -468,6 +464,8 @@ typedef struct { #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ #endif /* __CYGWIN__ */ +#include + #endif /* !__need_inttypes */ #undef __need_inttypes diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h index faf08bd..1268693 100644 --- a/winsup/cygwin/include/cygwin/types.h +++ b/winsup/cygwin/include/cygwin/types.h @@ -1,4 +1,4 @@ -/* types.h +/* cygwin/types.h Copyright 2001, 2002, 2003, 2005, 2006, 2010, 2011, 2012, 2015 Red Hat Inc. Written by Robert Collins @@ -12,128 +12,11 @@ details. */ #ifndef _CYGWIN_TYPES_H #define _CYGWIN_TYPES_H -#ifdef __cplusplus -extern "C" -{ -#endif +/* + * This file is provided for backward compatibility. It is no longer used in + * Newlib. Do not add new things to it. + */ -#include -#include -#include -#include - -#ifndef __timespec_t_defined -#define __timespec_t_defined -typedef struct timespec timespec_t; -#endif /*__timespec_t_defined*/ - -#ifndef __timestruc_t_defined -#define __timestruc_t_defined -typedef struct timespec timestruc_t; -#endif /*__timestruc_t_defined*/ - -typedef __loff_t loff_t; - -#if defined (__INSIDE_CYGWIN__) && !defined (__x86_64__) -struct __flock32 { - shortl_type;/* F_RDLCK, F_WRLCK, or F_UNLCK */ - shortl_whence; /* flag to choose starting offset */ - _off_t l_start; /* relative offset, in bytes */ - _off_t l_len; /* length, in bytes; 0 means lock to EOF */ - shortl_pid; /* returned with F_GETLK */ - shortl_xxx; /* reserved for future use */ -}; -#endif - -struct flock { - shortl_type;/* F_RDLCK, F_WRLCK, or F_UNLCK */ - shortl_whence; /* flag to choose starting offset */ - off_tl_start; /* relative offset, in bytes */ - off_tl_len; /* length, in bytes; 0 means lock to EOF */ - pid_tl_pid; /* returned with F_GETLK */ -}; - -#ifndef __BIT_TYPES_DEFINED -#define __BIT_TYPES_DEFINED__ 1 - -#ifndef __vm_offset_t_defined -#define __vm_offset_t_defined -typedef unsigned long vm_offset_t; -#endif /*__vm_offset_t_defined*/ - -#ifndef __vm_size_t_defined -#define __vm_size_t_defined -typedef unsigned long vm_size_t; -#endif /*__vm_size_t_defined*/ - -#ifndef __vm_object_t_defined -#define __vm_object_t_defined -typedef void *vm_object_t; -#endif /* __vm_object_t_defined */ - -#ifndef __register_t_defined -#define __register_t_defined -typedef __int32_t register_t; -#endif - -#ifndef __addr_t_defined -#define __addr_t_defined -typedef char *addr_t; -#endif - -#endif /*__BIT_TYPES_DEFINED*/ - -#if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus) - -typedef struct __pthread_t {char __dummy;} *pthread_t; -t
[PATCH v3 2/3] Always provide register_t via
Always provide register_t via for glibc and BSD compatibility. Define __BIT_TYPES_DEFINED__ to 1 like glibc for legacy header files. Signed-off-by: Sebastian Huber --- newlib/libc/include/sys/types.h | 6 ++ winsup/cygwin/include/machine/types.h | 5 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index bd7f287..a69054f 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -36,6 +36,8 @@ typedef __uint32_tu_int32_t; #if ___int64_t_defined typedef __uint64_t u_int64_t; #endif +typedef int register_t; +#define __BIT_TYPES_DEFINED__ 1 #if defined(__rtems__) || defined(__XMK__) /* @@ -158,10 +160,6 @@ typedef__ino_t ino_t; /* inode number */ typedefchar * addr_t; typedef unsigned long vm_offset_t; typedef unsigned long vm_size_t; - -#define __BIT_TYPES_DEFINED__ - -typedef int32_t register_t; #endif /* __i386__ && (GO32 || __MSDOS__) */ /* diff --git a/winsup/cygwin/include/machine/types.h b/winsup/cygwin/include/machine/types.h index cfc372f..bde3371 100644 --- a/winsup/cygwin/include/machine/types.h +++ b/winsup/cygwin/include/machine/types.h @@ -71,11 +71,6 @@ typedef unsigned long vm_size_t; typedef void *vm_object_t; #endif /* __vm_object_t_defined */ -#ifndef __register_t_defined -#define __register_t_defined -typedef __int32_t register_t; -#endif - #ifndef __addr_t_defined #define __addr_t_defined typedef char *addr_t; -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH v3 3/3] Provide FreeBSD types for on RTEMS
Provide the following types via on RTEMS for FreeBSD compatibility if __BSD_VISIBLE * accmode_t, * cap_rights_t, * c_caddr_t, * cpulevel_t, * fixpt_t, * lwpid_t, * uintfptr_t, * vm_offset_t, * vm_ooffset_t, * vm_paddr_t, * vm_pindex_t, and * vm_size_t. Signed-off-by: Sebastian Huber --- newlib/libc/sys/rtems/include/machine/_types.h | 7 +++ newlib/libc/sys/rtems/include/machine/types.h | 73 ++ 2 files changed, 80 insertions(+) create mode 100644 newlib/libc/sys/rtems/include/machine/types.h diff --git a/newlib/libc/sys/rtems/include/machine/_types.h b/newlib/libc/sys/rtems/include/machine/_types.h index e5dece0..f003ce9 100644 --- a/newlib/libc/sys/rtems/include/machine/_types.h +++ b/newlib/libc/sys/rtems/include/machine/_types.h @@ -28,6 +28,13 @@ typedef unsigned long __ino_t; typedef__uint32_t __mode_t; #define__machine_mode_t_defined +typedefint __accmode_t;/* access permissions */ +typedef__uint32_t __fixpt_t; /* fixed point number */ +typedefint __lwpid_t; /* Thread ID (a.k.a. LWP) */ +typedef__int64_t __rlim_t; /* resource limit - intentionally */ + /* signed, because of legacy code */ + /* that uses -1 for RLIM_INFINITY */ + #ifdef _KERNEL typedefint boolean_t; typedefstruct device *device_t; diff --git a/newlib/libc/sys/rtems/include/machine/types.h b/newlib/libc/sys/rtems/include/machine/types.h new file mode 100644 index 000..52ff790 --- /dev/null +++ b/newlib/libc/sys/rtems/include/machine/types.h @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2016 embedded brains GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS_TYPES_H +#error "must be included via " +#endif /* !_SYS_TYPES_H */ + +#if __BSD_VISIBLE + +#ifndef _ACCMODE_T_DECLARED +typedef__accmode_t accmode_t; /* access permissions */ +#define_ACCMODE_T_DECLARED +#endif + +#ifndef _CAP_RIGHTS_T_DECLARED +#define_CAP_RIGHTS_T_DECLARED +struct cap_rights; + +typedefstruct cap_rights cap_rights_t; +#endif + +typedefconst char *c_caddr_t; /* core address, pointer to const */ + +typedefint cpulevel_t; +typedefint cpusetid_t; +typedefint cpuwhich_t; + +typedef__fixpt_t fixpt_t;/* fixed point number */ + +#ifndef _LWPID_T_DECLARED +typedef__lwpid_t lwpid_t;/* Thread ID (a.k.a. LWP) */ +#define_LWPID_T_DECLARED +#endif + +#ifndef _RLIM_T_DECLARED +typedef__rlim_trlim_t; /* resource limit */ +#define_RLIM_T_DECLARED +#endif + +typedef__uintptr_t segsz_t;/* segment size (in pages) */ + +typedef__uintptr_t uintfptr_t; + +typedef__intptr_t vm_ooffset_t; +typedef__uintptr_t vm_offset_t; +typedef__uintptr_t vm_paddr_t; +typedef__uintptr_t vm_pindex_t; +typedef__uintptr_t vm_size_t; + +#endif /* __BSD_VISIBLE */ -- 1.8.4.5 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel