Browse Source

Modify gPXE core and drivers to work with the new timer subsystem

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
tags/v0.9.4
Alexey Zaytsev 16 years ago
parent
commit
a1572e0ab0
58 changed files with 62 additions and 121 deletions
  1. 1
    0
      src/arch/i386/Makefile
  2. 3
    4
      src/arch/i386/firmware/pcbios/gateA20.c
  3. 0
    12
      src/arch/i386/include/latch.h
  4. 1
    1
      src/core/getkey.c
  5. 1
    1
      src/core/misc.c
  6. 1
    1
      src/core/random.c
  7. 1
    1
      src/core/serial.c
  8. 0
    1
      src/drivers/bitbash/bitbash.c
  9. 1
    1
      src/drivers/bitbash/i2c_bit.c
  10. 1
    1
      src/drivers/bitbash/spi_bit.c
  11. 1
    1
      src/drivers/bus/eisa.c
  12. 1
    1
      src/drivers/bus/isapnp.c
  13. 0
    1
      src/drivers/bus/mca.c
  14. 0
    1
      src/drivers/infiniband/arbel.c
  15. 0
    1
      src/drivers/infiniband/hermon.c
  16. 1
    1
      src/drivers/net/3c509.c
  17. 0
    1
      src/drivers/net/3c515.c
  18. 0
    1
      src/drivers/net/3c595.c
  19. 0
    1
      src/drivers/net/3c5x9.c
  20. 4
    3
      src/drivers/net/3c90x.c
  21. 0
    1
      src/drivers/net/amd8111e.c
  22. 0
    1
      src/drivers/net/bnx2.c
  23. 0
    1
      src/drivers/net/dmfe.c
  24. 0
    1
      src/drivers/net/e1000/e1000.h
  25. 1
    1
      src/drivers/net/e1000/e1000_osdep.h
  26. 0
    1
      src/drivers/net/eepro.c
  27. 8
    5
      src/drivers/net/eepro100.c
  28. 9
    7
      src/drivers/net/epic100.c
  29. 0
    1
      src/drivers/net/etherfabric.c
  30. 0
    1
      src/drivers/net/forcedeth.c
  31. 0
    1
      src/drivers/net/ipoib.c
  32. 0
    1
      src/drivers/net/mlx_ipoib/mt23108_imp.c
  33. 0
    1
      src/drivers/net/mlx_ipoib/mt25218_imp.c
  34. 1
    1
      src/drivers/net/mtnic.c
  35. 1
    1
      src/drivers/net/natsemi.c
  36. 0
    1
      src/drivers/net/pcnet32.c
  37. 0
    1
      src/drivers/net/prism2.c
  38. 0
    1
      src/drivers/net/r8169.c
  39. 1
    1
      src/drivers/net/rtl8139.c
  40. 0
    1
      src/drivers/net/sis900.c
  41. 0
    1
      src/drivers/net/smc9000.c
  42. 0
    1
      src/drivers/net/sundance.c
  43. 0
    1
      src/drivers/net/tg3.c
  44. 0
    1
      src/drivers/net/tlan.c
  45. 12
    9
      src/drivers/net/via-rhine.c
  46. 0
    2
      src/drivers/net/via-velocity.h
  47. 4
    5
      src/drivers/net/w89c840.c
  48. 1
    1
      src/drivers/nvs/spi.c
  49. 1
    1
      src/drivers/nvs/threewire.c
  50. 1
    1
      src/hci/mucurses/kb.c
  51. 1
    1
      src/hci/shell_banner.c
  52. 1
    1
      src/include/etherboot.h
  53. 0
    1
      src/include/gpxe/dhcp.h
  54. 0
    1
      src/include/gpxe/tcp.h
  55. 0
    27
      src/include/timer.h
  56. 1
    1
      src/net/retry.c
  57. 1
    1
      src/net/tcp.c
  58. 1
    0
      src/net/udp/dhcp.c

+ 1
- 0
src/arch/i386/Makefile View File

7
 SRCDIRS		+= arch/i386/core arch/i386/transitions arch/i386/prefix
7
 SRCDIRS		+= arch/i386/core arch/i386/transitions arch/i386/prefix
8
 SRCDIRS		+= arch/i386/firmware/pcbios
8
 SRCDIRS		+= arch/i386/firmware/pcbios
9
 SRCDIRS		+= arch/i386/image
9
 SRCDIRS		+= arch/i386/image
10
+SRCDIRS		+= arch/i386/drivers
10
 SRCDIRS		+= arch/i386/drivers/bus
11
 SRCDIRS		+= arch/i386/drivers/bus
11
 SRCDIRS		+= arch/i386/drivers/net
12
 SRCDIRS		+= arch/i386/drivers/net
12
 SRCDIRS		+= arch/i386/drivers/disk
13
 SRCDIRS		+= arch/i386/drivers/disk

+ 3
- 4
src/arch/i386/firmware/pcbios/gateA20.c View File

1
 #include <stdio.h>
1
 #include <stdio.h>
2
-#include "realmode.h"
3
-#include "timer.h"
4
-#include "latch.h"
5
-#include "bios.h"
2
+#include <realmode.h>
3
+#include <bios.h>
4
+#include <gpxe/timer.h>
6
 
5
 
7
 #define K_RDWR		0x60		/* keyboard data & cmds (read/write) */
6
 #define K_RDWR		0x60		/* keyboard data & cmds (read/write) */
8
 #define K_STATUS	0x64		/* keyboard status */
7
 #define K_STATUS	0x64		/* keyboard status */

+ 0
- 12
src/arch/i386/include/latch.h View File

