[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/19] libqos/ahci: add ahci command size setter
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 13/19] libqos/ahci: add ahci command size setters |
Date: |
Mon, 02 Feb 2015 11:35:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 30/01/2015 19:42, John Snow wrote:
> +void ahci_command_set_sizes(AHCICommand *cmd, uint64_t xbytes,
> + unsigned prd_size)
> +{
> + /* Each PRD can describe up to 4MiB, and must not be odd. */
> + g_assert_cmphex(prd_size, <=, 4096 * 1024);
> + g_assert_cmphex(prd_size & 0x01, ==, 0x00);
> + cmd->prd_size = prd_size;
> + cmd->xbytes = xbytes;
> + cmd->fis.count = cpu_to_le16(cmd->xbytes / AHCI_SECTOR_SIZE);
Why do you need cpu_to_le16 here, instead of having it in the function
that writes the command to guest memory?
Paolo
> + cmd->header.prdtl = size_to_prdtl(cmd->xbytes, cmd->prd_size);
> +}
> +
- Re: [Qemu-devel] [PATCH 13/19] libqos/ahci: add ahci command size setters,
Paolo Bonzini <=