mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-03 23:09:34 +00:00
Replace Addr68k related macros with NativeAligned inline functions
This commit is contained in:
14
src/ether.c
14
src/ether.c
@@ -381,7 +381,7 @@ LispPTR ether_get(LispPTR args[])
|
|||||||
sigprocmask(SIG_BLOCK, &signals, NULL);
|
sigprocmask(SIG_BLOCK, &signals, NULL);
|
||||||
|
|
||||||
if (ether_fd > 0 && (MaxByteCount > 0)) {
|
if (ether_fd > 0 && (MaxByteCount > 0)) {
|
||||||
ether_buf = (u_char *)Addr68k_from_LADDR(args[1]);
|
ether_buf = (u_char *)NativeAligned2FromLAddr(args[1]);
|
||||||
ether_bsize = MaxByteCount; /* do this LAST; it enables reads */
|
ether_bsize = MaxByteCount; /* do this LAST; it enables reads */
|
||||||
result = get_packet();
|
result = get_packet();
|
||||||
/* check_ether(); for old behavior, move comment to above line */
|
/* check_ether(); for old behavior, move comment to above line */
|
||||||
@@ -413,7 +413,7 @@ LispPTR ether_send(LispPTR args[])
|
|||||||
u_char *BufferAddr; /* buffer address pointer(in native address) */
|
u_char *BufferAddr; /* buffer address pointer(in native address) */
|
||||||
|
|
||||||
MaxByteCount = 2 * (0xFFFF & args[0]); /* words to bytes */
|
MaxByteCount = 2 * (0xFFFF & args[0]); /* words to bytes */
|
||||||
BufferAddr = (u_char *)Addr68k_from_LADDR(args[1]);
|
BufferAddr = (u_char *)NativeAligned2FromLAddr(args[1]);
|
||||||
|
|
||||||
if (ether_fd > 0) {
|
if (ether_fd > 0) {
|
||||||
#ifdef PKTFILTER
|
#ifdef PKTFILTER
|
||||||
@@ -550,7 +550,7 @@ LispPTR check_ether() {
|
|||||||
DBPRINT(
|
DBPRINT(
|
||||||
("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
||||||
nitpos += fromlen;
|
nitpos += fromlen;
|
||||||
((INTSTAT *)Addr68k_from_LADDR(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
((INTSTAT *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
||||||
ETHEREventCount++;
|
ETHEREventCount++;
|
||||||
Irq_Stk_Check = Irq_Stk_End = 0;
|
Irq_Stk_Check = Irq_Stk_End = 0;
|
||||||
*PENDINGINTERRUPT68k = ATOM_T;
|
*PENDINGINTERRUPT68k = ATOM_T;
|
||||||
@@ -591,7 +591,7 @@ LispPTR check_ether() {
|
|||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = data.len;
|
IOPage->dlethernet[3] = data.len;
|
||||||
((INTSTAT *)Addr68k_from_LADDR(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
((INTSTAT *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 1;
|
||||||
ETHEREventCount++;
|
ETHEREventCount++;
|
||||||
Irq_Stk_Check = Irq_Stk_End = 0;
|
Irq_Stk_Check = Irq_Stk_End = 0;
|
||||||
*PENDINGINTERRUPT68k = ATOM_T;
|
*PENDINGINTERRUPT68k = ATOM_T;
|
||||||
@@ -786,8 +786,8 @@ void init_ether() {
|
|||||||
struct strioctl si;
|
struct strioctl si;
|
||||||
unsigned long snaplen = 0;
|
unsigned long snaplen = 0;
|
||||||
|
|
||||||
/* ((INTSTAT*)Addr68k_from_LADDR(*INTERRUPTSTATE_word))->ETHERInterrupt = 0;
|
/* ((INTSTAT*)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->ETHERInterrupt = 0;
|
||||||
((INTSTAT2 *)Addr68k_from_LADDR(*INTERRUPTSTATE_word))->handledmask = 0;
|
((INTSTAT2 *)NativeAligned4FromLAddr(*INTERRUPTSTATE_word))->handledmask = 0;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (ether_fd < 0) {
|
if (ether_fd < 0) {
|
||||||
@@ -1107,7 +1107,7 @@ LispPTR check_sum(LispPTR *args)
|
|||||||
DLword *address;
|
DLword *address;
|
||||||
int nwords;
|
int nwords;
|
||||||
|
|
||||||
address = (DLword *)Addr68k_from_LADDR(*args++);
|
address = (DLword *)NativeAligned2FromLAddr(*args++);
|
||||||
nwords = *args++;
|
nwords = *args++;
|
||||||
|
|
||||||
if (*args != NIL)
|
if (*args != NIL)
|
||||||
|
|||||||
Reference in New Issue
Block a user