coreboot-kgpe-d16/payloads/libpayload
Patrick Rudolph 1fea734e54 libpayload/drivers/usb: Fix leaks
Don't leak buffers on device detach.

Tested on qemu using:
qemu-system-x86_64 -bios build/coreboot.rom -M pc -m 2048 -usb \
 -device usb-ehci,id=ehci -device usb-mouse -device usb-audio,bus=usb-bus.0 \
 -device usb-bt-dongle,bus=usb-bus.0 -device usb-kbd

Change-Id: Ib2d80dd4590aa0dacdf2da3b614c6505c931d0be
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/23689
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2018-10-01 16:58:29 +00:00
..
arch src/*: normalize Google copyright headers 2018-09-28 07:13:00 +00:00
bin
configs libpayload: cheza - fix config for chromium chroot build 2018-06-22 13:11:06 +00:00
crypto
curses payloads: Remove/fix trailing whitespace 2018-09-04 12:38:40 +00:00
drivers libpayload/drivers/usb: Fix leaks 2018-10-01 16:58:29 +00:00
gdb
include src/*: normalize Google copyright headers 2018-09-28 07:13:00 +00:00
libc libpayload/libc/time: Add an arch_ndelay() 2018-09-12 14:15:18 +00:00
libcbfs cbfs: Rename CBFS_TYPE_PAYLOAD to CBFS_TYPE_SELF 2018-05-04 10:30:24 +00:00
liblz4
liblzma
libpci libpayload: Add pci_free_dev() and some boilerplate 2017-12-07 21:51:24 +00:00
sample
tests
Doxyfile payloads: Remove/fix trailing whitespace 2018-09-04 12:38:40 +00:00
Kconfig libpayload: disable mouse on CHROMEOS 2018-05-18 16:00:18 +00:00
LICENSES
LICENSE_GPL
Makefile libpayload: Make libpayload compile using gnu11 2018-07-16 07:44:03 +00:00
Makefile.inc
README Use git HTTP URLs without `/p` in it 2018-04-17 10:38:06 +00:00

README

-------------------------------------------------------------------------------
libpayload README
-------------------------------------------------------------------------------

libpayload is a minimal library to support standalone payloads
that can be booted with firmware like coreboot. It handles the setup
code, and provides common C library symbols such as malloc() and printf().

Note: This is _not_ a standard library for use with an operating system,
rather it's only useful for coreboot payload development!
See https://www.coreboot.org for details on coreboot.


Installation
------------

 $ git clone https://review.coreboot.org/coreboot.git

 $ cd coreboot/payloads/libpayload

 $ make menuconfig

 $ make

 $ sudo make install (optional, will install into /opt per default)

As libpayload is for 32bit x86 systems only, you might have to install the
32bit libgcc version, otherwise your payloads will fail to compile.
On Debian systems you'd do 'apt-get install gcc-multilib' for example.


Usage
-----

Here's an example of a very simple payload (hello.c) and how to build it:

 #include <libpayload.h>

 int main(void)
 {
     printf("Hello, world!\n");
     return 0;
 }

Building the payload using the 'lpgcc' compiler wrapper:

 $ lpgcc -o hello.elf hello.c

Please see the sample/ directory for details.


Website and Mailing List
------------------------

The main website is https://www.coreboot.org/Libpayload.

For additional information, patches, and discussions, please join the
coreboot mailing list at https://www.coreboot.org/Mailinglist, where most
libpayload developers are subscribed.


Copyright and License
---------------------

See LICENSES.