#include <stdint.h>
#include <byteswap.h>
-#include <ipxe/uaccess.h>
#include <ipxe/crypto.h>
/******************************************************************************
/** Raw content information */
struct peerdist_raw {
/** Data buffer */
- userptr_t data;
+ const void *data;
/** Length of data buffer */
size_t len;
};
extern struct digest_algorithm sha512_trunc_algorithm;
-extern int peerdist_info ( userptr_t data, size_t len,
+extern int peerdist_info ( const void *data, size_t len,
struct peerdist_info *info );
extern int peerdist_info_segment ( const struct peerdist_info *info,
struct peerdist_info_segment *segment,
}
/* Copy data */
- copy_from_user ( data, info->raw.data, offset, len );
+ memcpy ( data, ( info->raw.data + offset ), len );
return 0;
}
* @v info Content information to fill in
* @ret rc Return status code
*/
-int peerdist_info ( userptr_t data, size_t len, struct peerdist_info *info ) {
+int peerdist_info ( const void *data, size_t len,
+ struct peerdist_info *info ) {
union peerdist_info_version version;
int rc;
#include <stdint.h>
#include <string.h>
#include <assert.h>
-#include <ipxe/uaccess.h>
#include <ipxe/pccrc.h>
#include <ipxe/sha256.h>
#include <ipxe/sha512.h>
const char *file, unsigned int line ) {
/* Parse content information */
- okx ( peerdist_info ( virt_to_user ( test->data ), test->len,
- info ) == 0, file, line );
+ okx ( peerdist_info ( test->data, test->len, info ) == 0, file, line );
/* Verify content information */
- okx ( info->raw.data == virt_to_user ( test->data ), file, line );
+ okx ( info->raw.data == test->data, file, line );
okx ( info->raw.len == test->len, file, line );
okx ( info->digest == test->expected_digest, file, line );
okx ( info->digestsize == test->expected_digestsize, file, line );