Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added the embedded pxelinux payload patch from hpa.
- Loading branch information
Michael Brown
committed
Jan 8, 2008
1 parent
3311169
commit 74fd544
Showing
6 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.section ".data", "aw" | ||
.balign 4 | ||
.globl _embedded_image_start | ||
_embedded_image_start: | ||
.incbin EMBEDIMG | ||
.globl _embedded_image_end | ||
_embedded_image_end: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** @file | ||
* | ||
* Take a possible embedded image and put it in a struct image | ||
* data structure. | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <gpxe/image.h> | ||
#include <gpxe/malloc.h> | ||
#include <gpxe/uaccess.h> | ||
#include <gpxe/umalloc.h> | ||
#include <gpxe/embedded.h> | ||
|
||
extern char _embedded_image_start[], _embedded_image_end[]; | ||
|
||
struct image *embedded_image(void) | ||
{ | ||
static int reclaimed = 0; | ||
struct image *image; | ||
size_t eisize = _embedded_image_end - _embedded_image_start; | ||
|
||
if ( !eisize ) | ||
return NULL; /* No embedded image */ | ||
|
||
if ( reclaimed ) | ||
return NULL; /* Already reclaimed */ | ||
|
||
printf("Embedded image: %d bytes at %p\n", | ||
eisize, _embedded_image_start); | ||
|
||
image = alloc_image(); | ||
if (!image) | ||
return NULL; | ||
|
||
image->len = eisize; | ||
image->data = umalloc(eisize); | ||
if (image->data == UNULL) { | ||
image_put(image); | ||
return image = NULL; | ||
} | ||
copy_to_user(image->data, 0, _embedded_image_start, eisize); | ||
|
||
/* Reclaim embedded image memory */ | ||
reclaimed = 1; | ||
mpopulate(_embedded_image_start, eisize); | ||
|
||
return image; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef _GPXE_EMBEDDED_H | ||
#define _GPXE_EMBEDDED_H | ||
|
||
#include <gpxe/image.h> | ||
|
||
struct image *embedded_image(void); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters