Skip to contentSkip to conversation

Target_Core_Mod Makefile/Kconfig and div64.c

RFC PATCH Superseded Nicholas A. Bellinger 2 participants 3 messages Sep 12, 2009 – Sep 14, 2009

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 19/19 Target_Core_Mod Makefile/Kconfig and div64.c

[RFC PATCH 19/19] Target_Core_Mod Makefile/Kconfig and div64.c

This patch adds the remaining misc Makefile and Kconfig changes

It also has wrappers for unsigned long division in div64c, that will be converted to include/asm-generic/div64.h

drivers/target/div64.c new file +16 -0
new file mode 100644
index 0000000..6d59864
@@ -0,0 +1,16 @@
+#include <asm/types.h>
+#include <asm/div64.h>
+
+#if BITS_PER_LONG == 32
+
+u64 __udivdi3(u64 a, u64 b)
+{
+  do_div(a, b);
+  return a;
+}
+
+u64 __umoddi3(u64 a, u64 b)
+{
+  return do_div(a, b);
+}
+#endif
drivers/target/Makefile new file +96 -0

96 lines not on this page · raw message

drivers/target/Kconfig new file +7 -0
new file mode 100644
index 0000000..04564f1
@@ -0,0 +1,7 @@
+config TARGET_CORE
+        tristate "Generic Target Core Engine and ConfigFS Infrastructure"
+	select CONFIGFS_FS
+	select SCSI_TGT
+        default m
+        ---help---
+        Say Y here to enable the Storage Engine, Subsystem Plugins, and ConfigFS enabled control path for the Generic Target Engine.
#1 lore raw

drivers/target/Makefile

Quoted 31 lines · Nicholas A. Bellinger

[RFC PATCH 19/19] Target_Core_Mod Makefile/Kconfig and div64.c

This patch adds the remaining misc Makefile and Kconfig changes

It also has wrappers for unsigned long division in div64c, that will be converted to include/asm-generic/div64.h

drivers/target/div64.c new file +16 -0
new file mode 100644
index 0000000..6d59864
@@ -0,0 +1,16 @@
+#include <asm/types.h>
+#include <asm/div64.h>
+
+#if BITS_PER_LONG == 32
+
+u64 __udivdi3(u64 a, u64 b)
+{
+  do_div(a, b);
+  return a;
+}
+
+u64 __umoddi3(u64 a, u64 b)
+{
+  return do_div(a, b);
+}
+#endif
drivers/target/Makefile +0 -0

I like Kbuild better then Makefile. And so does the Kernel documentation. It says new code should use Kbuild

Quoted 17 lines

new file mode 100644
index 0000000..3e413b0

drivers/target/Makefile new file +12 -0
@@ -0,0 +1,96 @@
+CWD=$(shell pwd)
+
+PYX_ISCSI_VENDOR ?="Linux-iSCSI.org"
+
+# Transport Plugins and Devices.
+ #
+LINUX_PARALLEL_SCSI ?= 1
+LINUX_STGT ?= 1
+LINUX_SCSI_MEDIA_ROM ?= 1
+LINUX_PARALLEL_ATA ?= 0
+LINUX_IBLOCK ?= 1
+LINUX_RAMDISK ?= 1

drivers/target/Makefile line 22

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+LINUX_FILEIO ?= 1
+
+LINUX_VPD_PAGE_CHECK?=1
+LIO_TARGET_CONFIGFS?=1
+
+MODVER ?= 1
+USEGDB ?= 1
+DEBUG_DEV ?= 0
+SNMP_FEATURE ?= 1
+

Now when in-Kernel don't you need to use Kconfig for all this "configuration".

What's with the re-invent the wheel, here.

