iso9660: Add support for Rock Ridge filenames

Add support for parsing SUSP and RRIP records, and support for Rock
Ridge filename extensions, thus avoiding the filename limitations
(length and character set) of plain iso9660.  This will be a part of
using UTF-8 for filenames and console.

[ hpa: manually rebased to the elflink branch ]
iso9660: Avoid arbitrarily large malloc()s

After explaining the slightly wasteful usage of malloc()/memcpy()
with multi-block CE entries, i noticed that i did not install a
safety cap on the malloc size.

I could not challenge this in practice but only by gdb manipulation.
My most CE-happy test image has 3 occasions of multi-block CE.
All three only span over 2 blocks each.
iso9660: read littleendian ISO 9660/SUSP numbers

Attached is a patch which switches susp_rr.c from reading the
big-endian ISO 9660 and SUSP numbers to reading the little-endian
ones.

Tested within libisofs on my collection of ISO images.

[ hpa: more mastering programs are known which botch the bigendian
  information than the littleendian information, so most systems only
  read the littleendian info regardless of the native byte order. ]
Generic facilities for byteswapping and unaligned references

For future portability, add functions to access both littleendian and
bigendian numbers, and to perform unaligned memory references.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
iso9660: use generic get_le32() accessor in SUSP/Rock Ridge code

Use the new get_le32() accessor in the SUSP/Rock Ridge code.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Schmitt <scdbackup@gmx.net>
iso9660.c did not copy terminating 0 of Rock Ridge name

I noticed that the trailing 0-byte is not copied to the result of
iso_readdir(). The function iso_convert_name() does append a trailing 0.
com32sys_t inreg shall be zeroified prior intcall

As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters
of intcall() shall be zeroified.

Having unclean inreg could trigger bad behaviors on some hosts.

This patch is about adding memset() calls prior any intcall() :
- some intcall didn't had any memset at all
- some successive intcall() calls didn't memset inreg in between calls
mem: Calling int15 for 0x8800

On some code, the intcall 0x15 was missing when playing with 0x8800
making code useless.

That's not a big deal since e820 or e801 shall be provided by host but
anyway, let's fix it ;)
efi: Add Intel copyright notices

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Add const qualifiers to loadleys

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
ldlinux/readconfig.c: remove bail: from do_include()

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
com32/modules/poweroff.c: fix main()

Wrong prototype; use GCC unused

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
com32/moduless/poweroff.c: use __unused attribute instead

Recommended-By: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Merge branch 'syslinux-5.xx' into master; fixes loadkeys

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
com32: fix __bswap_64_macro

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Add const qualifiers

Some functions are ignoring the const qualifier.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
efi/udp.c: Save UDP Port in core_udp_open()

core_udp_open() should obtain a UDP port allocation and save it for
  core_udp_connect() and core_udp_sendto() to reuse.

Author:        H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
efi/udp.c: Use existing UDP port in core_udp_sendto()

core_udp_open() obtained a port allocation.  Continue using it.

Author:        Celelibi <celelibi@gmail.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
efi: UseDefaultAddress in udp.c/tcp.c

We don't need to re-inform EFI what IPv4 address and subnet mask to use.
This change should help to re-use the exising routes.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
efu/udp: Unset mode

udata.AcceptAnyPort caused the udata.StationPort to return as 0.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>