summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers/net/undinet.c
diff options
context:
space:
mode:
authorMichael Brown2008-07-01 03:52:13 +0200
committerMichael Brown2008-07-01 03:52:13 +0200
commit4fbbf651d7cb91983801904f5ed2b07d15566c1d (patch)
tree36e8d2ecd24b17a0fd4cbe9dfd7c0143bb0d578f /src/arch/i386/drivers/net/undinet.c
parent[pxe] Fix a typo in PXENV_GET_CACHED_INFO that broke Altiris (diff)
downloadipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.tar.gz
ipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.tar.xz
ipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.zip
[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/arch/i386/drivers/net/undinet.c')
-rw-r--r--src/arch/i386/drivers/net/undinet.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/arch/i386/drivers/net/undinet.c b/src/arch/i386/drivers/net/undinet.c
index 09c29aba..12b954c0 100644
--- a/src/arch/i386/drivers/net/undinet.c
+++ b/src/arch/i386/drivers/net/undinet.c
@@ -176,9 +176,9 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
"addw $6, %%sp\n\t" )
: "=a" ( exit ), "=b" ( discard_b ),
"=D" ( discard_D )
- : "p" ( &__from_data16 ( undinet_entry_point )),
+ : "p" ( __from_data16 ( &undinet_entry_point )),
"b" ( function ),
- "D" ( &__from_data16 ( undinet_params ) )
+ "D" ( __from_data16 ( &undinet_params ) )
: "ecx", "edx", "esi", "ebp" );
/* UNDI API calls may rudely change the status of A20 and not
@@ -211,7 +211,7 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
if ( rc != 0 ) {
SEGOFF16_t rm_params = {
.segment = rm_ds,
- .offset = (intptr_t) &__from_data16 ( undinet_params ),
+ .offset = __from_data16 ( &undinet_params ),
};
DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
@@ -357,17 +357,14 @@ static int undinet_transmit ( struct net_device *netdev,
/* Create PXENV_UNDI_TRANSMIT data structure */
memset ( &undi_transmit, 0, sizeof ( undi_transmit ) );
undi_transmit.DestAddr.segment = rm_ds;
- undi_transmit.DestAddr.offset
- = ( ( unsigned ) & __from_data16 ( undinet_tbd ) );
+ undi_transmit.DestAddr.offset = __from_data16 ( &undinet_tbd );
undi_transmit.TBD.segment = rm_ds;
- undi_transmit.TBD.offset
- = ( ( unsigned ) & __from_data16 ( undinet_tbd ) );
+ undi_transmit.TBD.offset = __from_data16 ( &undinet_tbd );
/* Create PXENV_UNDI_TBD data structure */
undinet_tbd.ImmedLength = len;
undinet_tbd.Xmit.segment = rm_ds;
- undinet_tbd.Xmit.offset
- = ( ( unsigned ) & __from_data16 ( basemem_packet ) );
+ undinet_tbd.Xmit.offset = __from_data16 ( basemem_packet );
/* Issue PXE API call */
if ( ( rc = undinet_call ( undinic, PXENV_UNDI_TRANSMIT,