blob: 4e47c06fea3d3f1f61bf31928234b0c787537b8c [file] [log] [blame]
/******************************************************************************
* Copyright (c) 2004, 2008 IBM Corporation
* All rights reserved.
* This program and the accompanying materials
* are made available under the terms of the BSD License
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/bsd-license.php
*
* Contributors:
* IBM Corporation - initial implementation
*****************************************************************************/
#include <libhvcall.h>
// : hv-putchar ( char -- )
PRIM(hv_X2d_putchar)
char c = TOS.n; POP;
hv_putchar(c);
MIRP
// : hv-getchar ( -- char )
PRIM(hv_X2d_getchar)
PUSH;
TOS.n = hv_getchar();
MIRP
// : hv-haschar ( -- res )
PRIM(hv_X2d_haschar)
PUSH;
TOS.n = hv_haschar();
MIRP
// : hv-reg-crq ( unit qaddr qsize -- res )
PRIM(hv_X2d_reg_X2d_crq)
unsigned long qsize = TOS.u; POP;
unsigned long qaddr = TOS.u; POP;
unsigned int unit = TOS.u;
TOS.n = hv_reg_crq(unit, qaddr, qsize);
MIRP
// : hv-free-crq ( unit -- )
PRIM(hv_X2d_free_X2d_crq)
unsigned int unit = TOS.u; POP;
hv_free_crq(unit);
MIRP
// : hv-send-crq ( unit msgaddr -- rc )
PRIM(hv_X2d_send_X2d_crq)
uint64_t *msgaddr = (uint64_t *)TOS.u; POP;
unsigned int unit = TOS.u;
TOS.n = hv_send_crq(unit, msgaddr);
MIRP