Quoted 39 lines
drivers/target/Makefile new file +39 -0
+obj-$(CONFIG_TARGET_CORE)		+=	target_core_mod.o
+target_core_mod-objs			:=	target_core_configfs.o \
+						target_core_device.o \
+						target_core_hba.o \
+						target_core_plugin.o \
+						target_core_pr.o \
+						target_core_alua.o \
+						target_core_scdb.o \
+						target_core_seobj.o \
+						target_core_tmr.o \
+						target_core_tpg.o \
+						target_core_transport.o \
+						target_core_ua.o \
+						div64.o
+
+ifeq ($(LINUX_IBLOCK), 1)
+target_core_mod-objs			+=	target_core_iblock.o
+EXTRA_CFLAGS				+=	-DPYX_IBLOCK
+endif
+ifeq ($(LINUX_PARALLEL_SCSI), 1)
+target_core_mod-objs			+=	target_core_pscsi.o
+EXTRA_CFLAGS				+=	-DPARALLEL_SCSI
+endif
+ifeq ($(LINUX_STGT), 1)
+target_core_mod-objs			+=	target_core_stgt.o
+EXTRA_CFLAGS				+=	-DSTGT_PLUGIN
+endif
+ifeq ($(LINUX_RAMDISK), 1)
+target_core_mod-objs			+=	target_core_rd.o
+EXTRA_CFLAGS				+=	-DPYX_RAMDISK
+endif
+ifeq ($(LINUX_FILEIO), 1)
+target_core_mod-objs			+=	target_core_file.o
+EXTRA_CFLAGS				+=	-DPYX_FILEIO
+endif
+ifeq ($(SNMP_FEATURE), 1)
+target_core_mod-objs			+=	target_core_mib.o
+EXTRA_CFLAGS				+=	-DSNMP_SUPPORT
+endif

drivers/target/Makefile line 71

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+ifeq ($(LINUX_VPD_PAGE_CHECK), 1)
+EXTRA_CFLAGS += -DLINUX_VPD_PAGE_CHECK
+endif
+ifeq ($(LINUX_SCSI_MEDIA_ROM), 1)
+EXTRA_CFLAGS += -DLINUX_SCSI_MEDIA_ROM
+endif
+ifeq ($(DEBUG_DEV), 1)
+EXTRA_CFLAGS += -DDEBUG_DEV
+endif
+

You see what I mean. Try with Kconfig variables all this disappears.

drivers/target/Makefile line 74

Quoted 3 lines
drivers/target/Makefile new file +3 -0
+
+EXTRA_CFLAGS+=-I$(CWD)/drivers/target/ -I$(CWD)/drivers/scsi/
+EXTRA_CFLAGS+=-D_TARGET -DLINUX -DLINUX_KERNEL_26 -DLINUX_SCSI_HOST_LOCK -DLINUX_USE_SIGHAND

?? are you sure

drivers/target/Makefile line 75

Quoted 1 line
drivers/target/Makefile new file +1 -0
+EXTRA_CFLAGS+=-DLINUX_SCATTERLIST_HAS_PAGE -DPYX_ISCSI_VENDOR='"Linux-iSCSI.org"'

And these are for ??

<Makefile>

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+
+all:
+	$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(CWD) modules CWD=$(CWD) ARCH=$(ARCH) KBUILD_VERBOSE=0
+
+install ins:
+	rm -f /lib/modules/`uname -r`/kernel/drivers/scsi/iscsi_target_mod.ko
+	rm -f /lib/modules/`uname -r`/kernel/drivers/iscsi/iscsi_target_mod.ko
+	mkdir -p /lib/modules/`uname -r`/kernel/drivers/iscsi
+	cp -f iscsi_target_mod.ko /lib/modules/`uname -r`/kernel/drivers/iscsi
+	cp -f target_core_mod.ko /lib/modules/`uname -r`/kernel/drivers/iscsi

drivers/target/Makefile line 95

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+	depmod -ae
+
+
+
+clean:
+	rm -f $(foreach prog,$(target_core_mod-objs) $(obj-m),$(CWD)/$(prog)) $(CWD)/target_core_mod.mod.o
+	rm -f target_core_mod.ko target_core_mod.mod.c
+	rm -f .*.cmd ../common/.*.cmd .make_autoconfig *~
+	rm -fr .tmp_versions
+

</Makefile>

OK this should go in a Makefile and kept out-of-tree

Quoted 9 lines
drivers/target/Makefile new file +1 -0
+
drivers/target/Kconfig new file +0 -0
new file mode 100644
index 0000000..04564f1

drivers/target/Kconfig line 7

