[Linux-hls-cvs] qosman/demos Makefile,1.1.1.1,1.2 mpdemo.c,1.1.1.1,1.2 ppsdemo.c,1.1.1.1,1.2 qtest.c
Status: Pre-Alpha
Brought to you by:
lucabe
|
From: Luca A. <lu...@us...> - 2004-04-09 13:53:21
|
Update of /cvsroot/linux-hls/qosman/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23177/demos Modified Files: Makefile mpdemo.c ppsdemo.c qtest.c test1.c Log Message: - Some cleanups in the demos - New "text only" demo (will be used to test the pps model) - Interface change (names...) - Fix bug in feeback functions statistics - Resynch with my local tree (too many changes to mention) Index: qtest.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/qtest.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** qtest.c 21 Feb 2004 13:01:52 -0000 1.1.1.1 --- qtest.c 9 Apr 2004 13:39:56 -0000 1.2 *************** *** 32,35 **** --- 32,37 ---- */ + #include<sys/types.h> + #include<sys/wait.h> #include<stdio.h> *************** *** 46,52 **** #include "qos.h" #include "req.h" - #include "adj.h" - #include "pid.h" extern TASK mpbody(WORD id); int ac; --- 48,53 ---- #include "qos.h" #include "req.h" + extern struct reqactions pidactions; extern TASK mpbody(WORD id); int ac; *************** *** 68,76 **** int main(int argc, char *argv[]) { ! struct qparm t; ! struct qmparm initparm; ID qt1, qt2; char name[80]; int i; ac = argc; --- 69,78 ---- int main(int argc, char *argv[]) { ! struct qtask_attr t; ! struct qman_attr initparm; ID qt1, qt2; char name[80]; int i; + int dummy; ac = argc; *************** *** 89,93 **** cprintf(" done!\n"); /* setreq(&adjactions); */ ! setreq(&pidactions); t.wcet = 1000; t.per = 33000; --- 91,95 ---- cprintf(" done!\n"); /* setreq(&adjactions); */ ! qman_feedback(&pidactions); t.wcet = 1000; t.per = 33000; *************** *** 98,103 **** t.name = name; t.body = mpbody; ! qt1 = qset_addtask(&t); if (qt1 == 0) { printf("QoS Task creation failed...\n"); --- 100,106 ---- t.name = name; t.body = mpbody; + t.model = MM_TASK; ! qt1 = qman_task(&t); if (qt1 == 0) { printf("QoS Task creation failed...\n"); *************** *** 113,118 **** t.name = name; t.body = mpbody; ! qt2 = qset_addtask(&t); if (qt2 == 0) { printf("QoS Task creation failed...\n"); --- 116,122 ---- t.name = name; t.body = mpbody; + t.model = MM_TASK; ! qt2 = qman_task(&t); if (qt2 == 0) { printf("QoS Task creation failed...\n"); *************** *** 122,127 **** printf("Waiting...\n"); ! for (;;); ! sleep(20); exit(0); --- 126,131 ---- printf("Waiting...\n"); ! wait(&dummy); wait(&dummy); ! sleep(2); exit(0); Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 21 Feb 2004 13:01:51 -0000 1.1.1.1 --- Makefile 9 Apr 2004 13:39:56 -0000 1.2 *************** *** 1,12 **** - #Makefile for rk kernel modules - QOS = qos - LINUXDIR=../../linux - LINUXINCLUDE=$(LINUXDIR)/include CFLAGS = `gtk-config --cflags` ! CFLAGS += -I$(LINUXINCLUDE) \ ! -I../include -I../us/include\ ! -D__RK__ -O2 \ ! -Wall -Wstrict-prototypes GTKLIB = `gtk-config --libs` O_OBJS = --- 1,5 ---- QOS = qos CFLAGS = `gtk-config --cflags` ! CFLAGS += -I../include -I../us/include -O2 -Wall -Wstrict-prototypes GTKLIB = `gtk-config --libs` O_OBJS = *************** *** 15,24 **** all: $(TESTS) ! mpdemo: qtest.o mpdemo.o ../libqos.a ! gcc qtest.o mpdemo.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o mpdemo ! ppsdemo: test1.o ppsdemo.o ../libqos.a ! gcc test1.o ppsdemo.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o ppsdemo deps :$(O_OBJS:.o=.c) --- 8,19 ---- all: $(TESTS) ! mpdemo: mpcore.o qtest.o mpdemo.o ../libqos.a ! gcc qtest.o mpdemo.o mpcore.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o mpdemo ! ppsdemo: mpcore.o test1.o ppsdemo.o ../libqos.a ! gcc test1.o mpcore.o ppsdemo.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o ppsdemo + txtdemo: txtdemo.o + gcc txtdemo.o -L.. -lqos -lncurses -o txtdemo deps :$(O_OBJS:.o=.c) Index: mpdemo.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/mpdemo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** mpdemo.c 21 Feb 2004 13:01:52 -0000 1.1.1.1 --- mpdemo.c 9 Apr 2004 13:39:56 -0000 1.2 *************** *** 43,46 **** --- 43,47 ---- #include <mpeg.h> + #include "mpcore.h" #if 0 #include <rk/rk.h> *************** *** 54,60 **** #include "qos.h" - static GdkPixmap *screen; - static GdkGC *gc, *gc1; - static unsigned long long int timevect[10000]; static unsigned long int timevect1[10000]; --- 55,58 ---- *************** *** 63,68 **** static struct feedbk_stat fstats[10000]; - static int end = 0; - extern gint ac; extern gchar *av[]; --- 61,64 ---- *************** *** 71,109 **** #define MAXSLIDE 150 - gint delete_event(GtkWidget * widget, GdkEvent * event, gpointer data) - { - end = 1; - - return (TRUE); - } - - gboolean expose_event(GtkWidget * widget, GdkEventExpose * event, - gpointer data) - { - if ((screen != NULL) && (!end)) { - gdk_draw_pixmap(widget->window, - widget->style->fg_gc[GTK_WIDGET_STATE(widget)], - screen, event->area.x, event->area.y, - event->area.x, event->area.y, event->area.width, - event->area.height); - } - - return TRUE; - } - - gint configure_event(GtkWidget * widget, GdkEventConfigure * event) - { - if (!screen) { - screen = - gdk_pixmap_new(widget->window, widget->allocation.width, - widget->allocation.height, -1); - gdk_draw_rectangle(screen, widget->style->white_gc, TRUE, 0, 0, - widget->allocation.width, - widget->allocation.height); - } - return TRUE; - } - - void save_results(void) { --- 67,70 ---- *************** *** 170,174 **** } - //gint mpdbody(gint argc, gchar *argv[]) gint mpbody(int num) --- 131,134 ---- *************** *** 176,192 **** gint argc; gchar **argv; GtkWidget *prbar; GtkWidget *d_area; - GtkWidget *window; - GtkWidget *vbox; - GtkWidget *hbox; - GtkWidget *label; - GtkObject *adj2; - GdkColor black; - GdkColor white; GdkRectangle u_area; ! char buff[80]; int x, y, ox, oy, dir; - gint expid, confid; long int l; FILE *mpeg; --- 136,146 ---- gint argc; gchar **argv; + struct controls *c; + #if 0 GtkWidget *prbar; GtkWidget *d_area; GdkRectangle u_area; ! #endif int x, y, ox, oy, dir; long int l; FILE *mpeg; *************** *** 207,284 **** } ! mpeg = fopen(argv[1], "rb"); ! if (mpeg == NULL) { ! perror("Error opening:"); ! exit(-1); ! } ! SetMPEGOption(MPEG_DITHER, FULL_COLOR_DITHER); ! if (!OpenMPEG(mpeg, &img)) { ! fprintf(stderr, "OpenMPEG on %s failed\n", argv[1]); ! exit(-1); ! } ! ! ! pid_setstats(fstats, -1); ! rgbbuff = malloc(img.Size * sizeof(char)); printf("Image: %dx%dx%d\n", img.Width, img.Height, img.Depth); - gdk_rgb_init(); - gtk_widget_set_default_colormap(gdk_rgb_get_cmap()); - gtk_widget_set_default_visual(gdk_rgb_get_visual()); - - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size(GTK_WINDOW(window), img.Width, - img.Height + 50); - - vbox = gtk_vbox_new(FALSE, 0); - hbox = gtk_hbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - - - adj2 = gtk_adjustment_new(0.0, 0.0, 21.0, 0.1, 1.0, 1.0); - prbar = gtk_progress_bar_new_with_adjustment(GTK_ADJUSTMENT(adj2)); - gtk_box_pack_start(GTK_BOX(vbox), prbar, TRUE, TRUE, 0); - gtk_widget_show(prbar); - //drawing area - d_area = gtk_drawing_area_new(); - gtk_drawing_area_size(GTK_DRAWING_AREA(d_area), img.Width, img.Height); - expid = - gtk_signal_connect(GTK_OBJECT(d_area), "expose_event", - GTK_SIGNAL_FUNC(expose_event), NULL); - confid = - gtk_signal_connect(GTK_OBJECT(d_area), "configure_event", - GTK_SIGNAL_FUNC(configure_event), NULL); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(d_area), FALSE, FALSE, 5); - gtk_widget_show(d_area); - - sprintf(buff, "QoSlib Demo"); - label = gtk_label_new(buff); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 5); - gtk_widget_show(label); - - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, FALSE, 5); - - gtk_widget_show(hbox); - gtk_widget_show(vbox); - gtk_widget_show(window); - gtk_signal_connect(GTK_OBJECT(window), "delete_event", - GTK_SIGNAL_FUNC(delete_event), NULL); - - u_area.x = 0; - u_area.y = 0; - u_area.width = d_area->allocation.width; - u_area.height = d_area->allocation.height; - gc = gdk_gc_new(d_area->window); - gc1 = gdk_gc_new(d_area->window); - - gdk_color_black(gdk_colormap_get_system(), &black); - gdk_color_white(gdk_colormap_get_system(), &white); - gdk_gc_set_foreground(gc, &black); - gdk_gc_set_background(gc, &white); - gdk_gc_set_foreground(gc1, &white); - gdk_gc_set_background(gc1, &black); - x = 60; y = 60; --- 161,171 ---- } ! mpeg = file_open(argv[1], &img); + qman_setstats(fstats, -1); + rgbbuff = malloc(img.Size * sizeof(char)); printf("Image: %dx%dx%d\n", img.Width, img.Height, img.Depth); x = 60; y = 60; *************** *** 288,295 **** i = 0; cprintf("[MPEGDemo] Starting to play...\n"); ! // rt_wait_for_start_time(); ! while (!end) { gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; --- 175,183 ---- i = 0; + c = window_prepare(img.Width, img.Height); + cprintf("[MPEGDemo] Starting to play...\n"); ! while (!file_end()) { gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; *************** *** 302,317 **** gtk_main_iteration_do(FALSE); } ! if (!end) { moreframes = GetMPEGFrame(rgbbuff); if (moreframes == 0) { ! end = 1; } ! gdk_draw_rgb_32_image(screen, gc, ! 0, 0, img.Width, img.Height, ! GDK_RGB_DITHER_MAX, rgbbuff, ! img.Width * 4); ! gtk_widget_draw(GTK_WIDGET(d_area), &u_area); } ! l = howlate(0); // timevect2[i] = l; l = l / 5000; --- 190,201 ---- gtk_main_iteration_do(FALSE); } ! if (!file_end()) { moreframes = GetMPEGFrame(rgbbuff); if (moreframes == 0) { ! file_set_end(); } ! frame_display(c, &img, rgbbuff); } ! l = qman_howlate(0); // timevect2[i] = l; l = l / 5000; *************** *** 319,329 **** l = MAXSLIDE; } ! gtk_progress_bar_update(GTK_PROGRESS_BAR(prbar), (float) l / (float) MAXSLIDE); gettimeofday(&now, NULL); timevect1[i] = now.tv_usec + now.tv_sec * 1000000; ! timevect3[i] = getq(0); ! timevect2[i++] = qtask_endcycle(); } --- 203,213 ---- l = MAXSLIDE; } ! gtk_progress_bar_update(GTK_PROGRESS_BAR(c->prbar), (float) l / (float) MAXSLIDE); gettimeofday(&now, NULL); timevect1[i] = now.tv_usec + now.tv_sec * 1000000; ! timevect3[i] = qman_budget(0); ! timevect2[i++] = qman_task_endcycle(); } Index: ppsdemo.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/ppsdemo.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ppsdemo.c 21 Feb 2004 13:01:52 -0000 1.1.1.1 --- ppsdemo.c 9 Apr 2004 13:39:56 -0000 1.2 *************** *** 43,46 **** --- 43,47 ---- #include <mpeg.h> + #include "mpcore.h" #if 0 #include <rk/rk.h> *************** *** 54,66 **** #include "qos.h" - static GdkPixmap *screen; - static GdkGC *gc, *gc1; - static unsigned long long int timevect[10000]; static unsigned long int timevect1[10000]; static unsigned long int timevect2[10000]; - static int end = 0; - extern gint ac; extern gchar *av[]; --- 55,62 ---- *************** *** 68,123 **** #define MAXSLIDE 500 ! gint delete_event(GtkWidget * widget, GdkEvent * event, gpointer data) ! { ! end = 1; ! ! return (TRUE); ! } ! ! gboolean expose_event(GtkWidget * widget, GdkEventExpose * event, ! gpointer data) { ! if ((screen != NULL) && (!end)) { ! gdk_draw_pixmap(widget->window, ! widget->style->fg_gc[GTK_WIDGET_STATE(widget)], ! screen, event->area.x, event->area.y, ! event->area.x, event->area.y, event->area.width, ! event->area.height); } ! return TRUE; ! } ! ! gint configure_event(GtkWidget * widget, GdkEventConfigure * event) ! { ! if (!screen) { ! screen = ! gdk_pixmap_new(widget->window, widget->allocation.width, ! widget->allocation.height, -1); ! gdk_draw_rectangle(screen, widget->style->white_gc, TRUE, 0, 0, ! widget->allocation.width, ! widget->allocation.height); } ! return TRUE; } - //gint mpdbody(gint argc, gchar *argv[]) gint mpbody(int num) { gint argc; gchar **argv; ! GtkWidget *prbar; ! GtkWidget *d_area; ! GtkWidget *window; ! GtkWidget *vbox; ! GtkWidget *hbox; ! GtkWidget *label; ! GtkObject *adj2; ! GdkColor black; ! GdkColor white; ! GdkRectangle u_area; ! char buff[80]; int x, y, ox, oy, dir; - gint expid, confid; long int l; FILE *mpeg; --- 64,118 ---- #define MAXSLIDE 500 ! void results_save(int n) { ! FILE *f; ! int i; ! char filename[20]; ! ! printf("Saving\n"); ! sprintf(filename, "res_%d_if.tim", n); ! f = fopen(filename, "w"); ! for (i = 1; i < 5000; i++) { ! if (timevect1[i] != 0) { ! if (timevect[i] < timevect[i - 1]) { ! timevect[i] = timevect[i - 1]; ! // fprintf(f, "%d\t-1\t%lu\n", i, (unsigned long int)timevect[i] /*- timevect[0]*/); ! } else { ! if (timevect[i - 1] != timevect[i - 2]) { ! fprintf(f, "%d\t%lu\t%lu\n", i, ! (unsigned long int) (timevect[i] - ! timevect[i - 1]), ! (unsigned long int) timevect[i] ! /*- timevect[0]*/ ! ); ! } ! } ! } } + sprintf(filename, "res_%d_ct.tim", n); + fclose(f); ! f = fopen(filename, "w"); ! for (i = 1; i < 500; i++) { ! if (timevect1[i] != 0) { ! fprintf(f, "%d\t%lu\t1\n", i, ! (unsigned long int) (timevect1[i] - timevect[i])); ! } } ! sprintf(filename, "res_%d_l.tim", n); ! f = fopen(filename, "w"); ! for (i = 1; i < 500; i++) { ! fprintf(f, "%d\t%lu\n", i, timevect2[i]); ! } ! ! fclose(f); } gint mpbody(int num) { gint argc; gchar **argv; ! struct controls *c; int x, y, ox, oy, dir; long int l; FILE *mpeg; *************** *** 125,133 **** ImageDesc img; unsigned char *rgbbuff; struct timeval now; ! FILE *f; ! char filename[20]; ! int i; sleep(1); --- 120,127 ---- ImageDesc img; unsigned char *rgbbuff; + int i; struct timeval now; ! // FILE *f; sleep(1); *************** *** 140,212 **** } ! mpeg = fopen(argv[1], "rb"); ! if (mpeg == NULL) { ! perror("Error opening:"); ! exit(-1); ! } ! SetMPEGOption(MPEG_DITHER, FULL_COLOR_DITHER); ! if (!OpenMPEG(mpeg, &img)) { ! fprintf(stderr, "OpenMPEG on %s failed\n", argv[1]); ! exit(-1); ! } rgbbuff = malloc(img.Size * sizeof(char)); printf("Image: %dx%dx%d\n", img.Width, img.Height, img.Depth); - gdk_rgb_init(); - gtk_widget_set_default_colormap(gdk_rgb_get_cmap()); - gtk_widget_set_default_visual(gdk_rgb_get_visual()); - - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_default_size(GTK_WINDOW(window), img.Width, - img.Height + 50); - - vbox = gtk_vbox_new(FALSE, 0); - hbox = gtk_hbox_new(FALSE, 0); - gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(vbox)); - - - adj2 = gtk_adjustment_new(0.0, 0.0, 21.0, 0.1, 1.0, 1.0); - prbar = gtk_progress_bar_new_with_adjustment(GTK_ADJUSTMENT(adj2)); - gtk_box_pack_start(GTK_BOX(vbox), prbar, TRUE, TRUE, 0); - gtk_widget_show(prbar); - //drawing area - d_area = gtk_drawing_area_new(); - gtk_drawing_area_size(GTK_DRAWING_AREA(d_area), img.Width, img.Height); - expid = - gtk_signal_connect(GTK_OBJECT(d_area), "expose_event", - GTK_SIGNAL_FUNC(expose_event), NULL); - confid = - gtk_signal_connect(GTK_OBJECT(d_area), "configure_event", - GTK_SIGNAL_FUNC(configure_event), NULL); - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(d_area), FALSE, FALSE, 5); - gtk_widget_show(d_area); - - sprintf(buff, "QoSlib Demo"); - label = gtk_label_new(buff); - gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(label), FALSE, FALSE, 5); - gtk_widget_show(label); - - gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(hbox), FALSE, FALSE, 5); - - gtk_widget_show(hbox); - gtk_widget_show(vbox); - gtk_widget_show(window); - gtk_signal_connect(GTK_OBJECT(window), "delete_event", - GTK_SIGNAL_FUNC(delete_event), NULL); - - u_area.x = 0; - u_area.y = 0; - u_area.width = d_area->allocation.width; - u_area.height = d_area->allocation.height; - gc = gdk_gc_new(d_area->window); - gc1 = gdk_gc_new(d_area->window); - - gdk_color_black(gdk_colormap_get_system(), &black); - gdk_color_white(gdk_colormap_get_system(), &white); - gdk_gc_set_foreground(gc, &black); - gdk_gc_set_background(gc, &white); - gdk_gc_set_foreground(gc1, &white); - gdk_gc_set_background(gc1, &black); - x = 60; y = 60; --- 134,142 ---- } ! mpeg = file_open(argv[1], &img); ! rgbbuff = malloc(img.Size * sizeof(char)); printf("Image: %dx%dx%d\n", img.Width, img.Height, img.Depth); x = 60; y = 60; *************** *** 216,221 **** i = 0; cprintf("Starting...\n"); ! while (!end) { gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; --- 146,153 ---- i = 0; + c = window_prepare(img.Width, img.Height); + cprintf("Starting...\n"); ! while (!file_end()) { gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; *************** *** 228,243 **** gtk_main_iteration_do(FALSE); } ! if (!end) { moreframes = GetMPEGFrame(rgbbuff); if (moreframes == 0) { ! end = 1; } ! gdk_draw_rgb_32_image(screen, gc, ! 0, 0, img.Width, img.Height, ! GDK_RGB_DITHER_MAX, rgbbuff, ! img.Width * 4); ! gtk_widget_draw(GTK_WIDGET(d_area), &u_area); } ! l = howlate(0); timevect2[i] = l; l = l / 33000; --- 160,171 ---- gtk_main_iteration_do(FALSE); } ! if (!file_end()) { moreframes = GetMPEGFrame(rgbbuff); if (moreframes == 0) { ! file_set_end(); } ! frame_display(c, &img, rgbbuff); } ! l = qman_howlate(0); timevect2[i] = l; l = l / 33000; *************** *** 245,249 **** l = MAXSLIDE; } ! gtk_progress_bar_update(GTK_PROGRESS_BAR(prbar), (float) l / (float) MAXSLIDE); --- 173,177 ---- l = MAXSLIDE; } ! gtk_progress_bar_update(GTK_PROGRESS_BAR(c->prbar), (float) l / (float) MAXSLIDE); *************** *** 256,295 **** free(rgbbuff); ! printf("Saving\n"); ! sprintf(filename, "res_%d_if.tim", num); ! f = fopen(filename, "w"); ! for (i = 1; i < 5000; i++) { ! if (timevect1[i] != 0) { ! if (timevect[i] < timevect[i - 1]) { ! timevect[i] = timevect[i - 1]; ! // fprintf(f, "%d\t-1\t%lu\n", i, (unsigned long int)timevect[i] /*- timevect[0]*/); ! } else { ! if (timevect[i - 1] != timevect[i - 2]) { ! fprintf(f, "%d\t%lu\t%lu\n", i, ! (unsigned long int) (timevect[i] - ! timevect[i - 1]), ! (unsigned long int) timevect[i] ! /*- timevect[0]*/ ! ); ! } ! } ! } ! } ! sprintf(filename, "res_%d_ct.tim", num); ! f = fopen(filename, "w"); ! for (i = 1; i < 500; i++) { ! if (timevect1[i] != 0) { ! fprintf(f, "%d\t%lu\t1\n", i, ! (unsigned long int) (timevect1[i] - timevect[i])); ! } ! } ! sprintf(filename, "res_%d_l.tim", num); ! f = fopen(filename, "w"); ! for (i = 1; i < 500; i++) { ! fprintf(f, "%d\t%lu\n", i, timevect2[i]); ! } ! ! fclose(f); ! cprintf("Returning\n"); return 1; --- 184,189 ---- free(rgbbuff); ! results_save(num); ! cprintf("Returning\n"); return 1; Index: test1.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/test1.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** test1.c 21 Feb 2004 13:01:52 -0000 1.1.1.1 --- test1.c 9 Apr 2004 13:39:56 -0000 1.2 *************** *** 43,51 **** #include <local.h> /*#include <arch/basetype.h>*/ #include "qos.h" #include "req.h" - #include "adj.h" extern TASK mpbody(WORD id); int ac; --- 43,52 ---- #include <local.h> /*#include <arch/basetype.h>*/ + #include <wait.h> #include "qos.h" #include "req.h" + extern struct reqactions adjactions; extern TASK mpbody(WORD id); int ac; *************** *** 67,75 **** int main(int argc, char *argv[]) { ! struct psparm t; ! struct qmparm initparm; ID qt1, qt2; char name[80]; ! int i; ac = argc; --- 68,76 ---- int main(int argc, char *argv[]) { ! struct pstask_attr t; ! struct qman_attr initparm; ID qt1, qt2; char name[80]; ! int i, dummy; ac = argc; *************** *** 87,91 **** ! setreq(&adjactions); printf("Init Done!!!\n"); t.quantum = 3000; --- 88,92 ---- ! qman_feedback(&adjactions); printf("Init Done!!!\n"); t.quantum = 3000; *************** *** 96,100 **** t.body = mpbody; ! qt1 = ps_addtask(&t); if (qt1 == 0) { printf("QoS Task creation failed...\n"); --- 97,101 ---- t.body = mpbody; ! qt1 = qman_pstask(&t); if (qt1 == 0) { printf("QoS Task creation failed...\n"); *************** *** 109,113 **** t.body = mpbody; ! qt2 = ps_addtask(&t); if (qt2 == 0) { printf("QoS Task creation failed...\n"); --- 110,114 ---- t.body = mpbody; ! qt2 = qman_pstask(&t); if (qt2 == 0) { printf("QoS Task creation failed...\n"); *************** *** 117,122 **** printf("Waiting...\n"); ! for (;;); ! sleep(20); exit(0); --- 118,123 ---- printf("Waiting...\n"); ! wait(&dummy); wait(&dummy); ! sleep(2); exit(0); |