1
-#ifndef LATCH_H
2
-#define LATCH_H
3
-
4
-#define	TICKS_PER_SEC		18
5
-
6
-/* For different calibrators of the TSC move the declaration of
7
- * sleep_latch and the definitions of it's length here...
8
- */
9
-
10
-extern unsigned long currticks ( void );
11
-
12
-#endif /* LATCH_H */

+ 1
- 1
src/core/getkey.c View File

17
  */
17
  */
18
 
18
 
19
 #include <console.h>
19
 #include <console.h>
20
-#include <latch.h>
21
 #include <gpxe/process.h>
20
 #include <gpxe/process.h>
22
 #include <gpxe/keys.h>
21
 #include <gpxe/keys.h>
22
+#include <gpxe/timer.h>
23
 
23
 
24
 /** @file
24
 /** @file
25
  *
25
  *

+ 1
- 1
src/core/misc.c View File

4
 
4
 
5
 #include <stdlib.h>
5
 #include <stdlib.h>
6
 #include <byteswap.h>
6
 #include <byteswap.h>
7
-#include <latch.h>
8
 #include <gpxe/in.h>
7
 #include <gpxe/in.h>
8
+#include <gpxe/timer.h>
9
 
9
 
10
 /**************************************************************************
10
 /**************************************************************************
11
 INET_ATON - Convert an ascii x.x.x.x to binary form
11
 INET_ATON - Convert an ascii x.x.x.x to binary form

+ 1
- 1
src/core/random.c View File

5
  */
5
  */
6
 
6
 
7
 #include <stdlib.h>
7
 #include <stdlib.h>
8
-#include <latch.h>
8
+#include <gpxe/timer.h>
9
 
9
 
10
 static int32_t rnd_seed = 0;
10
 static int32_t rnd_seed = 0;
11
 
11
 

+ 1
- 1
src/core/serial.c View File

15
 #include "console.h"
15
 #include "console.h"
16
 #include <gpxe/init.h>
16
 #include <gpxe/init.h>
17
 #include "io.h"
17
 #include "io.h"
18
-#include "timer.h"
18
+#include <unistd.h>
19
 #include "config/serial.h"
19
 #include "config/serial.h"
20
 
20
 
21
 /* Set default values if none specified */
21
 /* Set default values if none specified */

+ 0
- 1
src/drivers/bitbash/bitbash.c View File

16
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
  */
17
  */
18
 
18
 
19
-#include <timer.h>
20
 #include <gpxe/bitbash.h>
19
 #include <gpxe/bitbash.h>
21
 
20
 
22
 /** @file
21
 /** @file

+ 1
- 1
src/drivers/bitbash/i2c_bit.c View File

20
 #include <stdint.h>
20
 #include <stdint.h>
21
 #include <errno.h>
21
 #include <errno.h>
22
 #include <assert.h>
22
 #include <assert.h>
23
-#include <timer.h>
23
+#include <unistd.h>
24
 #include <gpxe/bitbash.h>
24
 #include <gpxe/bitbash.h>
25
 #include <gpxe/i2c.h>
25
 #include <gpxe/i2c.h>
26
 
26
 

+ 1
- 1
src/drivers/bitbash/spi_bit.c View File

22
 #include <byteswap.h>
22
 #include <byteswap.h>
23
 #include <errno.h>
23
 #include <errno.h>
24
 #include <assert.h>
24
 #include <assert.h>
25
-#include <timer.h>
25
+#include <unistd.h>
26
 #include <gpxe/bitbash.h>
26
 #include <gpxe/bitbash.h>
27
 #include <gpxe/spi_bit.h>
27
 #include <gpxe/spi_bit.h>
28
 
28
 

+ 1
- 1
src/drivers/bus/eisa.c View File

4
 #include <stdio.h>
4
 #include <stdio.h>
5
 #include <errno.h>
5
 #include <errno.h>
6
 #include <io.h>
6
 #include <io.h>
7
-#include <timer.h>
7
+#include <unistd.h>
8
 #include <gpxe/eisa.h>
8
 #include <gpxe/eisa.h>
9
 
9
 
10
 static struct eisa_driver eisa_drivers[0]
10
 static struct eisa_driver eisa_drivers[0]

+ 1
- 1
src/drivers/bus/isapnp.c View File

61
 #include <stdio.h>
61
 #include <stdio.h>
62
 #include <errno.h>
62
 #include <errno.h>
63
 #include <io.h>
63
 #include <io.h>
64
-#include <timer.h>
64
+#include <unistd.h>
65
 #include <gpxe/isapnp.h>
65
 #include <gpxe/isapnp.h>
66
 
66
 
67
 /**
67
 /**

+ 0
- 1
src/drivers/bus/mca.c View File

11
 #include <stdio.h>
11
 #include <stdio.h>
12
 #include <errno.h>
12
 #include <errno.h>
13
 #include <io.h>
13
 #include <io.h>
14
-#include <timer.h>
15
 #include <gpxe/mca.h>
14
 #include <gpxe/mca.h>
16
 
15
 
17
 static struct mca_driver mca_drivers[0]
16
 static struct mca_driver mca_drivers[0]

+ 0
- 1
src/drivers/infiniband/arbel.c View File

26
 #include <strings.h>
26
 #include <strings.h>
27
 #include <unistd.h>
27
 #include <unistd.h>
28
 #include <errno.h>
28
 #include <errno.h>
29
-#include <timer.h>
30
 #include <byteswap.h>
29
 #include <byteswap.h>
31
 #include <gpxe/pci.h>
30
 #include <gpxe/pci.h>
32
 #include <gpxe/malloc.h>
31
 #include <gpxe/malloc.h>

+ 0
- 1
src/drivers/infiniband/hermon.c View File

24
 #include <strings.h>
24
 #include <strings.h>
25
 #include <unistd.h>
25
 #include <unistd.h>
26
 #include <errno.h>
26
 #include <errno.h>
27
-#include <timer.h>
28
 #include <byteswap.h>
27
 #include <byteswap.h>
29
 #include <gpxe/pci.h>
28
 #include <gpxe/pci.h>
30
 #include <gpxe/malloc.h>
29
 #include <gpxe/malloc.h>

+ 1
- 1
src/drivers/net/3c509.c View File

9
 #include <string.h>
9
 #include <string.h>
10
 #include <errno.h>
10
 #include <errno.h>
11
 #include <io.h>
11
 #include <io.h>
12
-#include <timer.h>
12
+#include <unistd.h>
13
 #include <gpxe/device.h>
13
 #include <gpxe/device.h>
14
 #include <gpxe/isa.h>
14
 #include <gpxe/isa.h>
15
 #include "3c509.h"
15
 #include "3c509.h"

+ 0
- 1
src/drivers/net/3c515.c View File

50
 #include "nic.h"
50
 #include "nic.h"
51
 #include <gpxe/isapnp.h>
51
 #include <gpxe/isapnp.h>
52
 #include <gpxe/isa.h> /* for ISA_ROM */
