#1761 closed enhancement (fixed)

2kB of memory are lost in the SpaceWire Driver

Reported by: Cláudio Silva Owned by: Daniel Hellstrom
Priority: highest Milestone: 4.11
Component: bsps Version: 4.10
Severity: minor Keywords:
Cc: joel.sherrill@…, cynt6007@… Blocked By:
Blocking:

Description (last modified by Gedare Bloom)

The structure GRSPW_DEV has two members that are the Descriptor Tables
used for the DMA engines. These members are allocated statically (“char
_txtable[SPACEWIRE_BDTABLE_SIZE*2];” ) with twice the size they need
to be. They should have 1024 bytes of size and have 2048. This extra
size is needed because the descriptor table needs to be “1024 aligned
(0x400)”.

In the function “grspw_hw_init” these memory areas are passed to the
function SPW_ALIGN which returns the first aligned address in the
memory area. This way the driver is allocating twice the memory
needed in order to find an aligned base address for the table inside
the memory area.

For example if the _txtable start address is 0x40000001, the address
returned by SPW_ALIGN will be 0x40000400 and the used memory area
will be 0x40000400-0x40000800. Addresses in the range 0x80000001-
0x40000399 will not be used, but will remain allocated.

This way we are losing 2kB in the descriptor tables.

Attachments (2)

grspw.patch (2.4 KB) - added by Daniel Ramirez on Dec 16, 2013 at 12:40:34 AM.
Descriptor tables are no longer statically allocated, saving memory
grspw-2.patch (2.5 KB) - added by Daniel Ramirez on Dec 16, 2013 at 6:39:05 PM.
Desciptor tables no longer statically allocated

Download all attachments as: .zip

Change History (10)

comment:1 Changed on Mar 10, 2011 at 8:57:27 AM by Cláudio Silva

Owner: changed from Joel Sherrill to Chris Johns

comment:2 Changed on Mar 10, 2011 at 2:46:13 PM by Joel Sherrill

Cc: Joel Sherrill added

Changed on Dec 16, 2013 at 12:40:34 AM by Daniel Ramirez

Attachment: grspw.patch added

Descriptor tables are no longer statically allocated, saving memory

Changed on Dec 16, 2013 at 6:39:05 PM by Daniel Ramirez

Attachment: grspw-2.patch added

Desciptor tables no longer statically allocated

comment:3 Changed on Dec 16, 2013 at 6:39:05 PM by Daniel Ramirez

attachments.isobsolete: 01

comment:4 Changed on Jan 8, 2014 at 4:49:13 AM by cynt6007

Status: newassigned, cynt6007@vandals.uidaho.edu

comment:5 Changed on Nov 23, 2014 at 5:37:45 PM by Joel Sherrill

Description: modified (diff)
Owner: changed from Chris Johns to Daniel Hellstrom

comment:6 Changed on Dec 19, 2014 at 5:06:18 AM by Gedare Bloom

Priority: normalhighest

Bump priority to highest for tickets with a fix attached or seemingly simple fix proposed in the description or comments.

comment:7 Changed on Jan 22, 2015 at 9:18:33 PM by Gedare Bloom

Description: modified (diff)

Fixed by 2486c49/rtems

comment:8 Changed on Jan 22, 2015 at 9:19:17 PM by Gedare Bloom

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.