source: soft/giet_vm/giet_libs/stdio.c @ 490

Last change on this file since 490 was 487, checked in by alain, 9 years ago

1) Change the user sbt_barrier_init() prototype: the two (nclusters/ntasks) arguments
replace the single (ntasks) argument.
2) Introduce an explicit (channel) argument in all iuser access functions to the NIC component.
Previously, the channel registered in the task context was an implicit argument.
The channel is still registered in the task context for checking.

  • Property svn:executable set to *
File size: 24.5 KB
Line 
1//////////////////////////////////////////////////////////////////////////////////
2// File     : stdio.c         
3// Date     : 01/04/2010
4// Author   : alain greiner & Joel Porquet
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#include <stdarg.h>
9#include <stdio.h>
10#include <giet_config.h>
11
12////////////////////////////////////////////////////////////////////////////////////
13/////////////////////  MIPS32     related system calls /////////////////////////////
14////////////////////////////////////////////////////////////////////////////////////
15
16////////////////////////////////////////////
17void giet_proc_xyp( unsigned int* cluster_x,
18                    unsigned int* cluster_y,
19                    unsigned int* lpid )
20{
21    sys_call( SYSCALL_PROC_XYP,
22              (unsigned int)cluster_x,
23              (unsigned int)cluster_y,
24              (unsigned int)lpid,
25               0 );
26}
27
28////////////////////////////
29unsigned int giet_proctime() 
30{
31    return (unsigned int)sys_call( SYSCALL_PROC_TIME, 
32                                   0, 0, 0, 0 );
33}
34
35////////////////////////
36unsigned int giet_rand() 
37{
38    unsigned int x = (unsigned int)sys_call( SYSCALL_PROC_TIME,
39                                             0, 0, 0, 0);
40    if ((x & 0xF) > 7) 
41    {
42        return (x*x & 0xFFFF);
43    }
44    else 
45    {
46        return (x*x*x & 0xFFFF);
47    }
48}
49
50//////////////////////////////////////////////////////////////////////////////////
51///////////////////// Task context  system calls /////////////////////////////////
52//////////////////////////////////////////////////////////////////////////////////
53
54////////////////////////////////
55unsigned int giet_proc_task_id() 
56{
57    return (unsigned int)sys_call( SYSCALL_LOCAL_TASK_ID, 
58                                   0, 0, 0, 0 );
59}
60
61//////////////////////////////////
62unsigned int giet_global_task_id() 
63{
64    return (unsigned int)sys_call( SYSCALL_GLOBAL_TASK_ID, 
65                                   0, 0, 0, 0 );
66}
67
68/////////////////////////////
69unsigned int giet_thread_id() 
70{
71    return (unsigned int)sys_call( SYSCALL_THREAD_ID, 
72                                   0, 0, 0, 0 );
73}
74
75
76////////////////////////////////////////////////////////////////////////////////////
77/////////////////////  TTY device related system calls /////////////////////////////
78////////////////////////////////////////////////////////////////////////////////////
79
80/////////////////////
81void giet_tty_alloc()
82{
83    sys_call( SYSCALL_TTY_ALLOC, 0, 0 ,0 ,0 );
84}
85
86////////////////////////////////////////////////////////////////////////
87static  int __printf( char* format, unsigned int channel, va_list* args) 
88{
89    int ret;                    // return value from the syscall
90
91printf_text:
92
93    while (*format) 
94    {
95        unsigned int i;
96        for (i = 0 ; format[i] && (format[i] != '%') ; i++);
97        if (i) 
98        {
99            ret = sys_call(SYSCALL_TTY_WRITE, 
100                           (unsigned int)format,
101                           i, 
102                           channel,
103                           0);
104
105            if (ret != i) goto return_error;
106
107            format += i;
108        }
109        if (*format == '%') 
110        {
111            format++;
112            goto printf_arguments;
113        }
114    }
115
116    return 0;
117
118printf_arguments:
119
120    {
121        char buf[20];
122        char * pbuf;
123        unsigned int len = 0;
124        static const char HexaTab[] = "0123456789ABCDEF";
125        unsigned int i;
126
127        switch (*format++) 
128        {
129            case ('c'):             /* char conversion */
130            {
131                int val = va_arg( *args, int );
132                len = 1;
133                buf[0] = val;
134                pbuf = &buf[0];
135                break;
136            }
137            case ('d'):             /* 32 bits decimal signed integer */
138            {
139                int val = va_arg( *args, int );
140                if (val < 0) 
141                {
142                    val = -val;
143                    ret = sys_call(SYSCALL_TTY_WRITE, 
144                                   (unsigned int)"-",
145                                   1,
146                                   channel,
147                                   0);
148                    if (ret != 1) goto return_error;
149                }
150                for(i = 0; i < 10; i++) 
151                {
152                    buf[9 - i] = HexaTab[val % 10];
153                    if (!(val /= 10)) break;
154                }
155                len =  i + 1;
156                pbuf = &buf[9 - i];
157                break;
158            }
159            case ('u'):             /* 32 bits decimal unsigned integer */
160            {
161                unsigned int val = va_arg( *args, unsigned int );
162                for(i = 0; i < 10; i++) 
163                {
164                    buf[9 - i] = HexaTab[val % 10];
165                    if (!(val /= 10)) break;
166                }
167                len =  i + 1;
168                pbuf = &buf[9 - i];
169                break;
170            }
171            case ('x'):             /* 32 bits hexadecimal integer */
172            {
173                unsigned int val = va_arg( *args, unsigned int );
174                ret = sys_call(SYSCALL_TTY_WRITE,
175                               (unsigned int)"0x",
176                               2,
177                               channel,
178                               0);
179                if (ret != 2) goto return_error;       
180                for(i = 0; i < 8; i++) 
181                {
182                    buf[7 - i] = HexaTab[val % 16];
183                    if (!(val /= 16))  break;
184                }
185                len =  i + 1;
186                pbuf = &buf[7 - i];
187                break;
188            }
189            case ('l'):            /* 64 bits hexadecimal unsigned */
190            {
191                unsigned long long val = va_arg( *args, unsigned long long );
192                ret = sys_call(SYSCALL_TTY_WRITE,
193                               (unsigned int)"0x",
194                               2,
195                               channel,
196                               0);
197                if (ret != 2) goto return_error;
198                for(i = 0; i < 16; i++) 
199                {
200                    buf[15 - i] = HexaTab[val % 16];
201                    if (!(val /= 16))  break;
202                }
203                len =  i + 1;
204                pbuf = &buf[15 - i];
205                break;
206            }
207            case ('s'):             /* string */
208            {
209                char* str = va_arg( *args, char* );
210                while (str[len]) 
211                {
212                    len++;
213                }
214                pbuf = str;
215                break;
216            }
217            default:
218                goto return_error;
219        }
220
221        ret = sys_call(SYSCALL_TTY_WRITE, 
222                       (unsigned int)pbuf,
223                       len,
224                       channel, 
225                       0);
226        if (ret != len)  goto return_error;
227       
228        goto printf_text;
229    }
230
231return_error:
232    return 1;
233} // end __printf()
234
235
236////////////////////////////////////////
237void giet_tty_printf( char* format, ...) 
238{
239    va_list args;
240
241    va_start( args, format );
242    int ret = __printf(format, 0xFFFFFFFF, &args);
243    va_end( args );
244
245    if (ret)
246    {
247        giet_exit("ERROR in giet_tty_printf()");
248    }
249} // end giet_tty_printf()
250
251////////////////////////////////////////
252void giet_shr_printf( char* format, ...) 
253{
254    va_list args;
255    const int channel = 0;
256    volatile unsigned int sr_save;
257
258    sys_call( SYSCALL_TTY_GET_LOCK,
259              channel,
260              (unsigned int)&sr_save,
261              0, 0 );
262
263    va_start( args, format );
264    int ret = __printf(format, channel, &args);
265    va_end( args );
266
267    sys_call( SYSCALL_TTY_RELEASE_LOCK,
268              channel,
269              (unsigned int)&sr_save,
270              0, 0 );
271
272    if (ret)
273    {
274        giet_exit("error in giet_shr_printf()");
275    }
276} // end giet_shr_printf()
277
278/////////////////////////////////
279void giet_tty_getc( char * byte ) 
280{
281    int ret;
282
283    do
284    {
285        ret = sys_call(SYSCALL_TTY_READ, 
286                      (unsigned int)byte,  // buffer address
287                      1,                   // number of characters
288                      0xFFFFFFFF,          // channel index from task context
289                      0);
290        if ( ret < 0 ) giet_exit("error in giet_tty_getc()");
291    }
292    while (ret != 1); 
293}
294
295/////////////////////////////////////
296void giet_tty_gets( char*        buf, 
297                    unsigned int bufsize ) 
298{
299    int           ret;
300    unsigned char byte;
301    unsigned int  index = 0;
302 
303    while (index < (bufsize - 1)) 
304    {
305        do 
306        { 
307            ret = sys_call(SYSCALL_TTY_READ, 
308                           (unsigned int)(&byte),
309                           1,
310                           0xFFFFFFFF,
311                           0);
312            if ( ret < 0 ) giet_exit("error in giet_tty_gets()");
313        } 
314        while (ret != 1);
315
316        if (byte == 0x0A)  /* LF */
317        {
318            break; 
319        }
320        else if ((byte == 0x7F) && (index > 0))  /* DEL */
321        {
322            index--; 
323        }
324        else 
325        {
326            buf[index] = byte;
327            index++;
328        }
329    }
330    buf[index] = 0;
331}
332
333///////////////////////////////////////
334void giet_tty_getw( unsigned int* val ) 
335{
336    unsigned char buf[32];
337    unsigned int  string_byte   = 0x00000000;    // string containing one single byte
338    unsigned int  string_cancel = 0x00082008;    // string containing BS/SPACE/BS
339    unsigned int  save = 0;
340    unsigned int  dec = 0;
341    unsigned int  done = 0;
342    unsigned int  overflow = 0;
343    unsigned int  length = 0;
344    unsigned int  i;
345    unsigned int  channel = 0xFFFFFFFF;
346    int           ret;      // return value from syscalls
347 
348    // get characters
349    while (done == 0) 
350    {
351        // read one character
352        do 
353        { 
354            ret = sys_call( SYSCALL_TTY_READ,
355                            (unsigned int)(&string_byte),
356                            1,
357                            channel, 
358                            0); 
359            if ( ret < 0 ) giet_exit("error in giet_tty_getw()");
360        } 
361        while (ret != 1);
362
363        // analyse character
364        if ((string_byte > 0x2F) && (string_byte < 0x3A))  /* decimal character */
365        {
366            buf[length] = (unsigned char)string_byte;
367            length++;
368
369            // echo
370            ret = sys_call( SYSCALL_TTY_WRITE, 
371                            (unsigned int)(&string_byte),
372                            1, 
373                            channel, 
374                            0 );
375            if ( ret < 0 ) giet_exit("error in giet_tty_gets()");
376        }
377        else if (string_byte == 0x0A)                     /* LF character */
378        {
379            done = 1;
380        }
381        else if ( (string_byte == 0x7F) ||                /* DEL character */
382                  (string_byte == 0x08) )                 /* BS  character */
383        {
384            if ( length > 0 ) 
385            {
386                length--;    // cancel the character
387
388                ret = sys_call( SYSCALL_TTY_WRITE, 
389                                (unsigned int)(&string_cancel),
390                                3, 
391                                channel, 
392                                0 );
393                if ( ret < 0 ) giet_exit("error in giet_tty_getw()");
394            }
395        }
396
397        // test buffer overflow
398        if ( length >= 32 ) 
399        {
400            overflow = 1;
401            done     = 1;
402        }
403    }  // end while characters
404
405    // string to int conversion with overflow detection
406    if ( overflow == 0 )
407    {
408        for (i = 0; (i < length) && (overflow == 0) ; i++) 
409        {
410            dec = dec * 10 + (buf[i] - 0x30);
411            if (dec < save)  overflow = 1; 
412            save = dec;
413        }
414    } 
415
416    // final evaluation
417    if ( overflow == 0 )
418    {
419        // return value
420        *val = dec;
421    }
422    else
423    {
424        // cancel all echo characters
425        for (i = 0; i < length ; i++) 
426        {
427            ret = sys_call( SYSCALL_TTY_WRITE, 
428                            (unsigned int)(&string_cancel),
429                            3, 
430                            channel, 
431                            0 );
432            if ( ret < 0 ) giet_exit("error in giet_tty_getw()");
433        }
434        // echo character '0'
435        string_byte = 0x30;
436        ret = sys_call( SYSCALL_TTY_WRITE, 
437                        (unsigned int)(&string_byte),
438                        1, 
439                        channel, 
440                        0 );
441        if ( ret < 0 ) giet_exit("error in giet_tty_getw()");
442
443        // return 0 value
444        *val = 0;
445    }
446}
447
448
449//////////////////////////////////////////////////////////////////////////////////
450/////////////////////  TIMER related system calls ////////////////////////////////
451//////////////////////////////////////////////////////////////////////////////////
452
453///////////////////////
454void giet_timer_alloc() 
455{
456    if ( sys_call( SYSCALL_TIM_ALLOC,
457                   0, 0, 0, 0 ) ) giet_exit("error in giet_timer_alloc()");
458}
459
460////////////////////////////////////////////
461void giet_timer_start( unsigned int period ) 
462{
463    if ( sys_call( SYSCALL_TIM_START,
464                   period,
465                   0, 0, 0 ) ) giet_exit("error in giet_timer_start()");
466}
467
468//////////////////////
469void giet_timer_stop() 
470{
471    if ( sys_call( SYSCALL_TIM_STOP,
472                   0, 0, 0, 0 ) ) giet_exit("error in giet_timer_stop()");
473}
474
475
476//////////////////////////////////////////////////////////////////////////////////
477///////////////  Frame buffer device related system calls  ///////////////////////
478//////////////////////////////////////////////////////////////////////////////////
479
480/////////////////////////
481void giet_fbf_cma_alloc()
482{
483    if ( sys_call( SYSCALL_FBF_CMA_ALLOC, 
484                   0, 0, 0, 0 ) )    giet_exit("error in giet_fbf_cma_alloc()");
485}
486
487///////////////////////////////////////////
488void giet_fbf_cma_start( void *       buf0,
489                         void *       buf1,
490                         unsigned int length )
491{
492    if ( sys_call( SYSCALL_FBF_CMA_START,
493                   (unsigned int)buf0, 
494                   (unsigned int)buf1, 
495                   length,
496                   0 ) )   giet_exit("error in giet_fbf_cma_start()");
497}
498
499////////////////////////////////////////////////
500void giet_fbf_cma_display( unsigned int buffer )
501{
502    if ( sys_call( SYSCALL_FBF_CMA_DISPLAY,
503                   buffer, 
504                   0, 0, 0 ) )   giet_exit("error in giet_fbf_cma_display()");
505}
506
507////////////////////////
508void giet_fbf_cma_stop()
509{
510    if ( sys_call( SYSCALL_FBF_CMA_STOP, 
511                   0, 0, 0, 0 ) )    giet_exit("error in giet_fbf_cma_stop()");
512}
513
514//////////////////////////////////////////////
515void giet_fbf_sync_write( unsigned int offset, 
516                          void *       buffer, 
517                          unsigned int length ) 
518{
519    if ( sys_call( SYSCALL_FBF_SYNC_WRITE, 
520                   offset, 
521                   (unsigned int)buffer, 
522                   length, 
523                   0 ) )  giet_exit("error in giet_fbf_sync_write()");
524}
525
526/////////////////////////////////////////////
527void giet_fbf_sync_read( unsigned int offset, 
528                         void *       buffer, 
529                         unsigned int length ) 
530{
531    if ( sys_call( SYSCALL_FBF_SYNC_READ, 
532                   offset, 
533                   (unsigned int)buffer, 
534                   length, 
535                   0 ) )   giet_exit("error in giet_fbf_sync_read()");
536}
537
538
539//////////////////////////////////////////////////////////////////////////////////
540/////////////////////// NIC related system calls /////////////////////////////////
541//////////////////////////////////////////////////////////////////////////////////
542
543////////////////////////////////
544unsigned int giet_nic_rx_alloc()
545{
546    int channel = sys_call( SYSCALL_NIC_ALLOC,
547                            1, 
548                            0, 0, 0 );
549    if ( channel < 0 ) giet_exit("error in giet_nic_rx_alloc()");
550
551    return (unsigned int)channel;
552}
553
554////////////////////////////////
555unsigned int giet_nic_tx_alloc()
556{
557    int channel = sys_call( SYSCALL_NIC_ALLOC,
558                            0, 
559                            0, 0, 0 );
560    if ( channel < 0 ) giet_exit("error in giet_nic_tx_alloc()");
561
562    return (unsigned int)channel;
563}
564
565//////////////////////////////////////////////
566void giet_nic_rx_start( unsigned int channel )
567{
568    if ( sys_call( SYSCALL_NIC_START,
569                   1,
570                   channel,
571                   0, 0 ) ) giet_exit("error in giet_nic_rx_start()");
572}
573
574//////////////////////////////////////////////
575void giet_nic_tx_start( unsigned int channel )
576{
577    if ( sys_call( SYSCALL_NIC_START,
578                   0, 
579                   channel,
580                   0, 0 ) ) giet_exit("error in giet_nic_tx_start()");
581}
582
583///////////////////////////////////////////////////////////
584void giet_nic_rx_move( unsigned int channel, void* buffer )
585{
586    if ( sys_call( SYSCALL_NIC_MOVE,
587                   1,
588                   channel, 
589                   (unsigned int)buffer,
590                   0 ) )  giet_exit("error in giet_nic_rx_move()");
591}
592
593///////////////////////////////////////////////////////////
594void giet_nic_tx_move( unsigned int channel, void* buffer )
595{
596    if ( sys_call( SYSCALL_NIC_MOVE,
597                   0,
598                   channel, 
599                   (unsigned int)buffer,
600                   0 ) )  giet_exit("error in giet_nic_tx_move()");
601}
602
603/////////////////////////////////////////////
604void giet_nic_rx_stop( unsigned int channel )
605{
606    if ( sys_call( SYSCALL_NIC_STOP,
607                   1, 
608                   channel,
609                   0, 0 ) ) giet_exit("error in giet_nic_rx_stop()");
610}
611
612/////////////////////////////////////////////
613void giet_nic_tx_stop( unsigned int channel )
614{
615    if ( sys_call( SYSCALL_NIC_STOP,
616                   0, 
617                   channel,
618                   0, 0 ) ) giet_exit("error in giet_nic_tx_stop()");
619}
620
621//////////////////////////////////////////////
622void giet_nic_rx_stats( unsigned int channel )
623{
624    if ( sys_call( SYSCALL_NIC_STATS,
625                   1, 
626                   channel,
627                   0, 0 ) ) giet_exit("error in giet_nic_rx_stats()");
628}
629
630//////////////////////////////////////////////
631void giet_nic_tx_stats( unsigned int channel )
632{
633    if ( sys_call( SYSCALL_NIC_STATS,
634                   0, 
635                   channel,
636                   0, 0 ) ) giet_exit("error in giet_nic_tx_stats()");
637}
638
639//////////////////////////////////////////////
640void giet_nic_rx_clear( unsigned int channel )
641{
642    if ( sys_call( SYSCALL_NIC_CLEAR,
643                   1, 
644                   channel,
645                   0, 0 ) ) giet_exit("error in giet_nic_rx_clear()");
646}
647
648//////////////////////////////////////////////
649void giet_nic_tx_clear( unsigned int channel )
650{
651    if ( sys_call( SYSCALL_NIC_CLEAR,
652                   0, 
653                   channel,
654                   0, 0 ) ) giet_exit("error in giet_nic_tx_clear()");
655}
656
657
658
659///////////////////////////////////////////////////////////////////////////////////
660///////////////////// FAT related system calls ////////////////////////////////////
661///////////////////////////////////////////////////////////////////////////////////
662
663///////////////////////////////////////////
664int giet_fat_open( const char*   pathname, 
665                   unsigned int  flags )
666{
667    return sys_call( SYSCALL_FAT_OPEN, 
668                     (unsigned int)pathname, 
669                     flags,
670                     0, 0 );
671}
672
673////////////////////////////////////
674void giet_fat_read( unsigned int fd,     
675                    void*        buffer, 
676                    unsigned int count, 
677                    unsigned int offset ) 
678{
679    if ( sys_call( SYSCALL_FAT_READ,
680                   fd, 
681                   (unsigned int)buffer,
682                   count, 
683                   offset ) != count ) giet_exit("ERROR in giet_fat_read()");
684}
685
686/////////////////////////////////////
687void giet_fat_write( unsigned int fd,
688                     void*        buffer, 
689                     unsigned int count,
690                     unsigned int offset )
691{
692    if ( sys_call( SYSCALL_FAT_WRITE, 
693                   fd, 
694                   (unsigned int)buffer,
695                   count, 
696                   offset ) != count ) giet_exit("ERROR in giet_fat_write()");
697}
698
699/* variant implementing the UNIX spec
700///////////////////////////////////////////////////////////////////////////////////
701// This system call writes to a file identified by the "fd" file descriptor.
702// - "buffer" is the source buffer virtual address (must be word aligned).
703// - "count" is a number of bytes (must be multiple of 4).
704// It uses the implicit "lseek" pointer in file descriptor.
705///////////////////////////////////////////////////////////////////////////////////
706void giet_fat_write( unsigned int fd,
707                    void*        buffer,
708                    unsigned int count )  // number of bytes
709{
710    return sys_call( SYSCALL_FAT_WRITE,
711                     fd,
712                     (unsigned int)buffer,
713                     count, 0 );
714}
715*/
716
717/////////////////////////////////////
718void giet_fat_lseek( unsigned int fd, 
719                    unsigned int offset, 
720                    unsigned int whence )
721{
722    if ( sys_call( SYSCALL_FAT_LSEEK, 
723                   fd, 
724                   offset, 
725                   whence, 
726                   0 ) ) giet_exit("ERROR in giet_fat_lseek()");
727}
728
729//////////////////////////////////////
730void giet_fat_fstat( unsigned int fd )
731{
732    if ( sys_call( SYSCALL_FAT_FSTAT,
733                   fd,
734                   0, 0, 0 ) )  giet_exit("ERROR in giet_fat_lseek()");
735}
736
737/////////////////////////////////////
738void giet_fat_close( unsigned int fd )
739{
740    if ( sys_call( SYSCALL_FAT_CLOSE,
741                   fd,
742                   0, 0, 0 ) )  giet_exit("ERROR in giet_fat_close()");
743}
744
745
746
747
748//////////////////////////////////////////////////////////////////////////////////
749///////////////////// Miscellaneous system calls /////////////////////////////////
750//////////////////////////////////////////////////////////////////////////////////
751
752//////////////////////////////
753void giet_exit( char* string ) 
754{
755    sys_call( SYSCALL_EXIT,
756              (unsigned int)string,
757              0, 0, 0 );
758}
759
760/////////////////////////////////////////
761void giet_assert( unsigned int condition,
762                  char*        string )
763{
764    if ( condition == 0 ) giet_exit( string );
765}
766
767//////////////////////////
768void giet_context_switch() 
769{
770    sys_call( SYSCALL_CTX_SWITCH,
771              0, 0, 0, 0 );
772}
773
774///////////////////////////////////////////////
775void giet_proc_number( unsigned int  cluster_id, 
776                       unsigned int* buffer ) 
777{
778    if ( sys_call( SYSCALL_PROC_NUMBER, 
779                   cluster_id, 
780                   (unsigned int) buffer, 
781                   0, 0) )  giet_exit("ERROR in giet_proc_number()");
782}
783
784////////////////////////////////////////////////////
785void giet_vobj_get_vbase( char*         vspace_name, 
786                          char*         vobj_name, 
787                          unsigned int* vbase ) 
788{
789    if ( sys_call( SYSCALL_VOBJ_GET_VBASE, 
790                   (unsigned int) vspace_name,
791                   (unsigned int) vobj_name,
792                   (unsigned int) vbase,
793                   0 ) )  giet_exit("ERROR in giet_vobj_get_vbase()");
794}
795
796////////////////////////////////////////////////////
797void giet_vobj_get_length( char*         vspace_name, 
798                           char*         vobj_name, 
799                           unsigned int* length ) 
800{
801    if ( sys_call( SYSCALL_VOBJ_GET_LENGTH, 
802                   (unsigned int) vspace_name,
803                   (unsigned int) vobj_name,
804                   (unsigned int) length,
805                   0 ) )  giet_exit("ERROR in giet_vobj_get_length()");
806}
807
808/////////////////////////////////////////
809void giet_heap_info( unsigned int* vaddr, 
810                     unsigned int* length,
811                     unsigned int  x,
812                     unsigned int  y ) 
813{
814    if ( sys_call( SYSCALL_HEAP_INFO, 
815                   (unsigned int)vaddr, 
816                   (unsigned int)length, 
817                   x,
818                   y ) )  giet_exit("ERROR in giet_heap_info()");
819}
820
821/////////////////////////////////////////
822void giet_get_xy( void*         ptr,
823                  unsigned int* px,
824                  unsigned int* py )
825{
826    if ( sys_call( SYSCALL_GET_XY,
827                   (unsigned int)ptr,
828                   (unsigned int)px,
829                   (unsigned int)py,
830                   0 ) )  giet_exit("ERROR in giet_get_xy()");
831}
832
833// Local Variables:
834// tab-width: 4
835// c-basic-offset: 4
836// c-file-offsets:((innamespace . 0)(inline-open . 0))
837// indent-tabs-mode: nil
838// End:
839// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
840
Note: See TracBrowser for help on using the repository browser.