Ignore:
Timestamp:
Dec 27, 2018, 7:38:58 PM (5 years ago)
Author:
alain
Message:

Fix several bugs in VFS to support the following
ksh commandis : cp, mv, rm, mkdir, cd, pwd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/list.h

    r457 r610  
    33 *
    44 * Authors Ghassan Almaless  (2008,2009,2010,2011,2012)
    5  *         Alain Greiner     (2016)
     5 *         Alain Greiner     (2016,2017,2018)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
     
    2323 */
    2424
    25 #ifndef _ALMOS_LIST_H_
    26 #define _ALMOS_LIST_H_
     25#ifndef _LIST_H_
     26#define _LIST_H_
    2727
    2828#include <kernel_config.h>
    2929#include <hal_kernel_types.h>
     30#include <printk.h>
    3031
    3132#ifndef NULL
     
    240241}
    241242
    242 
    243 #endif  /* _ALMOS_LIST_H_ */
     243/***************************************************************************
     244 * This debug function displays all entries of a list.
     245 * @ root    : local pointer on the root list_entry_t.
     246 * @ string  : list identifier displayed in header.
     247 * @ max     : max number of éléments to display.
     248 **************************************************************************/
     249static inline void list_display( list_entry_t * root,
     250                                 char         * string,
     251                                 uint32_t       max )
     252{
     253    list_entry_t * iter;
     254    list_entry_t * next;
     255    list_entry_t * pred;
     256    uint32_t       index;
     257
     258    next = root->next;
     259    pred = root->pred;
     260
     261    printk("\n***** root (%x) / next (%x) / pred (%x) / %s *****\n",
     262    root, next, pred, string );
     263
     264    if( list_is_empty( root ) == false )
     265    {
     266        for( iter = next , index = 0 ;
     267             (iter != root) && (index < max) ;
     268             iter = next , index++ )
     269        {
     270            next = iter->next;
     271                        pred = iter->pred;
     272
     273            printk(" - %d : iter (%x) / next (%x) / pred (%x)\n",
     274            index, iter, next, pred );
     275        }
     276    }
     277}  // end list_display()
     278
     279
     280#endif  /* _LIST_H_ */
Note: See TracChangeset for help on using the changeset viewer.