Просмотр исходного кода

Backing out last change; no immediate plans to make the whole block-device

layer asynchronous, so keeping the sync/async boundary within aoedev.c
seems cleanest for now.
tags/v0.9.3
Michael Brown 18 лет назад
Родитель
Сommit
1f394c2f7c
3 измененных файлов: 9 добавлений и 11 удалений
  1. 5
    4
      src/drivers/ata/aoedev.c
  2. 1
    2
      src/drivers/block/ata.c
  3. 3
    5
      src/include/gpxe/ata.h

+ 5
- 4
src/drivers/ata/aoedev.c Просмотреть файл

@@ -30,14 +30,15 @@
30 30
  *
31 31
  * @v ata		ATA device
32 32
  * @v command		ATA command
33
- * @ret aop		Asynchronous operation
33
+ * @ret rc		Return status code
34 34
  */
35
-static struct async_operation * aoe_command ( struct ata_device *ata,
36
-					      struct ata_command *command ) {
35
+static int aoe_command ( struct ata_device *ata,
36
+			 struct ata_command *command ) {
37 37
 	struct aoe_device *aoedev
38 38
 		= container_of ( ata, struct aoe_device, ata );
39 39
 
40
-	return aoe_issue ( &aoedev->aoe, command );
40
+	aoe_issue ( &aoedev->aoe, command );
41
+	return async_wait ( &aoedev->aoe.aop );
41 42
 }
42 43
 
43 44
 /**

+ 1
- 2
src/drivers/block/ata.c Просмотреть файл

@@ -20,7 +20,6 @@
20 20
 #include <string.h>
21 21
 #include <assert.h>
22 22
 #include <byteswap.h>
23
-#include <gpxe/async.h>
24 23
 #include <gpxe/blockdev.h>
25 24
 #include <gpxe/ata.h>
26 25
 
@@ -49,7 +48,7 @@ ata_command ( struct ata_device *ata, struct ata_command *command ) {
49 48
 	      ( unsigned long long ) command->cb.lba.native,
50 49
 	      command->cb.count.native );
51 50
 
52
-	return async_wait ( ata->command ( ata, command ) );
51
+	return ata->command ( ata, command );	
53 52
 }
54 53
 
55 54
 /**

+ 3
- 5
src/include/gpxe/ata.h Просмотреть файл

@@ -11,8 +11,6 @@
11 11
  *
12 12
  */
13 13
 
14
-struct async_operation;
15
-
16 14
 /**
17 15
  * An ATA Logical Block Address
18 16
  *
@@ -193,10 +191,10 @@ struct ata_device {
193 191
 	 *
194 192
 	 * @v ata		ATA device
195 193
 	 * @v command		ATA command
196
-	 * @ret aop		Asynchronous operation
194
+	 * @ret rc		Return status code
197 195
 	 */
198
-	struct async_operation * ( * command ) ( struct ata_device *ata,
199
-						 struct ata_command *command );
196
+	int ( * command ) ( struct ata_device *ata,
197
+			    struct ata_command *command );
200 198
 };
201 199
 
202 200
 extern int init_atadev ( struct ata_device *ata );

Загрузка…
Отмена
Сохранить