Quoted 7 lines
drivers/target/Kconfig new file +7 -0
@@ -0,0 +1,7 @@
+config TARGET_CORE
+        tristate "Generic Target Core Engine and ConfigFS Infrastructure"
+	select CONFIGFS_FS
+	select SCSI_TGT
+        default m
+        ---help---
+        Say Y here to enable the Storage Engine, Subsystem Plugins, and ConfigFS enabled control path for the Generic Target Engine.

Lots of more configs missing here

Cheers
Boaz

#2 lore raw
Quoted 66 lines · Boaz Harrosh

drivers/target/Makefile

Quoted 31 lines · Nicholas A. Bellinger

[RFC PATCH 19/19] Target_Core_Mod Makefile/Kconfig and div64.c

This patch adds the remaining misc Makefile and Kconfig changes

It also has wrappers for unsigned long division in div64c, that will be converted to include/asm-generic/div64.h

drivers/target/div64.c new file +16 -0
new file mode 100644
index 0000000..6d59864
@@ -0,0 +1,16 @@
+#include <asm/types.h>
+#include <asm/div64.h>
+
+#if BITS_PER_LONG == 32
+
+u64 __udivdi3(u64 a, u64 b)
+{
+  do_div(a, b);
+  return a;
+}
+
+u64 __umoddi3(u64 a, u64 b)
+{
+  return do_div(a, b);
+}
+#endif
drivers/target/Makefile +0 -0

I like Kbuild better then Makefile. And so does the Kernel documentation. It says new code should use Kbuild

Quoted 17 lines

new file mode 100644
index 0000000..3e413b0

drivers/target/Makefile new file +12 -0
@@ -0,0 +1,96 @@
+CWD=$(shell pwd)
+
+PYX_ISCSI_VENDOR ?="Linux-iSCSI.org"
+
+# Transport Plugins and Devices.
+ #
+LINUX_PARALLEL_SCSI ?= 1
+LINUX_STGT ?= 1
+LINUX_SCSI_MEDIA_ROM ?= 1
+LINUX_PARALLEL_ATA ?= 0
+LINUX_IBLOCK ?= 1
+LINUX_RAMDISK ?= 1

drivers/target/Makefile line 22

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+LINUX_FILEIO ?= 1
+
+LINUX_VPD_PAGE_CHECK?=1
+LIO_TARGET_CONFIGFS?=1
+
+MODVER ?= 1
+USEGDB ?= 1
+DEBUG_DEV ?= 0
+SNMP_FEATURE ?= 1
+

Now when in-Kernel don't you need to use Kconfig for all this "configuration".

Quoted 1 line

What's with the re-invent the wheel, here.

Ok, I will move all of these config items into Kbuild

Quoted 44 lines
Quoted 44 lines
drivers/target/Makefile new file +43 -0
+obj-$(CONFIG_TARGET_CORE)		+=	target_core_mod.o
+target_core_mod-objs			:=	target_core_configfs.o \
+						target_core_device.o \
+						target_core_hba.o \
+						target_core_plugin.o \
+						target_core_pr.o \
+						target_core_alua.o \
+						target_core_scdb.o \
+						target_core_seobj.o \
+						target_core_tmr.o \
+						target_core_tpg.o \
+						target_core_transport.o \
+						target_core_ua.o \
+						div64.o
+
+ifeq ($(LINUX_IBLOCK), 1)
+target_core_mod-objs			+=	target_core_iblock.o
+EXTRA_CFLAGS				+=	-DPYX_IBLOCK
+endif
+ifeq ($(LINUX_PARALLEL_SCSI), 1)
+target_core_mod-objs			+=	target_core_pscsi.o
+EXTRA_CFLAGS				+=	-DPARALLEL_SCSI
+endif
+ifeq ($(LINUX_STGT), 1)
+target_core_mod-objs			+=	target_core_stgt.o
+EXTRA_CFLAGS				+=	-DSTGT_PLUGIN
+endif
+ifeq ($(LINUX_RAMDISK), 1)
+target_core_mod-objs			+=	target_core_rd.o
+EXTRA_CFLAGS				+=	-DPYX_RAMDISK
+endif
+ifeq ($(LINUX_FILEIO), 1)
+target_core_mod-objs			+=	target_core_file.o
+EXTRA_CFLAGS				+=	-DPYX_FILEIO
+endif
+ifeq ($(SNMP_FEATURE), 1)
+target_core_mod-objs			+=	target_core_mib.o
+EXTRA_CFLAGS				+=	-DSNMP_SUPPORT
+endif
+ifeq ($(LINUX_VPD_PAGE_CHECK), 1)
+EXTRA_CFLAGS += -DLINUX_VPD_PAGE_CHECK
+endif
+ifeq ($(LINUX_SCSI_MEDIA_ROM), 1)
Quoted 8 lines

