mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Keep the dummy handlers for restrict, map_resource and unmap_resource
for MiniOS, or else the build breaks with:
ld: /home/osstest/build.158759.build-amd64/xen/stubdom/mini-os-x86_64-xenstore/mini-os.o: in function `xenforeignmemory_restrict':
/home/osstest/build.158759.build-amd64/xen/stubdom/libs-x86_64/foreignmemory/core.c:137: undefined reference to `osdep_xenforeignmemory_restrict'
ld: /home/osstest/build.158759.build-amd64/xen/stubdom/mini-os-x86_64-xenstore/mini-os.o: in function `xenforeignmemory_map_resource':
/home/osstest/build.158759.build-amd64/xen/stubdom/libs-x86_64/foreignmemory/core.c:171: undefined reference to `osdep_xenforeignmemory_map_resource'
ld: /home/osstest/build.158759.build-amd64/xen/stubdom/mini-os-x86_64-xenstore/mini-os.o: in function `xenforeignmemory_unmap_resource':
/home/osstest/build.158759.build-amd64/xen/stubdom/libs-x86_64/foreignmemory/core.c:185: undefined reference to `osdep_xenforeignmemory_unmap_resource'
ld: /home/osstest/build.158759.build-amd64/xen/stubdom/mini-os-x86_64-xenstore/mini-os.o: in function `xenforeignmemory_resource_size':
/home/osstest/build.158759.build-amd64/xen/stubdom/libs-x86_64/foreignmemory/core.c:200: undefined reference to `osdep_xenforeignmemory_map_resource'
Fixes: 2b4b33ffe7 ('libs/foreignmemory: Implement on NetBSD')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
100 lines
2.7 KiB
C
100 lines
2.7 KiB
C
#ifndef XENFOREIGNMEMORY_PRIVATE_H
|
|
#define XENFOREIGNMEMORY_PRIVATE_H
|
|
|
|
#include <xentoollog.h>
|
|
|
|
#include <xenforeignmemory.h>
|
|
|
|
#include <xentoolcore_internal.h>
|
|
|
|
#include <xen/xen.h>
|
|
#include <xen/sys/privcmd.h>
|
|
|
|
#ifndef PAGE_SHIFT /* Mini-os, Yukk */
|
|
#define PAGE_SHIFT 12
|
|
#endif
|
|
#ifndef __MINIOS__ /* Yukk */
|
|
#define PAGE_SIZE (1UL << PAGE_SHIFT)
|
|
#define PAGE_MASK (~(PAGE_SIZE-1))
|
|
#endif
|
|
|
|
struct xenforeignmemory_handle {
|
|
xentoollog_logger *logger, *logger_tofree;
|
|
unsigned flags;
|
|
int fd;
|
|
Xentoolcore__Active_Handle tc_ah;
|
|
int unimpl_errno;
|
|
};
|
|
|
|
int osdep_xenforeignmemory_open(xenforeignmemory_handle *fmem);
|
|
int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
|
|
|
|
void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
|
|
uint32_t dom, void *addr,
|
|
int prot, int flags, size_t num,
|
|
const xen_pfn_t arr[num], int err[num]);
|
|
int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
|
|
void *addr, size_t num);
|
|
|
|
#if defined(__sun__)
|
|
/* Strictly compat for those two only only */
|
|
void *osdep_map_foreign_batch(xenforeignmemory_handle *fmem, uint32_t dom,
|
|
void *addr, int prot, int flags,
|
|
xen_pfn_t *arr, int num);
|
|
#endif
|
|
|
|
struct xenforeignmemory_resource_handle {
|
|
domid_t domid;
|
|
unsigned int type;
|
|
unsigned int id;
|
|
unsigned long frame;
|
|
unsigned long nr_frames;
|
|
void *addr;
|
|
int prot;
|
|
int flags;
|
|
};
|
|
|
|
#if defined(__sun__) || defined(__MINIOS__)
|
|
static inline int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
|
|
domid_t domid)
|
|
{
|
|
errno = EOPNOTSUPP;
|
|
return -1;
|
|
}
|
|
|
|
static inline int osdep_xenforeignmemory_map_resource(
|
|
xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
|
|
{
|
|
errno = EOPNOTSUPP;
|
|
return -1;
|
|
}
|
|
|
|
static inline int osdep_xenforeignmemory_unmap_resource(
|
|
xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres)
|
|
{
|
|
return 0;
|
|
}
|
|
#else
|
|
int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,
|
|
domid_t domid);
|
|
int osdep_xenforeignmemory_map_resource(
|
|
xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres);
|
|
int osdep_xenforeignmemory_unmap_resource(
|
|
xenforeignmemory_handle *fmem, xenforeignmemory_resource_handle *fres);
|
|
#endif
|
|
|
|
#define PERROR(_f...) \
|
|
xtl_log(fmem->logger, XTL_ERROR, errno, "xenforeignmemory", _f)
|
|
|
|
#endif
|
|
|
|
/*
|
|
* Local variables:
|
|
* mode: C
|
|
* c-file-style: "BSD"
|
|
* c-basic-offset: 4
|
|
* tab-width: 4
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*/
|