Changeset 668 for trunk


Ignore:
Timestamp:
Oct 10, 2020, 6:38:47 PM (4 years ago)
Author:
alain
Message:

typos...

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r657 r668  
    3030# Rules that don't build target files
    3131# always out-of-date, need to be regenerated everytime they are called
    32 .PHONY: compile                                \
    33         hard_config.h                      \
    34                 dirs                                           \
    35                 list                                           \
    36                 extract                                        \
    37                 fsck                                           \
    38                 clean                                          \
    39                 build_libs                         \
    40                 build-disk                                     \
    41                 $(BOOTLOADER_PATH)/build/boot.elf  \
    42                 kernel/build/kernel.elf            \
    43                 user/init/build/init.elf           \
    44                 user/ksh/build/ksh.elf             \
    45                 user/pgdc/build/pgcd.elf           \
    46                 user/idbg/build/idbg.elf           \
    47                 user/sort/build/sort.elf           \
    48         user/fft/build/fft.elf             \
    49         user/display/build/display.elf     \
    50         user/convol/build/convol.elf       \
    51         user/transpose/build/transpose.elf \
    52         user/kleenex/build/kleenex.elf
     32.PHONY: compile                                  \
     33        hard_config.h                        \
     34                dirs                                             \
     35                list                                             \
     36                extract                                          \
     37                fsck                                             \
     38                clean                                            \
     39                build_libs                           \
     40                build-disk                                       \
     41                $(BOOTLOADER_PATH)/build/boot.elf    \
     42                kernel/build/kernel.elf              \
     43                user/init/build/init.elf             \
     44                user/ksh/build/ksh.elf               \
     45                user/pgdc/build/pgcd.elf             \
     46                user/idbg/build/idbg.elf             \
     47                user/sort/build/sort.elf             \
     48        user/fft/build/fft.elf               \
     49        user/display/build/display.elf       \
     50        user/convol/build/convol.elf         \
     51        user/transpose/build/transpose.elf   \
     52        user/kleenex/build/kleenex.elf       \
     53        user/tcp_server/build/tcp_server.elf \
     54        user/tcp_client/build/tcp_client.elf
    5355 
    54 
    5556# Virtual disk path
    5657DISK_IMAGE      := hdd/virt_hdd.dmg
     
    6667# when the corresponding sources files have been modified or destroyed.
    6768# The "home" directory on the virtual disk is not modified
    68 compile: dirs                                \
    69          hard_config.h                       \
    70          build_libs                          \
    71          $(BOOTLOADER_PATH)/build/boot.elf   \
    72          kernel/build/kernel.elf             \
    73          user/init/build/init.elf            \
    74          user/ksh/build/ksh.elf              \
    75          user/pgcd/build/pgcd.elf            \
    76          user/idbg/build/idbg.elf            \
    77          user/sort/build/sort.elf            \
    78          user/fft/build/fft.elf              \
    79          user/display/build/display.elf      \
    80          user/convol/build/convol.elf        \
    81          user/transpose/build/transpose.elf  \
    82          user/kleenex/build/kleenex.elf      \
     69compile: dirs                                 \
     70         hard_config.h                        \
     71         build_libs                           \
     72         $(BOOTLOADER_PATH)/build/boot.elf    \
     73         kernel/build/kernel.elf              \
     74         user/init/build/init.elf             \
     75         user/ksh/build/ksh.elf               \
     76         user/pgcd/build/pgcd.elf             \
     77         user/idbg/build/idbg.elf             \
     78         user/sort/build/sort.elf             \
     79         user/fft/build/fft.elf               \
     80         user/display/build/display.elf       \
     81         user/convol/build/convol.elf         \
     82         user/transpose/build/transpose.elf   \
     83         user/kleenex/build/kleenex.elf       \
     84         user/tcp_server/build/tcp_server.elf \
     85         user/tcp_client/build/tcp_client.elf \
    8386         list
    8487
     
    120123        $(MAKE) -C user/kleenex clean
    121124        $(MAKE) -C user/transpose clean
     125        $(MAKE) -C user/tcp_server clean
     126        $(MAKE) -C user/tcp_client clean
    122127        $(MAKE) -C $(HAL_ARCH) clean
    123128
     
    228233        $(MAKE) -C user/transpose
    229234        mcopy -o -i $(DISK_IMAGE) $@ ::/bin/user
     235user/tcp_server/build/tcp_server.elf: build_libs
     236        $(MAKE) -C user/tcp_server
     237        mcopy -o -i $(DISK_IMAGE) $@ ::/bin/user
     238user/tcp_client/build/tcp_client.elf: build_libs
     239        $(MAKE) -C user/tcp_client
     240        mcopy -o -i $(DISK_IMAGE) $@ ::/bin/user
  • trunk/kernel/devices/dev_nic.c

    r663 r668  
    384384        fdid_t   fdid       = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
    385385
    386         printk("\n[ERROR] reported by %s : socket[%x,%d] / %s / cmd %s / error %s \n",
     386        printk("\n[WARNING] reported by %s : socket[%x,%d] / %s / cmd %s / status %s \n",
    387387        __FUNCTION__, pid, fdid, socket_state_str(sock_state),
    388388        socket_cmd_type_str(cmd_type), socket_cmd_sts_str(status) );
     
    425425        fdid_t   fdid       = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
    426426
    427         printk("\n[ERROR] reported by %s : socket[%x,%d] / %s / cmd %s / error %s\n",
     427        printk("\n[WARNING] reported by %s : socket[%x,%d] / %s / cmd %s / status %s\n",
    428428        __FUNCTION__, pid, fdid, socket_state_str(sock_state),
    429429        socket_cmd_type_str(cmd_type), socket_cmd_sts_str(status) );
  • trunk/kernel/devices/dev_nic.h

    r663 r668  
    158158#define NIC_KERNEL_BUF_SIZE    0x800        // 2 Kbytes for one ETH/IP/TCP packet
    159159
     160#define CMD_
     161
    160162/*****************************************************************************************
    161163 * This structure defines the specific chdev extension for NIC device:
  • trunk/kernel/kern/ksocket.c

    r662 r668  
    11571157    thread_t  * this      = CURRENT_THREAD;
    11581158    xptr_t      client_xp = XPTR( local_cxy , this );
     1159    pid_t       pid       = this->process->pid;
     1160    trdid_t     trdid     = this->trdid;
    11591161
    11601162    // get pointers on file descriptor
     
    11761178#if DEBUG_SOCKET_CONNECT
    11771179uint32_t cycle = (uint32_t)hal_get_cycles();
    1178 pid_t    pid   = this->process->pid;
    1179 trdid_t  trdid = this->trdid;
    11801180if( DEBUG_SOCKET_CONNECT < cycle )
    11811181printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / addr %x / port %d / cycle %d\n",
     
    13281328    thread_t   * this      = CURRENT_THREAD;
    13291329    xptr_t       client_xp = XPTR( local_cxy , this );
    1330     process_t  * process   = this->process;
     1330    pid_t        pid       = this->process->pid;
     1331    trdid_t      trdid     = this->trdid;
    13311332
    13321333    // get pointer on socket descriptor
     
    13401341#if DEBUG_SOCKET_CLOSE
    13411342uint32_t cycle = (uint32_t)hal_get_cycles();
    1342 pid_t    pid   = this->process->pid;
    13431343if (DEBUG_SOCKET_CLOSE < cycle )
    13441344printk("\n[%s] thread[%x,%x] enters for socket[%x,%d] / cycle %d\n",
    1345 __FUNCTION__, pid, this->trdid, pid, fdid, cycle );
     1345__FUNCTION__, pid, trdid, pid, fdid, cycle );
    13461346#endif
    13471347
     
    13601360                   
    13611361        printk("\n[ERROR] in %s : previous TX cmd on socket[%x,%d] / thread[%x,%x]\n",
    1362         __FUNCTION__, process->pid, fdid, process->pid, this->trdid );
     1362        __FUNCTION__, pid, fdid, pid, trdid );
    13631363        return -1;
    13641364    }
     
    13811381if( cycle > DEBUG_DEV_NIC_TX )
    13821382printk("\n[%s] thread[%x,%x] socket[%x,%d] %s / destroy socket / cycle %d\n",
    1383 __FUNCTION__, this->process->pid, this->trdid, pid, fdid,
    1384 socket_state_str( socket_state ), cycle );
     1383__FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle );
    13851384#endif
    13861385        // directly destroy socket
     
    13981397if( cycle > DEBUG_DEV_NIC_TX )
    13991398printk("\n[%s] thread[%x,%x] socket[%x,%d] %s / destroy socket / cycle %d\n",
    1400 __FUNCTION__, this->process->pid, this->trdid, pid, fdid,
    1401 socket_state_str( socket_state ), cycle );
     1399__FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle );
    14021400#endif
    14031401        // directly destroy socket
     
    14321430if( DEBUG_SOCKET_CLOSE < cycle )
    14331431printk("\n[%s] thread[%x,%x] socket[%x,%d] blocks on <IO> waiting close / cycle %d \n",
    1434 __FUNCTION__, pid, this->trdid, pid, fdid, cycle );
     1432__FUNCTION__, pid, trdid, pid, fdid, cycle );
    14351433#endif
    14361434        // block itself and deschedule
     
    14421440if( DEBUG_SOCKET_CLOSE < cycle )
    14431441printk("\n[%s] thread[%x,%x] socket[%x,%d] / resumes / cycle %d \n",
    1444 __FUNCTION__, pid, this->trdid, pid, fdid, cycle );
     1442__FUNCTION__, pid, trdid, pid, fdid, cycle );
    14451443#endif
    14461444        // take socket lock
     
    14741472if( DEBUG_SOCKET_CLOSE < cycle )
    14751473printk("\n[%s] thread[%x,%x] socket[%x,%d] / destroy socket / cycle %d\n",
    1476 __FUNCTION__, pid, this->trdid, pid, fdid, socket_state_str(socket_state) , cycle );
     1474__FUNCTION__, pid, trdid, pid, fdid, socket_state_str(socket_state) , cycle );
    14771475#endif
    14781476            // destroy socket
  • trunk/kernel/kern/ksocket.h

    r662 r668  
    421421 * It is called by a (local) server process to specify the max size of the CRQ queue
    422422 * for a socket identified by the <fdid> argument, that expect connection requests
    423  * from one or several (remote) client processes.  The selected socket CRQ is supposed
     423 * from one or several (remote) client processes. The selected socket CRQ is supposed
    424424 * to register all connections requests, whatever the client IP address and port values.
     425 *
    425426 * This function applies only to a TCP socket, that must be in the BOUND state.
    426  * The <fdid> socket is set to the LISTEN state.
     427 * The socket is set to the LISTEN state.
    427428 * It does not require any service from the NIC_TX and NIC_RX server threads.
    428429 * It can be called by a thread running in any cluster.
     
    451452 * with bind(), and listening for connections after a listen(). It  blocks on the <IO>
    452453 * condition if the CRQ is empty. Otherwise, it get a pending connection request from
    453  * the listening socket CRQ queue, and creates & initializes a new socket with
    454  * the same properties as the listening socket, allocating a new file descriptor
    455  * for this new socket. It returns the new socket fdid as well as the remote IP address
     454 * the listening socket CRQ queue, and creates a new socket with the same properties
     455 * as the listening socket, allocating a new file descriptor for this new socket.
     456 * It computes the nic_channel index [k] from <remote_addr> and <remote_port> values,
     457 * and initializes "remote_addr","remote_port", "nic_channel" in local socket.
     458 * It returns the new socket fdid as well as the remote IP address
    456459 * and port, but only when the new socket is set to the ESTAB state. The new socket
    457460 * cannot accept connections, but the listening socket keeps open for new connections. 
  • trunk/params-hard.mk

    r657 r668  
    22
    33ARCH      = /Users/alain/soc/tsar-trunk-svn-2013/platforms/tsar_generic_iob
    4 X_SIZE    = 2
    5 Y_SIZE    = 2
    6 NB_PROCS  = 1
    7 NB_TTYS   = 2
     4X_SIZE    = 1
     5Y_SIZE    = 1
     6NB_PROCS  = 2
     7NB_TTYS   = 4
    88IOC_TYPE  = IOC_BDV
    99TXT_TYPE  = TXT_TTY
  • trunk/user/tcp_server/tcp_server.c

    r660 r668  
    129129        exit( 0 );
    130130    }
    131     else
    132     {
    133         printf("\n[server] listening socket[%x,%d] bound : [%x,%x]\n",
    134         pid, listen_fdid, server_sin.sin_addr, server_sin.sin_port );
    135     }
     131
     132    printf("\n[server] listening socket[%x,%d] bound : [%x,%x]\n",
     133    pid, listen_fdid, server_sin.sin_addr, server_sin.sin_port );
    136134
    137135    // 3. Listen clients connection requests
     
    144142        exit( 0 );
    145143    }
    146     else
    147     {
    148         printf("\n[server] listening socket[%x,%d] waiting connection request\n",
    149         pid, listen_fdid );
    150     }
    151144
     145    printf("\n[server] listening socket[%x,%d] waiting connection request\n",
     146    pid, listen_fdid );
    152147   
    153148    // 4. accept connection(s)
     
    156151                        &addr_length );
    157152
    158     if( chat_fdid == -1 )
     153    if( chat_fdid < 0 )
    159154    {
    160155        printf("\n[server error] accept failure on socket[%x,%d]\n",
     
    162157        exit( 0 );
    163158    }
    164     else
    165     {
    166         printf("\n[server] chat socket[%x,%d] accepted client [%x,%x]\n",
    167         pid, chat_fdid , client_sin.sin_addr , client_sin.sin_port );
    168     }
     159
     160    printf("\n[server] chat socket[%x,%d] accepted client [%x,%x]\n",
     161    pid, chat_fdid , client_sin.sin_addr , client_sin.sin_port );
    169162
    170163    // 5. call chat function
    171     // server_chat( chat_fdid );
     164    server_chat( chat_fdid );
    172165
    173166    // 6. close listen and chat sockets
    174 
    175     printf("\n[server] before close socket[%x,%d]\n", pid, chat_fdid );
    176 
    177167    close( chat_fdid );
    178 
    179     printf("\n[server] after close socket[%x,%d]\n", pid, chat_fdid );
    180 
    181168    close( listen_fdid );
    182169
Note: See TracChangeset for help on using the changeset viewer.