| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
When dynamic debug is engaged, the output is pretty flooded by
malloc/free messages while you are looking at other traces.
As devel.mk have a DEBUG_MALLOC option, it seems pretty logical to
enable the malloc/free dprintf() only if this option is engaged.
That patch make the dynamic debug output less floody while letting the
choice to get the malloc/free dprintf() messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can exercise the memory subsystem through unit tests with a little
bit of coaxing. We need to create a number of fake data objects in order
to get it to build. This is less than ideal, but once we've got good
test coverage and confidence in our tests we can begin refactoring.
Had this unit test already been in place, commit 33c4ab1b ("mem: fix
regression in recent memscan changes") would have never been required
because buggy commit a1331f8d ("memscan: pass enum syslinux_memmap_types
around") would have broke the unit test. Ordinarily, this unit test
would have been part of the bugfix commit 33c4ab1b, but the bugfix needs
to be backported to 5.xx on its own.
test_mem_init_reserved() tests whether SMT_RESERVED regions are
incorrectly added to the memory subsystems's freelist.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
It is good practice to explicitly include required header files as it
clearly highlights dependencies.
This practice also makes it easier to write unit tests since we
explicitly include dummy header files from unittest/include.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
A thinko in commit a1331f8d ("memscan: pass enum syslinux_memmap_types
around") causes many machines not to boot because the expression
"!SMT_FREE" always evaluates to "false", regardless of the value of
'type', which means that mem_init() may use reserved memory regions for
general allocation.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
| |
The memscan interface should be using SMT_* to describe the types of
memory regions as SMT_* are platform agnostic values. This will allow us
to be much more descriptive about the type of memory regions in future.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
syslinux-5.10-pre2
Conflicts:
NEWS
com32/include/netinet/in.h
com32/include/sys/cpu.h
com32/lib/Makefile
core/Makefile
core/fs/diskio.c
core/fs/pxe/pxe.h
core/init.c
core/mem/free.c
core/mem/malloc.c
mk/devel.mk
version
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Welcome to Syslinux 5.10.
Conflicts:
NEWS
com32/lib/Makefile
com32/lib/sys/open.c
com32/lib/syslinux/ipappend.c
com32/modules/Makefile
com32/modules/prdhcp.c
core/Makefile
core/cmdline.inc
core/com32.inc
core/comboot.inc
core/configinit.inc
core/fs/chdir.c
core/fs/fs.c
core/fs/pxe/dnsresolv.c
core/fs/pxe/pxe.c
core/fs/pxe/pxe.h
core/idle.c
core/include/ctype.h
core/init.inc
core/mem/init.c
core/parseconfig.inc
core/runkernel.inc
core/syslinux.ld
core/ui.inc
doc/comboot.txt
version
|
| | |
| | |
| | |
| | |
| | |
| | | |
Dynamically size the heap to 1/16 of available high memory.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add a single semaphore to make malloc and free thread safe.
This is code I extracted from hpa's earlier effort at
importing lwip into syslinux.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Very little checking is performed on the validity of freelist
metadata. Add a magic field to struct arena_header which can be used
to detect memory corruption or whether a user tries to free something
that isn't a malloc pointer.
This feature can be enabled with -DDEBUG_MALLOC. Turn it on for
development in mk/devel.mk.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
Makefile
NEWS
com32/cmenu/Makefile
com32/elflink/ldlinux/Makefile
com32/gfxboot/Makefile
com32/gpllib/Makefile
com32/include/sys/module.h
com32/lib/Makefile
com32/lib/sys/module/elf_module.c
com32/menu/Makefile
com32/rosh/Makefile
com32/samples/Makefile
core/init.c
mk/elf.mk
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Failure to do so means we may put a free block in some random location
because ARENA_HEAP_GET() can return something invalid when used to
find the correct free list in __free_block().
This bug manifested as running out of available free memory.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
Makefile
com32/elflink/ldlinux/Makefile
com32/lib/sys/module/elf_module.c
core/cleanup.c
core/comboot.inc
core/conio.c
core/fs/fs.c
core/init.c
core/mem/free.c
core/mem/malloc.c
core/timer.inc
diag/geodsp/Makefile
extlinux/main.c
mk/embedded.mk
modules/Makefile
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before modules were dynamically loaded the boundary between GPL and
non-GPL code was implicit because of the separate link domains for
each module. With dynamic modules we need an explicit whitelist of
core symbols that non-GPL code can link against at runtime without
needing to be re-licensed under the GPL.
Mark such symbols with __export, so that it is explicitly clear which
symbols in the core can be linked against by non-GPL code.
Reduce the visibility of symbols in both the core and ldlinux.c32 with
-fvisibility=hidden. __export changes the visibility to 'default'.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of littering core/mem with #ifdef SYSLINUX_EFI move memory
operations into the 'firmware' structure so that they can be
implemented differently for BIOS and EFI.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Pull in the latest prerelease that includes some bug fixes for ldlinux
and a realloc() bug in core/.
Conflicts:
com32/cmenu/Makefile
com32/elflink/ldlinux/Makefile
com32/lib/Makefile
core/pxelinux.asm
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 79459f631546eea83d4158f535c20ebd4ac18987 copied portions of
com32/lib/realloc.c into core/mem/malloc.c, with minor changes
for accessing allocation arena header attributes. The previous
code used structure members and the current code uses bitmask
macros.
On a particular line in the original realloc(), there were two
assignments in a single expression that included a compound
assignment. This fact was missed when the code was copied and
modified to use the bitmask macros.
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
Makefile
com32/elflink/ldlinux/adv.c
com32/elflink/ldlinux/kernel.c
com32/elflink/ldlinux/ldlinux.c
com32/include/bitsize/stddef.h
com32/include/bitsize/stdint.h
com32/include/stdint.h
com32/include/sys/module.h
com32/include/sys/x86_64/bitops.h
com32/include/syslinux/linux.h
com32/lib/Makefile
com32/lib/sys/ansicon_write.c
com32/lib/sys/module/elfutils.h
com32/lib/sys/vesa/efi/fill.h
com32/lib/syslinux/load_linux.c
com32/lib/syslinux/serial.c
com32/lib/syslinux/shuffle.c
core/conio.c
core/elflink/config.c
core/elflink/load_env32.c
core/graphics.c
core/include/graphics.h
core/init.c
core/pxelinux.asm
mk/elf.mk
mk/lib.mk
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Remove a completely unused variable giving a "set but not used"
warning.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The reason behind commit 9333426b ("elflink: fix the global naming for
lmalloc") seems to be that we need to avoid having two 'lmalloc'
symbols, one in the core and one in the com32 library.
Unfortunately, this commit introduced the following warning in
multiple places,
meminfo.c:47:2: warning: implicit declaration of function ‘lmalloc’
meminfo.c:47:9: warning: assignment makes pointer from integer without a cast
meminfo.c:93:5: warning: implicit declaration of function ‘free’
meminfo.c:93:5: warning: incompatible implicit declaration of built-in function ‘free’
Consolidate the implementations of lmalloc() so that it's suitable for
use both in the com32 library code and the core.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of returning the pointer to the newly allocated memory,
relloc() currently returns garbage. Return the correct pointer.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We actually need to AllocatePool() the memory we want, otherwise the
firmware can use it behind our backs. Since EFI firmware doesn't
provide an interface for allocating memory at a specific address if
the requested size isn't a multiple of PAGE_SIZE, use the pool
functions.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
In an upcoming patch series we're going to need to abstract the
firmware operations because they will be provided by both BIOS and
EFI.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 46b993449264a2332427a165b4c77e400a053178.
Build failure was due to a non-clean tree.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
| |
| |
| |
| |
| |
| | |
Remove a redundant definition of zalloc() which causes a compile
failure.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
| |
| |
| |
| |
| | |
Fix warnings (that block -Werror) in core/mem/init.c
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There's only one function required for printing debugging information
and that is dprintf() - there is no need to invent another. dprintf()
is also superior to mp() because it can be enabled/disabled on a
per-file basis via the DEBUG symbol.
Switch all users of mp() to dprintf() and leave them disabled (don't
define the DEBUG) so we have a less verbose boot by default.
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
|
| |
| |
| |
| |
| |
| |
| | |
Change some printf() calls to dprintf() so that we stop printing
debugging information that is only useful for developers.
Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
|
|\ \
| |/
| |
| |
| |
| |
| |
| | |
Resolved Conflicts:
core/diskfs.inc
core/mem/free.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
__free_tagged called by comboot_cleanup_lowmem (core/mem/free.c) doesn't
seem to work correctly. Memory allocated with lmalloc() isn't marked as free
after the allocating module exits:
boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000553f0
boot: mem
lowmem_buf: 0x00075400
boot: mem
lowmem_buf: 0x00000000
boot:
The expected behaviour
boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000353e0
boot: mem
lowmem_buf: 0x000353e0
can be achieved with the following patch.
|
| | |
|
| |
| |
| |
| |
| | |
* remove com32/lib/malloc.h
* remove com32/elflink/test_memalign.c
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
* remove most of the functinal codes from com32 malloc/realloc code
* next step will be remove those codes from com32
* one left item is posix memalign problem and memory tag problem
which is usded by elf module load code
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
* modify execute.c to not using __com32.cs_bounce but lmalloc/lfree
* give core/malloc 32M memory
Now the kernel is loading ok, but "memdisk initrd=doshd.img" is not
working, need ask hpa if he has a new doshd.img
|
| | |
|
| |
| |
| |
| |
| | |
mask the malloc of com32, will still need to change
its way of calling inject_free_block
|
| | |
|
|/
|
|
|
| |
core and com32 both have their own malloc system, change the name
to make them co-exist
|
|
|
|
|
|
|
| |
No point in zeroing out the disk cache and the heap. Put those in a
.hugebss section which we align, but don't zero.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
| |
Use 128K for the heap, to allow TFTP buffers to be allocated there.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Add a few dprintf() statements to the core malloc/free which makes it
easier to track down bugs.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
a) initialize *all* the head nodes
b) the lowmem heap needs to be paragraph (16 byte) aligned
c) use a dedicated tag value for headnodes. The type code should be
removed and replaced with special tag values for head node and
free.
d) for libcom32 code called from the core, do NOT present a
usable bounce buffer; we should only ever use lmalloc/lfree.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Use a better malloc for the core. In particular, use the same core
that we should eventually be able to use for the entire system in
Syslinux 5 -- with module awareness, etc.
This code can also accommodate multiple heaps. Set up a separate heap
for lowmem; the intent is to use explicit lowmem allocations instead
of the static bounce buffer. The lowmem allocation is also exported
via the pmapi mechanism, so modules can safely allocate lowmem.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|