drivers/target/Makefile line 71

Quoted 6 lines
drivers/target/Makefile new file +6 -0
+EXTRA_CFLAGS += -DLINUX_SCSI_MEDIA_ROM
+endif
+ifeq ($(DEBUG_DEV), 1)
+EXTRA_CFLAGS += -DDEBUG_DEV
+endif
+

You see what I mean. Try with Kconfig variables all this disappears.

Understood.

Quoted 11 lines

drivers/target/Makefile line 74

Quoted 4 lines
drivers/target/Makefile new file +3 -0
+
+EXTRA_CFLAGS+=-I$(CWD)/drivers/target/ -I$(CWD)/drivers/scsi/
+EXTRA_CFLAGS+=-D_TARGET -DLINUX -DLINUX_KERNEL_26 -DLINUX_SCSI_HOST_LOCK -DLINUX_USE_SIGHAND

?? are you sure

drivers/target/Makefile line 75

Quoted 1 line
drivers/target/Makefile new file +1 -0
+EXTRA_CFLAGS+=-DLINUX_SCATTERLIST_HAS_PAGE -DPYX_ISCSI_VENDOR='"Linux-iSCSI.org"'

And these are for ??

Ok, these are some legacy items that I missed, and can be safely removed..

Quoted 23 lines

<Makefile>

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+
+all:
+	$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(CWD) modules CWD=$(CWD) ARCH=$(ARCH) KBUILD_VERBOSE=0
+
+install ins:
+	rm -f /lib/modules/`uname -r`/kernel/drivers/scsi/iscsi_target_mod.ko
+	rm -f /lib/modules/`uname -r`/kernel/drivers/iscsi/iscsi_target_mod.ko
+	mkdir -p /lib/modules/`uname -r`/kernel/drivers/iscsi
+	cp -f iscsi_target_mod.ko /lib/modules/`uname -r`/kernel/drivers/iscsi
+	cp -f target_core_mod.ko /lib/modules/`uname -r`/kernel/drivers/iscsi

drivers/target/Makefile line 95

Quoted 10 lines
drivers/target/Makefile new file +10 -0
+	depmod -ae
+
+
+
+clean:
+	rm -f $(foreach prog,$(target_core_mod-objs) $(obj-m),$(CWD)/$(prog)) $(CWD)/target_core_mod.mod.o
+	rm -f target_core_mod.ko target_core_mod.mod.c
+	rm -f .*.cmd ../common/.*.cmd .make_autoconfig *~
+	rm -fr .tmp_versions
+

</Makefile>

Quoted 1 line

OK this should go in a Makefile and kept out-of-tree

Ok, Got it

Quoted 11 lines
Quoted 11 lines
drivers/target/Makefile new file +1 -0
+
drivers/target/Kconfig new file +3 -0
new file mode 100644
index 0000000..04564f1
@@ -0,0 +1,7 @@
+config TARGET_CORE
+        tristate "Generic Target Core Engine and ConfigFS Infrastructure"
+	select CONFIGFS_FS
Quoted 9 lines

drivers/target/Kconfig line 7

Quoted 6 lines
drivers/target/Kconfig new file +4 -0
+	select SCSI_TGT
+        default m
+        ---help---
+        Say Y here to enable the Storage Engine, Subsystem Plugins, and ConfigFS enabled control path for the Generic Target Engine.

Lots of more configs missing here

Thanks for your comments Boaz!

--nab

Quoted 2 lines

Cheers
Boaz