nvmm: Fix building nvmm into kernel
authorAaron LI <aly@aaronly.me>
Wed, 21 Jul 2021 06:53:38 +0000 (14:53 +0800)
committerAaron LI <aly@aaronly.me>
Wed, 21 Jul 2021 08:28:06 +0000 (16:28 +0800)
commit11755db6b4ad8e01f32f277b591496121e03fc5d
treeb6e882c8762d21c9be53b9bcf84e1f11cb78c57a
parentae46c1640fd9f8c4ae021ca4d591411738a7cb31
nvmm: Fix building nvmm into kernel

* Remove 'DIAGNOSTIC' define from 'nvmm_os.h'.  First, 'DIAGNOSTIC' and
  'INVARIANTS' are different options.  Secondly, 'DIAGNOSTIC' should be
  defined in kernel configs, e.g., LINT64 defines it.
* Remove 'LOCORE' define from 'nvmm_x86_{svmfunc,vmxfunc}.S'.  It's
  already defined on the command line, when compiling ASM source files
  with the kernel (i.e., building the module into the kernel).
* Manually define 'LOCORE' for 'nvmm_x86_{svmfunc,vmxfunc}.o'
  compilation in the Makefile, fixing building as a standalone module.

This fixes building nvmm into kernel, like LINT64.

Thanks swildner for reporting the issue and helping with the fix.
sys/dev/virtual/nvmm/Makefile
sys/dev/virtual/nvmm/nvmm_os.h
sys/dev/virtual/nvmm/x86/nvmm_x86_svmfunc.S
sys/dev/virtual/nvmm/x86/nvmm_x86_vmxfunc.S