]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libsigma0/lib/src/tbuf.c
5c3521587d9a089ec8066a6101e9ab4159fbcb9e
[l4.git] / l4 / pkg / libsigma0 / lib / src / tbuf.c
1 /**
2  * \file        sigma0/lib/src/tbuf.c
3  * \brief       map tracebuffer descriptor using sigma0 protocol
4  *
5  * \date        02/2006
6  * \author      Frank Mehnert <fm3@os.inf.tu-dresden.de> */
7
8 /*
9  * (c) 2006-2009 Technische Universität Dresden
10  * This file is part of TUD:OS and distributed under the terms of the
11  * GNU Lesser General Public License 2.1.
12  * Please see the COPYING-LGPL-2.1 file for details.
13  */
14
15 #include <l4/sys/ipc.h>
16 #include <l4/sigma0/sigma0.h>
17
18 /**
19  * Map the Fiasco tracebuffer status descriptor using the Sigma0 protocol.
20  *
21  * \param pager  pager implementing the Sigma0 protocol
22  * \param virt   virtual address the descriptor should be mapped to
23  * \return  #0                 on success
24  *         -#L4SIGMA0_IPCERROR IPC error
25  *         -#L4SIGMA0_NOFPAGE  no fpage received
26  */
27 int
28 l4sigma0_map_tbuf(l4_cap_idx_t pager, l4_addr_t virt)
29 {
30   //assert(0);
31   // hand-made assert:
32   __builtin_trap();
33   (void)pager;
34   (void)virt;
35 #if 0
36   l4_msgdope_t result;
37   int error;
38   l4_msgtag_t tag = l4_msgtag(L4_MSGTAG_SIGMA0, 0, 0, 0);
39
40   error = l4_ipc_call(pager, tag, L4_IPC_NEVER, &result, &tag);
41
42   if (error)
43     return -L4SIGMA0_IPCERROR;
44
45   if (fpage.fpage == 0 || !l4_ipc_fpage_received(result))
46     return -L4SIGMA0_NOFPAGE;
47 #endif
48   return 0;
49 }