flash_device.cc (11226:7b317ee691fb) flash_device.cc (11321:02e930db812d)
1/*
2 * Copyright (c) 2013-2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 /*
94 * Let 'a' be a power of two of n bits, written such that a-n is the msb
95 * and a-0 is the lsb. Since it is a power of two, only one bit (a-x,
96 * with 0 <= x <= n) is set. If we subtract one from this number the bits
97 * a-(x-1) to a-0 are set and all the other bits are cleared. Hence a
98 * bitwise AND with those two numbers results in an integer with all bits
99 * cleared.
100 */
1/*
2 * Copyright (c) 2013-2015 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 84 unchanged lines hidden (view full) ---

93 /*
94 * Let 'a' be a power of two of n bits, written such that a-n is the msb
95 * and a-0 is the lsb. Since it is a power of two, only one bit (a-x,
96 * with 0 <= x <= n) is set. If we subtract one from this number the bits
97 * a-(x-1) to a-0 are set and all the other bits are cleared. Hence a
98 * bitwise AND with those two numbers results in an integer with all bits
99 * cleared.
100 */
101 if(numPlanes & planeMask)
101 if (numPlanes & planeMask)
102 fatal("Number of planes is not a power of 2 in flash device.\n");
103}
104
105/**
106 * Initiates all the flash functions: initializes the lookup tables, age of
107 * the device, etc. This can only be done once the disk image is known.
108 * Thats why it can't be done in the constructor.
109 */

--- 130 unchanged lines hidden (view full) ---

240 */
241 for (uint32_t count = 0; count < numPlanes; count++){
242 plane_address = (time[plane_address] > time[count]) ? plane_address
243 : count;
244
245 DPRINTF(FlashDevice, "Plane %d is busy for %d ticks\n", count,
246 time[count]);
247
102 fatal("Number of planes is not a power of 2 in flash device.\n");
103}
104
105/**
106 * Initiates all the flash functions: initializes the lookup tables, age of
107 * the device, etc. This can only be done once the disk image is known.
108 * Thats why it can't be done in the constructor.
109 */

--- 130 unchanged lines hidden (view full) ---

240 */
241 for (uint32_t count = 0; count < numPlanes; count++){
242 plane_address = (time[plane_address] > time[count]) ? plane_address
243 : count;
244
245 DPRINTF(FlashDevice, "Plane %d is busy for %d ticks\n", count,
246 time[count]);
247
248 if (time[count] != 0) {
248 if (time[count] != 0) {
249
250 struct CallBackEntry cbe;
251 /**
252 * If there are no events for this plane, then add the current
253 * time to the occupation time; otherwise, plan it after the
254 * last event. If by chance that event is handled in this tick,
255 * then we would still end up with the same result.
256 */

--- 339 unchanged lines hidden ---
249
250 struct CallBackEntry cbe;
251 /**
252 * If there are no events for this plane, then add the current
253 * time to the occupation time; otherwise, plan it after the
254 * last event. If by chance that event is handled in this tick,
255 * then we would still end up with the same result.
256 */

--- 339 unchanged lines hidden ---