52
 #include <gpxe/isa.h> /* for ISA_ROM */
53
-#include "timer.h"
54
 #include <gpxe/ethernet.h>
53
 #include <gpxe/ethernet.h>
55
 
54
 
56
 static void t3c515_wait(unsigned int nticks)
55
 static void t3c515_wait(unsigned int nticks)

+ 0
- 1
src/drivers/net/3c595.c View File

30
 #include <gpxe/pci.h>
30
 #include <gpxe/pci.h>
31
 #include <gpxe/ethernet.h>
31
 #include <gpxe/ethernet.h>
32
 #include "3c595.h"
32
 #include "3c595.h"
33
-#include "timer.h"
34
 
33
 
35
 static struct nic_operations t595_operations;
34
 static struct nic_operations t595_operations;
36
 
35
 

+ 0
- 1
src/drivers/net/3c5x9.c View File

28
 #include "etherboot.h"
28
 #include "etherboot.h"
29
 #include "nic.h"
29
 #include "nic.h"
30
 #include <gpxe/isa.h>
30
 #include <gpxe/isa.h>
31
-#include "timer.h"
32
 #include "3c509.h"
31
 #include "3c509.h"
33
 
32
 
34
 static enum { none, bnc, utp } connector = none;	/* for 3C509 */
33
 static enum { none, bnc, utp } connector = none;	/* for 3C509 */

+ 4
- 3
src/drivers/net/3c90x.c View File

43
 #include "nic.h"
43
 #include "nic.h"
44
 #include <gpxe/pci.h>
44
 #include <gpxe/pci.h>
45
 #include <gpxe/ethernet.h>
45
 #include <gpxe/ethernet.h>
46
-#include "timer.h"
47
 
46
 
48
 static struct nic_operations a3c90x_operations;
47
 static struct nic_operations a3c90x_operations;
49
 
48
 
498
 
497
 
499
     unsigned char status;
498
     unsigned char status;
500
     unsigned i, retries;
499
     unsigned i, retries;
500
+    tick_t ct;
501
 
501
 
502
     for (retries=0; retries < XMIT_RETRIES ; retries++)
502
     for (retries=0; retries < XMIT_RETRIES ; retries++)
503
 	{
503
 	{
540
 	    ;
540
 	    ;
541
 
541
 
542
 	/** Wait for NIC Transmit to Complete **/
542
 	/** Wait for NIC Transmit to Complete **/
543
-	load_timer2(10*TICKS_PER_MS);	/* Give it 10 ms */
543
+	ct = currticks();
544
+
544
 	while (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004) &&
545
 	while (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004) &&
545
-		timer2_running())
546
+		ct + 10*USECS_IN_MSEC < currticks());
546
 		;
547
 		;
547
 
548
 
548
 	if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004))
549
 	if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004))

+ 0
- 1
src/drivers/net/amd8111e.c View File

33
 #include "mii.h"
33
 #include "mii.h"
34
 #include <gpxe/pci.h>
34
 #include <gpxe/pci.h>
35
 #include <gpxe/ethernet.h>
35
 #include <gpxe/ethernet.h>
36
-#include "timer.h"
37
 #include "string.h"
36
 #include "string.h"
38
 #include "stdint.h"
37
 #include "stdint.h"
39
 #include "amd8111e.h"
38
 #include "amd8111e.h"

+ 0
- 1
src/drivers/net/bnx2.c View File

18
 #include <errno.h>
18
 #include <errno.h>
19
 #include <gpxe/pci.h>
19
 #include <gpxe/pci.h>
20
 #include <gpxe/ethernet.h>
20
 #include <gpxe/ethernet.h>
21
-#include "timer.h"
22
 #include "string.h"
21
 #include "string.h"
23
 #include "bnx2.h"
22
 #include "bnx2.h"
24
 #include "bnx2_fw.h"
23
 #include "bnx2_fw.h"

+ 0
- 1
src/drivers/net/dmfe.c View File

43
 /* to get the PCI support functions, if this is a PCI NIC */
43
 /* to get the PCI support functions, if this is a PCI NIC */
44
 #include <gpxe/pci.h>
44
 #include <gpxe/pci.h>
45
 #include <gpxe/ethernet.h>
45
 #include <gpxe/ethernet.h>
46
-#include "timer.h"
47
 
46
 
48
 /* #define EDEBUG 1 */
47
 /* #define EDEBUG 1 */
49
 #ifdef EDEBUG
48
 #ifdef EDEBUG

+ 0
- 1
src/drivers/net/e1000/e1000.h View File

36
 #include <stdio.h>
