Freddie Chopin | 19 May 20:48 2015
Picon

Another improvement of gmtime_r()

Hello!

You may assume that I have some strange obsession with gmtime_r(), but 
that wouldn't be true (; I just found a very good document about date 
algorithms with very good code samples that are placed in public domain, 
so I couldn't resist checking how does that compare to current newlib's 
code.

http://howardhinnant.github.io/date_algorithms.html#civil_from_days

I've added the author of the code to CC list.

It turns out that gmtime_r() with the algorithm from civil_from_days() 
by Howard Hinnant is ~13% faster on ARM Cortex-M4 - 3 million 
calculations take 29.5s vs 34s. The code is slightly larger, but we're 
talking about ~100 bytes in that case.

I've verified the correctness of the calculations by comparing the 
modified code with results of gmtime_r() from glibc over the span of 
~1600 years (with 64-bit time_t), every 60 seconds - the results match. 
I've also compared the results of the modified function with result of 
current code in newlib and they are also equal.

I attach patch and a Changelog entry.

Regards,
FCh
2015-05-19  Freddie Chopin  <freddie_chopin <at> op.pl>
(Continue reading)

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 8/8] or1k: Add missing initialization of impure ptr

libgloss/Changelog:
    * or1k/impure.c: Fix initialization of impure ptr

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 7/8] or1k: set heap start for optimsoc-gzll

With the gzll kernel we have two different loading options:

 - If the image is loaded to the global memory, the bootstrapping
   loads the kernel to local memory. Applications are loaded on
   demand. The heap then starts right after bss.

 - If the image is pre-loaded to the local memory it includes the
   application binaries right after bss. The heap then starts after
   the application objects.

We can check if this is a gzll kernel as it has the string "gzll" at
0x2000. At 0x200c we then find the end of the application objects in
the image. If there is no global memory we set _or1k_heap_start to
this value.

libgloss/Changelog:
    * or1k/boards/optimsoc.S: Heap for gzll kernel
Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 5/8] or1k: UART also accept timeout interrupt

The UART interrupt only handled receiver FIFO full interrupts, but we
also want to handle timeout interrupts.

libgloss/Changelog:
    * or1k/or1k_uart.c: Fix interrupts

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 6/8] or1k: Make heap start configurable

Previously the heap started right after the bss section. This can now
be configured by changing the _or1k_heap_start symbol that defaults to
the old value (&end). In board_init_early, we can now set this to
another value.

libgloss/Changelog:
    * or1k/sbrk.c: Allow for different heap start

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 4/8] or1k: Bug fix in timer

Properly set the interrupt pending flag in the timer mode register.

libgloss/Changelog:
    * or1k/timer.c: Properly set interrupt flags

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 3/8] or1k: Store entire context

Store the exception program counter (from EPCR) and exception status
register (from ESR) also during the exception. A runtime system may
replace them thereby to implement a thread switch.

libgloss/Changelog:
    * or1k/exception-asm.S: Store missing state

Stefan Wallentowitz | 17 May 17:04 2015
Picon

[PATCH 2/8] or1k: Fix exception stack frame

We do not need a red zone here, as we do not operate on the current
stack, but always use the clear exception stack. Also reserve two
extra words for the context to store EPCR and ESR.

libgloss/Changelog:
    * or1k/crt0.S: Fix exception stack frame
    * or1k/exception-asm.S: ditto

Stefan Wallentowitz | 17 May 16:59 2015
Picon

[PATCH 1/8] or1k: Callee-saved registers for permanent data (with attachment)

During interrupt handling the PICSR, table pointers and current
interrupt line have been saved in incorrect registers and/or stored on
the stack.

Save the pointer in r16/r18, PICSR in r20 and the current interrupt
line in r22. Those are callee-saved registers, so that the register
values will be preserved.

libgloss/Changelog:
    * or1k/interruts-asm.S: Change registers to callee-saved

Stefan Wallentowitz | 17 May 16:53 2015
Picon

[PATCH 1/8] or1k: Callee-saved registers for permanent data

Hi all,

this is the first of a set of patches for the or1k libgloss, essentially
some small bug fixes.

Thanks in advance!

Best,
Stefan

During interrupt handling the PICSR, table pointers and current
interrupt line have been saved in incorrect registers and/or stored on
the stack.

Save the pointer in r16/r18, PICSR in r20 and the current interrupt
line in r22. Those are callee-saved registers, so that the register
values will be preserved.

libgloss/Changelog:
    * or1k/interruts-asm.S: Change registers to callee-saved

Nick Clifton | 13 May 16:22 2015
Picon

RFA: RL78: Add an assertion to detect link time data overflow.

Hi DJ,

  The patch below adds an assertion the .stack sections in the RL78
  linker scripts in libgloss.  This assertion checks for the data area
  overflowing into the stack space.  (Using the linker's
  --check-sections option does not work because the .stack section is
  empty).

  OK to apply ?

Cheers
  Nick

libgloss/ChangeLog
2015-05-13  Nick Clifton  <nickc <at> redhat.com>

	* rl78/rl78.ld (.stack): Add an assertion to make sure that the
	data area does not overrun the stack.
	* rl78/rl78-sim.ld (.stack): Likewise.

diff --git a/libgloss/rl78/rl78-sim.ld b/libgloss/rl78/rl78-sim.ld
index 26d62ac..ff7f403 100644
--- a/libgloss/rl78/rl78-sim.ld
+++ b/libgloss/rl78/rl78-sim.ld
 <at>  <at>  -126,6 +126,10  <at>  <at>  SECTIONS
   {
     PROVIDE (__stack = .);
     *(.stack)
+    /* Linker section checking ignores empty sections
+       like this so we have to have our own test here.
(Continue reading)


Gmane