rtoss - Diff between revs 74 and 79

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 74 Rev 79
Line 20... Line 20...
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE. 22  * THE SOFTWARE.
23  */ 23  */
24 24
25 #include "sun4m.h" -  
26 #include "sysbus.h" 25 #include "sysbus.h"
27 26
28 //#define DEBUG_ECC 27 //#define DEBUG_ECC
29 28
30 #ifdef DEBUG_ECC 29 #ifdef DEBUG_ECC
Line 36... Line 35...
36 35
37 /* There are 3 versions of this chip used in SMP sun4m systems: 36 /* There are 3 versions of this chip used in SMP sun4m systems:
38  * MCC (version 0, implementation 0) SS-600MP 37  * MCC (version 0, implementation 0) SS-600MP
39  * EMC (version 0, implementation 1) SS-10 38  * EMC (version 0, implementation 1) SS-10
40  * SMC (version 0, implementation 2) SS-10SX and SS-20 39  * SMC (version 0, implementation 2) SS-10SX and SS-20
-   40  *
-   41  * Chipset docs:
-   42  * "Sun-4M System Architecture (revision 2.0) by Chuck Narad", 950-1373-01,
-   43  * http://mediacast.sun.com/users/Barton808/media/Sun4M_SystemArchitecture_edited2.pdf
41  */ 44  */
42 45
43 #define ECC_MCC        0x00000000 46 #define ECC_MCC        0x00000000
44 #define ECC_EMC        0x10000000 47 #define ECC_EMC        0x10000000
45 #define ECC_SMC        0x20000000 48 #define ECC_SMC        0x20000000
Line 274... Line 277...
274         VMSTATE_UINT32(version, ECCState), 277         VMSTATE_UINT32(version, ECCState),
275         VMSTATE_END_OF_LIST() 278         VMSTATE_END_OF_LIST()
276     } 279     }
277 }; 280 };
278 281
279 static void ecc_reset(void *opaque) -  
-   282 static void ecc_reset(DeviceState *d)
280 { 283 {
281     ECCState *s = opaque; -  
-   284     ECCState *s = container_of(d, ECCState, busdev.qdev);
282 285
283     if (s->version == ECC_MCC) 286     if (s->version == ECC_MCC)
284         s->regs[ECC_MER] &= ECC_MER_REU; 287         s->regs[ECC_MER] &= ECC_MER_REU;
285     else 288     else
286         s->regs[ECC_MER] &= (ECC_MER_VER | ECC_MER_IMPL | ECC_MER_MRR | 289         s->regs[ECC_MER] &= (ECC_MER_VER | ECC_MER_IMPL | ECC_MER_MRR |
Line 308... Line 311...
308     if (s->version == ECC_MCC) { // SS-600MP only 311     if (s->version == ECC_MCC) { // SS-600MP only
309         ecc_io_memory = cpu_register_io_memory(ecc_diag_mem_read, 312         ecc_io_memory = cpu_register_io_memory(ecc_diag_mem_read,
310                                                ecc_diag_mem_write, s); 313                                                ecc_diag_mem_write, s);
311         sysbus_init_mmio(dev, ECC_DIAG_SIZE, ecc_io_memory); 314         sysbus_init_mmio(dev, ECC_DIAG_SIZE, ecc_io_memory);
312     } 315     }
313     vmstate_register(-1, &vmstate_ecc, s); -  
314     qemu_register_reset(ecc_reset, s); -  
315     ecc_reset(s); -  
-   316     ecc_reset(&s->busdev.qdev);
-   317
316     return 0; 318     return 0;
317 } 319 }
318 320
319 static SysBusDeviceInfo ecc_info = { 321 static SysBusDeviceInfo ecc_info = {
320     .init = ecc_init1, 322     .init = ecc_init1,
321     .qdev.name  = "eccmemctl", 323     .qdev.name  = "eccmemctl",
322     .qdev.size  = sizeof(ECCState), 324     .qdev.size  = sizeof(ECCState),
-   325     .qdev.vmsd  = &vmstate_ecc,
-   326     .qdev.reset = ecc_reset,
323     .qdev.props = (Property[]) { 327     .qdev.props = (Property[]) {
324         DEFINE_PROP_HEX32("version", ECCState, version, -1), 328         DEFINE_PROP_HEX32("version", ECCState, version, -1),
325         DEFINE_PROP_END_OF_LIST(), 329         DEFINE_PROP_END_OF_LIST(),
326     } 330     }
327 }; 331 };