36
 #include <stdio.h>
37
 #include <io.h>
37
 #include <io.h>
38
 #include <errno.h>
38
 #include <errno.h>
39
-#include <timer.h>
40
 #include <byteswap.h>
39
 #include <byteswap.h>
41
 #include <gpxe/pci.h>
40
 #include <gpxe/pci.h>
42
 #include <gpxe/malloc.h>
41
 #include <gpxe/malloc.h>

+ 1
- 1
src/drivers/net/e1000/e1000_osdep.h View File

39
 #include <stdio.h>
39
 #include <stdio.h>
40
 #include <io.h>
40
 #include <io.h>
41
 #include <errno.h>
41
 #include <errno.h>
42
-#include <timer.h>
42
+#include <unistd.h>
43
 #include <byteswap.h>
43
 #include <byteswap.h>
44
 #include <gpxe/pci.h>
44
 #include <gpxe/pci.h>
45
 #include <gpxe/if_ether.h>
45
 #include <gpxe/if_ether.h>

+ 0
- 1
src/drivers/net/eepro.c View File

35
 #include <errno.h>
35
 #include <errno.h>
36
 #include "nic.h"
36
 #include "nic.h"
37
 #include <gpxe/isa.h>
37
 #include <gpxe/isa.h>
38
-#include "timer.h"
39
 #include <gpxe/ethernet.h>
38
 #include <gpxe/ethernet.h>
40
 
39
 
41
 /* Different 82595 chips */
40
 /* Different 82595 chips */

+ 8
- 5
src/drivers/net/eepro100.c View File

107
 #include "nic.h"
107
 #include "nic.h"
108
 #include <gpxe/ethernet.h>
108
 #include <gpxe/ethernet.h>
109
 #include <gpxe/pci.h>
109
 #include <gpxe/pci.h>
110
-#include "timer.h"
111
 
110
 
112
 static int ioaddr;
111
 static int ioaddr;
113
 
112
 
408
 	} hdr;
407
 	} hdr;
409
 	unsigned short status;
408
 	unsigned short status;
410
 	int s1, s2;
409
 	int s1, s2;
410
+	tick_t ct;
411
 
411
 
412
 	status = inw(ioaddr + SCBStatus);
412
 	status = inw(ioaddr + SCBStatus);
413
 	/* Acknowledge all of the current interrupt sources ASAP. */
413
 	/* Acknowledge all of the current interrupt sources ASAP. */
445
 	wait_for_cmd_done(ioaddr + SCBCmd);
445
 	wait_for_cmd_done(ioaddr + SCBCmd);
446
 
446
 
447
 	s1 = inw (ioaddr + SCBStatus);
447
 	s1 = inw (ioaddr + SCBStatus);
448
-	load_timer2(10*TICKS_PER_MS);		/* timeout 10 ms for transmit */
449
-	while (!txfd.status && timer2_running())
448
+
449
+	ct = currticks();
450
+	/* timeout 10 ms for transmit */
451
+	while (!txfd.status && ct + 10*USECS_IN_MSEC)
450
 		/* Wait */;
452
 		/* Wait */;
451
 	s2 = inw (ioaddr + SCBStatus);
453
 	s2 = inw (ioaddr + SCBStatus);
452
 
454
 
606
 	int read_cmd, ee_size;
608
 	int read_cmd, ee_size;
607
 	int options;
609
 	int options;
608
 	int rx_mode;
610
 	int rx_mode;
611
+	tick_t ct;
609
 
612
 
610
 	/* we cache only the first few words of the EEPROM data
613
 	/* we cache only the first few words of the EEPROM data
611
 	   be careful not to access beyond this array */
614
 	   be careful not to access beyond this array */
749
 
752
 
750
 	whereami ("started TX thingy (config, iasetup).");
753
 	whereami ("started TX thingy (config, iasetup).");
751
 
754
 
752
-	load_timer2(10*TICKS_PER_MS);
753
-	while (!txfd.status && timer2_running())
755
+	ct = currticks();
756
+	while (!txfd.status && ct + 10*USECS_IN_MSEC < currticks())
754
 		/* Wait */;
757
 		/* Wait */;
755
 
758
 
756
 	/* Read the status register once to disgard stale data */
759
 	/* Read the status register once to disgard stale data */

+ 9
- 7
src/drivers/net/epic100.c View File

8
 #include <gpxe/pci.h>
8
 #include <gpxe/pci.h>
9
 #include <gpxe/ethernet.h>
9
 #include <gpxe/ethernet.h>
10
 #include "nic.h"
10
 #include "nic.h"
11
-#include "timer.h"
12
 #include "console.h"
11
 #include "console.h"
13
 #include "epic100.h"
12
 #include "epic100.h"
14
 
13
 
310
     unsigned short nstype;
309
     unsigned short nstype;
311
     unsigned char *txp;
310
     unsigned char *txp;
312
     int entry;
311
     int entry;
312
+    tick_t ct;
313
 
313
 
314
     /* Calculate the next Tx descriptor entry. */
314
     /* Calculate the next Tx descriptor entry. */
315
     entry = cur_tx % TX_RING_SIZE;
315
     entry = cur_tx % TX_RING_SIZE;
339
      * set the base address with the "ownership"
339
      * set the base address with the "ownership"
340
      * bits last.
340
      * bits last.
341
      */
341
      */
342
-    
342
+   
343
     tx_ring[entry].buflength |= cpu_to_le32(len);
343
     tx_ring[entry].buflength |= cpu_to_le32(len);
344
-    tx_ring[entry].status = cpu_to_le32(len << 16) | 
344
+    tx_ring[entry].status = cpu_to_le32(len << 16) |
345
 	    cpu_to_le32(TRING_OWN);	/* Pass ownership to the chip. */
