Skip to contentSkip to conversation

tools/hvmloader: link errno.h from xen internal

PATCH Superseded Tiejun Chen 2 participants 7 messages Nov 3, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/hvmloader: link errno.h from xen internal

We need to act on some specific hypercall error numbers, so require the hypervisor view on the errno.h value rather than just the build environment's number. So here link this headfile from xen.

---
v2:

* CCed more tools MAINTAINERS
* Rephrase long log
* Remove this line '@rm -rf errno.h' since we always force link
* Drop including this head file in util.c directly

 .gitignore                        | 1 +
 tools/firmware/hvmloader/Makefile | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
.gitignore +1 -0
index b24e905..52c3038 100644
@@ -127,6 +127,7 @@ tools/firmware/hvmloader/acpi/ssdt_*.h
 tools/firmware/hvmloader/hvmloader
 tools/firmware/hvmloader/roms.h
 tools/firmware/hvmloader/roms.inc
+tools/firmware/hvmloader/errno.h
 tools/firmware/rombios/BIOS-bochs-[^/]*
 tools/firmware/rombios/_rombios[^/]*_.c
 tools/firmware/rombios/rombios[^/]*.s
tools/firmware/hvmloader/Makefile +5 -2
index 46a79c5..333350b 100644
@@ -84,9 +84,12 @@ ROMS += $(SEABIOS_ROM)
 endif
 
 .PHONY: all
-all: subdirs-all
+all: subdirs-all .dir
 	$(MAKE) hvmloader
 
+.dir:
+	ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .
+
 ovmf.o rombios.o seabios.o hvmloader.o: roms.inc
 smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""
 
@@ -136,7 +139,7 @@ endif
 
 .PHONY: clean
 clean: subdirs-clean
-	rm -f roms.inc roms.inc.new acpi.h
+	rm -f roms.inc roms.inc.new acpi.h errno.h
 	rm -f hvmloader hvmloader.tmp *.o $(DEPS)
 
 -include $(DEPS)
Signature · 1 line
1.9.1
#1 lore raw

tools/firmware/hvmloader/Makefile ROMS += $(SEABIOS_ROM) · line 87

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 10:00, <[email protected]> wrote:
tools/firmware/hvmloader/Makefile +1 -1
@@ -84,9 +84,12 @@ ROMS += $(SEABIOS_ROM)
 endif
 
 .PHONY: all
-all: subdirs-all
+all: subdirs-all .dir

Considering uses going forward, I think subdirs-all should depend on .dir (which is being misnamed anyway, presumably due to blindly taking what is in tools/include/Makefile, where a directory _is_ being created). Considering that it's an individual file, the file name would seem quite right to be used as dependency here.

Jan

#2 lore raw
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 10:00, <[email protected]> wrote:
tools/firmware/hvmloader/Makefile +0 -0
@@ -84,9 +84,12 @@ ROMS += $(SEABIOS_ROM)
  endif
 
Quoted 8 lines

tools/firmware/hvmloader/Makefile ROMS += $(SEABIOS_ROM) · line 87

Quoted 3 lines
tools/firmware/hvmloader/Makefile +1 -1
  .PHONY: all
-all: subdirs-all
+all: subdirs-all .dir

Considering uses going forward, I think subdirs-all should depend on .dir (which is being misnamed anyway, presumably due to blindly taking what is in tools/include/Makefile, where a directory _is_ being created). Considering that it's an individual file, the file name would

You're right.

Quoted 1 line

seem quite right to be used as dependency here.

So what about this?

.PHONY: all
all: subdirs-all errno

    $(MAKE) hvmloader

errno:

    ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .

Thanks
Tiejun

#3 lore raw
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 11:05, <[email protected]> wrote:
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 10:00, <[email protected]> wrote:
tools/firmware/hvmloader/Makefile +0 -0
@@ -84,9 +84,12 @@ ROMS += $(SEABIOS_ROM)
  endif
 
Quoted 8 lines

