Changeset 26e7d6d in mainline for uspace/lib/c/arch/mips64/src/syscall.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/mips64/src/syscall.c
r3842a955 r26e7d6d 1 1 /* 2 * Copyright (c) 2006 Ondrej Palkovsky 3 * Copyright (c) 2008 Martin Decky 2 * Copyright (c) 2005 Martin Decky 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @defgroup msimfb MSIM text console 31 * @brief HelenOS MSIM text console. 32 * @ingroup fbs 29 /** @addtogroup libcmips64 33 30 * @{ 34 31 */ 35 32 /** @file 33 * @ingroup libcmips64 36 34 */ 37 35 38 #include <async.h>39 36 #include <libc.h> 40 #include <sysinfo.h>41 #include <as.h>42 #include <ddi.h>43 #include <errno.h>44 37 45 #include "serial_console.h" 46 #include "msim.h" 47 48 #define WIDTH 80 49 #define HEIGHT 24 50 51 static char *virt_addr; 52 53 static void msim_putc(const char c) 38 sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, 39 const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) 54 40 { 55 *virt_addr = c; 56 } 57 58 int msim_init(void) 59 { 60 sysarg_t phys_addr; 61 if (sysinfo_get_value("fb.address.physical", &phys_addr) != EOK) 62 return -1; 41 register sysarg_t __mips_reg_a0 asm("$4") = p1; 42 register sysarg_t __mips_reg_a1 asm("$5") = p2; 43 register sysarg_t __mips_reg_a2 asm("$6") = p3; 44 register sysarg_t __mips_reg_a3 asm("$7") = p4; 45 register sysarg_t __mips_reg_t0 asm("$8") = p5; 46 register sysarg_t __mips_reg_t1 asm("$9") = p6; 47 register sysarg_t __mips_reg_v0 asm("$2") = id; 63 48 64 virt_addr = (char *) as_get_mappable_page(1); 49 asm volatile ( 50 "syscall\n" 51 : "=r" (__mips_reg_v0) 52 : "r" (__mips_reg_a0), 53 "r" (__mips_reg_a1), 54 "r" (__mips_reg_a2), 55 "r" (__mips_reg_a3), 56 "r" (__mips_reg_t0), 57 "r" (__mips_reg_t1), 58 "r" (__mips_reg_v0) 59 /* 60 * We are a function call, although 61 * C does not know it 62 */ 63 : "%ra" 64 ); 65 65 66 if (physmem_map((void *) phys_addr, virt_addr, 1, 67 AS_AREA_READ | AS_AREA_WRITE) != 0) 68 return -1; 69 70 serial_console_init(msim_putc, WIDTH, HEIGHT); 71 72 async_set_client_connection(serial_client_connection); 73 return 0; 66 return __mips_reg_v0; 74 67 } 75 68
Note:
See TracChangeset
for help on using the changeset viewer.