Ver código fonte

Use shared symbols

tags/v0.9.3
Michael Brown 19 anos atrás
pai
commit
ee15c47cb5
1 arquivos alterados com 10 adições e 9 exclusões
  1. 10
    9
      src/drivers/net/via-rhine.c

+ 10
- 9
src/drivers/net/via-rhine.c Ver arquivo

@@ -546,6 +546,12 @@ struct rhine_rx_desc
546 546
 
547 547
 };
548 548
 
549
+struct {
550
+	char txbuf[TX_RING_SIZE * PKT_BUF_SZ + 32];
551
+	char rxbuf[RX_RING_SIZE * PKT_BUF_SZ + 32];
552
+	char txdesc[TX_RING_SIZE * sizeof (struct rhine_tx_desc) + 32];
553
+	char rxdesc[RX_RING_SIZE * sizeof (struct rhine_rx_desc) + 32];
554
+} rhine_buffers __shared;
549 555
 
550 556
 /* The I/O extent. */
551 557
 #define rhine_TOTAL_SIZE 0x80
@@ -1188,19 +1194,14 @@ rhine_reset (struct nic *nic)
1188 1194
     int rx_bufs_tmp, rx_bufs_tmp1;
1189 1195
     int tx_bufs_tmp, tx_bufs_tmp1;
1190 1196
 
1191
-    static char buf1[TX_RING_SIZE * PKT_BUF_SZ + 32];
1192
-    static char buf2[RX_RING_SIZE * PKT_BUF_SZ + 32];
1193
-    static char desc1[TX_RING_SIZE * sizeof (struct rhine_tx_desc) + 32];
1194
-    static char desc2[RX_RING_SIZE * sizeof (struct rhine_rx_desc) + 32];
1195
-
1196 1197
     /* printf ("rhine_reset\n"); */
1197 1198
     /* Soft reset the chip. */
1198 1199
     /*outb(CmdReset, ioaddr + ChipCmd); */
1199 1200
 
1200
-    tx_bufs_tmp = (int) buf1;
1201
-    tx_ring_tmp = (int) desc1;
1202
-    rx_bufs_tmp = (int) buf2;
1203
-    rx_ring_tmp = (int) desc2;
1201
+    tx_bufs_tmp = (int) rhine_buffers.txbuf;
1202
+    tx_ring_tmp = (int) rhine_buffers.txdesc;
1203
+    rx_bufs_tmp = (int) rhine_buffers.rxbuf;
1204
+    rx_ring_tmp = (int) rhine_buffers.rxdesc;
1204 1205
 
1205 1206
     /* tune RD TD 32 byte alignment */
1206 1207
     rx_ring_tmp1 = (int) virt_to_bus ((char *) rx_ring_tmp);

Carregando…
Cancelar
Salvar