345
 	    cpu_to_le32(TRING_OWN);	/* Pass ownership to the chip. */
346
 
346
 
347
     cur_tx++;
347
     cur_tx++;
348
 
348
 
349
     /* Trigger an immediate transmit demand. */
349
     /* Trigger an immediate transmit demand. */
350
-    outl(CR_QUEUE_TX, command); 
351
-    
352
-    load_timer2(10*TICKS_PER_MS);         /* timeout 10 ms for transmit */
353
-    while ((le32_to_cpu(tx_ring[entry].status) & (TRING_OWN)) && timer2_running())
350
+    outl(CR_QUEUE_TX, command);
351
+
352
+    ct = currticks();
353
+    /* timeout 10 ms for transmit */
354
+    while ((le32_to_cpu(tx_ring[entry].status) & (TRING_OWN)) &&
355
+		ct + 10*USECS_IN_MSEC < currticks())
354
 	/* Wait */;
356
 	/* Wait */;
355
 
357
 
356
     if ((le32_to_cpu(tx_ring[entry].status) & TRING_OWN) != 0)
358
     if ((le32_to_cpu(tx_ring[entry].status) & TRING_OWN) != 0)

+ 0
- 1
src/drivers/net/etherfabric.c View File

24
 #include <gpxe/i2c.h>
24
 #include <gpxe/i2c.h>
25
 #include <gpxe/spi.h>
25
 #include <gpxe/spi.h>
26
 #include <gpxe/nvo.h>
26
 #include <gpxe/nvo.h>
27
-#include "timer.h"
28
 #define dma_addr_t unsigned long
27
 #define dma_addr_t unsigned long
29
 #include "etherfabric.h"
28
 #include "etherfabric.h"
30
 
29
 

+ 0
- 1
src/drivers/net/forcedeth.c View File

51
 #include <gpxe/pci.h>
51
 #include <gpxe/pci.h>
52
 /* Include timer support functions */
52
 /* Include timer support functions */
53
 #include <gpxe/ethernet.h>
53
 #include <gpxe/ethernet.h>
54
-#include "timer.h"
55
 #include "mii.h"
54
 #include "mii.h"
56
 
55
 
57
 #define drv_version "v1.2"
56
 #define drv_version "v1.2"

+ 0
- 1
src/drivers/net/ipoib.c View File

22
 #include <string.h>
22
 #include <string.h>
23
 #include <byteswap.h>
23
 #include <byteswap.h>
24
 #include <errno.h>
24
 #include <errno.h>
25
-#include "timer.h"
26
 #include <gpxe/if_arp.h>
25
 #include <gpxe/if_arp.h>
27
 #include <gpxe/iobuf.h>
26
 #include <gpxe/iobuf.h>
28
 #include <gpxe/netdevice.h>
27
 #include <gpxe/netdevice.h>

+ 0
- 1
src/drivers/net/mlx_ipoib/mt23108_imp.c View File

37
 	}
37
 	}
38
 }
38
 }
39
 
39
 
40
-#include "timer.h"
41
 #include "cmdif_mt23108.c"
40
 #include "cmdif_mt23108.c"
42
 #include "cmdif_comm.c"
41
 #include "cmdif_comm.c"
43
 #include "ib_mt23108.c"
42
 #include "ib_mt23108.c"

+ 0
- 1
src/drivers/net/mlx_ipoib/mt25218_imp.c View File

37
 	}
37
 	}
38
 }
38
 }
39
 
39
 
40
-#include "timer.h"
41
 #include "cmdif_mt25218.c"
40
 #include "cmdif_mt25218.c"
42
 #include "cmdif_comm.c"
41
 #include "cmdif_comm.c"
43
 #include "ib_mt25218.c"
42
 #include "ib_mt25218.c"

+ 1
- 1
src/drivers/net/mtnic.c View File

37
 #include <gpxe/umalloc.h>
37
 #include <gpxe/umalloc.h>
38
 #include <bits/byteswap.h>
38
 #include <bits/byteswap.h>
39
 #include <little_bswap.h>
39
 #include <little_bswap.h>
40
-#include <timer.h>
40
+#include <unistd.h>
41
 #include <gpxe/pci.h>
41
 #include <gpxe/pci.h>
42
 #include <gpxe/ethernet.h>
42
 #include <gpxe/ethernet.h>
43
 #include <gpxe/netdevice.h>
43
 #include <gpxe/netdevice.h>

+ 1
- 1
src/drivers/net/natsemi.c View File

63
 #include <stdio.h>
63
 #include <stdio.h>
64
 #include <io.h>
64
 #include <io.h>
65
 #include <errno.h>
65
 #include <errno.h>
66
-#include <timer.h>
67
 #include <byteswap.h>
66
 #include <byteswap.h>
67
+#include <unistd.h>
68
 #include <gpxe/pci.h>
68
 #include <gpxe/pci.h>
69
 #include <gpxe/if_ether.h>
69
 #include <gpxe/if_ether.h>
70
 #include <gpxe/ethernet.h>
70
 #include <gpxe/ethernet.h>

+ 0
- 1
src/drivers/net/pcnet32.c View File

43
 #include "nic.h"
43
 #include "nic.h"
44
 #include <gpxe/pci.h>
44
 #include <gpxe/pci.h>
45
 #include <gpxe/ethernet.h>
45
 #include <gpxe/ethernet.h>
46
-#include "timer.h"
47
 #include "mii.h"
46
 #include "mii.h"
48
 
47
 
49
 /* void hex_dump(const char *data, const unsigned int len); */
48
 /* void hex_dump(const char *data, const unsigned int len); */

+ 0
- 1
src/drivers/net/prism2.c View File

