#else
#ifndef LOCKLESS
//fprintf(stderr, "addr %012llo\n", addr);
- fprintf(stderr, "addr %012llo word %012llo\n", addr, M[(addr >> 18) & 077777][addr & 0777777]);
+ //fprintf(stderr, "addr %012llo word %012llo\n", addr, M[(addr >> 18) & 077777][addr & 0777777]);
if (M[(addr >> 18) & 077777][addr & 0777777] & MEM_UNINITIALIZED)
{
sim_debug (DBG_WARN, & cpu_dev,
struct known_segment *make_known(const char *name) {
name = xlate_segname(name);
-
+
// see if already loaded
for (int i = 0; i < n_known_segment; ++i)
if (strcmp(known_segment[i].name, name) == 0)
if (strcmp(p->name, "hcs_") == 0) {
if (strcmp(name, "make_ptr") == 0)
return its_pointer(linkage_segment, emcall_stubs_offset);
+ if (strcmp(name, "proc_info") == 0)
+ return its_pointer(linkage_segment, emcall_stubs_offset + 3);
+ }
+ else if (strcmp(p->name, "sys_info") == 0) {
+ if (strcmp(name, "service_system") == 0)
+ return its_pointer(linkage_segment, emcall_stubs_offset + 6);
}
struct object_map *object_map = get_object_map(p);
char entry_point_name_buf[NAME_LEN + 1];
get_string_rstrip(entry_point_name_buf, entry_point_name, NAME_LEN);
- printf("%s:%s\n", entryname_buf, entry_point_name_buf);
*ref_pointer =
entry_point_name_buf[0] ?
*code = 0;
}
+void emcall_proc_info(void) {
+}
+
int main(int argc, char **argv) {
bool af = false;
if (argc >= 2 && strcmp(argv[1], "--af") == 0) {
// initialize CPU
sim_deb = stderr;
cpu_dev.dctrl =
- DBG_TRACE |
+ //DBG_TRACE |
//DBG_MSG |
//DBG_REGDUMPAQI |
//DBG_REGDUMPIDX |
);
// create emcall stubs
- emcall_stubs_offset = allocate_linkage(3, 1);
+ emcall_stubs_offset = allocate_linkage(7, 1);
uint64_t *emcall_stubs = (uint64_t *)(
M[linkage_segment] + emcall_stubs_offset
);
emcall_stubs[0] = 0700046272120L; // tsp2 pr7|46,n* alm_entry
emcall_stubs[1] = 0000027420400L; // emcall make_ptr
emcall_stubs[2] = 0700044710120L; // tra pr7|44,n* alm_return_no_pop
+ emcall_stubs[3] = 0700046272120L; // tsp2 pr7|46,n* alm_entry
+ emcall_stubs[4] = 0000030420400L; // emcall proc_info
+ emcall_stubs[5] = 0700044710120L; // tra pr7|44,n* alm_return_no_pop
+ emcall_stubs[6] = 0400000000000L; // bit(1) indicating system is up
// create calling stub
int calling_stub_offset = allocate_linkage(2, 1);