summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-05-20 20:09:42 +0000
committerJordan Crouse <jordan.crouse@amd.com>2008-05-20 20:09:42 +0000
commit506980808d2f525e294cdd364b2b4e08276ab8d9 (patch)
tree34a9de981586eafb7de51021415f037726b2bc7a /payloads/libpayload/libc
parentd43841defc07cd84b1dde502a65f4f22c8d8374e (diff)
downloadcoreboot-506980808d2f525e294cdd364b2b4e08276ab8d9.tar.xz
libpayload: Add larfptr function
Add a function to get a pointer to the start of a LAR entry. Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3337 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/lar.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/lar.c b/payloads/libpayload/libc/lar.c
index 65b503d1c8..6ae4052039 100644
--- a/payloads/libpayload/libc/lar.c
+++ b/payloads/libpayload/libc/lar.c
@@ -218,6 +218,16 @@ int larstat(struct LAR *lar, const char *path, struct larstat *buf)
return 0;
}
+void * larfptr(struct LAR *lar, const char *filename)
+{
+ struct lar_header *header = get_header_by_name(lar, filename);
+
+ if (header == NULL)
+ return NULL;
+
+ return (void *) ((u8 *) header + ntohl(header->offset));
+}
+
struct LFILE * lfopen(struct LAR *lar, const char *filename)
{
struct LFILE *file;