1/*
2 * Copyright (c) 2014 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10#ifndef XEON_PHI_MANAGER_CLIENT_H
11#define XEON_PHI_MANAGER_CLIENT_H
12
13/*
14 * ----------------------------------------------------------------------------
15 * This library is to be used solely by the Xeon Phi drivers to talk to the
16 * Xeon Phi manager domain in order to setup the Xeon Phi IDs and the
17 * inter-Xeon Phi driver connections.
18 * ----------------------------------------------------------------------------
19 */
20
21
22/**
23 * \brief registers the Xeon Phi driver card with the Xeon Phi Manager
24 *
25 * \param svc_iref  iref of the own exported Xeon Phi driver interface
26 * \param id        returns the assigned Xeon Phi card ID
27 * \param num       returns the size of the cards array
28 * \param irefs     returns array of irefs to the other cards
29 *
30 * NOTE: this is a blocking function. The function will only return after
31 *       the Xeon Phi manager connection has been fully established and the
32 *       registration protocol has been executed.
33 *
34 * \returns SYS_ERR_OK on success
35 *          errval on failure
36 */
37errval_t xeon_phi_manager_client_register(iref_t svc_iref,
38                                          uint8_t *id,
39                                          uint8_t *num,
40                                          iref_t **irefs);
41
42/**
43 * \brief  deregisters the Xeon Phi driver with the Xeon Phi Manager
44 *
45 * \return SYS_ERR_OK on success
46 *         errval on failure
47 */
48errval_t xeon_phi_manager_client_deregister(void);
49
50/**
51 * \brief looks up the iref of a Xeon Phi with the given id
52 *
53 * \param xid       Xeon Phi ID
54 * \param svc_iref  the returned svc_iref of the xeon phi
55 *
56 * \returns SYS_ERR_OK on success
57 */
58errval_t xeon_phi_manager_lookup(xphi_id_t xid,
59                                 iref_t *svc_iref);
60
61#endif // XEON_PHI_MANAGER_CLIENT_H
62