shithub: riscv

Download patch

ref: be3ba38c452084cf6644d4ae6fb35ccf6abbb1cb
parent: 33a4a56c1c163192b0d166740e7d81fbde602d2a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Sep 13 09:51:00 EDT 2015

libfis: fix wrong shift for lba40 (thanks geoff and charles)

---------- Forwarded message ----------
From: Charles Forsyth <charles.forsyth@gmail.com>
Date: 13 September 2015 at 12:38
Subject: fis bug
To: erik quanstrom <quanstro@quanstro.net>


geoff spotted something similar in sdiahci.c, but it's in libfis as well:

c[Flba24] = lba >> 24;
c[Flba32] = lba >> 32;
c[Flba40] = lba >> 48;

>> 48??  should be >> 40, especially with drive sizes getting up there.

--- a/sys/src/libfis/fis.c
+++ b/sys/src/libfis/fis.c
@@ -432,7 +432,7 @@
 
 	c[Flba24] = lba >> 24;
 	c[Flba32] = lba >> 32;
-	c[Flba40] = lba >> 48;
+	c[Flba40] = lba >> 40;
 	c[Ffeat8] = 0;
 
 	c[Fsc] = nsect;