From nobody Sat Apr 20 13:53:40 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1499791877424530.0053854528363; Tue, 11 Jul 2017 09:51:17 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dUyLb-00044v-Bs; Tue, 11 Jul 2017 18:49:15 +0200 Received: from mail-qk0-f195.google.com ([209.85.220.195]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dUyLN-000413-Jw for seabios@seabios.org; Tue, 11 Jul 2017 18:49:12 +0200 Received: by mail-qk0-f195.google.com with SMTP id v143so1430616qkb.3 for ; Tue, 11 Jul 2017 09:50:43 -0700 (PDT) Received: from localhost ([64.9.249.1]) by smtp.gmail.com with ESMTPSA id b13sm392539qta.25.2017.07.11.09.50.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 09:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koconnor-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=ZN5f383X40YlA6QLc5kI1DeEo+VapKV4ZoTxnpBsP+4=; b=nkLPj55nd2hwFqvy4dcA45uFZ1/PEZoBsy9dwP+Lb/PmEUMQkMjuHiHhU5djD2kxot isyT/Hsq67xkVvPnEYQwaB3l3kmslg4t3KgnqfioKdEI34diCE6aVzeEplBb/bTpeDG7 AasT/3kJcjqaOBdO1DKiPA61okGNc+6VpeYijtj3V7Kj77JpClRnjVIVEo+5eVqed1ei LHxSQf6LwEcdDt1/ZsFrMlIoV2dckwWItUAwTIgQOEsOqAhFsg7YqmVdxNUptn3Mxi4D /A0WaJFwzpaIPHX7ln2WQSm1z75Mc+yjKPHNWMo6CGcrCoGBh6GgKJxzhmSa+MDJ/WMv 1iQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ZN5f383X40YlA6QLc5kI1DeEo+VapKV4ZoTxnpBsP+4=; b=PEWt+NlPT1jHtgd2aK4+Em2hFd6cw4zuJ/u6M4jafo4C3K0OXgMDlyOMJXIXwG+4d8 CYboGmEJ6dN4ko84flyaWTcwM9QVJBLhdu0OiaFm3zFbLWaSwY2pNKZZw5ChAjYC7u7I 5OdO80qqJ5ATQC9u756j8jRxcoUsvnCZd5vEG4iEMucTzx89DHeLXGJdt5xyPto6M0fQ 96x+13Bsnx8zHsIVi1qsMQtiGPbEke2eMbjEsCI+nCYCIgyxMZh511QNXQK8GF+WvwGW dOITRLeteA86qwO32dxR7wHHLDK9XQUO8uhArdumN2XWsp/XJw0vWwoCgqs3BrZFwbPa cQ/g== X-Gm-Message-State: AIVw110LioMrB035bi0GOxXu0zvFyb19q4WSVmuOHDGbeykMCVT8CqEQ quX6dxArvK0ssJQy1HNkrg== X-Received: by 10.55.217.157 with SMTP id q29mr1084380qkl.152.1499791835903; Tue, 11 Jul 2017 09:50:35 -0700 (PDT) From: Kevin O'Connor To: seabios@seabios.org Date: Tue, 11 Jul 2017 12:50:29 -0400 Message-Id: <20170711165032.2443-2-kevin@koconnor.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170711165032.2443-1-kevin@koconnor.net> References: <20170711165032.2443-1-kevin@koconnor.net> X-Spam-Score: -2.1 (--) Subject: [SeaBIOS] [PATCH 1/4] boot: Rename drive_g to drive X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'struct drive_s' pointer is a 32bit pointer (and boot.c code is only compiled in 32bit mode), so avoid using the "_g" suffix on the pointer. Signed-off-by: Kevin O'Connor Tested-by: Paolo Bonzini --- src/boot.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/boot.c b/src/boot.c index 59623fb..83d48f2 100644 --- a/src/boot.c +++ b/src/boot.c @@ -372,24 +372,24 @@ boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio) } =20 void -boot_add_floppy(struct drive_s *drive_g, const char *desc, int prio) +boot_add_floppy(struct drive_s *drive, const char *desc, int prio) { bootentry_add(IPL_TYPE_FLOPPY, defPrio(prio, DefaultFloppyPrio) - , (u32)drive_g, desc); + , (u32)drive, desc); } =20 void -boot_add_hd(struct drive_s *drive_g, const char *desc, int prio) +boot_add_hd(struct drive_s *drive, const char *desc, int prio) { bootentry_add(IPL_TYPE_HARDDISK, defPrio(prio, DefaultHDPrio) - , (u32)drive_g, desc); + , (u32)drive, desc); } =20 void -boot_add_cd(struct drive_s *drive_g, const char *desc, int prio) +boot_add_cd(struct drive_s *drive, const char *desc, int prio) { bootentry_add(IPL_TYPE_CDROM, defPrio(prio, DefaultCDPrio) - , (u32)drive_g, desc); + , (u32)drive, desc); } =20 // Add a CBFS payload entry @@ -648,13 +648,13 @@ boot_disk(u8 bootdrv, int checksig) =20 // Boot from a CD-ROM static void -boot_cdrom(struct drive_s *drive_g) +boot_cdrom(struct drive_s *drive) { if (! CONFIG_CDROM_BOOT) return; printf("Booting from DVD/CD...\n"); =20 - int status =3D cdrom_boot(drive_g); + int status =3D cdrom_boot(drive); if (status) { printf("Boot failed: Could not read from CDROM (code %04x)\n", sta= tus); return; --=20 2.9.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sat Apr 20 13:53:40 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1499791869780514.8708593990924; Tue, 11 Jul 2017 09:51:09 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dUyLV-00043u-Pz; Tue, 11 Jul 2017 18:49:09 +0200 Received: from mail-qk0-f195.google.com ([209.85.220.195]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dUyLJ-000419-J1 for seabios@seabios.org; Tue, 11 Jul 2017 18:49:07 +0200 Received: by mail-qk0-f195.google.com with SMTP id p21so1484767qke.0 for ; Tue, 11 Jul 2017 09:50:39 -0700 (PDT) Received: from localhost ([64.9.249.1]) by smtp.gmail.com with ESMTPSA id w46sm369352qtw.28.2017.07.11.09.50.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 09:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koconnor-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=6m4PSUsEtGbcAKuSfBF4/IQHE49aI1PrqJqwb1dAfis=; b=K+JkQ0VaQyQg4YGKXKVg9rW/6cbO6f/rta9UZM8STDoPluAjF8PHXmMYZ0tM9UwvQT Go97qVU1TMmlllTgTx7KYaCFQxivThpEnIoe1E6UHiXn65QQgeJYcWqCEPMuNrpgpL3d WHLH9yx8LH68IZ8lYlBvxMUgEuzeSx5gpFHHMeVZdvhQjmOXO5GS0I0Eegm8WpFzhawh 3od+fdeYZCkK6dixc+Q6tYTCkzyWgvRuklKraP4QfomxYeinrQmXRthApZAZgkgI9RCX GhjHYccD6t+wBL8EdgBeFqXQMwsPn5FNIrhClMrjfdPnxtKNPPJ7k9HJBBPd7ieJVuST UOjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=6m4PSUsEtGbcAKuSfBF4/IQHE49aI1PrqJqwb1dAfis=; b=hJxlkuT/LRAzGeKMpTu2sj9aMZ5834e8ep98tIf/Ppj6o3jPALH9RO1u1n5gQap6c9 ZHjFexkIh7JMf21NIAjhp2zBEJuuvYlxUP/v5Ufisvw7hsJ5Dym0Uw7Y7ODFX7OU+S2m tXngFEwDUVuhNt2sFV1ku4HpOXyFm8uF3xao2b1QFqhm+5PJf1CqdNzeKb80dPjoR+hl qY1BnMDTeDqL+ODdqgd+Ka1rC6QSVkHzsVhGzy9j9myTb9c+KK0wY/BYBq3eygOMuGMe ENOkeDf+8fwGApKswtUqn6iWR2wc0/etB/pqCKpUhVz7SntPvY7g4RWBL47oEAvCnAfe gK5A== X-Gm-Message-State: AIVw113nvnRs9434USJTM1tS3JHDgEzvgomxSmnjKjMTvixjcueNTT8U 0D/jWA4FLdf5JYEzNnfK/g== X-Received: by 10.55.152.66 with SMTP id a63mr1012443qke.31.1499791836928; Tue, 11 Jul 2017 09:50:36 -0700 (PDT) From: Kevin O'Connor To: seabios@seabios.org Date: Tue, 11 Jul 2017 12:50:30 -0400 Message-Id: <20170711165032.2443-3-kevin@koconnor.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170711165032.2443-1-kevin@koconnor.net> References: <20170711165032.2443-1-kevin@koconnor.net> X-Spam-Score: 0.3 (/) Subject: [SeaBIOS] [PATCH 2/4] disk: Don't require the 'struct drive_s' to be in the f-segment X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow the 'struct drive_s' drive description structure to be in either the "low" memory segment or the f-segment. Signed-off-by: Kevin O'Connor Tested-by: Paolo Bonzini --- src/block.c | 22 +++++++++++----------- src/disk.c | 10 +++++----- src/hw/blockcmd.c | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/block.c b/src/block.c index d104f6d..8c5fb2d 100644 --- a/src/block.c +++ b/src/block.c @@ -312,12 +312,12 @@ fill_generic_edd(struct segoff_s edd, struct drive_s = *drive_gf =20 // EDD 1.x =20 - u8 type =3D GET_GLOBALFLAT(drive_gf->type); - u16 npc =3D GET_GLOBALFLAT(drive_gf->pchs.cylinder); - u16 nph =3D GET_GLOBALFLAT(drive_gf->pchs.head); - u16 nps =3D GET_GLOBALFLAT(drive_gf->pchs.sector); - u64 lba =3D GET_GLOBALFLAT(drive_gf->sectors); - u16 blksize =3D GET_GLOBALFLAT(drive_gf->blksize); + u8 type =3D GET_FLATPTR(drive_gf->type); + u16 npc =3D GET_FLATPTR(drive_gf->pchs.cylinder); + u16 nph =3D GET_FLATPTR(drive_gf->pchs.head); + u16 nps =3D GET_FLATPTR(drive_gf->pchs.sector); + u64 lba =3D GET_FLATPTR(drive_gf->sectors); + u16 blksize =3D GET_FLATPTR(drive_gf->blksize); =20 dprintf(DEBUG_HDL_13, "disk_1348 size=3D%d t=3D%d chs=3D%d,%d,%d lba= =3D%d bs=3D%d\n" , size, type, npc, nph, nps, (u32)lba, blksize); @@ -469,7 +469,7 @@ fill_ata_edd(struct segoff_s edd, struct drive_s *drive= _gf) int noinline fill_edd(struct segoff_s edd, struct drive_s *drive_gf) { - switch (GET_GLOBALFLAT(drive_gf->type)) { + switch (GET_FLATPTR(drive_gf->type)) { case DTYPE_ATA: case DTYPE_ATA_ATAPI: return fill_ata_edd(edd, drive_gf); @@ -477,7 +477,7 @@ fill_edd(struct segoff_s edd, struct drive_s *drive_gf) case DTYPE_VIRTIO_SCSI: return fill_generic_edd( edd, drive_gf, 0xffffffff, EDD_PCI | EDD_SCSI - , edd_pci_path(GET_GLOBALFLAT(drive_gf->cntl_id), 0), 0); + , edd_pci_path(GET_FLATPTR(drive_gf->cntl_id), 0), 0); default: return fill_generic_edd(edd, drive_gf, 0, 0, 0, 0); } @@ -527,7 +527,7 @@ default_process_op(struct disk_op_s *op) static int process_op_both(struct disk_op_s *op) { - switch (GET_GLOBALFLAT(op->drive_gf->type)) { + switch (GET_FLATPTR(op->drive_gf->type)) { case DTYPE_ATA_ATAPI: return ata_atapi_process_op(op); case DTYPE_USB: @@ -585,7 +585,7 @@ static int process_op_16(struct disk_op_s *op) { ASSERT16(); - switch (GET_GLOBALFLAT(op->drive_gf->type)) { + switch (GET_FLATPTR(op->drive_gf->type)) { case DTYPE_FLOPPY: return floppy_process_op(op); case DTYPE_ATA: @@ -608,7 +608,7 @@ process_op(struct disk_op_s *op) , op->count, op->command); =20 int ret, origcount =3D op->count; - if (origcount * GET_GLOBALFLAT(op->drive_gf->blksize) > 64*1024) { + if (origcount * GET_FLATPTR(op->drive_gf->blksize) > 64*1024) { op->count =3D 0; return DISK_RET_EBOUNDARY; } diff --git a/src/disk.c b/src/disk.c index 6e58428..5a4fe9d 100644 --- a/src/disk.c +++ b/src/disk.c @@ -81,9 +81,9 @@ getLCHS(struct drive_s *drive_gf) res.sector =3D sptcyl & 0x3f; return res; } - res.cylinder =3D GET_GLOBALFLAT(drive_gf->lchs.cylinder); - res.head =3D GET_GLOBALFLAT(drive_gf->lchs.head); - res.sector =3D GET_GLOBALFLAT(drive_gf->lchs.sector); + res.cylinder =3D GET_FLATPTR(drive_gf->lchs.cylinder); + res.head =3D GET_FLATPTR(drive_gf->lchs.head); + res.sector =3D GET_FLATPTR(drive_gf->lchs.sector); return res; } =20 @@ -168,7 +168,7 @@ extended_access(struct bregs *regs, struct drive_s *dri= ve_gf, u16 command) dop.lba =3D GET_FARVAR(regs->ds, param_far->lba); dop.command =3D command; dop.drive_gf =3D drive_gf; - if (dop.lba >=3D GET_GLOBALFLAT(drive_gf->sectors)) { + if (dop.lba >=3D GET_FLATPTR(drive_gf->sectors)) { warn_invalid(regs); disk_ret(regs, DISK_RET_EPARAM); return; @@ -287,7 +287,7 @@ disk_1308(struct bregs *regs, struct drive_s *drive_gf) if (CONFIG_CDROM_EMU && drive_gf =3D=3D GET_GLOBAL(cdemu_drive_gf)) regs->bx =3D GET_LOW(CDEmu.media) * 2; else - regs->bx =3D GET_GLOBALFLAT(drive_gf->floppy_type); + regs->bx =3D GET_FLATPTR(drive_gf->floppy_type); =20 // set es & di to point to 11 byte diskette param table in ROM regs->es =3D SEG_BIOS; diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c index 98c06ce..f260dd8 100644 --- a/src/hw/blockcmd.c +++ b/src/hw/blockcmd.c @@ -5,10 +5,10 @@ // // This file may be distributed under the terms of the GNU LGPLv3 license. =20 -#include "biosvar.h" // GET_GLOBALFLAT #include "block.h" // struct disk_op_s #include "blockcmd.h" // struct cdb_request_sense #include "byteorder.h" // be32_to_cpu +#include "farptr.h" // GET_FLATPTR #include "output.h" // dprintf #include "std/disk.h" // DISK_RET_EPARAM #include "string.h" // memset @@ -117,7 +117,7 @@ scsi_fill_cmd(struct disk_op_s *op, void *cdbcmd, int m= axcdb) : CDB_CMD_WRITE_10); cmd->lba =3D cpu_to_be32(op->lba); cmd->count =3D cpu_to_be16(op->count); - return GET_GLOBALFLAT(op->drive_gf->blksize); + return GET_FLATPTR(op->drive_gf->blksize); case CMD_SCSI: if (MODESEGMENT) return -1; --=20 2.9.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sat Apr 20 13:53:40 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1499791885252792.656580536771; Tue, 11 Jul 2017 09:51:25 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dUyLc-00045f-UL; Tue, 11 Jul 2017 18:49:17 +0200 Received: from mail-qk0-f195.google.com ([209.85.220.195]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dUyLL-00041U-AK for seabios@seabios.org; Tue, 11 Jul 2017 18:49:13 +0200 Received: by mail-qk0-f195.google.com with SMTP id v143so1430964qkb.3 for ; Tue, 11 Jul 2017 09:50:40 -0700 (PDT) Received: from localhost ([64.9.249.1]) by smtp.gmail.com with ESMTPSA id n3sm324326qkd.21.2017.07.11.09.50.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 09:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koconnor-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=slGJ8TVFNyth6XazE9dY7slhE9xW8kgxE9olT/lvt/g=; b=cVYVaF+I8JgCGdGbOsJ+UprTircjlSDPoSk5G6EYcVuHRZ0VPUOQ+wcPonGecMotG5 cl9sX/Yh0bmXjrfNLTfuDoCYSyhaonlzTXo/GaLbYlaReNiMcCKjcvCdsKIouo1RF88y Oto9R113RNIW5Fc+3EwIbpV6pG1l//mz7jES0ioAgCOMi9w894r/PWyBeJLdeuQCCO3a CrvbJnqL/mX/qp6aSRgMJ1yhUxqAWVKX5TeVcIieNttB1tKsq8rFlSVCE49tTWAXg8Hl KHZqWHAdAGcnIs1xmpMSs5uT3dY1elpFxAQxISOv5Gtffqfg720grXTu6FsxFOd/OYk0 y9gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=slGJ8TVFNyth6XazE9dY7slhE9xW8kgxE9olT/lvt/g=; b=QbLGHfq9MHIQOq8JCiK2ZyvWH2ULcz+ES4YhtU9+QQEA2uFkTvNiaP2vFUJAol24vO 365LFXKP2A/rbYxP3IYn5ECjgri48+VSVQAcAI7HpxEZBtYz9PWEqH6LJs1pcCh9F71M RnDezFWUokr/kmHeHP2VwL3jKqutfxjPKfTmo/fCJgpt++onwMwZskwbZaPAMtyY0BqR V7i8vC9bzQnn48cmf235Also6sl/6gh4Yc/WGda5MHvxC5tj784hYlw9Vvqxd6gHaPon gyK6tomm2h7FRjuBOJuB/ZJxA0xZZE51/QBvfC+vKkS5IXHr7R9iOVCYkFoNq2Q9r88U RWew== X-Gm-Message-State: AIVw112Tb/rEktagsaPks1C7DelQd6tNL8/FFt23QN5SWhWMkBwXcQN/ d9NTACUrf0IzrVEMDRoMsQ== X-Received: by 10.55.50.208 with SMTP id y199mr1084405qky.174.1499791838134; Tue, 11 Jul 2017 09:50:38 -0700 (PDT) From: Kevin O'Connor To: seabios@seabios.org Date: Tue, 11 Jul 2017 12:50:31 -0400 Message-Id: <20170711165032.2443-4-kevin@koconnor.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170711165032.2443-1-kevin@koconnor.net> References: <20170711165032.2443-1-kevin@koconnor.net> X-Spam-Score: -6.0 (------) Subject: [SeaBIOS] [PATCH 3/4] block: Rename disk_op_s->drive_gf to drive_fl X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that the drive_s struct does not need to be in the f-segment, rename references to drive_gf in the generic drive code to drive_fl. This is just variable renames - no code changes. Signed-off-by: Kevin O'Connor Tested-by: Paolo Bonzini --- src/block.c | 36 ++++----- src/block.h | 2 +- src/cdrom.c | 6 +- src/disk.c | 218 +++++++++++++++++++++++++----------------------= ---- src/hw/ahci.c | 4 +- src/hw/ata.c | 26 +++--- src/hw/blockcmd.c | 8 +- src/hw/esp-scsi.c | 2 +- src/hw/floppy.c | 20 ++--- src/hw/lsi-scsi.c | 2 +- src/hw/megasas.c | 2 +- src/hw/mpt-scsi.c | 2 +- src/hw/nvme.c | 2 +- src/hw/pvscsi.c | 2 +- src/hw/ramdisk.c | 2 +- src/hw/sdcard.c | 2 +- src/hw/usb-msc.c | 4 +- src/hw/usb-uas.c | 2 +- src/hw/virtio-blk.c | 2 +- src/hw/virtio-scsi.c | 2 +- 20 files changed, 173 insertions(+), 173 deletions(-) diff --git a/src/block.c b/src/block.c index 8c5fb2d..f73ec18 100644 --- a/src/block.c +++ b/src/block.c @@ -298,7 +298,7 @@ map_floppy_drive(struct drive_s *drive) =20 // Fill in EDD info static int -fill_generic_edd(struct segoff_s edd, struct drive_s *drive_gf +fill_generic_edd(struct segoff_s edd, struct drive_s *drive_fl , u32 dpte_so, u8 bus_iface, u32 iface_path, u32 device_p= ath) { u16 seg =3D edd.seg; @@ -312,12 +312,12 @@ fill_generic_edd(struct segoff_s edd, struct drive_s = *drive_gf =20 // EDD 1.x =20 - u8 type =3D GET_FLATPTR(drive_gf->type); - u16 npc =3D GET_FLATPTR(drive_gf->pchs.cylinder); - u16 nph =3D GET_FLATPTR(drive_gf->pchs.head); - u16 nps =3D GET_FLATPTR(drive_gf->pchs.sector); - u64 lba =3D GET_FLATPTR(drive_gf->sectors); - u16 blksize =3D GET_FLATPTR(drive_gf->blksize); + u8 type =3D GET_FLATPTR(drive_fl->type); + u16 npc =3D GET_FLATPTR(drive_fl->pchs.cylinder); + u16 nph =3D GET_FLATPTR(drive_fl->pchs.head); + u16 nps =3D GET_FLATPTR(drive_fl->pchs.sector); + u64 lba =3D GET_FLATPTR(drive_fl->sectors); + u16 blksize =3D GET_FLATPTR(drive_fl->blksize); =20 dprintf(DEBUG_HDL_13, "disk_1348 size=3D%d t=3D%d chs=3D%d,%d,%d lba= =3D%d bs=3D%d\n" , size, type, npc, nph, nps, (u32)lba, blksize); @@ -467,19 +467,19 @@ fill_ata_edd(struct segoff_s edd, struct drive_s *dri= ve_gf) =20 // Fill Extended Disk Drive (EDD) "Get drive parameters" info for a drive int noinline -fill_edd(struct segoff_s edd, struct drive_s *drive_gf) +fill_edd(struct segoff_s edd, struct drive_s *drive_fl) { - switch (GET_FLATPTR(drive_gf->type)) { + switch (GET_FLATPTR(drive_fl->type)) { case DTYPE_ATA: case DTYPE_ATA_ATAPI: - return fill_ata_edd(edd, drive_gf); + return fill_ata_edd(edd, drive_fl); case DTYPE_VIRTIO_BLK: case DTYPE_VIRTIO_SCSI: return fill_generic_edd( - edd, drive_gf, 0xffffffff, EDD_PCI | EDD_SCSI - , edd_pci_path(GET_FLATPTR(drive_gf->cntl_id), 0), 0); + edd, drive_fl, 0xffffffff, EDD_PCI | EDD_SCSI + , edd_pci_path(GET_FLATPTR(drive_fl->cntl_id), 0), 0); default: - return fill_generic_edd(edd, drive_gf, 0, 0, 0, 0); + return fill_generic_edd(edd, drive_fl, 0, 0, 0, 0); } } =20 @@ -527,7 +527,7 @@ default_process_op(struct disk_op_s *op) static int process_op_both(struct disk_op_s *op) { - switch (GET_FLATPTR(op->drive_gf->type)) { + switch (GET_FLATPTR(op->drive_fl->type)) { case DTYPE_ATA_ATAPI: return ata_atapi_process_op(op); case DTYPE_USB: @@ -556,7 +556,7 @@ int VISIBLE32FLAT process_op_32(struct disk_op_s *op) { ASSERT32FLAT(); - switch (op->drive_gf->type) { + switch (op->drive_fl->type) { case DTYPE_VIRTIO_BLK: return virtio_blk_process_op(op); case DTYPE_AHCI: @@ -585,7 +585,7 @@ static int process_op_16(struct disk_op_s *op) { ASSERT16(); - switch (GET_FLATPTR(op->drive_gf->type)) { + switch (GET_FLATPTR(op->drive_fl->type)) { case DTYPE_FLOPPY: return floppy_process_op(op); case DTYPE_ATA: @@ -604,11 +604,11 @@ int process_op(struct disk_op_s *op) { dprintf(DEBUG_HDL_13, "disk_op d=3D%p lba=3D%d buf=3D%p count=3D%d cmd= =3D%d\n" - , op->drive_gf, (u32)op->lba, op->buf_fl + , op->drive_fl, (u32)op->lba, op->buf_fl , op->count, op->command); =20 int ret, origcount =3D op->count; - if (origcount * GET_FLATPTR(op->drive_gf->blksize) > 64*1024) { + if (origcount * GET_FLATPTR(op->drive_fl->blksize) > 64*1024) { op->count =3D 0; return DISK_RET_EBOUNDARY; } diff --git a/src/block.h b/src/block.h index f03ec38..a380f16 100644 --- a/src/block.h +++ b/src/block.h @@ -10,7 +10,7 @@ =20 struct disk_op_s { void *buf_fl; - struct drive_s *drive_gf; + struct drive_s *drive_fl; u8 command; u16 count; union { diff --git a/src/cdrom.c b/src/cdrom.c index a4f31ad..828fb3b 100644 --- a/src/cdrom.c +++ b/src/cdrom.c @@ -31,7 +31,7 @@ cdemu_read(struct disk_op_s *op) { struct drive_s *drive_gf =3D GET_LOW(emulated_drive_gf); struct disk_op_s dop; - dop.drive_gf =3D drive_gf; + dop.drive_fl =3D drive_gf; dop.command =3D op->command; dop.lba =3D GET_LOW(CDEmu.ilba) + op->lba / 4; =20 @@ -136,8 +136,8 @@ cdrom_boot(struct drive_s *drive) struct disk_op_s dop; int cdid =3D getDriveId(EXTTYPE_CD, drive); memset(&dop, 0, sizeof(dop)); - dop.drive_gf =3D drive; - if (!dop.drive_gf || cdid < 0) + dop.drive_fl =3D drive; + if (!dop.drive_fl || cdid < 0) return 1; =20 int ret =3D scsi_is_ready(&dop); diff --git a/src/disk.c b/src/disk.c index 5a4fe9d..0328fbd 100644 --- a/src/disk.c +++ b/src/disk.c @@ -67,10 +67,10 @@ __disk_stub(struct bregs *regs, int lineno, const char = *fname) =20 // Get the cylinders/heads/sectors for the given drive. static struct chs_s -getLCHS(struct drive_s *drive_gf) +getLCHS(struct drive_s *drive_fl) { struct chs_s res =3D { }; - if (CONFIG_CDROM_EMU && drive_gf =3D=3D GET_GLOBAL(cdemu_drive_gf)) { + if (CONFIG_CDROM_EMU && drive_fl =3D=3D GET_GLOBAL(cdemu_drive_gf)) { // Emulated drive - get info from CDEmu. (It's not possible to // populate the geometry directly in the driveid because the // geometry is only known after the bios segment is made @@ -81,9 +81,9 @@ getLCHS(struct drive_s *drive_gf) res.sector =3D sptcyl & 0x3f; return res; } - res.cylinder =3D GET_FLATPTR(drive_gf->lchs.cylinder); - res.head =3D GET_FLATPTR(drive_gf->lchs.head); - res.sector =3D GET_FLATPTR(drive_gf->lchs.sector); + res.cylinder =3D GET_FLATPTR(drive_fl->lchs.cylinder); + res.head =3D GET_FLATPTR(drive_fl->lchs.head); + res.sector =3D GET_FLATPTR(drive_fl->lchs.sector); return res; } =20 @@ -117,10 +117,10 @@ send_disk_op(struct disk_op_s *op) =20 // Perform read/write/verify using old-style chs accesses static void noinline -basic_access(struct bregs *regs, struct drive_s *drive_gf, u16 command) +basic_access(struct bregs *regs, struct drive_s *drive_fl, u16 command) { struct disk_op_s dop; - dop.drive_gf =3D drive_gf; + dop.drive_fl =3D drive_fl; dop.command =3D command; =20 u8 count =3D regs->al; @@ -135,7 +135,7 @@ basic_access(struct bregs *regs, struct drive_s *drive_= gf, u16 command) } dop.count =3D count; =20 - struct chs_s chs =3D getLCHS(drive_gf); + struct chs_s chs =3D getLCHS(drive_fl); u16 nlc=3Dchs.cylinder, nlh=3Dchs.head, nls=3Dchs.sector; =20 // sanity check on cyl heads, sec @@ -160,15 +160,15 @@ basic_access(struct bregs *regs, struct drive_s *driv= e_gf, u16 command) =20 // Perform read/write/verify using new-style "int13ext" accesses. static void noinline -extended_access(struct bregs *regs, struct drive_s *drive_gf, u16 command) +extended_access(struct bregs *regs, struct drive_s *drive_fl, u16 command) { struct disk_op_s dop; struct int13ext_s *param_far =3D (struct int13ext_s*)(regs->si+0); // Get lba and check. dop.lba =3D GET_FARVAR(regs->ds, param_far->lba); dop.command =3D command; - dop.drive_gf =3D drive_gf; - if (dop.lba >=3D GET_FLATPTR(drive_gf->sectors)) { + dop.drive_fl =3D drive_fl; + if (dop.lba >=3D GET_FLATPTR(drive_fl->sectors)) { warn_invalid(regs); disk_ret(regs, DISK_RET_EPARAM); return; @@ -196,10 +196,10 @@ extended_access(struct bregs *regs, struct drive_s *d= rive_gf, u16 command) =20 // disk controller reset static void -disk_1300(struct bregs *regs, struct drive_s *drive_gf) +disk_1300(struct bregs *regs, struct drive_s *drive_fl) { struct disk_op_s dop; - dop.drive_gf =3D drive_gf; + dop.drive_fl =3D drive_fl; dop.command =3D CMD_RESET; dop.count =3D 0; int status =3D send_disk_op(&dop); @@ -208,7 +208,7 @@ disk_1300(struct bregs *regs, struct drive_s *drive_gf) =20 // read disk status static void -disk_1301(struct bregs *regs, struct drive_s *drive_gf) +disk_1301(struct bregs *regs, struct drive_s *drive_fl) { u8 v; if (regs->dl < EXTSTART_HD) @@ -223,32 +223,32 @@ disk_1301(struct bregs *regs, struct drive_s *drive_g= f) =20 // read disk sectors static void -disk_1302(struct bregs *regs, struct drive_s *drive_gf) +disk_1302(struct bregs *regs, struct drive_s *drive_fl) { - basic_access(regs, drive_gf, CMD_READ); + basic_access(regs, drive_fl, CMD_READ); } =20 // write disk sectors static void -disk_1303(struct bregs *regs, struct drive_s *drive_gf) +disk_1303(struct bregs *regs, struct drive_s *drive_fl) { - basic_access(regs, drive_gf, CMD_WRITE); + basic_access(regs, drive_fl, CMD_WRITE); } =20 // verify disk sectors static void -disk_1304(struct bregs *regs, struct drive_s *drive_gf) +disk_1304(struct bregs *regs, struct drive_s *drive_fl) { - basic_access(regs, drive_gf, CMD_VERIFY); + basic_access(regs, drive_fl, CMD_VERIFY); } =20 // format disk track static void noinline -disk_1305(struct bregs *regs, struct drive_s *drive_gf) +disk_1305(struct bregs *regs, struct drive_s *drive_fl) { debug_stub(regs); =20 - struct chs_s chs =3D getLCHS(drive_gf); + struct chs_s chs =3D getLCHS(drive_fl); u16 nlc=3Dchs.cylinder, nlh=3Dchs.head, nls=3Dchs.sector; =20 u8 count =3D regs->al; @@ -261,7 +261,7 @@ disk_1305(struct bregs *regs, struct drive_s *drive_gf) } =20 struct disk_op_s dop; - dop.drive_gf =3D drive_gf; + dop.drive_fl =3D drive_fl; dop.command =3D CMD_FORMAT; dop.lba =3D (((u32)cylinder * (u32)nlh) + (u32)head) * (u32)nls; dop.count =3D count; @@ -272,10 +272,10 @@ disk_1305(struct bregs *regs, struct drive_s *drive_g= f) =20 // read disk drive parameters static void noinline -disk_1308(struct bregs *regs, struct drive_s *drive_gf) +disk_1308(struct bregs *regs, struct drive_s *drive_fl) { // Get logical geometry from table - struct chs_s chs =3D getLCHS(drive_gf); + struct chs_s chs =3D getLCHS(drive_fl); u16 nlc=3Dchs.cylinder, nlh=3Dchs.head, nls=3Dchs.sector; nlc--; nlh--; @@ -284,10 +284,10 @@ disk_1308(struct bregs *regs, struct drive_s *drive_g= f) // Floppy count =3D GET_GLOBAL(FloppyCount); =20 - if (CONFIG_CDROM_EMU && drive_gf =3D=3D GET_GLOBAL(cdemu_drive_gf)) + if (CONFIG_CDROM_EMU && drive_fl =3D=3D GET_GLOBAL(cdemu_drive_gf)) regs->bx =3D GET_LOW(CDEmu.media) * 2; else - regs->bx =3D GET_FLATPTR(drive_gf->floppy_type); + regs->bx =3D GET_FLATPTR(drive_fl->floppy_type); =20 // set es & di to point to 11 byte diskette param table in ROM regs->es =3D SEG_BIOS; @@ -323,33 +323,33 @@ disk_1308(struct bregs *regs, struct drive_s *drive_g= f) =20 // initialize drive parameters static void -disk_1309(struct bregs *regs, struct drive_s *drive_gf) +disk_1309(struct bregs *regs, struct drive_s *drive_fl) { DISK_STUB(regs); } =20 // seek to specified cylinder static void -disk_130c(struct bregs *regs, struct drive_s *drive_gf) +disk_130c(struct bregs *regs, struct drive_s *drive_fl) { DISK_STUB(regs); } =20 // alternate disk reset static void -disk_130d(struct bregs *regs, struct drive_s *drive_gf) +disk_130d(struct bregs *regs, struct drive_s *drive_fl) { DISK_STUB(regs); } =20 // check drive ready static void -disk_1310(struct bregs *regs, struct drive_s *drive_gf) +disk_1310(struct bregs *regs, struct drive_s *drive_fl) { // should look at 40:8E also??? =20 struct disk_op_s dop; - dop.drive_gf =3D drive_gf; + dop.drive_fl =3D drive_fl; dop.command =3D CMD_ISREADY; dop.count =3D 0; int status =3D send_disk_op(&dop); @@ -358,21 +358,21 @@ disk_1310(struct bregs *regs, struct drive_s *drive_g= f) =20 // recalibrate static void -disk_1311(struct bregs *regs, struct drive_s *drive_gf) +disk_1311(struct bregs *regs, struct drive_s *drive_fl) { DISK_STUB(regs); } =20 // controller internal diagnostic static void -disk_1314(struct bregs *regs, struct drive_s *drive_gf) +disk_1314(struct bregs *regs, struct drive_s *drive_fl) { DISK_STUB(regs); } =20 // read disk drive size static void noinline -disk_1315(struct bregs *regs, struct drive_s *drive_gf) +disk_1315(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_SUCCESS); if (regs->dl < EXTSTART_HD || regs->dl >=3D EXTSTART_CD) { @@ -383,7 +383,7 @@ disk_1315(struct bregs *regs, struct drive_s *drive_gf) // Hard drive =20 // Get logical geometry from table - struct chs_s chs =3D getLCHS(drive_gf); + struct chs_s chs =3D getLCHS(drive_fl); u16 nlc=3Dchs.cylinder, nlh=3Dchs.head, nls=3Dchs.sector; =20 // Compute sector count seen by int13 @@ -394,7 +394,7 @@ disk_1315(struct bregs *regs, struct drive_s *drive_gf) } =20 static void -disk_1316(struct bregs *regs, struct drive_s *drive_gf) +disk_1316(struct bregs *regs, struct drive_s *drive_fl) { if (regs->dl >=3D EXTSTART_HD) { // Hard drive @@ -406,7 +406,7 @@ disk_1316(struct bregs *regs, struct drive_s *drive_gf) =20 // IBM/MS installation check static void -disk_1341(struct bregs *regs, struct drive_s *drive_gf) +disk_1341(struct bregs *regs, struct drive_s *drive_fl) { regs->bx =3D 0xaa55; // install check regs->cx =3D 0x0007; // ext disk access and edd, removable supported @@ -416,23 +416,23 @@ disk_1341(struct bregs *regs, struct drive_s *drive_g= f) =20 // IBM/MS extended read static void -disk_1342(struct bregs *regs, struct drive_s *drive_gf) +disk_1342(struct bregs *regs, struct drive_s *drive_fl) { - extended_access(regs, drive_gf, CMD_READ); + extended_access(regs, drive_fl, CMD_READ); } =20 // IBM/MS extended write static void -disk_1343(struct bregs *regs, struct drive_s *drive_gf) +disk_1343(struct bregs *regs, struct drive_s *drive_fl) { - extended_access(regs, drive_gf, CMD_WRITE); + extended_access(regs, drive_fl, CMD_WRITE); } =20 // IBM/MS verify static void -disk_1344(struct bregs *regs, struct drive_s *drive_gf) +disk_1344(struct bregs *regs, struct drive_s *drive_fl) { - extended_access(regs, drive_gf, CMD_VERIFY); + extended_access(regs, drive_fl, CMD_VERIFY); } =20 // Locks for removable devices @@ -440,7 +440,7 @@ u8 CDRom_locks[BUILD_MAX_EXTDRIVE] VARLOW; =20 // lock static void -disk_134500(struct bregs *regs, struct drive_s *drive_gf) +disk_134500(struct bregs *regs, struct drive_s *drive_fl) { int cdid =3D regs->dl - EXTSTART_CD; u8 locks =3D GET_LOW(CDRom_locks[cdid]); @@ -456,7 +456,7 @@ disk_134500(struct bregs *regs, struct drive_s *drive_g= f) =20 // unlock static void -disk_134501(struct bregs *regs, struct drive_s *drive_gf) +disk_134501(struct bregs *regs, struct drive_s *drive_fl) { int cdid =3D regs->dl - EXTSTART_CD; u8 locks =3D GET_LOW(CDRom_locks[cdid]); @@ -473,7 +473,7 @@ disk_134501(struct bregs *regs, struct drive_s *drive_g= f) =20 // status static void -disk_134502(struct bregs *regs, struct drive_s *drive_gf) +disk_134502(struct bregs *regs, struct drive_s *drive_fl) { int cdid =3D regs->dl - EXTSTART_CD; u8 locks =3D GET_LOW(CDRom_locks[cdid]); @@ -482,14 +482,14 @@ disk_134502(struct bregs *regs, struct drive_s *drive= _gf) } =20 static void -disk_1345XX(struct bregs *regs, struct drive_s *drive_gf) +disk_1345XX(struct bregs *regs, struct drive_s *drive_fl) { disk_ret_unimplemented(regs, DISK_RET_EPARAM); } =20 // IBM/MS lock/unlock drive static void -disk_1345(struct bregs *regs, struct drive_s *drive_gf) +disk_1345(struct bregs *regs, struct drive_s *drive_fl) { if (regs->dl < EXTSTART_CD) { // Always success for HD @@ -498,16 +498,16 @@ disk_1345(struct bregs *regs, struct drive_s *drive_g= f) } =20 switch (regs->al) { - case 0x00: disk_134500(regs, drive_gf); break; - case 0x01: disk_134501(regs, drive_gf); break; - case 0x02: disk_134502(regs, drive_gf); break; - default: disk_1345XX(regs, drive_gf); break; + case 0x00: disk_134500(regs, drive_fl); break; + case 0x01: disk_134501(regs, drive_fl); break; + case 0x02: disk_134502(regs, drive_fl); break; + default: disk_1345XX(regs, drive_fl); break; } } =20 // IBM/MS eject media static void noinline -disk_1346(struct bregs *regs, struct drive_s *drive_gf) +disk_1346(struct bregs *regs, struct drive_s *drive_fl) { if (regs->dl < EXTSTART_CD) { // Volume Not Removable @@ -541,22 +541,22 @@ disk_1346(struct bregs *regs, struct drive_s *drive_g= f) =20 // IBM/MS extended seek static void -disk_1347(struct bregs *regs, struct drive_s *drive_gf) +disk_1347(struct bregs *regs, struct drive_s *drive_fl) { - extended_access(regs, drive_gf, CMD_SEEK); + extended_access(regs, drive_fl, CMD_SEEK); } =20 // IBM/MS get drive parameters static void -disk_1348(struct bregs *regs, struct drive_s *drive_gf) +disk_1348(struct bregs *regs, struct drive_s *drive_fl) { - int ret =3D fill_edd(SEGOFF(regs->ds, regs->si), drive_gf); + int ret =3D fill_edd(SEGOFF(regs->ds, regs->si), drive_fl); disk_ret(regs, ret); } =20 // IBM/MS extended media change static void -disk_1349(struct bregs *regs, struct drive_s *drive_gf) +disk_1349(struct bregs *regs, struct drive_s *drive_fl) { if (regs->dl < EXTSTART_CD) { // Always success for HD @@ -569,56 +569,56 @@ disk_1349(struct bregs *regs, struct drive_s *drive_g= f) } =20 static void -disk_134e01(struct bregs *regs, struct drive_s *drive_gf) +disk_134e01(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_SUCCESS); } =20 static void -disk_134e03(struct bregs *regs, struct drive_s *drive_gf) +disk_134e03(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_SUCCESS); } =20 static void -disk_134e04(struct bregs *regs, struct drive_s *drive_gf) +disk_134e04(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_SUCCESS); } =20 static void -disk_134e06(struct bregs *regs, struct drive_s *drive_gf) +disk_134e06(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_SUCCESS); } =20 static void -disk_134eXX(struct bregs *regs, struct drive_s *drive_gf) +disk_134eXX(struct bregs *regs, struct drive_s *drive_fl) { disk_ret(regs, DISK_RET_EPARAM); } =20 // IBM/MS set hardware configuration static void -disk_134e(struct bregs *regs, struct drive_s *drive_gf) +disk_134e(struct bregs *regs, struct drive_s *drive_fl) { switch (regs->al) { - case 0x01: disk_134e01(regs, drive_gf); break; - case 0x03: disk_134e03(regs, drive_gf); break; - case 0x04: disk_134e04(regs, drive_gf); break; - case 0x06: disk_134e06(regs, drive_gf); break; - default: disk_134eXX(regs, drive_gf); break; + case 0x01: disk_134e01(regs, drive_fl); break; + case 0x03: disk_134e03(regs, drive_fl); break; + case 0x04: disk_134e04(regs, drive_fl); break; + case 0x06: disk_134e06(regs, drive_fl); break; + default: disk_134eXX(regs, drive_fl); break; } } =20 static void -disk_13XX(struct bregs *regs, struct drive_s *drive_gf) +disk_13XX(struct bregs *regs, struct drive_s *drive_fl) { disk_ret_unimplemented(regs, DISK_RET_EPARAM); } =20 static void -disk_13(struct bregs *regs, struct drive_s *drive_gf) +disk_13(struct bregs *regs, struct drive_s *drive_fl) { //debug_stub(regs); =20 @@ -626,37 +626,37 @@ disk_13(struct bregs *regs, struct drive_s *drive_gf) SET_BDA(disk_interrupt_flag, 0); =20 switch (regs->ah) { - case 0x00: disk_1300(regs, drive_gf); break; - case 0x01: disk_1301(regs, drive_gf); break; - case 0x02: disk_1302(regs, drive_gf); break; - case 0x03: disk_1303(regs, drive_gf); break; - case 0x04: disk_1304(regs, drive_gf); break; - case 0x05: disk_1305(regs, drive_gf); break; - case 0x08: disk_1308(regs, drive_gf); break; - case 0x09: disk_1309(regs, drive_gf); break; - case 0x0c: disk_130c(regs, drive_gf); break; - case 0x0d: disk_130d(regs, drive_gf); break; - case 0x10: disk_1310(regs, drive_gf); break; - case 0x11: disk_1311(regs, drive_gf); break; - case 0x14: disk_1314(regs, drive_gf); break; - case 0x15: disk_1315(regs, drive_gf); break; - case 0x16: disk_1316(regs, drive_gf); break; - case 0x41: disk_1341(regs, drive_gf); break; - case 0x42: disk_1342(regs, drive_gf); break; - case 0x43: disk_1343(regs, drive_gf); break; - case 0x44: disk_1344(regs, drive_gf); break; - case 0x45: disk_1345(regs, drive_gf); break; - case 0x46: disk_1346(regs, drive_gf); break; - case 0x47: disk_1347(regs, drive_gf); break; - case 0x48: disk_1348(regs, drive_gf); break; - case 0x49: disk_1349(regs, drive_gf); break; - case 0x4e: disk_134e(regs, drive_gf); break; - default: disk_13XX(regs, drive_gf); break; + case 0x00: disk_1300(regs, drive_fl); break; + case 0x01: disk_1301(regs, drive_fl); break; + case 0x02: disk_1302(regs, drive_fl); break; + case 0x03: disk_1303(regs, drive_fl); break; + case 0x04: disk_1304(regs, drive_fl); break; + case 0x05: disk_1305(regs, drive_fl); break; + case 0x08: disk_1308(regs, drive_fl); break; + case 0x09: disk_1309(regs, drive_fl); break; + case 0x0c: disk_130c(regs, drive_fl); break; + case 0x0d: disk_130d(regs, drive_fl); break; + case 0x10: disk_1310(regs, drive_fl); break; + case 0x11: disk_1311(regs, drive_fl); break; + case 0x14: disk_1314(regs, drive_fl); break; + case 0x15: disk_1315(regs, drive_fl); break; + case 0x16: disk_1316(regs, drive_fl); break; + case 0x41: disk_1341(regs, drive_fl); break; + case 0x42: disk_1342(regs, drive_fl); break; + case 0x43: disk_1343(regs, drive_fl); break; + case 0x44: disk_1344(regs, drive_fl); break; + case 0x45: disk_1345(regs, drive_fl); break; + case 0x46: disk_1346(regs, drive_fl); break; + case 0x47: disk_1347(regs, drive_fl); break; + case 0x48: disk_1348(regs, drive_fl); break; + case 0x49: disk_1349(regs, drive_fl); break; + case 0x4e: disk_134e(regs, drive_fl); break; + default: disk_13XX(regs, drive_fl); break; } } =20 static void -floppy_13(struct bregs *regs, struct drive_s *drive_gf) +floppy_13(struct bregs *regs, struct drive_s *drive_fl) { // Only limited commands are supported on floppies. switch (regs->ah) { @@ -669,9 +669,9 @@ floppy_13(struct bregs *regs, struct drive_s *drive_gf) case 0x08: case 0x15: case 0x16: - disk_13(regs, drive_gf); + disk_13(regs, drive_fl); break; - default: disk_13XX(regs, drive_gf); break; + default: disk_13XX(regs, drive_fl); break; } } =20 @@ -707,21 +707,21 @@ handle_legacy_disk(struct bregs *regs, u8 extdrive) } =20 if (extdrive < EXTSTART_HD) { - struct drive_s *drive_gf =3D getDrive(EXTTYPE_FLOPPY, extdrive); - if (!drive_gf) + struct drive_s *drive_fl =3D getDrive(EXTTYPE_FLOPPY, extdrive); + if (!drive_fl) goto fail; - floppy_13(regs, drive_gf); + floppy_13(regs, drive_fl); return; } =20 - struct drive_s *drive_gf; + struct drive_s *drive_fl; if (extdrive >=3D EXTSTART_CD) - drive_gf =3D getDrive(EXTTYPE_CD, extdrive - EXTSTART_CD); + drive_fl =3D getDrive(EXTTYPE_CD, extdrive - EXTSTART_CD); else - drive_gf =3D getDrive(EXTTYPE_HD, extdrive - EXTSTART_HD); - if (!drive_gf) + drive_fl =3D getDrive(EXTTYPE_HD, extdrive - EXTSTART_HD); + if (!drive_fl) goto fail; - disk_13(regs, drive_gf); + disk_13(regs, drive_fl); return; =20 fail: diff --git a/src/hw/ahci.c b/src/hw/ahci.c index b9043b9..1746e7a 100644 --- a/src/hw/ahci.c +++ b/src/hw/ahci.c @@ -217,7 +217,7 @@ int ahci_atapi_process_op(struct disk_op_s *op) return 0; =20 struct ahci_port_s *port_gf =3D container_of( - op->drive_gf, struct ahci_port_s, drive); + op->drive_fl, struct ahci_port_s, drive); struct ahci_cmd_s *cmd =3D port_gf->cmd; =20 if (op->command =3D=3D CMD_WRITE || op->command =3D=3D CMD_FORMAT) @@ -237,7 +237,7 @@ static int ahci_disk_readwrite_aligned(struct disk_op_s *op, int iswrite) { struct ahci_port_s *port_gf =3D container_of( - op->drive_gf, struct ahci_port_s, drive); + op->drive_fl, struct ahci_port_s, drive); struct ahci_cmd_s *cmd =3D port_gf->cmd; int rc; =20 diff --git a/src/hw/ata.c b/src/hw/ata.c index 9a4b435..b6e073c 100644 --- a/src/hw/ata.c +++ b/src/hw/ata.c @@ -271,15 +271,15 @@ fail: ****************************************************************/ =20 // Transfer 'op->count' blocks (of 'blocksize' bytes) to/from drive -// 'op->drive_gf'. +// 'op->drive_fl'. static int ata_pio_transfer(struct disk_op_s *op, int iswrite, int blocksize) { dprintf(16, "ata_pio_transfer id=3D%p write=3D%d count=3D%d bs=3D%d bu= f=3D%p\n" - , op->drive_gf, iswrite, op->count, blocksize, op->buf_fl); + , op->drive_fl, iswrite, op->count, blocksize, op->buf_fl); =20 struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); struct ata_channel_s *chan_gf =3D GET_GLOBALFLAT(adrive_gf->chan_gf); u16 iobase1 =3D GET_GLOBALFLAT(chan_gf->iobase1); u16 iobase2 =3D GET_GLOBALFLAT(chan_gf->iobase2); @@ -289,14 +289,14 @@ ata_pio_transfer(struct disk_op_s *op, int iswrite, i= nt blocksize) for (;;) { if (iswrite) { // Write data to controller - dprintf(16, "Write sector id=3D%p dest=3D%p\n", op->drive_gf, = buf_fl); + dprintf(16, "Write sector id=3D%p dest=3D%p\n", op->drive_fl, = buf_fl); if (CONFIG_ATA_PIO32) outsl_fl(iobase1, buf_fl, blocksize / 4); else outsw_fl(iobase1, buf_fl, blocksize / 2); } else { // Read data from controller - dprintf(16, "Read sector id=3D%p dest=3D%p\n", op->drive_gf, b= uf_fl); + dprintf(16, "Read sector id=3D%p dest=3D%p\n", op->drive_fl, b= uf_fl); if (CONFIG_ATA_PIO32) insl_fl(iobase1, buf_fl, blocksize / 4); else @@ -366,7 +366,7 @@ ata_try_dma(struct disk_op_s *op, int iswrite, int bloc= ksize) // Need minimum alignment of 1. return -1; struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); struct ata_channel_s *chan_gf =3D GET_GLOBALFLAT(adrive_gf->chan_gf); u16 iomaster =3D GET_GLOBALFLAT(chan_gf->iomaster); if (! iomaster) @@ -413,10 +413,10 @@ ata_dma_transfer(struct disk_op_s *op) { if (! CONFIG_ATA_DMA) return -1; - dprintf(16, "ata_dma_transfer id=3D%p buf=3D%p\n", op->drive_gf, op->b= uf_fl); + dprintf(16, "ata_dma_transfer id=3D%p buf=3D%p\n", op->drive_fl, op->b= uf_fl); =20 struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); struct ata_channel_s *chan_gf =3D GET_GLOBALFLAT(adrive_gf->chan_gf); u16 iomaster =3D GET_GLOBALFLAT(chan_gf->iomaster); =20 @@ -466,7 +466,7 @@ static int ata_pio_cmd_data(struct disk_op_s *op, int iswrite, struct ata_pio_command= *cmd) { struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); struct ata_channel_s *chan_gf =3D GET_GLOBALFLAT(adrive_gf->chan_gf); u16 iobase1 =3D GET_GLOBALFLAT(chan_gf->iobase1); u16 iobase2 =3D GET_GLOBALFLAT(chan_gf->iobase2); @@ -495,7 +495,7 @@ ata_dma_cmd_data(struct disk_op_s *op, struct ata_pio_c= ommand *cmd) if (! CONFIG_ATA_DMA) return -1; struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); int ret =3D send_cmd(adrive_gf, cmd); if (ret) return ret; @@ -559,7 +559,7 @@ ata_process_op(struct disk_op_s *op) return 0; =20 struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); switch (op->command) { case CMD_READ: return ata_readwrite(op, 0); @@ -597,7 +597,7 @@ ata_atapi_process_op(struct disk_op_s *op) return default_process_op(op); =20 struct atadrive_s *adrive_gf =3D container_of( - op->drive_gf, struct atadrive_s, drive); + op->drive_fl, struct atadrive_s, drive); struct ata_channel_s *chan_gf =3D GET_GLOBALFLAT(adrive_gf->chan_gf); u16 iobase1 =3D GET_GLOBALFLAT(chan_gf->iobase1); u16 iobase2 =3D GET_GLOBALFLAT(chan_gf->iobase2); @@ -667,7 +667,7 @@ send_ata_identity(struct atadrive_s *adrive, u16 *buffe= r, int command) =20 struct disk_op_s dop; memset(&dop, 0, sizeof(dop)); - dop.drive_gf =3D &adrive->drive; + dop.drive_fl =3D &adrive->drive; dop.count =3D 1; dop.lba =3D 1; dop.buf_fl =3D MAKE_FLATPTR(GET_SEG(SS), buffer); diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c index f260dd8..1f15081 100644 --- a/src/hw/blockcmd.c +++ b/src/hw/blockcmd.c @@ -117,7 +117,7 @@ scsi_fill_cmd(struct disk_op_s *op, void *cdbcmd, int m= axcdb) : CDB_CMD_WRITE_10); cmd->lba =3D cpu_to_be32(op->lba); cmd->count =3D cpu_to_be16(op->count); - return GET_FLATPTR(op->drive_gf->blksize); + return GET_FLATPTR(op->drive_fl->blksize); case CMD_SCSI: if (MODESEGMENT) return -1; @@ -141,7 +141,7 @@ int scsi_is_ready(struct disk_op_s *op) { ASSERT32FLAT(); - dprintf(6, "scsi_is_ready (drive=3D%p)\n", op->drive_gf); + dprintf(6, "scsi_is_ready (drive=3D%p)\n", op->drive_fl); =20 /* Retry TEST UNIT READY for 5 seconds unless MEDIUM NOT PRESENT is * reported by the device. If the device reports "IN PROGRESS", @@ -223,7 +223,7 @@ int scsi_rep_luns_scan(struct drive_s *tmp_drive, scsi_= add_lun add_lun) .command =3D CDB_CMD_REPORT_LUNS, }; struct disk_op_s op =3D { - .drive_gf =3D tmp_drive, + .drive_fl =3D tmp_drive, .command =3D CMD_SCSI, .count =3D 1, .cdbcmd =3D &cdb, @@ -284,7 +284,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, = int prio) ASSERT32FLAT(); struct disk_op_s dop; memset(&dop, 0, sizeof(dop)); - dop.drive_gf =3D drive; + dop.drive_fl =3D drive; struct cdbres_inquiry data; int ret =3D cdb_get_inquiry(&dop, &data); if (ret) diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c index 57d3832..ffd86d0 100644 --- a/src/hw/esp-scsi.c +++ b/src/hw/esp-scsi.c @@ -83,7 +83,7 @@ esp_scsi_process_op(struct disk_op_s *op) if (!CONFIG_ESP_SCSI) return DISK_RET_EBADTRACK; struct esp_lun_s *llun_gf =3D - container_of(op->drive_gf, struct esp_lun_s, drive); + container_of(op->drive_fl, struct esp_lun_s, drive); u16 target =3D GET_GLOBALFLAT(llun_gf->target); u16 lun =3D GET_GLOBALFLAT(llun_gf->lun); u8 cdbcmd[16]; diff --git a/src/hw/floppy.c b/src/hw/floppy.c index 98ed9bb..f2577c5 100644 --- a/src/hw/floppy.c +++ b/src/hw/floppy.c @@ -473,7 +473,7 @@ floppy_dma_cmd(struct disk_op_s *op, int count, int com= mand, u8 *param) return DISK_RET_EBOUNDARY; =20 // Invoke floppy controller - u8 floppyid =3D GET_GLOBALFLAT(op->drive_gf->cntl_id); + u8 floppyid =3D GET_GLOBALFLAT(op->drive_fl->cntl_id); ret =3D floppy_drive_pio(floppyid, command, param); if (ret) return ret; @@ -506,11 +506,11 @@ lba2chs(struct disk_op_s *op) struct chs_s res =3D { }; =20 u32 tmp =3D op->lba; - u16 nls =3D GET_GLOBALFLAT(op->drive_gf->lchs.sector); + u16 nls =3D GET_GLOBALFLAT(op->drive_fl->lchs.sector); res.sector =3D (tmp % nls) + 1; =20 tmp /=3D nls; - u16 nlh =3D GET_GLOBALFLAT(op->drive_gf->lchs.head); + u16 nlh =3D GET_GLOBALFLAT(op->drive_fl->lchs.head); res.head =3D tmp % nlh; =20 tmp /=3D nlh; @@ -538,12 +538,12 @@ static int floppy_read(struct disk_op_s *op) { struct chs_s chs =3D lba2chs(op); - int ret =3D floppy_prep(op->drive_gf, chs.cylinder); + int ret =3D floppy_prep(op->drive_fl, chs.cylinder); if (ret) return ret; =20 // send read-normal-data command to controller - u8 floppyid =3D GET_GLOBALFLAT(op->drive_gf->cntl_id); + u8 floppyid =3D GET_GLOBALFLAT(op->drive_fl->cntl_id); u8 param[8]; param[0] =3D (chs.head << 2) | floppyid; // HD DR1 DR2 param[1] =3D chs.cylinder; @@ -561,12 +561,12 @@ static int floppy_write(struct disk_op_s *op) { struct chs_s chs =3D lba2chs(op); - int ret =3D floppy_prep(op->drive_gf, chs.cylinder); + int ret =3D floppy_prep(op->drive_fl, chs.cylinder); if (ret) return ret; =20 // send write-normal-data command to controller - u8 floppyid =3D GET_GLOBALFLAT(op->drive_gf->cntl_id); + u8 floppyid =3D GET_GLOBALFLAT(op->drive_fl->cntl_id); u8 param[8]; param[0] =3D (chs.head << 2) | floppyid; // HD DR1 DR2 param[1] =3D chs.cylinder; @@ -584,7 +584,7 @@ static int floppy_verify(struct disk_op_s *op) { struct chs_s chs =3D lba2chs(op); - int ret =3D floppy_prep(op->drive_gf, chs.cylinder); + int ret =3D floppy_prep(op->drive_fl, chs.cylinder); if (ret) return ret; =20 @@ -597,12 +597,12 @@ static int floppy_format(struct disk_op_s *op) { struct chs_s chs =3D lba2chs(op); - int ret =3D floppy_prep(op->drive_gf, chs.cylinder); + int ret =3D floppy_prep(op->drive_fl, chs.cylinder); if (ret) return ret; =20 // send format-track command to controller - u8 floppyid =3D GET_GLOBALFLAT(op->drive_gf->cntl_id); + u8 floppyid =3D GET_GLOBALFLAT(op->drive_fl->cntl_id); u8 param[7]; param[0] =3D (chs.head << 2) | floppyid; // HD DR1 DR2 param[1] =3D FLOPPY_SIZE_CODE; diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c index 5233251..d5fc3e4 100644 --- a/src/hw/lsi-scsi.c +++ b/src/hw/lsi-scsi.c @@ -57,7 +57,7 @@ lsi_scsi_process_op(struct disk_op_s *op) if (!CONFIG_LSI_SCSI) return DISK_RET_EBADTRACK; struct lsi_lun_s *llun_gf =3D - container_of(op->drive_gf, struct lsi_lun_s, drive); + container_of(op->drive_fl, struct lsi_lun_s, drive); u16 target =3D GET_GLOBALFLAT(llun_gf->target); u16 lun =3D GET_GLOBALFLAT(llun_gf->lun); u8 cdbcmd[16]; diff --git a/src/hw/megasas.c b/src/hw/megasas.c index efd0f6e..d267580 100644 --- a/src/hw/megasas.c +++ b/src/hw/megasas.c @@ -167,7 +167,7 @@ megasas_process_op(struct disk_op_s *op) if (blocksize < 0) return default_process_op(op); struct megasas_lun_s *mlun_gf =3D - container_of(op->drive_gf, struct megasas_lun_s, drive); + container_of(op->drive_fl, struct megasas_lun_s, drive); struct megasas_cmd_frame *frame =3D GET_GLOBALFLAT(mlun_gf->frame); u16 pci_id =3D GET_GLOBALFLAT(mlun_gf->pci_id); int i; diff --git a/src/hw/mpt-scsi.c b/src/hw/mpt-scsi.c index 80c6d6b..1faede6 100644 --- a/src/hw/mpt-scsi.c +++ b/src/hw/mpt-scsi.c @@ -188,7 +188,7 @@ mpt_scsi_process_op(struct disk_op_s *op) return default_process_op(op); =20 struct mpt_lun_s *llun_gf =3D - container_of(op->drive_gf, struct mpt_lun_s, drive); + container_of(op->drive_fl, struct mpt_lun_s, drive); u16 target =3D GET_GLOBALFLAT(llun_gf->target); u16 lun =3D GET_GLOBALFLAT(llun_gf->lun); u32 iobase =3D GET_GLOBALFLAT(llun_gf->iobase); diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 556a9a4..93c25f5 100644 --- a/src/hw/nvme.c +++ b/src/hw/nvme.c @@ -601,7 +601,7 @@ nvme_process_op(struct disk_op_s *op) if (!CONFIG_NVME) return DISK_RET_SUCCESS; =20 - struct nvme_namespace *ns =3D container_of(op->drive_gf, struct nvme_n= amespace, + struct nvme_namespace *ns =3D container_of(op->drive_fl, struct nvme_n= amespace, drive); =20 switch (op->command) { diff --git a/src/hw/pvscsi.c b/src/hw/pvscsi.c index 7c850a9..d62d0a0 100644 --- a/src/hw/pvscsi.c +++ b/src/hw/pvscsi.c @@ -213,7 +213,7 @@ pvscsi_process_op(struct disk_op_s *op) if (!CONFIG_PVSCSI) return DISK_RET_EBADTRACK; struct pvscsi_lun_s *plun =3D - container_of(op->drive_gf, struct pvscsi_lun_s, drive); + container_of(op->drive_fl, struct pvscsi_lun_s, drive); struct pvscsi_ring_dsc_s *ring_dsc =3D plun->ring_dsc; struct PVSCSIRingsState *s =3D ring_dsc->ring_state; u32 req_entries =3D s->reqNumEntriesLog2; diff --git a/src/hw/ramdisk.c b/src/hw/ramdisk.c index adec1d1..b9e9baa 100644 --- a/src/hw/ramdisk.c +++ b/src/hw/ramdisk.c @@ -62,7 +62,7 @@ ramdisk_setup(void) static int ramdisk_copy(struct disk_op_s *op, int iswrite) { - u32 offset =3D GET_GLOBALFLAT(op->drive_gf->cntl_id); + u32 offset =3D GET_GLOBALFLAT(op->drive_fl->cntl_id); offset +=3D (u32)op->lba * DISK_SECTOR_SIZE; u64 opd =3D GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE((u32)op->buf_fl); u64 ramd =3D GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE(offset); diff --git a/src/hw/sdcard.c b/src/hw/sdcard.c index 73fef29..6410340 100644 --- a/src/hw/sdcard.c +++ b/src/hw/sdcard.c @@ -266,7 +266,7 @@ static int sdcard_readwrite(struct disk_op_s *op, int iswrite) { struct sddrive_s *drive =3D container_of( - op->drive_gf, struct sddrive_s, drive); + op->drive_fl, struct sddrive_s, drive); int cmd =3D iswrite ? SC_WRITE_SINGLE : SC_READ_SINGLE; if (op->count > 1) cmd =3D iswrite ? SC_WRITE_MULTIPLE : SC_READ_MULTIPLE; diff --git a/src/hw/usb-msc.c b/src/hw/usb-msc.c index a234f13..2b18828 100644 --- a/src/hw/usb-msc.c +++ b/src/hw/usb-msc.c @@ -69,9 +69,9 @@ usb_process_op(struct disk_op_s *op) return 0; =20 dprintf(16, "usb_cmd_data id=3D%p write=3D%d count=3D%d buf=3D%p\n" - , op->drive_gf, 0, op->count, op->buf_fl); + , op->drive_fl, 0, op->count, op->buf_fl); struct usbdrive_s *udrive_gf =3D container_of( - op->drive_gf, struct usbdrive_s, drive); + op->drive_fl, struct usbdrive_s, drive); =20 // Setup command block wrapper. struct cbw_s cbw; diff --git a/src/hw/usb-uas.c b/src/hw/usb-uas.c index f00221a..6a8decc 100644 --- a/src/hw/usb-uas.c +++ b/src/hw/usb-uas.c @@ -98,7 +98,7 @@ uas_process_op(struct disk_op_s *op) return DISK_RET_EBADTRACK; =20 struct uasdrive_s *drive_gf =3D container_of( - op->drive_gf, struct uasdrive_s, drive); + op->drive_fl, struct uasdrive_s, drive); =20 uas_ui ui; memset(&ui, 0, sizeof(ui)); diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index 901b8f5..ad16200 100644 --- a/src/hw/virtio-blk.c +++ b/src/hw/virtio-blk.c @@ -33,7 +33,7 @@ static int virtio_blk_op(struct disk_op_s *op, int write) { struct virtiodrive_s *vdrive_gf =3D - container_of(op->drive_gf, struct virtiodrive_s, drive); + container_of(op->drive_fl, struct virtiodrive_s, drive); struct vring_virtqueue *vq =3D vdrive_gf->vq; struct virtio_blk_outhdr hdr =3D { .type =3D write ? VIRTIO_BLK_T_OUT : VIRTIO_BLK_T_IN, diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index 4eea5c3..466b305 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -39,7 +39,7 @@ virtio_scsi_process_op(struct disk_op_s *op) if (! CONFIG_VIRTIO_SCSI) return 0; struct virtio_lun_s *vlun =3D - container_of(op->drive_gf, struct virtio_lun_s, drive); + container_of(op->drive_fl, struct virtio_lun_s, drive); struct vp_device *vp =3D vlun->vp; struct vring_virtqueue *vq =3D vlun->vq; struct virtio_scsi_req_cmd req; --=20 2.9.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios From nobody Sat Apr 20 13:53:40 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1499791919057830.7050044489496; Tue, 11 Jul 2017 09:51:59 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coresystems.de) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1dUyLc-00045F-6m; Tue, 11 Jul 2017 18:49:16 +0200 Received: from mail-qk0-f194.google.com ([209.85.220.194]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1dUyLL-00041W-N0 for seabios@seabios.org; Tue, 11 Jul 2017 18:49:12 +0200 Received: by mail-qk0-f194.google.com with SMTP id v143so1430987qkb.3 for ; Tue, 11 Jul 2017 09:50:41 -0700 (PDT) Received: from localhost ([64.9.249.1]) by smtp.gmail.com with ESMTPSA id q36sm387903qtq.46.2017.07.11.09.50.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Jul 2017 09:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=koconnor-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=9cylbgxDqN6lhCkG4bGwXyWII/FLR7ymxCe594Z8oKU=; b=YeiKbXLlMrxknQQUDbN52BYrAXyTP7l9ZVJNLuEPQP4qxA8PpigVpYU2klAa5ZSbsf BQrtB2Mq7sH0Clh60wEFUOZZgy4+CSWJZ35/cd1i5M9qbNNuytICmi5lk8PRPVvASZR/ O2zXVJcWl5i4QjNn1QW4jlsVvkJowAuXUVaGnc4w6Ty3y8nHclkWATkIFyvKGA8hFTlM 1r9/MZNbZSXXpty04NcqQjFYpC8mFZzK0WAoi4fudAggm1XHvMyi56s2ON/7Cxht85Dg 7DC7UrwWOdbgZq45bdBbD+C8zy2KDCxB/97SsNLjhXZtDshlKKiXpUMAKRDN9Lv63CF/ LoKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9cylbgxDqN6lhCkG4bGwXyWII/FLR7ymxCe594Z8oKU=; b=W07VoisaR8c12DOPLTzkkLHEl/WGNecEawEMcIM5AKnwIqVgX04pfOoyPcmSFEsM/9 TcC7Zr4ZmSfDuiav7fFgVI7LGjWLh7R8kxU+Yakfu/dR7f6RAeluIsDUt2fAGvbqml3/ i4bjf15OHxp3bPIViV/l9KYWVF9FQJqCxhDR9UK4oz133j8SGJt2hZkQjOgiR5X3KlDY T28QAeoMtkYOAosrSnMGXShF+cUWaNT4DmBBEJ4LWoBZ6lSkb0psRKil/VU2VBq6z9Gm +0WFidS3AFz9+eBADbK+3LGtC3t/x1dHIo8bIA2DYRM7ie+7wvsRjJqnYnYK+s/38xqR lYGQ== X-Gm-Message-State: AIVw111aH2ycG3XrnAgbV4lp2iAnBOI4jOUa8zlHc/ZlGYJQqjPnVA/y 4mD0Qf7I6oheFiUp1jEjnw== X-Received: by 10.55.54.196 with SMTP id d187mr1073319qka.96.1499791838989; Tue, 11 Jul 2017 09:50:38 -0700 (PDT) From: Kevin O'Connor To: seabios@seabios.org Date: Tue, 11 Jul 2017 12:50:32 -0400 Message-Id: <20170711165032.2443-5-kevin@koconnor.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170711165032.2443-1-kevin@koconnor.net> References: <20170711165032.2443-1-kevin@koconnor.net> X-Spam-Score: -4.0 (----) Subject: [SeaBIOS] [PATCH 4/4] virtio: Allocate drive_s storage in low memory X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Use the "low" memory segment instead of the f-segment for the drive_s storage. This can help avoid running out of memory in the f-segment. Signed-off-by: Kevin O'Connor Tested-by: Paolo Bonzini --- src/hw/virtio-blk.c | 12 ++++++------ src/hw/virtio-ring.c | 1 - src/hw/virtio-scsi.c | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index ad16200..88d7e54 100644 --- a/src/hw/virtio-blk.c +++ b/src/hw/virtio-blk.c @@ -32,9 +32,9 @@ struct virtiodrive_s { static int virtio_blk_op(struct disk_op_s *op, int write) { - struct virtiodrive_s *vdrive_gf =3D + struct virtiodrive_s *vdrive =3D container_of(op->drive_fl, struct virtiodrive_s, drive); - struct vring_virtqueue *vq =3D vdrive_gf->vq; + struct vring_virtqueue *vq =3D vdrive->vq; struct virtio_blk_outhdr hdr =3D { .type =3D write ? VIRTIO_BLK_T_OUT : VIRTIO_BLK_T_IN, .ioprio =3D 0, @@ -48,7 +48,7 @@ virtio_blk_op(struct disk_op_s *op, int write) }, { .addr =3D op->buf_fl, - .length =3D vdrive_gf->drive.blksize * op->count, + .length =3D vdrive->drive.blksize * op->count, }, { .addr =3D (void*)(&status), @@ -61,7 +61,7 @@ virtio_blk_op(struct disk_op_s *op, int write) vring_add_buf(vq, sg, 2, 1, 0, 0); else vring_add_buf(vq, sg, 1, 2, 0, 0); - vring_kick(&vdrive_gf->vp, vq, 1); + vring_kick(&vdrive->vp, vq, 1); =20 /* Wait for reply */ while (!vring_more_used(vq)) @@ -73,7 +73,7 @@ virtio_blk_op(struct disk_op_s *op, int write) /* Clear interrupt status register. Avoid leaving interrupts stuck if * VRING_AVAIL_F_NO_INTERRUPT was ignored and interrupts were raised. */ - vp_get_isr(&vdrive_gf->vp); + vp_get_isr(&vdrive->vp); =20 return status =3D=3D VIRTIO_BLK_S_OK ? DISK_RET_SUCCESS : DISK_RET_EBA= DTRACK; } @@ -99,7 +99,7 @@ init_virtio_blk(void *data) struct pci_device *pci =3D data; u8 status =3D VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER; dprintf(1, "found virtio-blk at %pP\n", pci); - struct virtiodrive_s *vdrive =3D malloc_fseg(sizeof(*vdrive)); + struct virtiodrive_s *vdrive =3D malloc_low(sizeof(*vdrive)); if (!vdrive) { warn_noalloc(); return; diff --git a/src/hw/virtio-ring.c b/src/hw/virtio-ring.c index 7205a0a..0ed3189 100644 --- a/src/hw/virtio-ring.c +++ b/src/hw/virtio-ring.c @@ -16,7 +16,6 @@ * */ =20 -#include "biosvar.h" // GET_GLOBAL #include "output.h" // panic #include "virtio-ring.h" #include "virtio-pci.h" diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index 466b305..a87cad8 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@ -7,7 +7,6 @@ // // This file may be distributed under the terms of the GNU LGPLv3 license. =20 -#include "biosvar.h" // GET_GLOBALFLAT #include "block.h" // struct drive_s #include "blockcmd.h" // scsi_drive_setup #include "config.h" // CONFIG_* @@ -114,7 +113,7 @@ virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv) { struct virtio_lun_s *tmpl_vlun =3D container_of(tmpl_drv, struct virtio_lun_s, drive); - struct virtio_lun_s *vlun =3D malloc_fseg(sizeof(*vlun)); + struct virtio_lun_s *vlun =3D malloc_low(sizeof(*vlun)); if (!vlun) { warn_noalloc(); return -1; --=20 2.9.4 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios