diff --git a/Makefile b/Makefile index 143e6bdc..af456bc4 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,8 @@ KERNEL_SOURCES += $(wildcard kernel/arch/${ARCH}/*.S) # Kernel modules are one file = one module; if you want to build more complicated # modules, you could potentially use `ld -r` to turn multiple source objects into # a single relocatable object file. -MODULES = $(patsubst modules/%.c,$(BASE)/mod/%.ko,$(wildcard modules/*.c)) +ARCH_ENABLED_MODS = $(shell util/valid-modules.sh $(ARCH)) +MODULES = $(patsubst modules/%.c,$(BASE)/mod/%.ko,$(foreach mod,$(ARCH_ENABLED_MODS),modules/$(mod).c)) EMU = qemu-system-${ARCH} diff --git a/modules/ac97.c b/modules/ac97.c index 6ca00b3e..65703bcd 100644 --- a/modules/ac97.c +++ b/modules/ac97.c @@ -1,6 +1,7 @@ /** * @file kernel/audio/ac97.c * @brief Driver for the Intel AC'97. + * @package x86_64 * * Simple PCM interface for the AC'97 codec when used with the * ICH hardware interface. There are other hardware interfaces diff --git a/modules/ahci.c b/modules/ahci.c index 37cba95f..eb20f976 100644 --- a/modules/ahci.c +++ b/modules/ahci.c @@ -1,6 +1,7 @@ /** * @brief AHCI Block Device Driver * @file modules/ahci.c + * @package x86_64 * * @warning This is a stub driver. * diff --git a/modules/ata.c b/modules/ata.c index 5aebd959..9ad6536b 100644 --- a/modules/ata.c +++ b/modules/ata.c @@ -1,6 +1,7 @@ /** * @brief (P)ATA / IDE disk driver * @file modules/ata.c + * @package x86_64 * * @warning This is very buggy. * diff --git a/modules/dospart.c b/modules/dospart.c index 700fb325..e829aa72 100644 --- a/modules/dospart.c +++ b/modules/dospart.c @@ -1,6 +1,7 @@ /** * @file modules/dospart.c * @brief DOS MBR partition table mapper + * @package x86_64 * * Provides partition entries for disks. * diff --git a/modules/e1000.c b/modules/e1000.c index 327c9430..9002dd35 100644 --- a/modules/e1000.c +++ b/modules/e1000.c @@ -1,6 +1,7 @@ /** * @file kernel/net/e1000.c * @brief Intel Gigabit Ethernet device driver + * @package x86_64 * * @copyright * This file is part of ToaruOS and is released under the terms diff --git a/modules/es1371.c b/modules/es1371.c index c6a63d61..c5b2b660 100644 --- a/modules/es1371.c +++ b/modules/es1371.c @@ -1,6 +1,7 @@ /** * @file kernel/audio/es1371.c * @brief Driver for the Ensoniq ES1371. + * @package x86_64 * * @ref http://www.vogons.org/download/file.php?id=13036&sid=30df81e15e2521deb842a79f451b1161 * diff --git a/modules/ext2.c b/modules/ext2.c index db40b3b3..6bc4206b 100644 --- a/modules/ext2.c +++ b/modules/ext2.c @@ -1,6 +1,7 @@ /** * @file modules/ext2.c * @brief Implementation of the Ext2 filesystem. + * @package x86_64 * * @warning There are many known bugs in this implementation. * diff --git a/modules/hda.c b/modules/hda.c index 543f302a..07777c1e 100644 --- a/modules/hda.c +++ b/modules/hda.c @@ -1,6 +1,7 @@ /** * @file kernel/audio/hda.c * @brief Driver for the Intel High Definition Audio. + * @package x86_64 * * @warning This is a stub driver. * diff --git a/modules/i965.c b/modules/i965.c index 2be65f9a..6cdb1bfd 100644 --- a/modules/i965.c +++ b/modules/i965.c @@ -1,6 +1,7 @@ /** * @file modules/i965.c * @brief Bitbanged modeset driver for a ThinkPad T410's Intel graphics. + * @package x86_64 * * This is NOT a viable driver for Intel graphics devices. It assumes Vesa * has already properly set up the display pipeline with the needed timings diff --git a/modules/iso9660.c b/modules/iso9660.c index b5d9892f..4153c368 100644 --- a/modules/iso9660.c +++ b/modules/iso9660.c @@ -1,6 +1,7 @@ /** * @file modules/iso9660.c * @brief ISO9660 "High Sierra" CD file system driver. + * @package x86_64 * * @copyright * This file is part of ToaruOS and is released under the terms diff --git a/modules/pcspkr.c b/modules/pcspkr.c index 28c58015..e7075636 100644 --- a/modules/pcspkr.c +++ b/modules/pcspkr.c @@ -1,6 +1,7 @@ /** * @file modules/pcspkr.c * @brief PC beeper device interface + * @package x86_64 * * Use with @ref apps/beep.c to play music. * diff --git a/modules/piix4.c b/modules/piix4.c index 4e80118b..392ed188 100644 --- a/modules/piix4.c +++ b/modules/piix4.c @@ -1,6 +1,7 @@ /** * @file modules/piix4.c * @brief Intel PIIX4 ISA Bridge Driver + * @package x86_64 * * @copyright * This file is part of ToaruOS and is released under the terms diff --git a/modules/test.c b/modules/test.c index 0ca4507a..879f43a3 100644 --- a/modules/test.c +++ b/modules/test.c @@ -1,6 +1,8 @@ /** * @file modules/test.c * @brief Test module. + * @package x86_64 + * @package aarch64 * * Load with various arguments to do things like crash the * kernel or print tracebacks. diff --git a/modules/vbox.c b/modules/vbox.c index f4b42932..e1a22736 100644 --- a/modules/vbox.c +++ b/modules/vbox.c @@ -1,6 +1,7 @@ /** * @file kernel/arch/x86_64/vbox.c * @brief VirtualBox Guest Additions driver + * @package x86_64 * * Implements the following features: * - Absolute mouse cursor positioning diff --git a/modules/vmware.c b/modules/vmware.c index 67241051..81aa92bb 100644 --- a/modules/vmware.c +++ b/modules/vmware.c @@ -1,6 +1,7 @@ /** * @file kernel/arch/x86_64/vmware.c * @brief VMware/QEMU mouse and VMWare backdoor driver. + * @package x86_64 * * Supports absolute mouse cursor and resolution setting. * @@ -34,7 +35,6 @@ #include #include -#ifdef __x86_64__ #include #define VMWARE_MAGIC 0x564D5868 /* hXMV */ @@ -522,4 +522,3 @@ struct Module metadata = { .fini = fini, }; -#endif diff --git a/modules/xhci.c b/modules/xhci.c index d235a277..762f2f2a 100644 --- a/modules/xhci.c +++ b/modules/xhci.c @@ -1,6 +1,7 @@ /** * @brief xHCI Host Controller Driver * @file modules/xhci.c + * @package x86_64 * * @warning This is a stub driver. * diff --git a/util/valid-modules.sh b/util/valid-modules.sh new file mode 100755 index 00000000..36120f63 --- /dev/null +++ b/util/valid-modules.sh @@ -0,0 +1,9 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +for mod in $DIR/../modules/*.c; do + fgrep -q "@package $1" "$mod" || continue + echo -n $mod | sed s'#.*/\([^/]*\)\.c#\1 #' +done + +echo