LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
    Date: Fri Apr 22 16:44:35 CEST 2005
    Subject: [openrisc] [or1ksim #80] Kill the sim on double ctrl-c
    Top
    Hi,

    While writting patch #81 I frequently locked the sim up in an infinite loop, in
    which case no (or) code was executed and thus pressing ctrl-c had no effect and
    the only way to kill it was to switch to another console and do a `killall sim'.
    This fixes this by killing the sim if the user pressed ctrl-c again before
    execution of the code continued. This should probably be fixed properly to not
    kill the sim on a ctrl-c when we are already waiting for input from the user,
    but well, this works for now.

    ChangeLog:
    * Kill the sim on the second ctrl-c.

    nog.
    -------------- next part --------------
    diff -uPr --unidirectional-new-file ./toplevel.c /home/nog/or1ksim-ac/toplevel.c
    --- ./toplevel.c 2005-03-31 18:16:59.000000000 +0200
    +++ /home/nog/or1ksim-ac/toplevel.c 2005-04-08 11:50:54.000000000 +0200
    @@ -101,6 +101,12 @@
    void ctrl_c(signum)
    int signum;
    {
    + /* Incase the user pressed ctrl+c twice without the sim reacting kill it.
    + * This is incase the sim locks up in a high level routine, without executeing
    + * any (or) code */
    + /* FIXME: Don't kill the sim in handle_sim_command */
    + if(runtime.sim.iprompt)
    + sim_done();
    runtime.sim.iprompt = 1;
    signal(SIGINT, ctrl_c);
    }

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.