Skip to content

Commit

Permalink
OS-7199 bhyve upstream sync 2018 Sept
Browse files Browse the repository at this point in the history
Reviewed by: Mike Gerdts <mike.gerdts@joyent.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Reviewed by: Mike Zeller <mike.zeller@joyent.com>
Approved by: Mike Zeller <mike.zeller@joyent.com>
  • Loading branch information
pfmooney committed Nov 1, 2018
1 parent 0817290 commit 6382b25
Show file tree
Hide file tree
Showing 88 changed files with 7,788 additions and 620 deletions.
1,506 changes: 1,506 additions & 0 deletions usr/contrib/freebsd/dev/nvme/nvme.h

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions usr/src/cmd/bhyve/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ SRCS = acpi.c \
pci_hostbridge.c \
pci_irq.c \
pci_lpc.c \
pci_nvme.c \
pci_passthru.c \
pci_uart.c \
pci_virtio_block.c \
Expand All @@ -76,8 +77,16 @@ SRCS = acpi.c \
vmm_instruction_emul.c \
xmsr.c \
spinup_ap.c \
iov.c \
bhyve_sol_glue.c

# The virtio-scsi driver appears to include a slew of materials from FreeBSD's
# native SCSI implementation. We will omit that complexity for now.
#ctl_util.c \
#ctl_scsi_all.c \
#pci_virtio_scsi.c \

OBJS = $(SRCS:.c=.o)

CLOBBERFILES = $(ROOTUSRSBINPROG) $(ZHYVE)
Expand Down Expand Up @@ -109,6 +118,13 @@ CPPFLAGS = -I$(COMPAT)/freebsd -I$(CONTRIB)/freebsd \
# Disable the crypto code until it is wired up
CPPFLAGS += -DNO_OPENSSL

pci_nvme.o := CERRWARN += -_gcc=-Wno-pointer-sign

# Force c99 for everything
CSTD= $(CSTD_GNU99)
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all

$(PROG) := LDLIBS += -lsocket -lnsl -ldlpi -ldladm -lmd -luuid -lvmmapi -lz
$(ZHYVE_PROG) := LDLIBS += -lnvpair
$(MEVENT_TEST_PROG) := LDLIBS += -lsocket
Expand Down
43 changes: 6 additions & 37 deletions usr/src/cmd/bhyve/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,14 @@ struct basl_fio {
};

#define EFPRINTF(...) \
err = fprintf(__VA_ARGS__); if (err < 0) goto err_exit;
if (fprintf(__VA_ARGS__) < 0) goto err_exit;

#define EFFLUSH(x) \
err = fflush(x); if (err != 0) goto err_exit;
if (fflush(x) != 0) goto err_exit;

static int
basl_fwrite_rsdp(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve RSDP template\n");
EFPRINTF(fp, " */\n");
Expand All @@ -156,10 +152,6 @@ basl_fwrite_rsdp(FILE *fp)
static int
basl_fwrite_rsdt(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve RSDT template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -196,10 +188,6 @@ basl_fwrite_rsdt(FILE *fp)
static int
basl_fwrite_xsdt(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve XSDT template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -236,11 +224,8 @@ basl_fwrite_xsdt(FILE *fp)
static int
basl_fwrite_madt(FILE *fp)
{
int err;
int i;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve MADT template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -326,10 +311,6 @@ basl_fwrite_madt(FILE *fp)
static int
basl_fwrite_fadt(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve FADT template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -547,10 +528,6 @@ basl_fwrite_fadt(FILE *fp)
static int
basl_fwrite_hpet(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve HPET template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -596,8 +573,6 @@ basl_fwrite_hpet(FILE *fp)
static int
basl_fwrite_mcfg(FILE *fp)
{
int err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve MCFG template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -629,10 +604,6 @@ basl_fwrite_mcfg(FILE *fp)
static int
basl_fwrite_facs(FILE *fp)
{
int err;

err = 0;

EFPRINTF(fp, "/*\n");
EFPRINTF(fp, " * bhyve FACS template\n");
EFPRINTF(fp, " */\n");
Expand Down Expand Up @@ -666,7 +637,6 @@ void
dsdt_line(const char *fmt, ...)
{
va_list ap;
int err = 0;

if (dsdt_error != 0)
return;
Expand All @@ -675,8 +645,10 @@ dsdt_line(const char *fmt, ...)
if (dsdt_indent_level != 0)
EFPRINTF(dsdt_fp, "%*c", dsdt_indent_level * 2, ' ');
va_start(ap, fmt);
if (vfprintf(dsdt_fp, fmt, ap) < 0)
if (vfprintf(dsdt_fp, fmt, ap) < 0) {
va_end(ap);
goto err_exit;
}
va_end(ap);
}
EFPRINTF(dsdt_fp, "\n");
Expand Down Expand Up @@ -735,9 +707,6 @@ dsdt_fixed_mem32(uint32_t base, uint32_t length)
static int
basl_fwrite_dsdt(FILE *fp)
{
int err;

err = 0;
dsdt_fp = fp;
dsdt_error = 0;
dsdt_indent_level = 0;
Expand Down Expand Up @@ -916,7 +885,7 @@ basl_make_templates(void)
int len;

err = 0;

/*
*
*/
Expand Down
Loading

0 comments on commit 6382b25

Please sign in to comment.