!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/arch/sh/kernel/   drwxr-xr-x
Free 318.29 GB of 458.09 GB (69.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rtc-aica.c (1.85 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* arch/sh/kernel/rtc-aica.c
 *
 * Dreamcast AICA RTC routines.
 *
 * Copyright (c) 2001 M. R. Brown <mrbrown@0xd6.org>
 *
 * Released under the terms of the GNU GPL v2.0.
 *
 */

#include <linux/time.h>

#include <asm/io.h>

/* The AICA RTC has an Epoch of 1/1/1950, so we must subtract 20 years (in
   seconds to get the standard Unix Epoch when getting the time, and add 20
   years when setting the time. */
#define TWENTY_YEARS ((20 * 365LU + 5) * 86400)

/* The AICA RTC is represented by a 32-bit seconds counter stored in 2 16-bit
   registers.*/
#define AICA_RTC_SECS_H        0xa0710000
#define AICA_RTC_SECS_L        0xa0710004

/**
 * aica_rtc_gettimeofday - Get the time from the AICA RTC
 * @tv: pointer to resulting timeval
 *
 * Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
 */
void aica_rtc_gettimeofday(struct timeval *tv) {
    unsigned long val1, val2;

    do {
        val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
            (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);

        val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
            (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
    } while (val1 != val2);

    tv->tv_sec = val1 - TWENTY_YEARS;

    /* Can't get microseconds with just a seconds counter. */
    tv->tv_usec = 0;
}

/**
 * aica_rtc_settimeofday - Set the AICA RTC to the current time
 * @tv: contains the timeval to set
 *
 * Adjusts the given @tv to the AICA Epoch and sets the RTC seconds counter.
 */
int aica_rtc_settimeofday(const struct timeval *tv) {
    unsigned long val1, val2;
    unsigned long secs = tv->tv_sec + TWENTY_YEARS;

    do {
        ctrl_outl((secs & 0xffff0000) >> 16, AICA_RTC_SECS_H);
        ctrl_outl((secs & 0xffff), AICA_RTC_SECS_L);

        val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
            (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);

        val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
            (ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
    } while (val1 != val2);

    return 0;
}

:: 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.0319 ]--