1 |
/* |
/* |
2 |
* Copyright (C) 2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2005-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: cpu_ia64_instr.c,v 1.1 2005/08/29 14:36:41 debug Exp $ |
* $Id: cpu_ia64_instr.c,v 1.4 2006/02/09 22:40:27 debug Exp $ |
29 |
* |
* |
30 |
* IA64 instructions. |
* IA64 instructions. |
31 |
* |
* |
65 |
|
|
66 |
|
|
67 |
/* |
/* |
|
* ia64_combine_instructions(): |
|
|
* |
|
|
* Combine two or more instructions, if possible, into a single function call. |
|
|
*/ |
|
|
void ia64_combine_instructions(struct cpu *cpu, struct ia64_instr_call *ic, |
|
|
uint64_t addr) |
|
|
{ |
|
|
int n_back; |
|
|
n_back = (addr >> 4) & (IA64_IC_ENTRIES_PER_PAGE-1); |
|
|
|
|
|
if (n_back >= 1) { |
|
|
} |
|
|
|
|
|
/* TODO: Combine forward as well */ |
|
|
} |
|
|
|
|
|
|
|
|
/*****************************************************************************/ |
|
|
|
|
|
|
|
|
/* |
|
68 |
* ia64_instr_to_be_translated(): |
* ia64_instr_to_be_translated(): |
69 |
* |
* |
70 |
* Translate an instruction word into an ia64_instr_call. ic is filled in with |
* Translate an instruction word into an ia64_instr_call. ic is filled in with |
75 |
X(to_be_translated) |
X(to_be_translated) |
76 |
{ |
{ |
77 |
uint64_t addr, low_pc; |
uint64_t addr, low_pc; |
78 |
struct ia64_vph_page *vph_p; |
#ifdef DYNTRANS_BACKEND |
79 |
unsigned char *page; |
int simple = 0; |
80 |
|
#endif |
81 |
unsigned char ib[16]; |
unsigned char ib[16]; |
82 |
|
|
83 |
/* Figure out the (virtual) address of the instruction: */ |
/* Figure out the (virtual) address of the instruction: */ |
91 |
|
|
92 |
/* Read the instruction word from memory: */ |
/* Read the instruction word from memory: */ |
93 |
#if 0 |
#if 0 |
|
if ((addr >> _TOPSHIFT) == 0) { |
|
|
vph_p = cpu->cd.alpha.vph_table0[(addr >> |
|
|
ALPHA_LEVEL0_SHIFT) & 8191]; |
|
|
page = vph_p->host_load[(addr >> ALPHA_LEVEL1_SHIFT) & 8191]; |
|
|
} else if ((addr >> ALPHA_TOPSHIFT) == ALPHA_TOP_KERNEL) { |
|
|
vph_p = cpu->cd.alpha.vph_table0_kernel[(addr >> |
|
|
ALPHA_LEVEL0_SHIFT) & 8191]; |
|
|
page = vph_p->host_load[(addr >> ALPHA_LEVEL1_SHIFT) & 8191]; |
|
|
} else |
|
|
page = NULL; |
|
|
|
|
94 |
if (page != NULL) { |
if (page != NULL) { |
95 |
/* fatal("TRANSLATION HIT!\n"); */ |
/* fatal("TRANSLATION HIT!\n"); */ |
96 |
memcpy(ib, page + (addr & 8191), sizeof(ib)); |
memcpy(ib, page + (addr & 8191), sizeof(ib)); |