62
  * quicker to convert code from the Linux Prism2 driver.
62
  * quicker to convert code from the Linux Prism2 driver.
63
  */
63
  */
64
 #include <errno.h>
64
 #include <errno.h>
65
-#include "timer.h"
66
 #define __le16_to_cpu(x) (x)
65
 #define __le16_to_cpu(x) (x)
67
 #define __le32_to_cpu(x) (x)
66
 #define __le32_to_cpu(x) (x)
68
 #define __cpu_to_le16(x) (x)
67
 #define __cpu_to_le16(x) (x)

+ 0
- 1
src/drivers/net/r8169.c View File

49
 #include <gpxe/pci.h>
49
 #include <gpxe/pci.h>
50
 #include <gpxe/ethernet.h>
50
 #include <gpxe/ethernet.h>
51
 #include <gpxe/malloc.h>
51
 #include <gpxe/malloc.h>
52
-#include "timer.h"
53
 
52
 
54
 #define drv_version "v1.6"
53
 #define drv_version "v1.6"
55
 #define drv_date "03-27-2004"
54
 #define drv_date "03-27-2004"

+ 1
- 1
src/drivers/net/rtl8139.c View File

71
 #include <stdio.h>
71
 #include <stdio.h>
72
 #include <io.h>
72
 #include <io.h>
73
 #include <errno.h>
73
 #include <errno.h>
74
-#include <timer.h>
74
+#include <unistd.h>
75
 #include <byteswap.h>
75
 #include <byteswap.h>
76
 #include <gpxe/pci.h>
76
 #include <gpxe/pci.h>
77
 #include <gpxe/if_ether.h>
77
 #include <gpxe/if_ether.h>

+ 0
- 1
src/drivers/net/sis900.c View File

46
 #include "etherboot.h"
46
 #include "etherboot.h"
47
 #include <gpxe/pci.h>
47
 #include <gpxe/pci.h>
48
 #include "nic.h"
48
 #include "nic.h"
49
-#include "timer.h"
50
 
49
 
51
 #include "sis900.h"
50
 #include "sis900.h"
52
 
51
 

+ 0
- 1
src/drivers/net/smc9000.c View File

40
 #include "etherboot.h"
40
 #include "etherboot.h"
41
 #include "nic.h"
41
 #include "nic.h"
42
 #include <gpxe/isa.h>
42
 #include <gpxe/isa.h>
43
-#include "timer.h"
44
 #include "smc9000.h"
43
 #include "smc9000.h"
45
 
44
 
46
 # define _outb outb
45
 # define _outb outb

+ 0
- 1
src/drivers/net/sundance.c View File

46
 #include "nic.h"
46
 #include "nic.h"
47
 /* to get the PCI support functions, if this is a PCI NIC */
47
 /* to get the PCI support functions, if this is a PCI NIC */
48
 #include <gpxe/pci.h>
48
 #include <gpxe/pci.h>
49
-#include "timer.h"
50
 #include "mii.h"
49
 #include "mii.h"
51
 
50
 
52
 #define drv_version "v1.12"
51
 #define drv_version "v1.12"

+ 0
- 1
src/drivers/net/tg3.c View File

17
 #include <errno.h>
17
 #include <errno.h>
18
 #include <gpxe/pci.h>
18
 #include <gpxe/pci.h>
19
 #include <gpxe/ethernet.h>
19
 #include <gpxe/ethernet.h>
20
-#include "timer.h"
21
 #include "string.h"
20
 #include "string.h"
22
 #include "tg3.h"
21
 #include "tg3.h"
23
 
22
 

+ 0
- 1
src/drivers/net/tlan.c View File

42
 #include "nic.h"
42
 #include "nic.h"
43
 #include <gpxe/pci.h>
43
 #include <gpxe/pci.h>
44
 #include <gpxe/ethernet.h>
44
 #include <gpxe/ethernet.h>
45
-#include "timer.h"
46
 #include "tlan.h"
45
 #include "tlan.h"
47
 
46
 
48
 #define drv_version "v1.4"
47
 #define drv_version "v1.4"

+ 12
- 9
src/drivers/net/via-rhine.c View File

50
 #include "nic.h"
50
 #include "nic.h"
51
 #include <gpxe/pci.h>
51
 #include <gpxe/pci.h>
52
 #include <gpxe/ethernet.h>
52
 #include <gpxe/ethernet.h>
53
-#include "timer.h"
54
 
53
 
55
 /* define all ioaddr */
54
 /* define all ioaddr */
56
 
55
 
785
     char byMIIAdrbak;
784
     char byMIIAdrbak;
786
     char byMIICRbak;
785
     char byMIICRbak;
787
     char byMIItemp;
786
     char byMIItemp;
787
+    tick_t ct;
788
 
788
 
789
     byMIIAdrbak = inb (byMIIAD);
789
     byMIIAdrbak = inb (byMIIAD);
790
     byMIICRbak = inb (byMIICR);
790
     byMIICRbak = inb (byMIICR);
799
     byMIItemp = inb (byMIICR);
799
     byMIItemp = inb (byMIICR);
800
     byMIItemp = byMIItemp & 0x40;
800
     byMIItemp = byMIItemp & 0x40;
801
 
801
 
