!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/drivers/sound/emu10k1/   drwxr-xr-x
Free 318.35 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     emuadxmg.c (3.11 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

/*     
 **********************************************************************
 *     emuadxmg.c - Address space manager for emu10k1 driver 
 *     Copyright 1999, 2000 Creative Labs, Inc. 
 * 
 ********************************************************************** 
 * 
 *     Date                 Author          Summary of changes 
 *     ----                 ------          ------------------ 
 *     October 20, 1999     Bertrand Lee    base code release 
 * 
 ********************************************************************** 
 * 
 *     This program is free software; you can redistribute it and/or 
 *     modify it under the terms of the GNU General Public License as 
 *     published by the Free Software Foundation; either version 2 of 
 *     the License, or (at your option) any later version. 
 * 
 *     This program is distributed in the hope that it will be useful, 
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *     GNU General Public License for more details. 
 * 
 *     You should have received a copy of the GNU General Public 
 *     License along with this program; if not, write to the Free 
 *     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 
 *     USA. 
 * 
 ********************************************************************** 
 */

#include "hwaccess.h"

/* Allocates emu address space */

int emu10k1_addxmgr_alloc(u32 size, struct emu10k1_card *card)
{
    u16 *pagetable = card->emupagetable;
    u16 index = 0;
    u16 numpages;
    unsigned long flags;

    /* Convert bytes to pages */
    numpages = (size / EMUPAGESIZE) + ((size % EMUPAGESIZE) ? 1 : 0);

    spin_lock_irqsave(&card->lock, flags);

    while (index < (MAXPAGES - 1)) {
        if (pagetable[index] & 0x8000) {
            /* This block of pages is in use, jump to the start of the next block. */
            index += (pagetable[index] & 0x7fff);
        } else {
            /* Found free block */
            if (pagetable[index] >= numpages) {

                /* Block is large enough */

                /* If free block is larger than the block requested
                 * then adjust the size of the block remaining */
                if (pagetable[index] > numpages)
                    pagetable[index + numpages] = pagetable[index] - numpages;

                pagetable[index] = (numpages | 0x8000);    /* Mark block as used */

                spin_unlock_irqrestore(&card->lock, flags);

                return index;
            } else {
                /* Block too small, jump to the start of the next block */
                index += pagetable[index];
            }
        }
    }

    spin_unlock_irqrestore(&card->lock, flags);

    return -1;
}

/* Frees a previously allocated emu address space. */

void emu10k1_addxmgr_free(struct emu10k1_card *card, int index)
{
    u16 *pagetable = card->emupagetable;
    u16 origsize = 0;
    unsigned long flags;

    spin_lock_irqsave(&card->lock, flags);

    if (pagetable[index] & 0x8000) {
        /* Block is allocated - mark block as free */
        origsize = pagetable[index] & 0x7fff;
        pagetable[index] = origsize;

        /* If next block is free, we concat both blocks */
        if (!(pagetable[index + origsize] & 0x8000))
            pagetable[index] += pagetable[index + origsize] & 0x7fff;
    }

    spin_unlock_irqrestore(&card->lock, flags);

    return;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0126 ]--