softmmu_template.h revision 9b898ee3642a830a4d4af4d0a485a49d157b5551
/*
* Software MMU support
*
* Copyright (c) 2003 Fabrice Bellard
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if DATA_SIZE == 8
#define SUFFIX q
#define USUFFIX q
#define SUFFIX l
#define USUFFIX l
#define SUFFIX w
#define SUFFIX b
#else
#endif
#ifdef SOFTMMU_CODE_ACCESS
#define READ_ACCESS_TYPE 2
#else
#define READ_ACCESS_TYPE 0
#endif
int is_user,
void *retaddr);
{
int index;
#if SHIFT <= 2
#else
#ifdef TARGET_WORDS_BIGENDIAN
#else
#endif
#endif /* SHIFT > 2 */
#ifdef USE_KQEMU
#endif
return res;
}
/* handle all cases except unaligned access which span two pages */
int is_user)
{
int index;
void *retaddr;
/* test if there is match for unaligned or IO access */
/* XXX: could done more in memory macro in a non portable way */
redo:
if (tlb_addr & ~TARGET_PAGE_MASK) {
/* IO access */
goto do_unaligned_access;
/* slow unaligned access (it spans two pages or IO) */
#ifdef ALIGNED_ONLY
#endif
} else {
#ifdef ALIGNED_ONLY
}
#endif
}
} else {
/* the page is not in the TLB : fill it */
#ifdef ALIGNED_ONLY
#endif
goto redo;
}
return res;
}
/* handle all unaligned cases */
int is_user,
void *retaddr)
{
redo:
if (tlb_addr & ~TARGET_PAGE_MASK) {
/* IO access */
goto do_unaligned_access;
/* slow unaligned access (it spans two pages) */
#ifdef TARGET_WORDS_BIGENDIAN
#else
#endif
} else {
}
} else {
/* the page is not in the TLB : fill it */
goto redo;
}
return res;
}
#ifndef SOFTMMU_CODE_ACCESS
int is_user,
void *retaddr);
void *retaddr)
{
int index;
#if SHIFT <= 2
#else
#ifdef TARGET_WORDS_BIGENDIAN
#else
#endif
#endif /* SHIFT > 2 */
#ifdef USE_KQEMU
#endif
}
int is_user)
{
void *retaddr;
int index;
redo:
if (tlb_addr & ~TARGET_PAGE_MASK) {
/* IO access */
goto do_unaligned_access;
#ifdef ALIGNED_ONLY
#endif
} else {
#ifdef ALIGNED_ONLY
}
#endif
}
} else {
/* the page is not in the TLB : fill it */
#ifdef ALIGNED_ONLY
#endif
goto redo;
}
}
/* handles all unaligned cases */
int is_user,
void *retaddr)
{
int index, i;
redo:
if (tlb_addr & ~TARGET_PAGE_MASK) {
/* IO access */
goto do_unaligned_access;
/* XXX: not efficient, but simple */
for(i = 0;i < DATA_SIZE; i++) {
#ifdef TARGET_WORDS_BIGENDIAN
#else
#endif
}
} else {
}
} else {
/* the page is not in the TLB : fill it */
goto redo;
}
}
#endif /* !defined(SOFTMMU_CODE_ACCESS) */