Annotation of qemu/roms/SLOF/board-qemu/veth/module_entry.c, revision 1.1.1.1

1.1       root        1: /******************************************************************************
                      2:  * Copyright (c) 2004, 2011 IBM Corporation
                      3:  * All rights reserved.
                      4:  * This program and the accompanying materials
                      5:  * are made available under the terms of the BSD License
                      6:  * which accompanies this distribution, and is available at
                      7:  * http://www.opensource.org/licenses/bsd-license.php
                      8:  *
                      9:  * Contributors:
                     10:  *     IBM Corporation - initial implementation
                     11:  *****************************************************************************/
                     12: 
                     13: #include "netdriver_int.h"
                     14: 
                     15: static void* memset( void *dest, int c, size_t n )
                     16: {
                     17:        while( n-- ) {
                     18:                *( char * ) dest++ = ( char ) c;
                     19:        }
                     20:        return dest;
                     21: }
                     22: 
                     23: extern char __bss_start;
                     24: extern char __bss_size;
                     25: 
                     26: extern snk_module_t* veth_module_init(snk_kernel_t *snk_kernel_int,
                     27:                                      vio_config_t *conf);
                     28: 
                     29: snk_module_t* module_init(snk_kernel_t *snk_kernel_int, pci_config_t *pciconf)
                     30: {
                     31:        char              *bss      = &__bss_start;
                     32:        unsigned long long bss_size = (unsigned long long) &__bss_size;
                     33:        vio_config_t      *vioconf  = (vio_config_t *)pciconf;
                     34: 
                     35:        if (((unsigned long long) bss) + bss_size >= 0xFF00000 
                     36:         || bss_size >= 0x2000000) {
                     37:                snk_kernel_int->print("BSS size (%llu bytes) is too big!\n",
                     38:                                      bss_size);
                     39:                return 0;
                     40:        }
                     41:        memset(bss, 0, bss_size);
                     42: 
                     43:        return veth_module_init(snk_kernel_int, vioconf);
                     44: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.