Move all to deprecated folder.
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
let people specify the number of runs on the command line
|
||||
|
||||
Patch by Vivi Li <vivi.li@analog.com>
|
||||
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -66,7 +70,7 @@
|
||||
/* end of variables for time measurement */
|
||||
|
||||
|
||||
-main ()
|
||||
+main(int argc, char *argv[])
|
||||
/*****/
|
||||
|
||||
/* main program, corresponds to procedures */
|
||||
@@ -101,6 +105,13 @@
|
||||
/* 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 +125,17 @@
|
||||
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);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Get HZ value from system rather than requiring via CPPFLAGS
|
||||
|
||||
Patch by Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
|
||||
--- 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 */
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
trust the exit status of the program
|
||||
|
||||
Patch by Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -274,6 +289,7 @@
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
+ exit(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
get prototypes for malloc/exit/strcpy
|
||||
|
||||
Patch by Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
--- 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
|
||||
@@ -0,0 +1,35 @@
|
||||
Avoid collision with C library using NO_PROTOTYPES found in code already
|
||||
|
||||
Patch by Robin Getz <rgetz@blackfin.uclinux.org>
|
||||
|
||||
--- a/dhry_1.c
|
||||
+++ b/dhry_1.c
|
||||
@@ -28,7 +28,9 @@
|
||||
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 +45,18 @@
|
||||
|
||||
#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
|
||||
@@ -0,0 +1,6 @@
|
||||
config BR2_PACKAGE_DHRYSTONE
|
||||
bool "dhrystone"
|
||||
help
|
||||
easy-to-use integer benchmark
|
||||
|
||||
http://www.netlib.org/benchmark/dhry-c
|
||||
12
deprecated/firmware/buildroot/package/dhrystone/Makefile
Normal file
12
deprecated/firmware/buildroot/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
|
||||
@@ -0,0 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e dhry-c
|
||||
24
deprecated/firmware/buildroot/package/dhrystone/dhrystone.mk
Normal file
24
deprecated/firmware/buildroot/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) $(DL_DIR)/$($(PKG)_SOURCE))
|
||||
$(Q)cp package/dhrystone/Makefile $(@D)/
|
||||
endef
|
||||
|
||||
define DHRYSTONE_BUILD_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(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