1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Implemented some optimizations which result in 14 fewer instructions in the

receive path.
This commit is contained in:
David Greenman 2000-06-19 00:58:34 +00:00
parent a0b74543ff
commit aed5349598
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61820
2 changed files with 12 additions and 4 deletions

View File

@ -125,11 +125,15 @@ static __inline void
fxp_lwcopy(src, dst)
volatile u_int32_t *src, *dst;
{
#ifdef __i386__
*dst = *src;
#else
volatile u_int16_t *a = (volatile u_int16_t *)src;
volatile u_int16_t *b = (volatile u_int16_t *)dst;
b[0] = a[0];
b[1] = a[1];
#endif
}
/*
@ -1158,7 +1162,7 @@ fxp_intr(arg)
*/
if (fxp_add_rfabuf(sc, m) == 0) {
struct ether_header *eh;
u_int16_t total_len;
int total_len;
total_len = rfa->actual_size &
(MCLBYTES - 1);
@ -1769,7 +1773,7 @@ fxp_add_rfabuf(sc, oldm)
sc->rfa_tailm->m_next = m;
v = vtophys(rfa);
fxp_lwcopy(&v, (volatile u_int32_t *) p_rfa->link_addr);
p_rfa->rfa_control &= ~FXP_RFA_CONTROL_EL;
p_rfa->rfa_control = 0;
} else {
sc->rfa_headm = m;
}

View File

@ -125,11 +125,15 @@ static __inline void
fxp_lwcopy(src, dst)
volatile u_int32_t *src, *dst;
{
#ifdef __i386__
*dst = *src;
#else
volatile u_int16_t *a = (volatile u_int16_t *)src;
volatile u_int16_t *b = (volatile u_int16_t *)dst;
b[0] = a[0];
b[1] = a[1];
#endif
}
/*
@ -1158,7 +1162,7 @@ fxp_intr(arg)
*/
if (fxp_add_rfabuf(sc, m) == 0) {
struct ether_header *eh;
u_int16_t total_len;
int total_len;
total_len = rfa->actual_size &
(MCLBYTES - 1);
@ -1769,7 +1773,7 @@ fxp_add_rfabuf(sc, oldm)
sc->rfa_tailm->m_next = m;
v = vtophys(rfa);
fxp_lwcopy(&v, (volatile u_int32_t *) p_rfa->link_addr);
p_rfa->rfa_control &= ~FXP_RFA_CONTROL_EL;
p_rfa->rfa_control = 0;
} else {
sc->rfa_headm = m;
}