Changeset 657 for trunk/libs/libalmosmkh/almosmkh.h
- Timestamp:
- Mar 18, 2020, 11:16:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/libalmosmkh/almosmkh.h
r650 r657 2 2 * almosmkh.h - User level ALMOS-MKH specific library definition. 3 3 * 4 * Author Alain Greiner (2016,2017,2018,2019 )4 * Author Alain Greiner (2016,2017,2018,2019,2020) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 29 29 * - non standard system calls. 30 30 * - debug functions. 31 * - remote malloc extensions. 31 * - remote malloc extensions. 32 * - a parallel_pthread_create function. 33 * - Frame Buffer access syscalls. 32 34 **************************************************************************************/ 33 35 34 36 #include <pthread.h> 35 37 #include <shared_almos.h> 38 36 39 37 40 /****************** Non standard (ALMOS_MKH specific) system calls ********************/ … … 138 141 139 142 /*************************************************************************************** 140 * This syscall returns an unsigned 32 bits integer from the standard "stdin" stream. 143 * This syscall returns an 32 bits integer from the standard "stdin" stream. 144 * The value is copied in buffer pointed by the <buf> argument 141 145 * Both decimal numbers and hexadecimal numbers (prefixed by 0x) are supported. 142 146 *************************************************************************************** 143 * returns the integer value if success / returns -1 if failure. 144 **************************************************************************************/ 145 unsigned int get_uint32( void ); 147 * @ buffer : pointer on buffer. 148 * @ returns 0 if success / returns -1 if failure. 149 **************************************************************************************/ 150 int get_uint32( unsigned int * buffer ); 151 152 /*************************************************************************************** 153 * This syscall returns a character string from the standard "stdin" stream. 154 * The string is copied in buffer pointed by the <string> argument. 155 * The string length (including the NUL terminating character) cannot be larger 156 * than the size defined by the <size> argument. 157 *************************************************************************************** 158 * @ string : pointer on the string buffer. 159 * @ maxlen : max number of bytes in string buffer. 160 * @ returns 0 if success / returns -1 if failure. 161 **************************************************************************************/ 162 int get_string( char * string, 163 int maxlen ); 146 164 147 165 … … 278 296 279 297 /*************************************************************************************** 280 * This debug syscall displays on the kernel terminal TXT0 the content of one given 281 * page of the FAT mapper. 282 * It can be called by any thread running in any cluster. 283 *************************************************************************************** 284 * @ page_id : page index in file. 285 * @ nb_entries : number of bytes to display. 298 * This debug syscall displays on the kernel terminal TXT0 the content of <nb_slots> 299 * of the FAT mapper, starting from <min_slot>. 300 * If <nb_slots> is zero, it displays the state of the FATFS context in cluster 301 * defined by the <min_slot> argument interpreted as a cluster identifier. 302 * It can be called by any thread running in any cluster. 303 *************************************************************************************** 304 * @ min_slot : first slot in page 305 * @ nb_slots : number of slots to display. 286 306 * @ return 0 if success / return -1 if page not found. 287 307 **************************************************************************************/ 288 int display_fat( unsigned int page_id,289 unsigned int nb_ entries );308 int display_fat( unsigned int min_slot, 309 unsigned int nb_slots ); 290 310 291 311 /***************************************************************************************** … … 551 571 552 572 553 554 555 573 /********* Non standard (ALMOS-MKH specific) Frame Buffer access syscalls *************/ 556 574 … … 562 580 563 581 /***************************************************************************************** 564 * This function returns in the <width> and <height> arguments the buffer size. 582 * This function returns in the <width>, <height> and <type> arguments 583 * the implementation specific frame buffer features. 565 584 ***************************************************************************************** 566 585 * @ width : [out] number of pixels per line. 567 586 * @ height : [out] number of lines. 568 587 * @ type : [out] pixel encoding type. 569 * @ returns 0 if success / returns -1 if error.588 * @ returns 0 if success / returns -1 if not found. 570 589 ****************************************************************************************/ 571 590 int fbf_get_config( unsigned int * width, … … 574 593 575 594 /***************************************************************************************** 576 * This blocking function moves <length> bytes from the frame buffer, starting 577 * from <offset>, to the user buffer defined by <buffer> argument. 595 * This function creates a new window defined by the <l_zero>, <p_zero>, <nlines>, 596 * and <npixels> arguments for the calling process, and register the process PID, the 597 * allocated <wid>, and the window size and coordinates in the FBF device descriptor. 598 * It returns in the output argument <buffer> the pointer on the buffer associated to 599 * the window, mapped in user space. 600 * Warning : Both pixel [p_zero,l_zero] and pixel [p_zero+npixels-1,l_zero+nlines-1] 601 * must be contained in the frame buffer. 602 ***************************************************************************************** 603 * @ l_zero : [in] first line index in FBF coordinates system. 604 * @ p_zero : [in] first pixel index in FBF coordinates system. 605 * @ nlines : [in] number of lines in the window. 606 * @ npixels : [in] number of pixels per line in the window. 607 * @ buffer : [out] pointer on 608 * @ returns <wid> if success / returns -1 if illegal size or coordinates. 609 ****************************************************************************************/ 610 int fbf_create_window( unsigned int l_zero, 611 unsigned int p_zero, 612 unsigned int nlines, 613 unsigned int npixels, 614 void ** buffer ); 615 616 /***************************************************************************************** 617 * This function deletes an existing window, identified by the <wid> argument. 618 * The calling process must be the window owner. 619 ***************************************************************************************** 620 * @ wid : window identifier. 621 * @ returns 0 if success / returns -1 if not found or process not owner. 622 ****************************************************************************************/ 623 int fbf_delete_window( unsigned int wid ); 624 625 /***************************************************************************************** 626 * This function refreshes in FBF all lines of a window identified by the <wid> argument, 627 * when the line index is in the interval [line_first,line_last[. 628 * It scans all registered windows to take into account the windows overlap. 629 ***************************************************************************************** 630 * @ wid : window identifier. 631 * @ line_first : first line index. 632 * @ line_last : last line index (excluded). 633 * @ returns 0 if success / returns -1 if illegal argument. 634 ****************************************************************************************/ 635 int fbf_refresh_window( unsigned int wid, 636 unsigned int line_first, 637 unsigned int line_last ); 638 639 /***************************************************************************************** 640 * This function changes the size of a window identified by the <wid> argument as defined 641 * by the <width> and height> arguments. The calling process must be the window owner. 642 * WARNING : Both pixel [p_zero,l_zero] and pixel [p_zero+width-1,l_zero+height-1] 643 * must be contained in the frame buffer. 644 ***************************************************************************************** 645 * @ wid : window identifier. 646 * @ width : number of pixels in line (one byte per pixel). 647 * @ height : number of lines in window. 648 * @ returns 0 if success / returns -1 if illegal arguments. 649 ****************************************************************************************/ 650 int fbf_resize_window( unsigned int wid, 651 unsigned int width, 652 unsigned int height ); 653 654 /***************************************************************************************** 655 * This function changes the <l_zero> & <p_zero> coordinates of a window identified 656 * by the <wid> argument. The calling process must be the window owner. 657 * WARNING : Both pixel [p_zero,l_zero] and pixel [p_zero+width-1,l_zero+height-1] 658 * must be contained in the frame buffer. 659 ***************************************************************************************** 660 * @ wid : window identifier. 661 * @ l_zero : new first line index in FBF. 662 * @ p_zero : new first pixel index in FBF. 663 * @ returns 0 if success / returns -1 if illegal arguments. 664 ****************************************************************************************/ 665 int fbf_move_window( unsigned int wid, 666 unsigned int l_zero, 667 unsigned int p_zero ); 668 669 /***************************************************************************************** 670 * This syscall is deprecated (january 2020 AG) 671 * This blocking function moves <length> pixels from the user buffer defined by <buffer> 672 * argument to the frame buffer, starting at <offset> in FBF. 578 673 ***************************************************************************************** 579 674 * @ buffer : pointer on buffer in user space. 580 675 * @ length : number of pixels (one byte per pixel). 581 * @ offset : first pixel index in frame buffer. 582 * @ returns 0 if success / returns -1 if error. 676 * @ offset : first pixel index in window. 677 * @ returns 0 if success / returns -1 if illegal arguments. 678 ****************************************************************************************/ 679 int fbf_write( void * buffer, 680 unsigned int length, 681 unsigned int offset ); 682 683 /***************************************************************************************** 684 * This syscall is deprecated (january 2020 AG) 685 * This blocking function moves <length> pixels from the frame buffer, starting at 686 * <offset> in FBF, to the user buffer defined by <buffer> argument. 687 ***************************************************************************************** 688 * @ buffer : pointer on buffer in user space. 689 * @ length : number of pixels (one byte per pixel). 690 * @ offset : first pixel index in window. 691 * @ returns 0 if success / returns -1 if illegal arguments. 583 692 ****************************************************************************************/ 584 693 int fbf_read( void * buffer, … … 586 695 unsigned int offset ); 587 696 588 /*****************************************************************************************589 * This blocking function moves <length> bytes from the user buffer defined by <buffer>590 * argument to the frame buffer, starting at <offset> in frame buffer.591 *****************************************************************************************592 * @ buffer : pointer on buffer in user space.593 * @ length : number of pixels (one byte per pixel).594 * @ offset : first pixel index in frame buffer.595 * @ returns 0 if success / returns -1 if error.596 ****************************************************************************************/597 int fbf_write( void * buffer,598 unsigned int length,599 unsigned int offset );600 697 601 698 #endif /* _LIBALMOSMKH_H_ */
Note: See TracChangeset
for help on using the changeset viewer.