From: Fergus Simpson <[email protected]> This makes the driver more consistent with the rest of Akaros's code.
Change-Id: I427e439ee1b34a2bcf5ec86c94e4f590c0681ee5 Signed-off-by: Fergus Simpson <[email protected]> --- kern/drivers/dev/sdiahci.c | 22 +++++++++++----------- kern/include/ahci.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/kern/drivers/dev/sdiahci.c b/kern/drivers/dev/sdiahci.c index accb4ca..af40b3d 100644 --- a/kern/drivers/dev/sdiahci.c +++ b/kern/drivers/dev/sdiahci.c @@ -175,7 +175,7 @@ struct ctlr { /* virtual register addresses */ uintptr_t mmio; - Ahba *hba; + struct ahba *hba; /* phyical register address */ uintptr_t physio; @@ -556,7 +556,7 @@ static int64_t ahciidentify(struct aportc *pc, uint16_t *id) #if 0 static int -ahciquiet(Aport *a) +ahciquiet(struct aport *a) { uint32_t *p, i; @@ -593,7 +593,7 @@ stop1: #if 0 static int -ahcicomreset(Aportc *pc) +ahcicomreset(struct aportc *pc) { unsigned char *c; @@ -717,7 +717,7 @@ static void ahciwakeup(struct aport *p) static int ahciconfigdrive(struct drive *d) { char *name; - Ahba *h; + struct ahba *h; struct aport *p; struct aportm *pm; @@ -765,12 +765,12 @@ static int ahciconfigdrive(struct drive *d) return 0; } -static void ahcienable(Ahba *h) +static void ahcienable(struct ahba *h) { h->ghc |= Hie; } -static void ahcidisable(Ahba *h) +static void ahcidisable(struct ahba *h) { h->ghc &= ~Hie; } @@ -788,10 +788,10 @@ static int countbits(uint32_t u) static int ahciconf(struct ctlr *ctlr) { - Ahba *h; + struct ahba *h; uint32_t u; - h = ctlr->hba = (Ahba *)ctlr->mmio; + h = ctlr->hba = (struct ahba *)ctlr->mmio; u = h->cap; if ((u & Hsam) == 0) @@ -807,7 +807,7 @@ static int ahciconf(struct ctlr *ctlr) #if 0 static int -ahcihbareset(Ahba *h) +ahcihbareset(struct ahba *h) { int wait; @@ -2070,7 +2070,7 @@ static struct sdev *iapnp(void) if (Intel(c) && p->dev_id != 0x2681) iasetupahci(c); nunit = ahciconf(c); - // ahcihbareset((Ahba*)c->mmio); + // ahcihbareset((struct ahba*)c->mmio); if (Intel(c) && iaahcimode(p) == -1) break; if (nunit < 1) { @@ -2309,7 +2309,7 @@ static char *iartopctl(struct sdev *sdev, char *p, char *e) { uint32_t cap; char pr[25]; - Ahba *hba; + struct ahba *hba; struct ctlr *ctlr; #define has(x, str) \ diff --git a/kern/include/ahci.h b/kern/include/ahci.h index 1931fd2..452d934 100644 --- a/kern/include/ahci.h +++ b/kern/include/ahci.h @@ -86,7 +86,7 @@ enum { Hhr = 1 << 0, /* hba reset */ }; -typedef struct abha { +struct ahba { uint32_t cap; uint32_t ghc; uint32_t isr; @@ -96,7 +96,7 @@ typedef struct abha { uint32_t cccports; uint32_t emloc; uint32_t emctl; -} Ahba; +}; enum { Acpds = 1 << 31, /* cold port detect status */ @@ -187,7 +187,7 @@ enum { #define serror scr1 #define sactive scr3 -typedef struct aport { +struct aport { uint32_t list; /* PxCLB must be 1kb aligned. */ uint32_t listhi; uint32_t fis; /* 256-byte aligned */ @@ -206,7 +206,7 @@ typedef struct aport { uint32_t ntf; unsigned char res2[8]; uint32_t vendor; -} Aport; +}; enum { /* @@ -227,14 +227,14 @@ enum { }; /* in host's memory; not memory mapped */ -typedef struct afis { +struct afis { unsigned char *base; unsigned char *d; unsigned char *p; unsigned char *r; unsigned char *u; uint32_t *devicebits; -} Afis; +}; enum { Lprdtl = 1 << 16, /* physical region descriptor table len */ @@ -249,27 +249,27 @@ enum { }; /* in hosts memory; memory mapped */ -typedef struct alist { +struct alist { uint32_t flags; uint32_t len; uint32_t ctab; uint32_t ctabhi; unsigned char reserved[16]; -} Alist; +}; -typedef struct aprdt { +struct aprdt { uint32_t dba; uint32_t dbahi; uint32_t pad; uint32_t count; -} Aprdt; +}; -typedef struct actab { +struct actab { unsigned char cfis[0x40]; unsigned char atapi[0x10]; unsigned char pad[0x30]; - Aprdt prdt; -} Actab; + struct aprdt prdt; +}; enum { Ferror = 1, @@ -285,18 +285,18 @@ enum { Datapi16 = 1 << 5, }; -typedef struct aportm { +struct aportm { qlock_t ql; struct rendez Rendez; unsigned char flag; unsigned char feat; unsigned char smart; - Afis fis; - Alist *list; - Actab *ctab; -} Aportm; + struct afis fis; + struct alist *list; + struct actab *ctab; +}; -typedef struct aportc { - Aport *p; - Aportm *pm; -} Aportc; +struct aportc { + struct aport *p; + struct aportm *pm; +}; -- 2.8.0.rc3.226.g39d4020 -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
