OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [sim/] [ppc/] [vm.h] - Diff between revs 835 and 841

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 835 Rev 841
/*  This file is part of the program psim.
/*  This file is part of the program psim.
 
 
    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
 
 
    This program is free software; you can redistribute it and/or modify
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    (at your option) any later version.
 
 
    This program is distributed in the hope that it will be useful,
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    GNU General Public License for more details.
 
 
    You should have received a copy of the GNU General Public License
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
    */
    */
 
 
 
 
#ifndef _VM_H_
#ifndef _VM_H_
#define _VM_H_
#define _VM_H_
 
 
typedef struct _vm vm;
typedef struct _vm vm;
typedef struct _vm_data_map vm_data_map;
typedef struct _vm_data_map vm_data_map;
typedef struct _vm_instruction_map vm_instruction_map;
typedef struct _vm_instruction_map vm_instruction_map;
 
 
 
 
/* each PowerPC requires two virtual memory maps */
/* each PowerPC requires two virtual memory maps */
 
 
INLINE_VM\
INLINE_VM\
(vm *) vm_create
(vm *) vm_create
(core *memory);
(core *memory);
 
 
INLINE_VM\
INLINE_VM\
(vm_data_map *) vm_create_data_map
(vm_data_map *) vm_create_data_map
(vm *memory);
(vm *memory);
 
 
INLINE_VM\
INLINE_VM\
(vm_instruction_map *) vm_create_instruction_map
(vm_instruction_map *) vm_create_instruction_map
(vm *memory);
(vm *memory);
 
 
 
 
/* address translation, if the translation is invalid
/* address translation, if the translation is invalid
   these will not return */
   these will not return */
 
 
INLINE_VM\
INLINE_VM\
(unsigned_word) vm_real_data_addr
(unsigned_word) vm_real_data_addr
(vm_data_map *data_map,
(vm_data_map *data_map,
 unsigned_word ea,
 unsigned_word ea,
 int is_read,
 int is_read,
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
INLINE_VM\
INLINE_VM\
(unsigned_word) vm_real_instruction_addr
(unsigned_word) vm_real_instruction_addr
(vm_instruction_map *instruction_map,
(vm_instruction_map *instruction_map,
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
 
 
/* generic block transfers.  Dependant on the presence of the
/* generic block transfers.  Dependant on the presence of the
   PROCESSOR arg, either returns the number of bytes transfered or (if
   PROCESSOR arg, either returns the number of bytes transfered or (if
   PROCESSOR is non NULL) aborts the simulation */
   PROCESSOR is non NULL) aborts the simulation */
 
 
INLINE_VM\
INLINE_VM\
(int) vm_data_map_read_buffer
(int) vm_data_map_read_buffer
(vm_data_map *map,
(vm_data_map *map,
 void *target,
 void *target,
 unsigned_word addr,
 unsigned_word addr,
 unsigned len,
 unsigned len,
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
INLINE_VM\
INLINE_VM\
(int) vm_data_map_write_buffer
(int) vm_data_map_write_buffer
(vm_data_map *map,
(vm_data_map *map,
 const void *source,
 const void *source,
 unsigned_word addr,
 unsigned_word addr,
 unsigned len,
 unsigned len,
 int violate_read_only_section,
 int violate_read_only_section,
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
 
 
/* fetch the next instruction from memory */
/* fetch the next instruction from memory */
 
 
INLINE_VM\
INLINE_VM\
(instruction_word) vm_instruction_map_read
(instruction_word) vm_instruction_map_read
(vm_instruction_map *instruction_map,
(vm_instruction_map *instruction_map,
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
 
 
/* read data from memory */
/* read data from memory */
 
 
#define DECLARE_VM_DATA_MAP_READ_N(N) \
#define DECLARE_VM_DATA_MAP_READ_N(N) \
INLINE_VM\
INLINE_VM\
(unsigned_##N) vm_data_map_read_##N \
(unsigned_##N) vm_data_map_read_##N \
(vm_data_map *map, \
(vm_data_map *map, \
 unsigned_word ea, \
 unsigned_word ea, \
 cpu *processor, \
 cpu *processor, \
 unsigned_word cia);
 unsigned_word cia);
 
 
DECLARE_VM_DATA_MAP_READ_N(1)
DECLARE_VM_DATA_MAP_READ_N(1)
DECLARE_VM_DATA_MAP_READ_N(2)
DECLARE_VM_DATA_MAP_READ_N(2)
DECLARE_VM_DATA_MAP_READ_N(4)
DECLARE_VM_DATA_MAP_READ_N(4)
DECLARE_VM_DATA_MAP_READ_N(8)
DECLARE_VM_DATA_MAP_READ_N(8)
DECLARE_VM_DATA_MAP_READ_N(word)
DECLARE_VM_DATA_MAP_READ_N(word)
 
 
 
 
/* write data to memory */
/* write data to memory */
 
 
#define DECLARE_VM_DATA_MAP_WRITE_N(N) \
#define DECLARE_VM_DATA_MAP_WRITE_N(N) \
INLINE_VM\
INLINE_VM\
(void) vm_data_map_write_##N \
(void) vm_data_map_write_##N \
(vm_data_map *map, \
(vm_data_map *map, \
 unsigned_word addr, \
 unsigned_word addr, \
 unsigned_##N val, \
 unsigned_##N val, \
 cpu *processor, \
 cpu *processor, \
 unsigned_word cia);
 unsigned_word cia);
 
 
DECLARE_VM_DATA_MAP_WRITE_N(1)
DECLARE_VM_DATA_MAP_WRITE_N(1)
DECLARE_VM_DATA_MAP_WRITE_N(2)
DECLARE_VM_DATA_MAP_WRITE_N(2)
DECLARE_VM_DATA_MAP_WRITE_N(4)
DECLARE_VM_DATA_MAP_WRITE_N(4)
DECLARE_VM_DATA_MAP_WRITE_N(8)
DECLARE_VM_DATA_MAP_WRITE_N(8)
DECLARE_VM_DATA_MAP_WRITE_N(word)
DECLARE_VM_DATA_MAP_WRITE_N(word)
 
 
 
 
/* update vm data structures due to a synchronization point */
/* update vm data structures due to a synchronization point */
 
 
INLINE_VM\
INLINE_VM\
(void) vm_synchronize_context
(void) vm_synchronize_context
(vm *memory,
(vm *memory,
 spreg *sprs,
 spreg *sprs,
 sreg *srs,
 sreg *srs,
 msreg msr,
 msreg msr,
 /**/
 /**/
 cpu *processor,
 cpu *processor,
 unsigned_word cia);
 unsigned_word cia);
 
 
 
 
/* update vm data structures due to a TLB operation */
/* update vm data structures due to a TLB operation */
 
 
INLINE_VM\
INLINE_VM\
(void) vm_page_tlb_invalidate_entry
(void) vm_page_tlb_invalidate_entry
(vm *memory,
(vm *memory,
 unsigned_word ea);
 unsigned_word ea);
 
 
INLINE_VM\
INLINE_VM\
(void) vm_page_tlb_invalidate_all
(void) vm_page_tlb_invalidate_all
(vm *memory);
(vm *memory);
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.