[image] Remove userptr_t from image definition

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-04-22 12:20:26 +01:00
parent e98b84f1b9
commit b89a34b07f
4 changed files with 10 additions and 8 deletions

View File

@@ -218,7 +218,7 @@ int image_set_cmdline ( struct image *image, const char *cmdline ) {
* @ret rc Return status code * @ret rc Return status code
*/ */
int image_set_len ( struct image *image, size_t len ) { int image_set_len ( struct image *image, size_t len ) {
userptr_t new; void *new;
/* (Re)allocate image data */ /* (Re)allocate image data */
new = urealloc ( image->data, len ); new = urealloc ( image->data, len );
@@ -238,7 +238,7 @@ int image_set_len ( struct image *image, size_t len ) {
* @v len Length of image data * @v len Length of image data
* @ret rc Return status code * @ret rc Return status code
*/ */
int image_set_data ( struct image *image, userptr_t data, size_t len ) { int image_set_data ( struct image *image, const void *data, size_t len ) {
int rc; int rc;
/* Set image length */ /* Set image length */
@@ -566,7 +566,8 @@ int image_set_trust ( int require_trusted, int permanent ) {
* @v len Length * @v len Length
* @ret image Image, or NULL on error * @ret image Image, or NULL on error
*/ */
struct image * image_memory ( const char *name, userptr_t data, size_t len ) { struct image * image_memory ( const char *name, const void *data,
size_t len ) {
struct image *image; struct image *image;
int rc; int rc;

View File

@@ -38,7 +38,7 @@ struct image {
/** Command line to pass to image */ /** Command line to pass to image */
char *cmdline; char *cmdline;
/** Raw file image */ /** Raw file image */
userptr_t data; void *data;
/** Length of raw file image */ /** Length of raw file image */
size_t len; size_t len;
@@ -191,7 +191,8 @@ extern int image_set_name ( struct image *image, const char *name );
extern char * image_strip_suffix ( struct image *image ); extern char * image_strip_suffix ( struct image *image );
extern int image_set_cmdline ( struct image *image, const char *cmdline ); extern int image_set_cmdline ( struct image *image, const char *cmdline );
extern int image_set_len ( struct image *image, size_t len ); extern int image_set_len ( struct image *image, size_t len );
extern int image_set_data ( struct image *image, userptr_t data, size_t len ); extern int image_set_data ( struct image *image, const void *data,
size_t len );
extern int register_image ( struct image *image ); extern int register_image ( struct image *image );
extern void unregister_image ( struct image *image ); extern void unregister_image ( struct image *image );
extern struct image * find_image ( const char *name ); extern struct image * find_image ( const char *name );
@@ -200,7 +201,7 @@ extern int image_exec ( struct image *image );
extern int image_replace ( struct image *replacement ); extern int image_replace ( struct image *replacement );
extern int image_select ( struct image *image ); extern int image_select ( struct image *image );
extern int image_set_trust ( int require_trusted, int permanent ); extern int image_set_trust ( int require_trusted, int permanent );
extern struct image * image_memory ( const char *name, userptr_t data, extern struct image * image_memory ( const char *name, const void *data,
size_t len ); size_t len );
extern const char * image_argument ( struct image *image, const char *key ); extern const char * image_argument ( struct image *image, const char *key );
extern int image_pixbuf ( struct image *image, struct pixel_buffer **pixbuf ); extern int image_pixbuf ( struct image *image, struct pixel_buffer **pixbuf );

View File

@@ -18,6 +18,6 @@ extern int imgdownload_string ( const char *uri_string, unsigned long timeout,
extern int imgacquire ( const char *name, unsigned long timeout, extern int imgacquire ( const char *name, unsigned long timeout,
struct image **image ); struct image **image );
extern void imgstat ( struct image *image ); extern void imgstat ( struct image *image );
extern int imgmem ( const char *name, userptr_t data, size_t len ); extern int imgmem ( const char *name, const void *data, size_t len );
#endif /* _USR_IMGMGMT_H */ #endif /* _USR_IMGMGMT_H */

View File

@@ -184,7 +184,7 @@ void imgstat ( struct image *image ) {
* @v len Length * @v len Length
* @ret rc Return status code * @ret rc Return status code
*/ */
int imgmem ( const char *name, userptr_t data, size_t len ) { int imgmem ( const char *name, const void *data, size_t len ) {
struct image *image; struct image *image;
/* Create image */ /* Create image */