[LTP] [PATCH v4 1/3] lib: adding .supported_archs field in tst_test structure

Li Wang liwang@redhat.com
Fri Nov 12 07:41:40 CET 2021


> > +#ifndef TST_ARCH_H__
> > +#define TST_ARCH_H__
> > +
> > +enum tst_arch_type {
> > +     TST_UNKNOWN,
> > +     TST_I386,
>
> I would still probably name this TST_X86, Linux does not support i386
> anymore, the remaining 32bit distributions usually require at least i586
> or i686...
>

Sure, If go with that TST_X86, we just need to do modifications based on
V4 like below, right? What else am I missing here?

--- a/include/tst_arch.h
+++ b/include/tst_arch.h
@@ -7,7 +7,7 @@

 enum tst_arch_type {
        TST_UNKNOWN,
-       TST_I386,
+       TST_X86,
        TST_X86_64,
        TST_IA64,
        TST_PPC,
diff --git a/lib/tst_arch.c b/lib/tst_arch.c
index 67a955789..f19802a03 100644
--- a/lib/tst_arch.c
+++ b/lib/tst_arch.c
@@ -13,9 +13,9 @@ const struct tst_arch tst_arch = {
 #if defined(__x86_64__)
         .name = "x86_64",
         .type = TST_X86_64,
-#elif defined(__i386__)
-        .name = "i386",
-        .type = TST_I386,
+#elif defined(__i386__) || defined(__i586__) || defined(__i686__)
+        .name = "x86",
+        .type = TST_X86,
 #elif defined(__ia64__)
         .name = "ia64",
         .type = TST_IA64,
@@ -48,6 +48,8 @@ const struct tst_arch tst_arch = {

 static const char *const arch_type_list[] = {
        "i386",
+       "i586",
+       "i686",
        "x86_64",
        "ia64",
        "ppc",
diff --git a/testcases/kernel/mem/tunable/max_map_count.c
b/testcases/kernel/mem/tunable/max_map_count.c
index bd5af0ff6..a4c3dbf8e 100644
--- a/testcases/kernel/mem/tunable/max_map_count.c
+++ b/testcases/kernel/mem/tunable/max_map_count.c
@@ -88,7 +88,7 @@ static bool filter_map(const char *line)
                return false;

        switch (tst_arch.type) {
-       case TST_I386:
+       case TST_X86:
        case TST_X86_64:
                /* On x86, there's an old compat vsyscall page */
                if (!strcmp(buf, "[vsyscall]"))

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211112/c76185de/attachment.htm>


More information about the ltp mailing list