summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [tables] Add table_index()Michael Brown2010-09-031-0/+25
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Add xfer_deliver_raw_meta()Michael Brown2010-09-031-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Generalise metadata "whence" field to "flags" fieldMichael Brown2010-09-031-25/+16Star
| | | | | | | | | | | | | iPXE has never supported SEEK_END; the usage of "whence" offers only the options of SEEK_SET and SEEK_CUR and so is effectively a boolean flag. Further flags will be required to support additional metadata required by the Fibre Channel network model, so repurpose the "whence" field as a generic "flags" field. xfer_seek() has always been used with SEEK_SET, so remove the "whence" field altogether from its argument list. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix misaligned table entries when using gcc 4.5Piotr Jaroszyński2010-08-206-15/+12Star
| | | | | | | | | | Declarations without the accompanying __table_entry cause misalignment of the table entries when using gcc 4.5. Fix by adding the appropriate __table_entry macro or (where possible) by removing unnecessary forward declarations. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [compiler] Prevent empty weak function stubs from being removedJoshua Oreman2010-08-191-0/+8
| | | | | | | | | | | | | | | | | Even with the noinline specifier added by commit 1a260f8, gcc may skip calls to non-inlinable functions that it knows have no side effects. This caused the get_cached_dhcpack() call in start_dhcp(), the weak stub of which has no code in its body, to be removed, preventing cached DHCP from working. Fix by adding a __keepme macro to compiler.h expanding to asm(""), as recommended by gcc's info page, and using it in the weak stub for get_cached_dhcpack(). Reported-by: Aaron Brooks <aaron@brooks1.net> Tested-by: Aaron Brooks <aaron@brooks1.net> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add the tap driverPiotr Jaroszyński2010-08-191-0/+1
| | | | | | | | | Add the tap driver that can be used like: $ ./ipxe.linux --net tap,if=tap0,mac=00:0c:29:c5:39:a1 The if setting is mandatory. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add command line argumentsPiotr Jaroszyński2010-08-191-0/+31
| | | | | | | | | | | Support qemu-like arguments for network setup: --net driver_name[,setting=value]* and global settings: --settings setting=value[,setting=value]* Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add device and driver modelPiotr Jaroszyński2010-08-192-0/+145
| | | | | | | | | Add the base to build linux drivers and the linux UI code on. UI fills device requests, which are later walked over by the linux root_driver and delegated to specific linux drivers. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add empty smbiosPiotr Jaroszyński2010-08-193-0/+20
| | | | | | | | | There exists an smbios userspace library so implementing this is probably possible, but doesn't seem really important to have in userspace. Hence provide a dummy implementation returning an error. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add napPiotr Jaroszyński2010-08-192-0/+19
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add umallocPiotr Jaroszyński2010-08-192-0/+19
| | | | | | | Add umalloc API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add uaccessPiotr Jaroszyński2010-08-192-0/+105
| | | | | | | | | | | | | | | Add user access API for linux. On linux userspace virtual == user == phys addresses. Physical addresses also being the same is wrong, but there is no general way of converting userspace addresses to physical as what appears to be contiguous in userspace is physically fragmented. Currently only the DMA memory is special-cased, but its conversion to bus addresses is done in phys_to_bus. This is known to break virtio as it is passing phys addresses to the virtual device. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add timerPiotr Jaroszyński2010-08-192-0/+19
| | | | | | | Add linux timer API. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linux api headersPiotr Jaroszyński2010-08-191-0/+72
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add strtoull()Piotr Jaroszyński2010-08-191-0/+40
| | | | | | | | | | Don't implement strtoul() on top of strtoull() as strtoull() is much bigger and only used on linux currently. Instead refactor most of the logic out of strtoul() into static inlines and reuse that. Also put it in a separate object so it won't get linked in. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add isxdigit()Piotr Jaroszyński2010-08-171-0/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Export find_setting()Piotr Jaroszyński2010-08-171-0/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Move get_memmap() to the I/O API groupPiotr Jaroszyński2010-08-162-36/+26Star
| | | | | | | | | pcbios specific get_memmap() is used by the b44 driver making all-drivers builds fail on other platforms. Move it to the I/O API group and provide a dummy implementation on EFI. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Allow out-of-order receive queue to be discardedMichael Brown2010-07-211-0/+12
| | | | | | | | | Allow packets in the receive queue to be discarded in order to free up memory. This avoids a potential deadlock condition in which the missing packet can never be received because the receive queue is occupying all of the memory available for further RX buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Add cache discard mechanismMichael Brown2010-07-211-0/+17
| | | | | | | Add a facility allowing cached data to be discarded in order to satisfy memory allocations that would otherwise fail. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Handle out-of-order received packetsMichael Brown2010-07-211-1/+30
| | | | | | | | | | | | | | | Maintain a queue of received packets, so that lost packets need not result in retransmission of the entire TCP window. Increase the TCP window to 8kB, in order that we can potentially transmit enough duplicate ACKs to trigger Fast Retransmission at the sender. Using a 10MB HTTP download in qemu-kvm with an artificial drop rate of 1 in 64 packets, this reduces the download time from around 26s to around 4s. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Replace virtio-net with native iPXE driverStefan Hajnoczi2010-07-173-4/+9
| | | | | | | | | | | | | | | | | | | | | | This patch adds a native iPXE virtio-net driver and removes the legacy Etherboot virtio-net driver. The main reasons for doing this are: 1. Multiple virtio-net NICs are now supported by iPXE. The legacy driver kept global state and caused issues in virtual machines with more than one virtio-net device. 2. Faster downloads. The native iPXE driver downloads 100 MB over HTTP in 12s, the legacy Etherboot driver in 37s. This simple benchmark uses KVM with tap networking and the Python SimpleHTTPServer both running on the same host. Changes to core virtio code reduce vring descriptors to 256 (QEMU uses 128 for virtio-blk and 256 for virtio-net) and change the opaque token from u16 to void*. Lowering the descriptor count reduces memory consumption. The void* opaque token change makes driver code simpler. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Mark weak functions noinlineStefan Hajnoczi2010-07-141-2/+9
| | | | | | | | | | | | | | | | | | | | | Weak functions whose visibility is hidden may be inlined due to a bug in GCC. Explicitly mark weak functions noinline to work around the problem. This makes the PXE_MENU config option work again, the PXE boot menu was never being called because the compiler inlined a weak stub function. The GCC bug was identified and fixed by Richard Sandiford <rdsandiford@googlemail.com> but in the meantime iPXE needs to implement a workaround. Reported-by: Steve Jones <steve@squaregoldfish.co.uk> Reported-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Suggested-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hci] Continue processing while prompting for shell bannerMichael Brown2010-07-141-0/+1
| | | | | | | | | Continue calling step() while displaying the shell banner. This potentially allows TCP connections to close gracefully after a failed boot attempt. Inspired-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [debug] Expose pause() and more() debugging functionsMichael Brown2010-07-141-24/+76
| | | | | | | | Include the pause() and more() debugging functions within the general iPXE debugging framework, by introducing DBGxxx_PAUSE() and DBGxxx_MORE() macros. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove some obsolete header filesMichael Brown2010-07-143-125/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Remove never-used putline() methodMichael Brown2010-07-141-15/+4Star
| | | | | | | | putline() was introduced back in 2007 for a feature that was never committed. No console driver implements it and no code calls it, so remove it from struct console_driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Fix embedded image buildingAlessandro Salvatori2010-07-051-3/+3
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Define Vendor Specific capability IDGlenn Brown2010-06-251-0/+1
| | | | | | | | Add a PCI_CAP_ID_VNDR definition for the PCI standard "Vendor Specific" capability ID. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_no_free handlerJoshua Oreman2010-06-231-0/+1
| | | | | | | Since more reference-counted structures than embedded images might want to mark themselves unfreeable, expose a dummy ref_no_free(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Allow for non-pass-through interface methodsMichael Brown2010-06-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | xfer_vredirect() should not be allowed to propagate to a pass-through interface. For example, when an HTTPS connection is opened, the redirect message should cause the TLS layer to reopen the TCP socket, rather than causing the HTTP layer to disconnect from the TLS layer. Fix by allowing for non-pass-through interface methods, and setting xfer_vredirect() to be one such method. This is slightly ugly, in that it complicates the notion of an interface method call by adding a "pass-through" / "non-pass-through" piece of metadata. However, the only current user of xfer_vredirect() is iscsi.c, which uses it only because we don't yet have an ioctl()-style call for retrieving the underlying socket address. The new interface infrastructure allows for such a call to be created, at which time this sole user of xfer_vredirect() can be removed, xfer_vredirect() can cease to be an interface method and become simply a wrapper around xfer_vreopen(), and the concept of a non-pass-through interface method can be reverted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-229-317/+60Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all name-resolution interfaces to generic interfacesMichael Brown2010-06-221-125/+6Star
| | | | | | | | Remove name-resolution as an interface type, and replace name-resolution interfaces with generic interfaces supporting the resolv_done() method. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all job-control interfaces to generic interfacesMichael Brown2010-06-224-141/+11Star
| | | | | | | | | Remove job-control as an interface type, and replace job-control interfaces with generic interfaces supporting the close() method. (Both done() and kill() are absorbed into the function of close(); kill() is merely close(-ECANCELED).) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Expand object interface to allow for polymorphic interfacesMichael Brown2010-06-224-30/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have several types of object interface at present (data-xfer, job control, name resolution), and there is some duplication of functionality between them. For example, job_done(), job_kill() and xfer_close() are almost isomorphic to each other. This updated version of the object interface mechanism allows for each interface to export an arbitrary list of supported operations. Advantages include: Operations methods now receive a pointer to the object, rather than a pointer to the interface. This allows an object to, for example, implement a single close() method that can handle close() operations from any of its exposed interfaces. The close() operation is implemented as a generic operation (rather than having specific variants for data-xfer, job control, etc.). This will allow functions such as monojob_wait() to be used to wait for e.g. a name resolution to complete. The amount of boilerplate code required in objects is reduced, not least because it is no longer necessary to include per-interface methods that simply use container_of() to derive a pointer to the object and then tail-call to a common per-object method. The cost of adding new operations is reduced; adding a new data-xfer operation such as stat() no longer incurs the penalty of adding a .stat member to the operations table of all existing data-xfer interfaces. The data-xfer, job control and name resolution interfaces have not yet been updated to use the new interface mechanism, but the code will still compile and run. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [retry] Add timer_init() wrapper functionMichael Brown2010-06-221-0/+12
| | | | | | | Standardise on using timer_init() to initialise an embedded retry timer, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-221-0/+35
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Move Ethernet MAC address checking routines to ethernet.hMichael Brown2010-06-071-0/+66
| | | | | Originally-fixed-by: Faur Andrei <da3drus@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [jme] Add JMicron Ethernet driverGuo-Fu Tseng2010-06-021-0/+1
| | | | | | | | | | | A new driver for JMicron Ethernet controller. Reviewed-by: Joshua Oreman <oremanj@rwcr.net> Reviewed-by: Michael Brown <mbrown@fensystems.co.uk> Reviewed-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add the "snpnet" driverGeoff Lywood2010-06-023-0/+92
| | | | | | | | | Add a new network driver that consumes the EFI Simple Network Protocol. Also add a bus driver that can find the Simple Network Protocol that iPXE was loaded from; the resulting behavior is similar to the "undionly" driver for BIOS systems. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Enable automated extraction of error usage reportsMichael Brown2010-05-314-158/+1048
| | | | | | | Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Tidy up output of EFI header import scriptMichael Brown2010-05-303-19/+65
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE declarations to EFI header filesMichael Brown2010-05-3040-0/+96
| | | | | | | | Autodetect the BSD licence statement in EFI header files, and add a suitable FILE_LICENCE macro to the version imported into the iPXE tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Synchronise EFI header filesMichael Brown2010-05-302-7/+10
| | | | | | | | | | Now that the PACKED macro conflict is resolved, we can use an unmodified import of the EFI header files (using include/ipxe/efi/import.pl). Synchronised to EDK2 SVN revision 10556. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove PACKED macroMichael Brown2010-05-301-3/+0Star
| | | | | | | Most of iPXE uses __attribute__((packed)) anyway, and PACKED conflicts with an identically-named macro in the upstream EFI header files. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update UEFI header files with latest version from TianoCoreGeoff Lywood2010-05-3040-1612/+6071
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Add generic base16 encoding and decoding routinesMichael Brown2010-05-282-0/+39
| | | | | | Base16 encoding is currently implemented in both iSCSI and SRP. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Add ability to decode base64 stringsMichael Brown2010-05-282-0/+16
| | | | | Inspired-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Allow base64_encode() to handle arbitrary dataMichael Brown2010-05-281-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-274-68/+7Star
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>