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


Viewing file:     time.c (2.73 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 *  linux/arch/m68k/sun3x/time.c
 *
 *  Sun3x-specific time handling
 */

#include <linux/types.h>
#include <linux/kd.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/interrupt.h>

#include <asm/irq.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/traps.h>
#include <asm/sun3x.h>
#include <asm/sun3ints.h>
#include <asm/rtc.h>

#include "time.h"

#define M_CONTROL 0xf8
#define M_SEC     0xf9
#define M_MIN     0xfa
#define M_HOUR    0xfb
#define M_DAY     0xfc
#define M_DATE    0xfd
#define M_MONTH   0xfe
#define M_YEAR    0xff

#define C_WRITE   0x80
#define C_READ    0x40
#define C_SIGN    0x20
#define C_CALIB   0x1f

#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10)
#define BIN_TO_BCD(val) (((val/10) << 4) | (val % 10))

/* Read the Mostek */
void sun3x_gettod (int *yearp, int *monp, int *dayp,
                   int *hourp, int *minp, int *secp)
{
    volatile unsigned char *eeprom = (unsigned char *)SUN3X_EEPROM;

    /* Stop updates */
    *(eeprom + M_CONTROL) |= C_READ;

    /* Read values */
    *yearp = BCD_TO_BIN(*(eeprom + M_YEAR));
    *monp  = BCD_TO_BIN(*(eeprom + M_MONTH)) +1;
    *dayp  = BCD_TO_BIN(*(eeprom + M_DATE));
    *hourp = BCD_TO_BIN(*(eeprom + M_HOUR));
    *minp  = BCD_TO_BIN(*(eeprom + M_MIN));
    *secp  = BCD_TO_BIN(*(eeprom + M_SEC));

    /* Restart updates */
    *(eeprom + M_CONTROL) &= ~C_READ;
}

int sun3x_hwclk(int set, struct hwclk_time *t)
{
    volatile struct mostek_dt *h = 
        (unsigned char *)(SUN3X_EEPROM+M_CONTROL);
    unsigned long flags;

    save_and_cli(flags);
    
    if(set) {
        h->csr |= C_WRITE;
        h->sec = BIN_TO_BCD(t->sec);
        h->min = BIN_TO_BCD(t->min);
        h->hour = BIN_TO_BCD(t->hour);
        h->wday = BIN_TO_BCD(t->wday);
        h->mday = BIN_TO_BCD(t->day);
        h->month = BIN_TO_BCD(t->mon);
        h->year = BIN_TO_BCD(t->year);
        h->csr &= ~C_WRITE;
    } else {
        h->csr |= C_READ;
        t->sec = BCD_TO_BIN(h->sec);
        t->min = BCD_TO_BIN(h->min);
        t->hour = BCD_TO_BIN(h->hour);
        t->wday = BCD_TO_BIN(h->wday);
        t->day = BCD_TO_BIN(h->mday);
        t->mon = BCD_TO_BIN(h->month);
        t->year = BCD_TO_BIN(h->year);
        h->csr &= ~C_READ;
    }

    restore_flags(flags);

    return 0;
}
/* Not much we can do here */
unsigned long sun3x_gettimeoffset (void)
{
    return 0L;
}

static void sun3x_timer_tick(int irq, void *dev_id, struct pt_regs *regs)
{
    void (*vector)(int, void *, struct pt_regs *) = dev_id;

    /* Clear the pending interrupt - pulse the enable line low */
    disable_irq(5);
    enable_irq(5);
    
    vector(irq, NULL, regs);
}

void __init sun3x_sched_init(void (*vector)(int, void *, struct pt_regs *))
{
    
    sun3_disable_interrupts();
    

    /* Pulse enable low to get the clock started */
    sun3_disable_irq(5);
    sun3_enable_irq(5);
    sun3_enable_interrupts();
}

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