summaryrefslogtreecommitdiff
path: root/com32/include/sys
Commit message (Collapse)AuthorAgeFilesLines
* removing double l from auxilliaryGeert Stappers2016-06-071-1/+1
| | | | | | | This patch changes only strings, no program code. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* fix a few typosJonathan Boeing2015-05-031-1/+1
| | | | Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
* sys/module.h: fix some typos in function documentationsFerenc Wágner2014-03-011-2/+3
|
* sys/module.h: remove the #ifdef DYNAMIC_MODULE conditionFerenc Wágner2014-03-011-20/+0
| | | | | This makes the module_* functions accessible to COM32 modules. MODULE_INIT and MODULE_EXIT are not used anymore.
* Merge tag 'syslinux-5.10-pre2' into for-hpa/elflink/firmwareMatt Fleming2013-03-223-49/+49
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge branch 'lwip' into elflinkMatt Fleming2013-02-261-4/+27
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * sys/cpu.h: add barriersH. Peter Anvin2012-03-271-6/+6
| | | | | | | | | | | | | | | | | | | | | Add compiler barriers around instructions that muck with the interrupt state and so on. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * pxe: when hooking an interrupt, explicitly enable it at the PICH. Peter Anvin2011-05-091-0/+23
| | | | | | | | | | | | | | | | | | | | | At least gPXE/iPXE apparently enters the NBP with the interrupt line disabled at the PIC; explicitly enable it instead. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | Merge tag 'syslinux-5.01' into firmwaresyslinux-6.00-pre4Matt Fleming2013-01-292-33/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | module: Replace cur_module with module_current()syslinux-5.01-pre4Matt Fleming2013-01-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's easy for cur_module and prev_module to get out of sync with reality (the actual module that is running), so add module_current() which returns the module at the head of the module_list, i.e. the module that was loaded most recently. Better still, by using the list we don't have to do any kind of stacking of module pointers ourselves. This fixes a bug where cur_module contained a stale pointer (the module had actually been unloaded) but the pointer value had since been reallocated for a new module in spawn_load(), meaning that the following check, if (!strcmp(cur_module->name, module->name)) was always going to be true, even though *no* module was actually loaded at this point as we were reloading ldlinux.c32 from start_ldlinux(). This could have been fixed with a NULL-assignment after module_unload(), but using the modules_head list to detect the current module is much cleaner. Note that the core module loaded in load_env32() is always on the list, therefore module_current() will always return a valid pointer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | elf: remove long-since-obsolete shallow module machineryH. Peter Anvin2013-01-172-33/+0
| | | | | | | | | | | | | | | | | | | | | Meant to handle symbols exported from the core, but we just pregenerate the dynamic section instead. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | | Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmwareMatt Fleming2012-08-131-0/+10
|\ \ \ | |/ / | | | | | | | | | Conflicts: com32/lib/sys/module/common.c
| * | ldlinux: Use findpath() to lookup filenamessyslinux-5.00-pre7Matt Fleming2012-08-071-0/+2
| | | | | | | | | | | | | | | | | | | | | We should use the same method of opening files as the module code when searching for extensions. In particular, we should search all of PATH. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | ldlinux: Return to command prompt after loading COM32Matt Fleming2012-08-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old COM32 loading code would drop the user at a command prompt once execution returned from the COM32 amodule. We need to replicate this because most callers of execute() don't expect it to return. This bug was noticed when loading a COM32 module from vesamenu.c32. Once execution returned from the COM32 module the display became garbled because no code exists to reinitialise the screen for VGA. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | | Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmwareMatt Fleming2012-07-304-718/+370
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | module: Make list of DT_NEEDED entries per-moduleMatt Fleming2012-06-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | We can't store the DT_NEEDED entries in the bss because 'needed[]' will be overwritten with recursive calls to module_load(). Make the list part of struct elf_module instead. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | elflink: Add _module_unload() prototype to module.hMatt Fleming2012-04-171-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8e0ed96bff7 ("elf: Support __constructor and __destructor") failed to add a prototype for the newly introduced _module_unload() function, which resulted in the following build warning being introduced, sys/module/exec.c: In function ‘spawn_load’: sys/module/exec.c:222:3: warning: implicit declaration of function ‘_module_unload’ Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | elflink: Delete dump_elf_module()Matt Fleming2012-04-171-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dump_elf_module() doesn't have any callers (it's call site is commented out in module_load()) and it's definition currently emits the following build warning, In file included from exit.c:34:0: ../include/sys/module.h: In function ‘dump_elf_module’: ../include/sys/module.h:123:55: warning: unused parameter ‘module’ Just delete it. If anyone needs a similar function in future it is trivial to write. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | ldlinux: Loading a config file should cause re-initialisationMatt Fleming2012-03-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a number of initialisation steps that need to be performed *every* time a config file is loaded. Reload ldlinux.c32 so that we can re-initialise the environment whenever a new config file is loaded. This involves unloading all the modules that have been loaded since ldlinux.c32. Luckily the list of loaded modules is sorted by load order, which means it's trivial to "pop" them from the front of the list. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | elf: Support __constructor and __destructorMatt Fleming2012-03-232-45/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old way of specifying functions that need to be run before/after a main function has never worked for ELF modules. Instead, the only way to get similiar behaviour was by using the MODULE_INIT() and MODULE_EXIT() macros, but no one seems to have bothered converting the old __constructor users over. Anyway, the old way is superior because it allows multiple functions be specified. Delete the MODULE_* macros as there's only one user of them in the entire tree. We can also get rid of the UNKNOWN_MODULE constant because now a module doesn't need a __module_init_ptr symbol to be classed as a library - if a module isn't an executable, it's a library, there's no such thing as an unknown type. It's no longer necessary to explicitly call __syslinux_get_ipappend_strings() from ldlinux.c because the __constructor tag on the version in com32/lib/syslinux will take care of invoking it before ldlinux.c32's main() is executed. Also, since we've refactored unload_module() to now run a module's destructors let's minimise the number of callers by deleting load_library() and unload_library(), which were only called by the test module in com32/elflink. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | | The ELF module load and the utility library routines fully support lookup, ↵chandramouli narayanan2012-06-254-363/+795
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resolution and relocation of symbols for both ELF32 and ELF64 environments. With this, syslinux.efi built for i386 and x86_64 can load the respective native command modules dynamically. The architecture dependent files are split into respective subdirectories (com32/lib/sys/module/i386 & com32/lib/sys/module/x86_64) for the build environment to pick. Files changed for commit: com32/include/sys/elfcommon.h com32/include/sys/module.h and its i386/ x86_64/ specific files com32/lib/sys/module/i386/common.[ch] and its counterpart in x86_64 com32/lib/sys/module/i386/elfutils.h and its counterpart in x86_64 com32/lib/sys/module/i386/elf_module.c and its counterpart in x86_64 com32/lib/sys/module/i386/shallow_module.c and its counterpart in x86_64 The implementation of com32/elflink/load_env32.c now takes care of both i386 and x86_64 to set up elf module system. Remanants of the unused old i386-only files, if any, need to be pruned.
* | | Patches here support 32bit and 64bit environment.chandramouli narayanan2012-06-256-156/+406
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the standard definitions of constants, variously-sized ints,limits into respective architecture specific files. com32/include/bitsize holds the standard header files that in turn include bitsize32 or bitsize64 based on the architecture. The makefiles should build pick the right ones based on architecture. Files com32/include/sys/cpu.h, com32/include/sys/bitops.h now have architecture specific files underneath to define relevant macros definitions. com32/include/setjmp.h has architecture specific counterparts underneath. ssize_t in dos/stdlib.h is appropriately defined based on architecture to be able to support building for 32bit and 64bit environments. Remanants of the unused old i386-only files, if any, need to be pruned.
* | ldlinux: Use DT_NEEDED for module dependenciesMatt Fleming2011-06-071-12/+0
| | | | | | | | | | | | | | | | | | The ELF file format uses DT_NEEDED entries in the dynamic section to name any shared library dependencies. Instead of rolling our own dependency logic via the modules.dep file and elf_gen_dep.sh script use the DT_NEEDED entries. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* | elflink: Move more code from core/ into ldlinuxMatt Fleming2011-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ldlinux now contains all the code necessary to load and execute modules, none is contained in the core. This change also allows us to change the spawn_load() prototype and to push the job of processing arguments to executable functions (e.g. the contents of char *argv[] as passed to a module's main function) into ldlinux/execute.c instead of doing it in spawn_load(). Moving it into ldlinux/ makes sense because the only core user of spawn_load() is load_env32() and we don't require any sort of argument processing in that path. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* | elflink: Remove MODULE_MAIN() from executable ELF modulesMatt Fleming2011-04-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make it easier to move existing COM32 modules over to ELF modules without having to modify them we need to search for and run their main() functions when they're loaded instead of requiring their initial function to be labeled with MODULE_MAIN(). Currently, we require all executable ELF modules to specify their initial function with the use of the MODULE_MAIN() macro and not via the traditional method of naming it main(). However, there are weird restrictions on what functions can be passed to MODULE_MAIN(), for instance, they must be declared static. This patch makes life much simpler and allows executable ELF modules to be loaded without the MODULE_MAIN() wrapper, but rather by naming their initial function main(). All the modules in com32/modules can now be run as ELF modules without any modifications. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* | Merge remote-tracking branch 'zytor/master' into elflinkMatt Fleming2011-04-261-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | We need the recent Makefile filename changes to be merged into the elflink branch because it will make things simpler when converting all modules to ELF format. Conflicts: com32/Makefile com32/modules/Makefile version
| * com32, bitops: proper constraint for byte-sized outputsyslinux-4.04-pre21H. Peter Anvin2011-04-041-1/+1
| | | | | | | | | | | | The proper output for the byte-sized output of "setc" is "=qm". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge commit 'syslinux-4.04-pre18' into elflinkH. Peter Anvin2011-04-041-5/+9
|\ \ | |/
| * com32, bitops: an "m" constraint takes an object, not a pointer to oneH. Peter Anvin2011-04-041-3/+7
| | | | | | | | | | | | | | | | | | The argument to an "m" constraint is an object, not a pointer to an object. For a void pointer it needs to be cast to an indirectable type (like char) and then indirected. Reported-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * bitops: the bt instructions returns result in CF, not ZFH. Peter Anvin2011-04-041-2/+2
| | | | | | | | | | | | | | | | The bit test instructions returns the tested bit in CF, not the inverse of the tested bit in ZF. I don't know how I got that idea... Reported-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge remote-tracking branch 'zytor/master' into elflink-mergeMatt Fleming2011-04-041-0/+58
|\ \ | |/ | | | | | | | | | | Conflicts: com32/lib/Makefile com32/lib/sys/open.c version
| * com32: add a centralized bitops headerH. Peter Anvin2010-11-141-0/+58
| | | | | | | | | | | | | | | | | | Add a centralized bitops header <sys/bitops.h> which uses x86 bitops instructions. This is necessary to keep gcc 4.5 from aborting compilation due to the inlined code being larger than the non-inlined version, and well, we should really use the bitops. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Convert mp() to dprintf()Matt Fleming2011-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | sys/times.h: Mark times() static inlineMatt Fleming2011-02-171-1/+7
| | | | | | | | | | | | | | | | | | As times() is just an accessor function for accessing __ms_timer it's worth marking it as static inline so that we don't incur any function call overhead just for accessing a symbol. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | elflink: merge with master branchFeng Tang2010-08-123-27/+715
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | ELF modules basically work Conflicts: com32/Makefile com32/lib/Makefile com32/lua/etc/luavs.bat core/fs/getcwd.c core/include/fs.h core/pmapi.c libinstaller/syslxmod.c Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * elflink: merge these filesFeng Tang2010-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | com32/include/sys/times.h com32/include/syslinux/config.h com32/include/syslinux/pmapi.h com32/include/unistd.h com32/include/zconf.h com32/include/zlib.h dos/Makefile dos/errno.h dos/string.h dos/syslinux.c dosutil/eltorito.asm dosutil/mdiskchk.c dosutil/mdiskchk.com extlinux/Makefile extlinux/fat.h extlinux/main.c libfat/libfat.h libfat/open.c libinstaller/Makefile libinstaller/setadv.c libinstaller/syslinux.h libinstaller/syslxcom.c libinstaller/syslxcom.h libinstaller/syslxint.h libinstaller/syslxmod.c libinstaller/syslxopt.c libinstaller/syslxopt.h linux/Makefile linux/syslinux.c
| * elflink: change the main func of hello.c to staticFeng Tang2010-07-201-18/+1
| | | | | | | | | | Otherwise it will be global and can't be searched, still don't know the real reason
| * elflink: add elf module dump funcFeng Tang2010-07-201-0/+17
| |
| * elflink: copy some elflink related files overFeng Tang2010-07-202-0/+511
| | | | | | | | also make sure the compiling passed
| * elflink: start merge with pathbased branchFeng Tang2010-07-201-27/+204
| | | | | | | | | | | | | | | | | | | | | | | | modify these files to make compile pass modified: com32/MCONFIG modified: com32/Makefile modified: com32/include/klibc/compiler.h modified: com32/include/sys/elfcommon.h modified: com32/lib/Makefile modified: com32/lib/free.c modified: com32/lib/malloc.c
* | com32: change clock_t to 32 bits, and in millisecondsH. Peter Anvin2010-07-051-2/+2
|/ | | | | | | Previously, clock_t was 16 bits and counted timer ticks, now make it 32 bits and count milliseconds. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: Unbreak <sys/cpu.h>H. Peter Anvin2010-05-111-32/+51
| | | | | | | CPUID functions were apparently broken when made PIC-safe; clean up and fix. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* core: move idle handling into protected modeH. Peter Anvin2010-03-301-1/+4
| | | | | | | | Do the actual idling in protected mode. This both allows PM code a more efficient interface, but also handles bugs in HVM implementations which don't handle HLT in real mode. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* sys/dirent.h: conversion macros between d_type and st_modeH. Peter Anvin2010-03-081-1/+9
| | | | | | Conversion macros to change between d_type and st_mode values. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* dirent.h: types for the d_type fieldH. Peter Anvin2010-03-061-2/+12
| | | | | | Add an enum for the DT_* constants for the d_type field. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* readdir: replace opendir/readdir/closedir API with a 32-bit APIH. Peter Anvin2010-03-041-5/+2
| | | | | | | | The 16-bit API to opendir/readdir/closedir was confused, had a memory leak, and was incompatible with Syslinux 3.x anyway. Replace it with a pure 32-bit API. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'master' into fscH. Peter Anvin2009-12-221-0/+16
|\ | | | | | | | | | | | | | | | | | | | | | | | | Resolved Conflicts: com32/Makefile com32/lib/sys/open.c com32/modules/Makefile dos/Makefile dos/com16.ld dos/syslinux.c version Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * com32: Avoid gpxe detection code duplicationErwan Velu2009-12-041-0/+16
| | | | | | | | | | | | Impact: avoid code duplication This will make code more generic, hdt will need it ;)
* | Merge branch 'master' into fscH. Peter Anvin2009-08-311-6/+6
|\ \ | |/
| * Merge commit 'hpa/master' into for-erwanPierre-Alexandre Meyer2009-08-049-224/+222
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: com32/cmenu/libmenu/com32io.h com32/gplinclude/dmi/dmi.h com32/gplinclude/dmi/dmi_base_board.h com32/gplinclude/dmi/dmi_memory.h com32/gplinclude/dmi/dmi_system.h com32/gpllib/dmi/dmi.c com32/gpllib/dmi/dmi_memory.c com32/include/sys/pci.h com32/lib/pci/scan.c com32/modules/Makefile Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>