802
-    load_timer2(2*TICKS_PER_MS);
803
-    while (byMIItemp != 0 && timer2_running())
802
+    ct = currticks();
803
+    while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
804
     {
804
     {
805
 	byMIItemp = inb (byMIICR);
805
 	byMIItemp = inb (byMIICR);
806
 	byMIItemp = byMIItemp & 0x40;
806
 	byMIItemp = byMIItemp & 0x40;
825
     char byMIIAdrbak;
825
     char byMIIAdrbak;
826
     char byMIICRbak;
826
     char byMIICRbak;
827
     char byMIItemp;
827
     char byMIItemp;
828
+    tick_t ct;
828
 
829
 
829
 
830
 
830
     byMIIAdrbak = inb (byMIIAD);
831
     byMIIAdrbak = inb (byMIIAD);
840
     byMIItemp = inb (byMIICR);
841
     byMIItemp = inb (byMIICR);
841
     byMIItemp = byMIItemp & 0x40;
842
     byMIItemp = byMIItemp & 0x40;
842
 
843
 
843
-    load_timer2(2*TICKS_PER_MS);
844
-    while (byMIItemp != 0 && timer2_running())
844
+    ct = currticks();
845
+    while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
845
     {
846
     {
846
 	byMIItemp = inb (byMIICR);
847
 	byMIItemp = inb (byMIICR);
847
 	byMIItemp = byMIItemp & 0x40;
848
 	byMIItemp = byMIItemp & 0x40;
870
     byMIItemp = inb (byMIICR);
871
     byMIItemp = inb (byMIICR);
871
     byMIItemp = byMIItemp & 0x20;
872
     byMIItemp = byMIItemp & 0x20;
872
 
873
 
873
-    load_timer2(2*TICKS_PER_MS);
874
-    while (byMIItemp != 0 && timer2_running())
874
+    ct = currticks();
875
+    while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
875
     {
876
     {
876
 	byMIItemp = inb (byMIICR);
877
 	byMIItemp = inb (byMIICR);
877
 	byMIItemp = byMIItemp & 0x20;
878
 	byMIItemp = byMIItemp & 0x20;
1345
     unsigned char CR1bak;
1346
     unsigned char CR1bak;
1346
     unsigned char CR0bak;
1347
     unsigned char CR0bak;
1347
     unsigned int nstype;
1348
     unsigned int nstype;
1349
+    tick_t ct;
1348
 
1350
 
1349
 
1351
 
1350
     /*printf ("rhine_transmit\n"); */
1352
     /*printf ("rhine_transmit\n"); */
1385
     outb (CR1bak, byCR1);
1387
     outb (CR1bak, byCR1);
1386
     do
1388
     do
1387
     {
1389
     {
1388
-        load_timer2(10*TICKS_PER_MS);
1390
+	ct = currticks();
1389
         /* Wait until transmit is finished or timeout*/
1391
         /* Wait until transmit is finished or timeout*/
1390
-        while((tp->tx_ring[entry].tx_status.bits.own_bit !=0) && timer2_running())
1392
+        while((tp->tx_ring[entry].tx_status.bits.own_bit !=0) &&
1393
+		ct + 10*USECS_IN_MSEC < currticks())
1391
         ;
1394
         ;
1392
 
1395
 
1393
         if(tp->tx_ring[entry].tx_status.bits.terr == 0)
1396
         if(tp->tx_ring[entry].tx_status.bits.terr == 0)

+ 0
- 2
src/drivers/net/via-velocity.h View File

24
  *       Copyright (c) 2006 by Timothy Legge <tlegge@rogers.com>
24
  *       Copyright (c) 2006 by Timothy Legge <tlegge@rogers.com>
25
  */
25
  */
26
 
26
 
27
-#include "timer.h"
28
-
29
 #ifndef VELOCITY_H
27
 #ifndef VELOCITY_H
30
 #define VELOCITY_H
28
 #define VELOCITY_H
31
 
29
 

+ 4
- 5
src/drivers/net/w89c840.c View File

81
 #include "nic.h"
81
 #include "nic.h"
82
 #include <gpxe/pci.h>
82
 #include <gpxe/pci.h>
83
 #include <gpxe/ethernet.h>
83
 #include <gpxe/ethernet.h>
84
-#include "timer.h"
85
 
84
 
86
 static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
85
 static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
87
 
86
 
113
 
112
 
114
 /* Operational parameters that usually are not changed. */
113
 /* Operational parameters that usually are not changed. */
115
 /* Time in jiffies before concluding the transmitter is hung. */
114
 /* Time in jiffies before concluding the transmitter is hung. */
116
-#define TX_TIMEOUT  (10*TICKS_PER_MS)
115
+#define TX_TIMEOUT  (10*USECS_IN_MSEC)
117
 
116
 
118
 #define PKT_BUF_SZ  1536  /* Size of each temporary Rx buffer.*/
117
 #define PKT_BUF_SZ  1536  /* Size of each temporary Rx buffer.*/
119
 
118
 
487
     /* send the packet to destination */
486
     /* send the packet to destination */
488
     unsigned entry;
487
     unsigned entry;
489
     int transmit_status;
488
     int transmit_status;
489
+    tick_t ct;
490
 
490
 
491
     /* Caution: the write order is important here, set the field
491
     /* Caution: the write order is important here, set the field
492
        with the "ownership" bits last. */
492
        with the "ownership" bits last. */
535
     /* Now wait for TX to complete. */
535
     /* Now wait for TX to complete. */
536
     transmit_status = w840private.tx_ring[entry].status;
536
     transmit_status = w840private.tx_ring[entry].status;
537
 
537
 
538
-    load_timer2(TX_TIMEOUT);
539
-
538
+    ct = currticks();
540
     {
539
     {
541
 #if defined W89C840_DEBUG
540
 #if defined W89C840_DEBUG
542
         u32 intr_stat = 0;
541
         u32 intr_stat = 0;
547
 	      decode_interrupt(intr_stat);
546
 	      decode_interrupt(intr_stat);
548
 #endif
547
 #endif
549
 
548
 
550
-                while ( (transmit_status & DescOwn) && timer2_running()) {
549
+                while ( (transmit_status & DescOwn) && ct + TX_TIMEOUT < currticks()) {
551
 
550
 
552
                     transmit_status = w840private.tx_ring[entry].status;
551
                     transmit_status = w840private.tx_ring[entry].status;
553
                 }
552
                 }

+ 1
- 1
src/drivers/nvs/spi.c View File

18
 
18
 
19
 #include <stddef.h>
19
 #include <stddef.h>
20
 #include <errno.h>
20
 #include <errno.h>
21
-#include <timer.h>
21
+#include <unistd.h>
22
 #include <gpxe/spi.h>
22
 #include <gpxe/spi.h>
23
 
23
 
24
 /** @file
24
 /** @file

+ 1
- 1
src/drivers/nvs/threewire.c View File

18
 
18
 
19
 #include <stddef.h>
19
 #include <stddef.h>
20
 #include <assert.h>
20
 #include <assert.h>
21
-#include <timer.h>
21
+#include <unistd.h>
22
 #include <gpxe/threewire.h>
22
 #include <gpxe/threewire.h>
23
 
23
 
24
 /** @file
24
 /** @file

+ 1
- 1
src/hci/mucurses/kb.c View File

1
 #include <curses.h>
1
 #include <curses.h>
2
 #include <stddef.h>
2
 #include <stddef.h>
3
-#include <timer.h>
3
+#include <unistd.h>
4
 #include "mucurses.h"
4
 #include "mucurses.h"
5
 
5
 
6
 /** @file
6
 /** @file

+ 1
- 1
src/hci/shell_banner.c View File

18
 
18
 
19
 #include <stdio.h>
19
 #include <stdio.h>
20
 #include <console.h>
20
 #include <console.h>
21
-#include <latch.h>
22
 #include <gpxe/features.h>
21
 #include <gpxe/features.h>
22
+#include <gpxe/timer.h>
23
 #include <gpxe/shell_banner.h>
23
 #include <gpxe/shell_banner.h>
24
 
24
 
25
 /** @file
25
 /** @file

+ 1
- 1
src/include/etherboot.h View File

12
 #include <stdio.h>
12
 #include <stdio.h>
13
 #include <unistd.h>
13
 #include <unistd.h>
14
 #include <strings.h>
14
 #include <strings.h>
15
-#include <latch.h>
16
 #include <console.h>
15
 #include <console.h>
16
+#include <gpxe/timer.h>
17
 #include <gpxe/if_arp.h>
17
 #include <gpxe/if_arp.h>
18
 #include <gpxe/if_ether.h>
18
 #include <gpxe/if_ether.h>
19
 
19
 

+ 0
- 1
src/include/gpxe/dhcp.h View File

12
 #include <gpxe/in.h>
12
 #include <gpxe/in.h>
13
 #include <gpxe/refcnt.h>
13
 #include <gpxe/refcnt.h>
14
 #include <gpxe/tables.h>
14
 #include <gpxe/tables.h>
15
-#include <latch.h>
16
 
15
 
17
 struct net_device;
16
 struct net_device;
18
 struct job_interface;
17
 struct job_interface;

+ 0
- 1
src/include/gpxe/tcp.h View File

9
  *
9
  *
10
  */
10
  */
11
 
11
 
12
-#include "latch.h"
13
 #include <gpxe/tcpip.h>
12
 #include <gpxe/tcpip.h>
14
 
13
 
15
 /**
14
 /**

+ 0
- 27
src/include/timer.h View File

1
-#ifndef TIMER_H
2
-#define TIMER_H
3
-
4
-/*
5
- * This file should be removed as soon as there are no
6
- * currticks() abusers.
7
- */
8
-
9
-#include <stddef.h>
10
-/*
11
-#warning Please fix me. I'm abusing the deprecated include/timer.h
12
-*/
13
-#include <unistd.h>
14
-
15
-/* Duplicates include/gpxe/timer.h */
16
-typedef uint32_t tick_t;
17
-
18
-#define MSECS_IN_SEC (1000)
19
-#define USECS_IN_SEC (1000*1000)
20
-#define USECS_IN_MSEC (1000)
21
-
22
-#define	TICKS_PER_SEC USECS_IN_SEC
23
-
24
-tick_t currticks(void);
25
-
26
-#endif
27
-

+ 1
- 1
src/net/retry.c View File

17
  */
17
  */
18
 
18
 
19
 #include <stddef.h>
19
 #include <stddef.h>
20
-#include <latch.h>
20
+#include <gpxe/timer.h>
21
 #include <gpxe/list.h>
21
 #include <gpxe/list.h>
22
 #include <gpxe/process.h>
22
 #include <gpxe/process.h>
23
 #include <gpxe/init.h>
23
 #include <gpxe/init.h>

+ 1
- 1
src/net/tcp.c View File

4
 #include <assert.h>
4
 #include <assert.h>
5
 #include <errno.h>
5
 #include <errno.h>
6
 #include <byteswap.h>
6
 #include <byteswap.h>
7
-#include <timer.h>
7
+#include <gpxe/timer.h>
8
 #include <gpxe/iobuf.h>
8
 #include <gpxe/iobuf.h>
9
 #include <gpxe/malloc.h>
9
 #include <gpxe/malloc.h>
10
 #include <gpxe/retry.h>
10
 #include <gpxe/retry.h>

+ 1
- 0
src/net/udp/dhcp.c View File

33
 #include <gpxe/ip.h>
33
 #include <gpxe/ip.h>
34
 #include <gpxe/uuid.h>
34
 #include <gpxe/uuid.h>
35
 #include <gpxe/dhcp.h>
35
 #include <gpxe/dhcp.h>
36
+#include <gpxe/timer.h>
36
 
37
 
37
 /** @file
38
 /** @file
38
  *
39
  *

Loading…
Cancel
Save