Deleted Added
full compact
smbiostbl.c (262744) smbiostbl.c (267811)
1/*-
2 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Tycho Nightingale <tycho.nightingale@pluribusnetworks.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/usr.sbin/bhyve/smbiostbl.c 262744 2014-03-04 17:12:06Z tychon $");
28__FBSDID("$FreeBSD: head/usr.sbin/bhyve/smbiostbl.c 267811 2014-06-24 02:02:51Z neel $");
29
30#include <sys/param.h>
31
32#include <assert.h>
33#include <errno.h>
34#include <md5.h>
35#include <stdio.h>
36#include <string.h>

--- 737 unchanged lines hidden (view full) ---

774{
775 struct smbios_entry_point *smbios_ep;
776 uint16_t n;
777 uint16_t maxssize;
778 char *curaddr, *startaddr, *ststartaddr;
779 int i;
780 int err;
781
29
30#include <sys/param.h>
31
32#include <assert.h>
33#include <errno.h>
34#include <md5.h>
35#include <stdio.h>
36#include <string.h>

--- 737 unchanged lines hidden (view full) ---

774{
775 struct smbios_entry_point *smbios_ep;
776 uint16_t n;
777 uint16_t maxssize;
778 char *curaddr, *startaddr, *ststartaddr;
779 int i;
780 int err;
781
782 err = vm_get_memory_seg(ctx, 0, &guest_lomem, NULL);
783 if (err != 0)
784 return (err);
782 guest_lomem = vm_get_lowmem_size(ctx);
783 guest_himem = vm_get_highmem_size(ctx);
785
784
786 err = vm_get_memory_seg(ctx, 4*GB, &guest_himem, NULL);
787 if (err != 0)
788 return (err);
789
790 startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH);
791 if (startaddr == NULL) {
792 fprintf(stderr, "smbios table requires mapped mem\n");
793 return (ENOMEM);
794 }
795
796 curaddr = startaddr;
797

--- 35 unchanged lines hidden ---
785 startaddr = paddr_guest2host(ctx, SMBIOS_BASE, SMBIOS_MAX_LENGTH);
786 if (startaddr == NULL) {
787 fprintf(stderr, "smbios table requires mapped mem\n");
788 return (ENOMEM);
789 }
790
791 curaddr = startaddr;
792

--- 35 unchanged lines hidden ---