aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2008-06-30 18:52:13 -0700
committerMichael Brown <mcb30@etherboot.org>2008-06-30 18:52:13 -0700
commit4fbbf651d7cb91983801904f5ed2b07d15566c1d (patch)
tree36e8d2ecd24b17a0fd4cbe9dfd7c0143bb0d578f /src/interface
parentd51d80f7854be874c7f60c6fda40d073cdfe717d (diff)
downloadipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.tar.gz
[i386] Change semantics of __from_data16 and __from_text16
__from_data16 and __from_text16 now take a pointer to a .data16/.text16 variable, and return the real-mode offset within the appropriate segment. This matches the use case for every occurrence of these macros, and prevents potential future bugs such as that fixed in commit d51d80f. (The bug arose essentially because "&pointer" is still syntactically valid.)
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/pxe/pxe_loader.c6
-rw-r--r--src/interface/pxe/pxe_preboot.c3
-rw-r--r--src/interface/pxe/pxe_undi.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/src/interface/pxe/pxe_loader.c b/src/interface/pxe/pxe_loader.c
index 708d203a6..f815bc252 100644
--- a/src/interface/pxe/pxe_loader.c
+++ b/src/interface/pxe/pxe_loader.c
@@ -42,11 +42,9 @@ PXENV_EXIT_t undi_loader ( struct s_UNDI_LOADER *undi_loader ) {
/* Fill in UNDI loader structure */
undi_loader->PXEptr.segment = rm_cs;
- undi_loader->PXEptr.offset =
- ( ( unsigned ) & __from_text16 ( ppxe ) );
+ undi_loader->PXEptr.offset = __from_text16 ( &ppxe );
undi_loader->PXENVptr.segment = rm_cs;
- undi_loader->PXENVptr.offset =
- ( ( unsigned ) & __from_text16 ( pxenv ) );
+ undi_loader->PXENVptr.offset = __from_text16 ( &pxenv );
undi_loader->Status = PXENV_STATUS_SUCCESS;
return PXENV_EXIT_SUCCESS;
diff --git a/src/interface/pxe/pxe_preboot.c b/src/interface/pxe/pxe_preboot.c
index 3574c7e32..b2914d366 100644
--- a/src/interface/pxe/pxe_preboot.c
+++ b/src/interface/pxe/pxe_preboot.c
@@ -196,8 +196,7 @@ PXENV_EXIT_t pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO
* fill it in.
*/
get_cached_info->Buffer.segment = rm_ds;
- get_cached_info->Buffer.offset =
- ( unsigned ) ( & __from_data16 ( *info ) );
+ get_cached_info->Buffer.offset = __from_data16 ( info );
get_cached_info->BufferSize = sizeof ( *info );
DBG ( " returning %04x:%04x+%04x['%x']",
get_cached_info->Buffer.segment,
diff --git a/src/interface/pxe/pxe_undi.c b/src/interface/pxe/pxe_undi.c
index 76b55df9d..26d1c7f5a 100644
--- a/src/interface/pxe/pxe_undi.c
+++ b/src/interface/pxe/pxe_undi.c
@@ -597,8 +597,7 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
undi_isr->FrameHeaderLength =
pxe_netdev->ll_protocol->ll_header_len;
undi_isr->Frame.segment = rm_ds;
- undi_isr->Frame.offset =
- ( ( unsigned ) & __from_data16 ( basemem_packet ) );
+ undi_isr->Frame.offset = __from_data16 ( basemem_packet );
/* Probably ought to fill in packet type */
undi_isr->ProtType = P_UNKNOWN;
undi_isr->PktType = XMT_DESTADDR;