[OpenBIOS] [PATCH 0/8] RFC: OFMEM cleanup/memory reduction patch

Blue Swirl blauwirbel at gmail.com
Sat Apr 7 13:09:19 CEST 2012


On Fri, Apr 6, 2012 at 19:48, Mark Cave-Ayland
<mark.cave-ayland at ilande.co.uk> wrote:
> This patchset aims to tidy up various parts of OFMEM, with the ultimate aim
> of reducing the image sizes. The first 4 patches perform the reorganisation,
> while the remainder of the patches ensure that video memory and the Forth
> machine memory are no longer contained within the image.

Patches look OK. Coding style could be adjusted while moving the code
and 'extern' is not useful in C for function prototypes.

> Note: the resulting SPARC64 image is now approximately half of its original
> size - BUT because we require 512K alignment for various parts of the image
> because of the 512K MMU page size, our ability to claim this space back
> directly is limited. Any further ideas on this would be welcomed.

At least FSYS_BUF in grubfs could be dynamically allocated and/or
shrunk, maybe some others also from this list:
$ nm --size --size-sort obj-sparc64/openbios-builtin.elf.nostrip |
egrep -v ' [tTrR] ' | tail
0000000000000100 b dp2.1303
0000000000000100 b file_descriptors
0000000000000100 b obio_cmdline
0000000000000118 d main_ctx
0000000000001000 B dstack
0000000000001000 B rstack
0000000000004000 b image_stack
0000000000008000 B FSYS_BUF
0000000000080000 d forth_dictionary
00000000000c0000 b s_ofmem_data

It wouldn't help here, but sections .text and .rodata could be merged,
GCC already assumes that .text is readable. This would save one TLB
entry since combined size is still < 512k.

>
> Mark Cave-Ayland (8):
>  Rename ofmem_arch_early_map_pages() to ofmem_arch_map_pages().
>  SPARC32: Move ofmem_arch_map_pages() into ofmem_sparc32.c with all
>    the other     architecture-specific code.
>  SPARC64: Refactor tte-data code in preparation for moving
>    architecture-specific     code to ofmem_sparc64.c.
>  SPARC64: Move ofmem_arch_map_pages()/ofmem_arch_unmap_pages() into
>     ofmem_sparc64.c with all the other architecture-specific code.
>  Remove architecture-specific routines from ofmem.h.
>  SPARC64: Remove video initialisation hack.
>  SPARC64: Swap Forth machine memory allocation over to OFMEM memory
>    pool.
>  SPARC32: Swap Forth machine memory allocation over to OFMEM memory
>    pool.
>
>  openbios-devel/arch/ppc/ofmem.c                    |    2 +-
>  openbios-devel/arch/ppc/qemu/ofmem.c               |    6 +-
>  openbios-devel/arch/sparc32/lib.c                  |   95 +---------
>  openbios-devel/arch/sparc32/ofmem_sparc32.c        |   82 ++++++++-
>  openbios-devel/arch/sparc32/openbios.c             |   27 ++-
>  openbios-devel/arch/sparc64/ldscript               |    6 -
>  openbios-devel/arch/sparc64/lib.c                  |  210 ++------------------
>  openbios-devel/arch/sparc64/ofmem_sparc64.c        |  176 ++++++++++++++++-
>  openbios-devel/arch/sparc64/ofmem_sparc64.h        |   32 ---
>  openbios-devel/arch/sparc64/openbios.c             |   30 ++-
>  openbios-devel/drivers/iommu.c                     |    4 +-
>  openbios-devel/drivers/vga_vbe.c                   |    9 +-
>  .../include/arch/sparc32/ofmem_sparc32.h           |   28 +++
>  openbios-devel/include/arch/sparc64/io.h           |    2 +-
>  .../include/arch/sparc64/ofmem_sparc64.h           |   50 +++++
>  openbios-devel/include/libopenbios/ofmem.h         |   22 +--
>  openbios-devel/libopenbios/ofmem_common.c          |    6 +-
>  openbios-devel/packages/video.c                    |    4 +-
>  18 files changed, 405 insertions(+), 386 deletions(-)
>  delete mode 100644 openbios-devel/arch/sparc64/ofmem_sparc64.h
>  create mode 100644 openbios-devel/include/arch/sparc32/ofmem_sparc32.h
>  create mode 100644 openbios-devel/include/arch/sparc64/ofmem_sparc64.h
>
> --
> 1.7.2.5
>
>
> --
> OpenBIOS                 http://openbios.org/
> Mailinglist:  http://lists.openbios.org/mailman/listinfo
> Free your System - May the Forth be with you



More information about the OpenBIOS mailing list