* ========== Copyright Header Begin ==========================================
* OpenSPARC T2 Processor File: tod.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
* The above named program 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
* General Public License for more details.
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
* ========== Copyright Header End ============================================
int tod_4v_ui_cmd(void*, int argc
, char * argv
[]);
void tod_1sec_callback(void * todobj
, void * );
class tod4v
:public Module
{
// simulated time. will match with Solaris sim time only if stick freq
// in Solaris and SAM are same
uint64_t event_fire_time
;
bool parse_arg(const char *);
void module_added(mmi_instance_t
, const char*){return; }
void module_deleted(mmi_instance_t
, const char*){return;}
printf("%s: sun4v tod module\n",getName());
printf("%s: IOMAP <0x%llx> to <0x%llx>\n",getName(),start_pa
, end_pa
);
printf("%s: current time of day is %s", getName(), ctime(&tod
));
void *get_interface(const char*){return 0;}
static int tod4v_physio_access(uint32_t cpuid
, void* obj
, uint64_t paddr
,
mmi_bool_t wr
, uint32_t size
, uint64_t* buf
, uint8_t bytemask
);
void tod4v_ld (uint64_t paddr
, uint64_t *buf
, int size
);
void tod4v_st(uint64_t paddr
, uint64_t *buf
, int size
);
tod4v(const char *, const char *);
fprintf(fp
,"tod 0x%lx\n",tod
);
fprintf(fp
,"sim_time %i\n",sim_time
);
fprintf(fp
,"event_fire_time 0x%llx\n",event_fire_time
);
fscanf(fp
,"tod 0x%lx\n",&tod
);
fscanf(fp
,"sim_time %i\n",&sim_time
);
fscanf(fp
,"event_fire_time 0x%llx\n",&event_fire_time
);
mmi_register_event(event_fire_time
,tod_1sec_callback
,(void*)this,0);
void handle_ui(int argc
, char * argv
[]);
printf("ui format: %s <command> <command args> ... \n",getName());
printf("%s supports following UI commands\n",getName());
printf(" debug [<level>]\n\
set the debug level for debug prints to \'level\'\n\
prints current tod every simulated second, and total simulated time.\n\
Note:Solaris sim time and tod sim time match, only if Solaris stick\n\
frequency is same as SAM stick frequency\n\
if \'level\' not provided, print current debug level\n\