tools/firmware/hvmloader/Makefile ROMS += $(SEABIOS_ROM) · line 87

Quoted 3 lines
tools/firmware/hvmloader/Makefile +1 -1
  .PHONY: all
-all: subdirs-all
+all: subdirs-all .dir

Considering uses going forward, I think subdirs-all should depend on .dir (which is being misnamed anyway, presumably due to blindly taking what is in tools/include/Makefile, where a directory _is_ being created). Considering that it's an individual file, the file name would

You're right.

Quoted 1 line

seem quite right to be used as dependency here.

Quoted 8 lines

So what about this?

.PHONY: all
all: subdirs-all errno

     $(MAKE) hvmloader

errno:

     ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .

This addresses just one of the points I made.

Jan

#4 lore raw
Quoted 23 lines · Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 11:05, <[email protected]> wrote:
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 10:00, <[email protected]> wrote:
tools/firmware/hvmloader/Makefile +0 -0
@@ -84,9 +84,12 @@ ROMS += $(SEABIOS_ROM)
   endif
 
Quoted 8 lines

tools/firmware/hvmloader/Makefile ROMS += $(SEABIOS_ROM) · line 87

Quoted 3 lines
tools/firmware/hvmloader/Makefile +1 -1
   .PHONY: all
-all: subdirs-all
+all: subdirs-all .dir

Considering uses going forward, I think subdirs-all should depend on .dir (which is being misnamed anyway, presumably due to blindly taking what is in tools/include/Makefile, where a directory _is_ being created). Considering that it's an individual file, the file name would

You're right.

Quoted 1 line

seem quite right to be used as dependency here.

So what about this?

Quoted 8 lines
Quoted 6 lines

.PHONY: all
all: subdirs-all errno

      $(MAKE) hvmloader

errno:

      ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .

This addresses just one of the points I made.

Are you saying that dependency?

@@ -87,6 +87,11 @@ endif
all: subdirs-all

        $(MAKE) hvmloader

+subdirs-all: errno
+
+errno:
+ ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .
+
ovmf.o rombios.o seabios.o hvmloader.o: roms.inc smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""

Thanks
Tiejun

#5 lore raw
Quoted 4 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 12:22, <[email protected]> wrote:

Are you saying that dependency?

tools/firmware/hvmloader/Makefile endif · line 96

Quoted 10 lines
tools/firmware/hvmloader/Makefile +5 -0
@@ -87,6 +87,11 @@ endif
  all: subdirs-all
         $(MAKE) hvmloader
 
+subdirs-all: errno
+
+errno:
+       ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .
+
  ovmf.o rombios.o seabios.o hvmloader.o: roms.inc
  smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""

Another step in the right direction. If now you also change the target to be "errno.h" instead of "errno", we'll have what we want.

Jan

#6 lore raw
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 03.11.14 at 12:22, <[email protected]> wrote:

Are you saying that dependency?

tools/firmware/hvmloader/Makefile +0 -0
@@ -87,6 +87,11 @@ endif
   all: subdirs-all
          $(MAKE) hvmloader
 
Quoted 11 lines

tools/firmware/hvmloader/Makefile ROMS += $(SEABIOS_ROM) · line 94

Quoted 7 lines
tools/firmware/hvmloader/Makefile +5 -0
+subdirs-all: errno
+
+errno:
+       ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .
+
   ovmf.o rombios.o seabios.o hvmloader.o: roms.inc
   smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""

Another step in the right direction. If now you also change the target to be "errno.h" instead of "errno", we'll have what we want.

Okay,

all: subdirs-all

        $(MAKE) hvmloader

+subdirs-all: errno.h
+
+errno.h:
+ ln -sf $(XEN_ROOT)/xen/include/xen/errno.h .
+
ovmf.o rombios.o seabios.o hvmloader.o: roms.inc smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""

If this is fine I will send next revision once some tools maintainer can give an acknowledge.

Thanks
Tiejun