Mercurial > hg > CbC > CbC_xv6
view src/impl/KernelRetImpl.cbc @ 381:874577d7505f
fix parse for interface
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 20 Jul 2020 15:00:11 +0900 |
parents | d67449aae7cd |
children |
line wrap: on
line source
#include "types.h" #include "arm.h" #include "param.h" #include "syscall.h" #include "proc.h" #interface "KernelRet.h" // ---- // typedef struct KernelRetImpl <Type, Isa> impl KernelRet { // __code next(....); // } KernelRetImpl; // ---- KernelRet* createKernelRetImpl(struct Context* cbc_context) { struct KernelRet* kernelRet = new KernelRet(); struct KernelRetImpl* kernelRet_impl = new KernelRetImpl(); kernelRet->kernelRet = (union Data*)kernelRet_impl; kernelRet->cbc_return = C_cbc_returnKernelRetImpl; kernelRet->exit = C_exitKernelRetImpl; kernelRet->swtch = C_swtchKernelRetImpl; return kernelRet; } extern __code trapret(void); __code cbc_returnKernelRetImpl(struct KernelRetImpl* kernelRet, int ret, __code next(...)) { int num = proc->cbc_arg.cbc_console_arg.num; if (num != SYS_exec) { proc->tf->r0 = ret; } goto trapret(); } extern __code exit(void); __code exitKernelRetImpl(struct KernelRetImpl* kernelRet, __code next(...)) { goto exit(); } extern __code swtch(void); __code swtchKernelRetImpl(struct KernelRetImpl* kernelRet, __code next(...)) { goto swtch(); }