Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
From 16d84fa7ecea8102680c9610d4186c4f54936b07 Mon Sep 17 00:00:00 2001
|
||||
From: Vivi Li <vivi.li@analog.com>
|
||||
Date: Mon, 15 Jul 2024 11:07:11 +0200
|
||||
Subject: [PATCH] let people specify the number of runs on the command line
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
dhry_1.c | 25 ++++++++++++++++++-------
|
||||
1 file changed, 18 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dhry_1.c b/dhry_1.c
|
||||
index 7ab02a8..97bd30f 100644
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -66,7 +66,7 @@ float Microseconds,
|
||||
/* end of variables for time measurement */
|
||||
|
||||
|
||||
-main ()
|
||||
+main(int argc, char *argv[])
|
||||
/*****/
|
||||
|
||||
/* main program, corresponds to procedures */
|
||||
@@ -101,6 +101,13 @@ main ()
|
||||
/* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
|
||||
/* overflow may occur for this array element. */
|
||||
|
||||
+ Number_Of_Runs = 0;
|
||||
+ if ( argc == 2 ) {
|
||||
+ if (atoi(argv[1]) > 0) {
|
||||
+ Number_Of_Runs = atoi(argv[1]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
printf ("\n");
|
||||
printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
|
||||
printf ("\n");
|
||||
@@ -114,13 +121,17 @@ main ()
|
||||
printf ("Program compiled without 'register' attribute\n");
|
||||
printf ("\n");
|
||||
}
|
||||
- printf ("Please give the number of runs through the benchmark: ");
|
||||
- {
|
||||
- int n;
|
||||
- scanf ("%d", &n);
|
||||
- Number_Of_Runs = n;
|
||||
+
|
||||
+ if (!Number_Of_Runs) {
|
||||
+ printf ("Please give the number of runs through the benchmark: ");
|
||||
+ fflush (stdout);
|
||||
+ {
|
||||
+ int n;
|
||||
+ scanf ("%d", &n);
|
||||
+ Number_Of_Runs = n;
|
||||
+ }
|
||||
+ printf ("\n");
|
||||
}
|
||||
- printf ("\n");
|
||||
|
||||
printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From 7d890402dc5a32a72d5bc0532c87576937c18eb7 Mon Sep 17 00:00:00 2001
|
||||
From: Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
Date: Mon, 15 Jul 2024 11:07:54 +0200
|
||||
Subject: [PATCH] Get HZ value from system rather than requiring via CPPFLAGS
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
dhry.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dhry.h b/dhry.h
|
||||
index 1714562..482d343 100644
|
||||
--- a/dhry.h
|
||||
+++ b/dhry.h
|
||||
@@ -359,6 +359,10 @@
|
||||
/* for "times" */
|
||||
#endif
|
||||
|
||||
+#ifndef HZ
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
+
|
||||
#define Mic_secs_Per_Second 1000000.0
|
||||
/* Berkeley UNIX C returns process times in seconds/HZ */
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From acd266448386c805c0afded780a5d7e6903bb485 Mon Sep 17 00:00:00 2001
|
||||
From: Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
Date: Mon, 15 Jul 2024 11:08:43 +0200
|
||||
Subject: [PATCH] trust the exit status of the program
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
dhry_1.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dhry_1.c b/dhry_1.c
|
||||
index 97bd30f..358bdc3 100644
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -285,6 +285,7 @@ main(int argc, char *argv[])
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
+ exit(0);
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 85dcf4ca20a60689479bcb143ecf8c0402822abe Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Mon, 15 Jul 2024 11:09:18 +0200
|
||||
Subject: [PATCH] get prototypes for malloc/exit/strcpy
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
dhry.h | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/dhry.h b/dhry.h
|
||||
index 482d343..825ef35 100644
|
||||
--- a/dhry.h
|
||||
+++ b/dhry.h
|
||||
@@ -388,6 +388,8 @@
|
||||
/* General definitions: */
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
/* for strcpy, strcmp */
|
||||
|
||||
#define Null 0
|
||||
--
|
||||
2.45.2
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From 9a701143fc38fd9f5373af70dfd5f0da0bc8e04a Mon Sep 17 00:00:00 2001
|
||||
From: Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
Date: Mon, 15 Jul 2024 11:09:55 +0200
|
||||
Subject: [PATCH] Avoid collision with C library using NO_PROTOTYPES
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
dhry_1.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dhry_1.c b/dhry_1.c
|
||||
index 358bdc3..3ed1716 100644
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -28,7 +28,9 @@ char Ch_1_Glob,
|
||||
int Arr_1_Glob [50];
|
||||
int Arr_2_Glob [50] [50];
|
||||
|
||||
+#ifndef NO_PROTOTYPES
|
||||
extern char *malloc ();
|
||||
+#endif
|
||||
Enumeration Func_1 ();
|
||||
/* forward declaration necessary since Enumeration may not simply be int */
|
||||
|
||||
@@ -45,14 +47,18 @@ Enumeration Func_1 ();
|
||||
|
||||
#ifdef TIMES
|
||||
struct tms time_info;
|
||||
+#ifndef NO_PROTOTYPES
|
||||
extern int times ();
|
||||
/* see library function "times" */
|
||||
+#endif
|
||||
#define Too_Small_Time 120
|
||||
/* Measurements should last at least about 2 seconds */
|
||||
#endif
|
||||
#ifdef TIME
|
||||
+#ifndef NO_PROTOTYPES
|
||||
extern long time();
|
||||
/* see library function "time" */
|
||||
+#endif
|
||||
#define Too_Small_Time 2
|
||||
/* Measurements should last at least 2 seconds */
|
||||
#endif
|
||||
--
|
||||
2.45.2
|
||||
|
||||
152
package/dhrystone/0006-Add-missing-function-declarations.patch
Normal file
152
package/dhrystone/0006-Add-missing-function-declarations.patch
Normal file
@@ -0,0 +1,152 @@
|
||||
From fd7ce4b6a9e268e60071c94852f7f00f6e60ef11 Mon Sep 17 00:00:00 2001
|
||||
From: Steffen Persvold <spersvold@gmail.com>
|
||||
Date: Mon, 15 Jul 2024 11:16:36 +0200
|
||||
Subject: [PATCH] Add missing function declarations
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Fixes:
|
||||
|
||||
GCC14 will give errors for missing function declarations and
|
||||
missing return types :
|
||||
|
||||
dhry_1.c:75:1: error: return type defaults to ‘int’ [-Wimplicit-int]
|
||||
75 | main(int argc, char *argv[])
|
||||
| ^~~~
|
||||
dhry_1.c: In function ‘main’:
|
||||
dhry_1.c:159:5: error: implicit declaration of function ‘Proc_5’ [-Wimplicit-function-declaration]
|
||||
159 | Proc_5();
|
||||
| ^~~~~~
|
||||
|
||||
Upstream: dead
|
||||
Signed-off-by: Steffen Persvold <spersvold@gmail.com>
|
||||
---
|
||||
dhry_1.c | 26 +++++++++++++++++---------
|
||||
dhry_2.c | 8 ++++----
|
||||
2 files changed, 21 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dhry_1.c b/dhry_1.c
|
||||
index 3ed1716..cad5840 100644
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -32,6 +32,7 @@ int Arr_2_Glob [50] [50];
|
||||
extern char *malloc ();
|
||||
#endif
|
||||
Enumeration Func_1 ();
|
||||
+Boolean Func_2 ();
|
||||
/* forward declaration necessary since Enumeration may not simply be int */
|
||||
|
||||
#ifndef REG
|
||||
@@ -71,8 +72,17 @@ float Microseconds,
|
||||
|
||||
/* end of variables for time measurement */
|
||||
|
||||
-
|
||||
-main(int argc, char *argv[])
|
||||
+/* forward declarations */
|
||||
+void Proc_1 ();
|
||||
+void Proc_2 ();
|
||||
+void Proc_3 ();
|
||||
+void Proc_4 ();
|
||||
+void Proc_5 ();
|
||||
+void Proc_6 ();
|
||||
+void Proc_7 ();
|
||||
+void Proc_8 ();
|
||||
+
|
||||
+int main(int argc, char *argv[])
|
||||
/*****/
|
||||
|
||||
/* main program, corresponds to procedures */
|
||||
@@ -295,7 +305,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
-Proc_1 (Ptr_Val_Par)
|
||||
+void Proc_1 (Ptr_Val_Par)
|
||||
/******************/
|
||||
|
||||
REG Rec_Pointer Ptr_Val_Par;
|
||||
@@ -329,7 +339,7 @@ REG Rec_Pointer Ptr_Val_Par;
|
||||
} /* Proc_1 */
|
||||
|
||||
|
||||
-Proc_2 (Int_Par_Ref)
|
||||
+void Proc_2 (Int_Par_Ref)
|
||||
/******************/
|
||||
/* executed once */
|
||||
/* *Int_Par_Ref == 1, becomes 4 */
|
||||
@@ -352,7 +362,7 @@ One_Fifty *Int_Par_Ref;
|
||||
} /* Proc_2 */
|
||||
|
||||
|
||||
-Proc_3 (Ptr_Ref_Par)
|
||||
+void Proc_3 (Ptr_Ref_Par)
|
||||
/******************/
|
||||
/* executed once */
|
||||
/* Ptr_Ref_Par becomes Ptr_Glob */
|
||||
@@ -367,7 +377,7 @@ Rec_Pointer *Ptr_Ref_Par;
|
||||
} /* Proc_3 */
|
||||
|
||||
|
||||
-Proc_4 () /* without parameters */
|
||||
+void Proc_4 () /* without parameters */
|
||||
/*******/
|
||||
/* executed once */
|
||||
{
|
||||
@@ -379,7 +389,7 @@ Proc_4 () /* without parameters */
|
||||
} /* Proc_4 */
|
||||
|
||||
|
||||
-Proc_5 () /* without parameters */
|
||||
+void Proc_5 () /* without parameters */
|
||||
/*******/
|
||||
/* executed once */
|
||||
{
|
||||
@@ -399,5 +409,3 @@ register int l;
|
||||
while (l--) *d++ = *s++;
|
||||
}
|
||||
#endif
|
||||
-
|
||||
-
|
||||
diff --git a/dhry_2.c b/dhry_2.c
|
||||
index 63a3d3e..25051e7 100644
|
||||
--- a/dhry_2.c
|
||||
+++ b/dhry_2.c
|
||||
@@ -26,8 +26,9 @@
|
||||
extern int Int_Glob;
|
||||
extern char Ch_1_Glob;
|
||||
|
||||
+Boolean Func_3 ();
|
||||
|
||||
-Proc_6 (Enum_Val_Par, Enum_Ref_Par)
|
||||
+void Proc_6 (Enum_Val_Par, Enum_Ref_Par)
|
||||
/*********************************/
|
||||
/* executed once */
|
||||
/* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
|
||||
@@ -61,7 +62,7 @@ Enumeration *Enum_Ref_Par;
|
||||
} /* Proc_6 */
|
||||
|
||||
|
||||
-Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
|
||||
+void Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
|
||||
/**********************************************/
|
||||
/* executed three times */
|
||||
/* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
|
||||
@@ -81,7 +82,7 @@ One_Fifty *Int_Par_Ref;
|
||||
} /* Proc_7 */
|
||||
|
||||
|
||||
-Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
|
||||
+void Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
|
||||
/*********************************************************************/
|
||||
/* executed once */
|
||||
/* Int_Par_Val_1 == 3 */
|
||||
@@ -189,4 +190,3 @@ Enumeration Enum_Par_Val;
|
||||
else /* not executed */
|
||||
return (false);
|
||||
} /* Func_3 */
|
||||
-
|
||||
--
|
||||
2.45.2
|
||||
|
||||
6
package/dhrystone/Config.in
Normal file
6
package/dhrystone/Config.in
Normal file
@@ -0,0 +1,6 @@
|
||||
config BR2_PACKAGE_DHRYSTONE
|
||||
bool "dhrystone"
|
||||
help
|
||||
easy-to-use integer benchmark
|
||||
|
||||
http://www.netlib.org/benchmark/dhry-c
|
||||
12
package/dhrystone/Makefile
Normal file
12
package/dhrystone/Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
CPPFLAGS += -DNO_PROTOTYPES=1 -DHZ=100
|
||||
LDLIBS += -lm
|
||||
|
||||
all: dhrystone
|
||||
|
||||
dhrystone: dhry_1.o dhry_2.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
clean:
|
||||
rm -f *.o dhrystone
|
||||
|
||||
.PHONY: all clean
|
||||
2
package/dhrystone/dhrystone.hash
Normal file
2
package/dhrystone/dhrystone.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e dhry-c
|
||||
24
package/dhrystone/dhrystone.mk
Normal file
24
package/dhrystone/dhrystone.mk
Normal file
@@ -0,0 +1,24 @@
|
||||
################################################################################
|
||||
#
|
||||
# dhrystone
|
||||
#
|
||||
################################################################################
|
||||
|
||||
DHRYSTONE_VERSION = 2
|
||||
DHRYSTONE_SOURCE = dhry-c
|
||||
DHRYSTONE_SITE = http://www.netlib.org/benchmark
|
||||
|
||||
define DHRYSTONE_EXTRACT_CMDS
|
||||
(cd $(@D) && $(SHELL) $(DHRYSTONE_DL_DIR)/$($(PKG)_SOURCE))
|
||||
$(Q)cp package/dhrystone/Makefile $(@D)/
|
||||
endef
|
||||
|
||||
define DHRYSTONE_BUILD_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS) -std=gnu99" $(MAKE) -C $(@D)
|
||||
endef
|
||||
|
||||
define DHRYSTONE_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -D $(@D)/dhrystone $(TARGET_DIR)/usr/bin/dhrystone
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user