<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/syslinux.git/com32/include/sys, branch syslinux-5.02-pre1</title>
<subtitle>git.kernel.org: pub/scm/boot/syslinux/syslinux.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/'/>
<entry>
<title>module: Replace cur_module with module_current()</title>
<updated>2013-01-23T15:05:29+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2013-01-23T14:46:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=7c42c59ebd9d33efe3a5f12542580a8c1379447d'/>
<id>7c42c59ebd9d33efe3a5f12542580a8c1379447d</id>
<content type='text'>
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-&gt;name, module-&gt;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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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-&gt;name, module-&gt;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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: remove long-since-obsolete shallow module machinery</title>
<updated>2013-01-18T00:52:20+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@linux.intel.com</email>
</author>
<published>2013-01-18T00:52:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=14fe8af6c11e71619de9be1afd4556ebbc770db3'/>
<id>14fe8af6c11e71619de9be1afd4556ebbc770db3</id>
<content type='text'>
Meant to handle symbols exported from the core, but we just
pregenerate the dynamic section instead.

Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Meant to handle symbols exported from the core, but we just
pregenerate the dynamic section instead.

Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldlinux: Use findpath() to lookup filenames</title>
<updated>2012-08-07T09:40:12+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-08-07T09:40:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=d1d03dee6bc961b0afd8dfc68fd35772ecded8be'/>
<id>d1d03dee6bc961b0afd8dfc68fd35772ecded8be</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldlinux: Return to command prompt after loading COM32</title>
<updated>2012-08-02T08:26:54+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-08-02T08:26:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=32ad2427ecda042a5eff93bae3773496ba5f44c1'/>
<id>32ad2427ecda042a5eff93bae3773496ba5f44c1</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>module: Make list of DT_NEEDED entries per-module</title>
<updated>2012-06-20T15:35:41+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-06-20T15:17:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=dffee2c45ad45957f791c89e9197e115f9449b40'/>
<id>dffee2c45ad45957f791c89e9197e115f9449b40</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elflink: Add _module_unload() prototype to module.h</title>
<updated>2012-04-17T09:58:33+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-04-02T10:50:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=ca5a008e119fd83866bface7037ae46ceb326980'/>
<id>ca5a008e119fd83866bface7037ae46ceb326980</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elflink: Delete dump_elf_module()</title>
<updated>2012-04-17T09:58:33+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-03-30T14:19:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=b5529aac6a38f15084f7710018fd24921cb6be54'/>
<id>b5529aac6a38f15084f7710018fd24921cb6be54</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldlinux: Loading a config file should cause re-initialisation</title>
<updated>2012-03-23T16:56:15+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-03-13T09:37:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=3a316db137afe3b4c9d7f04fcf47921f509ef36c'/>
<id>3a316db137afe3b4c9d7f04fcf47921f509ef36c</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Support __constructor and __destructor</title>
<updated>2012-03-23T16:54:47+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@intel.com</email>
</author>
<published>2012-03-22T15:31:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=8e0ed96bff75801f7430da88d83ea1b52827b123'/>
<id>8e0ed96bff75801f7430da88d83ea1b52827b123</id>
<content type='text'>
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 &lt;matt.fleming@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ldlinux: Use DT_NEEDED for module dependencies</title>
<updated>2011-06-07T14:59:58+00:00</updated>
<author>
<name>Matt Fleming</name>
<email>matt.fleming@linux.intel.com</email>
</author>
<published>2011-06-06T13:12:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/syslinux.git/commit/?id=558de6072a2fae89a27d10119b3ea49a4741db16'/>
<id>558de6072a2fae89a27d10119b3ea49a4741db16</id>
<content type='text'>
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 &lt;matt.fleming@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;matt.fleming@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
