From: Michael Brown Date: Mon, 9 May 2005 13:21:56 +0000 (+0000) Subject: Add off_t and physaddr_t, and the copy_{to,from}_phys helper routines. X-Git-Tag: v0.9.3~1718 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3f2aa7b4ddd96e17c4d0bf3d3d39800ef2acc2a;p=thirdparty%2Fipxe.git Add off_t and physaddr_t, and the copy_{to,from}_phys helper routines. --- diff --git a/src/arch/i386/include/stdint.h b/src/arch/i386/include/stdint.h index 42b048302..f56e91334 100644 --- a/src/arch/i386/include/stdint.h +++ b/src/arch/i386/include/stdint.h @@ -2,6 +2,7 @@ #define STDINT_H typedef unsigned size_t; +typedef unsigned off_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; @@ -13,4 +14,6 @@ typedef signed short int16_t; typedef signed long int32_t; typedef signed long long int64_t; +typedef unsigned long physaddr_t; + #endif /* STDINT_H */ diff --git a/src/arch/i386/include/virtaddr.h b/src/arch/i386/include/virtaddr.h index 15fad1ccd..3bc028333 100644 --- a/src/arch/i386/include/virtaddr.h +++ b/src/arch/i386/include/virtaddr.h @@ -45,6 +45,14 @@ static inline void * phys_to_virt ( unsigned long phys_addr ) { return ( void * ) ( phys_addr - virt_offset ); } +static inline void copy_to_phys ( physaddr_t dest, void *src, size_t len ) { + memcpy ( phys_to_virt ( dest ), src, len ); +} + +static inline void copy_from_phys ( void *dest, physaddr_t src, size_t len ) { + memcpy ( dest, phys_to_virt ( src ), len ); +} + #else /* KEEP_IT_REAL */ /*