| OLD | NEW |
| 1 /* syscalls.c --- implement system calls for the RX simulator. | 1 /* syscalls.c --- implement system calls for the RX simulator. |
| 2 | 2 |
| 3 Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2005, 2007-2012 Free Software Foundation, Inc. |
| 4 Contributed by Red Hat, Inc. | 4 Contributed by Red Hat, Inc. |
| 5 | 5 |
| 6 This file is part of the GNU simulators. | 6 This file is part of the GNU simulators. |
| 7 | 7 |
| 8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
| 9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
| 10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 /* The current syscall callbacks we're using. */ | 37 /* The current syscall callbacks we're using. */ |
| 38 static struct host_callback_struct *callbacks; | 38 static struct host_callback_struct *callbacks; |
| 39 | 39 |
| 40 void | 40 void |
| 41 set_callbacks (struct host_callback_struct *cb) | 41 set_callbacks (struct host_callback_struct *cb) |
| 42 { | 42 { |
| 43 callbacks = cb; | 43 callbacks = cb; |
| 44 } | 44 } |
| 45 | 45 |
| 46 struct host_callback_struct * |
| 47 get_callbacks (void) |
| 48 { |
| 49 return callbacks; |
| 50 } |
| 51 |
| 46 | 52 |
| 47 /* Arguments 1..4 are in R1..R4, remainder on stack. | 53 /* Arguments 1..4 are in R1..R4, remainder on stack. |
| 48 | 54 |
| 49 Return value in R1..R4 as needed. | 55 Return value in R1..R4 as needed. |
| 50 structs bigger than 16 bytes: pointer pushed on stack last | 56 structs bigger than 16 bytes: pointer pushed on stack last |
| 51 | 57 |
| 52 We only support arguments that fit in general registers. | 58 We only support arguments that fit in general registers. |
| 53 | 59 |
| 54 The system call number is in R5. We expect ssycalls to look like | 60 The system call number is in R5. We expect ssycalls to look like |
| 55 this in libgloss: | 61 this in libgloss: |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 case 255: | 304 case 255: |
| 299 { | 305 { |
| 300 int addr = arg (); | 306 int addr = arg (); |
| 301 mem_put_si (addr, rx_cycles + mem_usage_cycles()); | 307 mem_put_si (addr, rx_cycles + mem_usage_cycles()); |
| 302 } | 308 } |
| 303 break; | 309 break; |
| 304 | 310 |
| 305 } | 311 } |
| 306 return RX_MAKE_STEPPED (); | 312 return RX_MAKE_STEPPED (); |
| 307 } | 313 } |
| OLD | NEW |