mirror of
https://github.com/Interlisp/maiko.git
synced 2026-03-23 17:13:14 +00:00
Compare commits
5 Commits
master
...
nhb-pcap-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4a94344a | ||
|
|
5432d73819 | ||
|
|
a074c4a3c0 | ||
|
|
cdaa7b6889 | ||
|
|
eedc8a504a |
@@ -65,21 +65,28 @@ typedef struct closure_type {
|
|||||||
#endif /* BIGVM */
|
#endif /* BIGVM */
|
||||||
|
|
||||||
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
||||||
unsigned LogFileIO : 1; /* console msg arrived to print */
|
DLword LogFileIO : 1; /* console msg arrived to print */
|
||||||
unsigned ETHERInterrupt : 1; /* 10MB activity happened */
|
DLword ETHERInterrupt : 1; /* 10MB activity happened */
|
||||||
unsigned IOInterrupt : 1; /* I/O happened (not used yet) */
|
DLword IOInterrupt : 1; /* I/O happened (not used yet) */
|
||||||
unsigned gcdisabled : 1;
|
DLword gcdisabled : 1;
|
||||||
unsigned vmemfull : 1;
|
DLword vmemfull : 1;
|
||||||
unsigned stackoverflow : 1;
|
DLword stackoverflow : 1;
|
||||||
unsigned storagefull : 1;
|
DLword storagefull : 1;
|
||||||
unsigned waitinginterrupt : 1;
|
DLword waitinginterrupt : 1;
|
||||||
unsigned nil : 8; /* mask of ints being processed */
|
DLword P_LogFileIO : 1; /* interrupts awaiting processing, cleared by Lisp */
|
||||||
|
DLword P_ETHERInterrupt : 1;
|
||||||
|
DLword P_IOInterrupt : 1;
|
||||||
|
DLword P_gcdisabled : 1;
|
||||||
|
DLword P_vmemfull : 1;
|
||||||
|
DLword P_stackoverflow : 1;
|
||||||
|
DLword P_storagefull : 1;
|
||||||
|
DLword P_waitinginterrupt : 1;
|
||||||
DLword intcharcode;
|
DLword intcharcode;
|
||||||
} INTSTAT;
|
} INTSTAT;
|
||||||
|
|
||||||
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||||
unsigned pendingmask : 8;
|
DLword pendingmask : 8;
|
||||||
unsigned handledmask : 8;
|
DLword handledmask : 8;
|
||||||
DLword nil;
|
DLword nil;
|
||||||
} INTSTAT2;
|
} INTSTAT2;
|
||||||
|
|
||||||
@@ -204,21 +211,28 @@ typedef struct closure_type {
|
|||||||
|
|
||||||
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
typedef struct interrupt_state { /* Interrupt-request mask to communicate with INTERRUPTED */
|
||||||
DLword intcharcode;
|
DLword intcharcode;
|
||||||
unsigned nil : 8;
|
DLword P_waitinginterrupt : 1; /* interrupts awaiting processing, cleared by Lisp */
|
||||||
unsigned waitinginterrupt : 1;
|
DLword P_storagefull : 1;
|
||||||
unsigned storagefull : 1;
|
DLword P_stackoverflow : 1;
|
||||||
unsigned stackoverflow : 1;
|
DLword P_vmemfull : 1;
|
||||||
unsigned vmemfull : 1;
|
DLword P_gcdisabled : 1;
|
||||||
unsigned gcdisabled : 1;
|
DLword P_IOInterrupt : 1;
|
||||||
unsigned IOInterrupt : 1; /* I/O happened (not used yet) */
|
DLword P_ETHERInterrupt : 1;
|
||||||
unsigned ETHERInterrupt : 1; /* 10MB activity happened */
|
DLword P_LogFileIO : 1;
|
||||||
unsigned LogFileIO : 1; /* console msg arrived to print */
|
DLword waitinginterrupt : 1;
|
||||||
|
DLword storagefull : 1;
|
||||||
|
DLword stackoverflow : 1;
|
||||||
|
DLword vmemfull : 1;
|
||||||
|
DLword gcdisabled : 1;
|
||||||
|
DLword IOInterrupt : 1; /* I/O happened (not used yet) */
|
||||||
|
DLword ETHERInterrupt : 1; /* 10MB activity happened */
|
||||||
|
DLword LogFileIO : 1; /* console msg arrived to print */
|
||||||
} INTSTAT;
|
} INTSTAT;
|
||||||
|
|
||||||
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
typedef struct interrupt_state_2 { /* alternate view of the interrupt state */
|
||||||
DLword nil;
|
DLword nil;
|
||||||
unsigned handledmask : 8;
|
DLword handledmask : 8;
|
||||||
unsigned pendingmask : 8;
|
DLword pendingmask : 8;
|
||||||
} INTSTAT2;
|
} INTSTAT2;
|
||||||
|
|
||||||
struct state {
|
struct state {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h> /* for NAME_MAX */
|
#include <limits.h> /* for NAME_MAX */
|
||||||
#include <dirent.h> /* for MAXNAMLEN */
|
#include <dirent.h> /* for MAXNAMLEN */
|
||||||
|
#include <string.h> /* for strncpy in non-BYTESWAP case */
|
||||||
#include "lispemul.h" /* for DLword */
|
#include "lispemul.h" /* for DLword */
|
||||||
#include "commondefs.h" /* for error */
|
#include "commondefs.h" /* for error */
|
||||||
|
|
||||||
|
|||||||
@@ -297,12 +297,10 @@ static int recvPacket(void) {
|
|||||||
#if defined(BYTESWAP)
|
#if defined(BYTESWAP)
|
||||||
log_debug((" recvPacket() :: byte-swapping %d bytes at %p\n", bLen, (void *)ether_buf));
|
log_debug((" recvPacket() :: byte-swapping %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
dblwordsSwap(ether_buf, bLen);
|
dblwordsSwap(ether_buf, bLen);
|
||||||
IOPage->dlethernet[2] = bLen;
|
|
||||||
#else
|
#else
|
||||||
log_debug((" recvPacket() :: %d bytes at %p\n", bLen, (void *)ether_buf));
|
log_debug((" recvPacket() :: %d bytes at %p\n", bLen, (void *)ether_buf));
|
||||||
IOPage->dlethernet[3] = bLen;
|
|
||||||
#endif
|
#endif
|
||||||
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = blen;
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -477,7 +477,7 @@ int *ether_debug(void) {
|
|||||||
estat[0] = 0;
|
estat[0] = 0;
|
||||||
if (ether_fd < 0) return (NIL);
|
if (ether_fd < 0) return (NIL);
|
||||||
printf("fd %d bsize %d buf %p icb %X in %d out %d\n ", ether_fd, ether_bsize, (void *)ether_buf,
|
printf("fd %d bsize %d buf %p icb %X in %d out %d\n ", ether_fd, ether_bsize, (void *)ether_buf,
|
||||||
IOPage->dlethernet[3], ether_in, ether_out);
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB, ether_in, ether_out);
|
||||||
#endif /* MAIKO_ENABLE_ETHERNET */
|
#endif /* MAIKO_ENABLE_ETHERNET */
|
||||||
|
|
||||||
return (estat);
|
return (estat);
|
||||||
@@ -542,7 +542,7 @@ LispPTR check_ether(void) {
|
|||||||
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
||||||
ether_bsize = 0; /* deactivate receiver */
|
ether_bsize = 0; /* deactivate receiver */
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = fromlen;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = fromlen;
|
||||||
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;
|
||||||
@@ -586,7 +586,7 @@ LispPTR check_ether(void) {
|
|||||||
memcpy(ðer_buf[0], nit_buf, data.len);
|
memcpy(ðer_buf[0], nit_buf, data.len);
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = data.len;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = data.len;
|
||||||
((INTSTAT *)NativeAligned4FromLAddr(*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;
|
||||||
@@ -649,7 +649,7 @@ LispPTR get_packet(void) {
|
|||||||
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
memcpy(ðer_buf[0], &nit_buf[nitpos], fromlen);
|
||||||
ether_bsize = 0; /* deactivate receiver */
|
ether_bsize = 0; /* deactivate receiver */
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = fromlen;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = fromlen;
|
||||||
DBPRINT(("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
DBPRINT(("Found packet len %d, at pos %d in buflen %d.\n", fromlen, nitpos, nitlen));
|
||||||
nitpos += fromlen;
|
nitpos += fromlen;
|
||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
@@ -683,7 +683,7 @@ LispPTR get_packet(void) {
|
|||||||
memcpy(ðer_buf[0], nit_buf, data.len);
|
memcpy(ðer_buf[0], nit_buf, data.len);
|
||||||
ether_bsize = 0;
|
ether_bsize = 0;
|
||||||
ether_in++;
|
ether_in++;
|
||||||
IOPage->dlethernet[3] = data.len;
|
((DLETHERCSB *)IOPage->dlethernet)->DLFIRSTICB = data.len;
|
||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
}
|
}
|
||||||
} else if (errno != EWOULDBLOCK)
|
} else if (errno != EWOULDBLOCK)
|
||||||
|
|||||||
10
src/xinit.c
10
src/xinit.c
@@ -17,6 +17,8 @@
|
|||||||
#include <stdbool.h> // for false, bool, true
|
#include <stdbool.h> // for false, bool, true
|
||||||
#include <stdio.h> // for NULL
|
#include <stdio.h> // for NULL
|
||||||
#include <stdlib.h> // for exit
|
#include <stdlib.h> // for exit
|
||||||
|
#include <fcntl.h> // for fcntl, O_ASYNC, ...
|
||||||
|
#include <unistd.h> // for getpid
|
||||||
#include "adr68k.h" // for NativeAligned4FromLAddr
|
#include "adr68k.h" // for NativeAligned4FromLAddr
|
||||||
#include "dbprint.h" // for TPRINT
|
#include "dbprint.h" // for TPRINT
|
||||||
#include "devif.h" // for (anonymous), MRegion, DspInterface, OUTER_S...
|
#include "devif.h" // for (anonymous), MRegion, DspInterface, OUTER_S...
|
||||||
@@ -248,6 +250,7 @@ DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, u
|
|||||||
unsigned depth_hint)
|
unsigned depth_hint)
|
||||||
{
|
{
|
||||||
Screen *Xscreen;
|
Screen *Xscreen;
|
||||||
|
int xfd;
|
||||||
|
|
||||||
dsp->identifier = Display_Name; /* This is a hack. The display name */
|
dsp->identifier = Display_Name; /* This is a hack. The display name */
|
||||||
/* has to dealt with in a more */
|
/* has to dealt with in a more */
|
||||||
@@ -360,5 +363,12 @@ DspInterface X_init(DspInterface dsp, LispPTR lispbitmap, unsigned width_hint, u
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
XInitImage(&dsp->ScreenBitmap);
|
XInitImage(&dsp->ScreenBitmap);
|
||||||
|
|
||||||
|
#if defined(O_ASYNC)
|
||||||
|
xfd = ConnectionNumber(dsp->display_id);
|
||||||
|
if (fcntl(xfd, F_SETOWN, getpid()) == -1) perror("X_init: fcntl F_SETOWN error");
|
||||||
|
if (fcntl(xfd, F_SETFL, fcntl(xfd, F_GETFL, 0) | O_ASYNC) == -1) perror("X_init: fcntl F_SETFL O_ASYNC error");
|
||||||
|
#endif
|
||||||
|
|
||||||
return (dsp);
|
return (dsp);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user