altera_sdcard_io.c (239675) | altera_sdcard_io.c (245818) |
---|---|
1/*- 2 * Copyright (c) 2012 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by SRI International and the University of 6 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 7 * ("CTSRD"), as part of the DARPA CRASH research programme. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by SRI International and the University of 6 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 7 * ("CTSRD"), as part of the DARPA CRASH research programme. 8 * --- 15 unchanged lines hidden (view full) --- 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31#include <sys/cdefs.h> |
32__FBSDID("$FreeBSD: head/sys/dev/altera/sdcard/altera_sdcard_io.c 239675 2012-08-25 11:19:20Z rwatson $"); | 32__FBSDID("$FreeBSD: head/sys/dev/altera/sdcard/altera_sdcard_io.c 245818 2013-01-22 18:48:45Z brooks $"); |
33 34#include <sys/param.h> 35#include <sys/bus.h> 36#include <sys/condvar.h> 37#include <sys/conf.h> 38#include <sys/bio.h> 39#include <sys/endian.h> 40#include <sys/kernel.h> --- 47 unchanged lines hidden (view full) --- 88 * 89 * BLOCKNR = (C_SIZE + 1) * MULT 90 * MULT = 2^(C_SIZE_MULT+2) 91 * BLOCK_LEN = 2^READ_BL_LEN 92 */ 93 read_bl_len = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_READ_BL_LEN_BYTE]; 94 read_bl_len &= ALTERA_SDCARD_CSD_READ_BL_LEN_MASK; 95 | 33 34#include <sys/param.h> 35#include <sys/bus.h> 36#include <sys/condvar.h> 37#include <sys/conf.h> 38#include <sys/bio.h> 39#include <sys/endian.h> 40#include <sys/kernel.h> --- 47 unchanged lines hidden (view full) --- 88 * 89 * BLOCKNR = (C_SIZE + 1) * MULT 90 * MULT = 2^(C_SIZE_MULT+2) 91 * BLOCK_LEN = 2^READ_BL_LEN 92 */ 93 read_bl_len = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_READ_BL_LEN_BYTE]; 94 read_bl_len &= ALTERA_SDCARD_CSD_READ_BL_LEN_MASK; 95 |
96 byte0 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE0]; 97 byte0 &= ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK0; 98 byte1 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_MULT_BYTE1]; 99 byte1 &= ALTERA_SDCARD_CSD_C_SIZE_MULT_MASK1; 100 c_size_mult = (byte0 >> ALTERA_SDCARD_CSD_C_SIZE_MULT_RSHIFT0) | 101 (byte0 << ALTERA_SDCARD_CSD_C_SIZE_MULT_LSHIFT1); 102 | |
103 byte0 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE0]; 104 byte0 &= ALTERA_SDCARD_CSD_C_SIZE_MASK0; 105 byte1 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE1]; 106 byte2 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE2]; 107 byte2 &= ALTERA_SDCARD_CSD_C_SIZE_MASK2; 108 c_size = (byte0 >> ALTERA_SDCARD_CSD_C_SIZE_RSHIFT0) | 109 (byte1 << ALTERA_SDCARD_CSD_C_SIZE_LSHIFT1) | 110 (byte2 << ALTERA_SDCARD_CSD_C_SIZE_LSHIFT2); --- 337 unchanged lines hidden --- | 96 byte0 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE0]; 97 byte0 &= ALTERA_SDCARD_CSD_C_SIZE_MASK0; 98 byte1 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE1]; 99 byte2 = sc->as_csd.csd_data[ALTERA_SDCARD_CSD_C_SIZE_BYTE2]; 100 byte2 &= ALTERA_SDCARD_CSD_C_SIZE_MASK2; 101 c_size = (byte0 >> ALTERA_SDCARD_CSD_C_SIZE_RSHIFT0) | 102 (byte1 << ALTERA_SDCARD_CSD_C_SIZE_LSHIFT1) | 103 (byte2 << ALTERA_SDCARD_CSD_C_SIZE_LSHIFT2); --- 337 unchanged lines hidden --- |