pflash_cfi01.c (d7e2fe4aac8b74bbfe82b2309536528b4dbe0d34) | pflash_cfi01.c (a9262f551eba44d4d0f9e396d7124c059a93e204) |
---|---|
1/* 2 * CFI parallel flash with Intel command set emulation 3 * 4 * Copyright (c) 2006 Thorsten Zitterell 5 * Copyright (c) 2005 Jocelyn Mayer 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 378 unchanged lines hidden (view full) --- 387{ 388 int offset_end; 389 int ret; 390 if (pfl->blk) { 391 offset_end = offset + size; 392 /* widen to sector boundaries */ 393 offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE); 394 offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE); | 1/* 2 * CFI parallel flash with Intel command set emulation 3 * 4 * Copyright (c) 2006 Thorsten Zitterell 5 * Copyright (c) 2005 Jocelyn Mayer 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public --- 378 unchanged lines hidden (view full) --- 387{ 388 int offset_end; 389 int ret; 390 if (pfl->blk) { 391 offset_end = offset + size; 392 /* widen to sector boundaries */ 393 offset = QEMU_ALIGN_DOWN(offset, BDRV_SECTOR_SIZE); 394 offset_end = QEMU_ALIGN_UP(offset_end, BDRV_SECTOR_SIZE); |
395 ret = blk_pwrite(pfl->blk, offset, pfl->storage + offset, 396 offset_end - offset, 0); | 395 ret = blk_pwrite(pfl->blk, offset, offset_end - offset, 396 pfl->storage + offset, 0); |
397 if (ret < 0) { 398 /* TODO set error bit in status */ 399 error_report("Could not update PFLASH: %s", strerror(-ret)); 400 } 401 } 402} 403 404static inline void pflash_data_write(PFlashCFI01 *pfl, hwaddr offset, --- 639 unchanged lines hidden --- | 397 if (ret < 0) { 398 /* TODO set error bit in status */ 399 error_report("Could not update PFLASH: %s", strerror(-ret)); 400 } 401 } 402} 403 404static inline void pflash_data_write(PFlashCFI01 *pfl, hwaddr offset, --- 639 unchanged lines hidden --- |