Преглед на файлове

Use insb/outsb; it's marginally faster.

tags/v0.9.3
Michael Brown преди 18 години
родител
ревизия
4d0a0f822d
променени са 1 файла, в които са добавени 2 реда и са изтрити 9 реда
  1. 2
    9
      src/drivers/net/pnic.c

+ 2
- 9
src/drivers/net/pnic.c Целия файл

44
 				     void *input, uint16_t input_length,
44
 				     void *input, uint16_t input_length,
45
 				     void *output, uint16_t output_max_length,
45
 				     void *output, uint16_t output_max_length,
46
 				     uint16_t *output_length ) {
46
 				     uint16_t *output_length ) {
47
-	int i;
48
 	uint16_t status;
47
 	uint16_t status;
49
 	uint16_t _output_length;
48
 	uint16_t _output_length;
50
 
49
 
52
 		/* Write input length */
51
 		/* Write input length */
53
 		outw ( input_length, pnic->ioaddr + PNIC_REG_LEN );
52
 		outw ( input_length, pnic->ioaddr + PNIC_REG_LEN );
54
 		/* Write input data */
53
 		/* Write input data */
55
-		for ( i = 0; i < input_length; i++ ) {
56
-			outb( ((char*)input)[i],
57
-			      pnic->ioaddr + PNIC_REG_DATA );
58
-		}
54
+		outsb ( pnic->ioaddr + PNIC_REG_DATA, input, input_length );
59
 	}
55
 	}
60
 	/* Write command */
56
 	/* Write command */
61
 	outw ( command, pnic->ioaddr + PNIC_REG_CMD );
57
 	outw ( command, pnic->ioaddr + PNIC_REG_CMD );
80
 			_output_length = output_max_length;
76
 			_output_length = output_max_length;
81
 		}
77
 		}
82
 		/* Retrieve output data */
78
 		/* Retrieve output data */
83
-		for ( i = 0; i < _output_length; i++ ) {
84
-			((char*)output)[i] =
85
-				inb ( pnic->ioaddr + PNIC_REG_DATA );
86
-		}
79
+		insb ( pnic->ioaddr + PNIC_REG_DATA, output, _output_length );
87
 	}
80
 	}
88
 	return status;
81
 	return status;
89
 }
82
 }

Loading…
Отказ
Запис