!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/stboards/   drwxr-xr-x
Free 318.37 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:     irq.c (2.79 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* 
 * Copyright (C) 2000 David J. Mckay (david.mckay@st.com)
 *
 * May be copied or modified under the terms of the GNU General Public
 * License.  See linux/COPYING for more information.                            
 *
 * Looks after interrupts on the HARP board.
 *
 * Bases on the IPR irq system
 */

#include <linux/config.h>
#include <linux/init.h>
#include <linux/irq.h>

#include <asm/system.h>
#include <asm/io.h>

#include "harp.h"


#define NUM_EXTERNAL_IRQS 16

// Early versions of the STB1 Overdrive required this nasty frig
//#define INVERT_INTMASK_WRITES

static void enable_harp_irq(unsigned int irq);
static void disable_harp_irq(unsigned int irq);

/* shutdown is same as "disable" */
#define shutdown_harp_irq disable_harp_irq

static void mask_and_ack_harp(unsigned int);
static void end_harp_irq(unsigned int irq);

static unsigned int startup_harp_irq(unsigned int irq)
{
    enable_harp_irq(irq);
    return 0;        /* never anything pending */
}

static struct hw_interrupt_type harp_irq_type = {
    "Harp-IRQ",
    startup_harp_irq,
    shutdown_harp_irq,
    enable_harp_irq,
    disable_harp_irq,
    mask_and_ack_harp,
    end_harp_irq
};

static void disable_harp_irq(unsigned int irq)
{
    unsigned val, flags;
    unsigned maskReg;
    unsigned mask;
    int pri;

    if (irq < 0 || irq >= NUM_EXTERNAL_IRQS)
        return;

    pri = 15 - irq;

    if (pri < 8) {
        maskReg = EPLD_INTMASK0;
    } else {
        maskReg = EPLD_INTMASK1;
        pri -= 8;
    }

    save_and_cli(flags);
    mask = ctrl_inl(maskReg);
    mask &= (~(1 << pri));
#if defined(INVERT_INTMASK_WRITES)
    mask ^= 0xff;
#endif
    ctrl_outl(mask, maskReg);
    restore_flags(flags);
}

static void enable_harp_irq(unsigned int irq)
{
    unsigned flags;
    unsigned maskReg;
    unsigned mask;
    int pri;

    if (irq < 0 || irq >= NUM_EXTERNAL_IRQS)
        return;

    pri = 15 - irq;

    if (pri < 8) {
        maskReg = EPLD_INTMASK0;
    } else {
        maskReg = EPLD_INTMASK1;
        pri -= 8;
    }

    save_and_cli(flags);
    mask = ctrl_inl(maskReg);


    mask |= (1 << pri);

#if defined(INVERT_INTMASK_WRITES)
    mask ^= 0xff;
#endif
    ctrl_outl(mask, maskReg);

    restore_flags(flags);
}

/* This functions sets the desired irq handler to be an overdrive type */
static void __init make_harp_irq(unsigned int irq)
{
    disable_irq_nosync(irq);
    irq_desc[irq].handler = &harp_irq_type;
    disable_harp_irq(irq);
}

static void mask_and_ack_harp(unsigned int irq)
{
    disable_harp_irq(irq);
}

static void end_harp_irq(unsigned int irq)
{
    enable_harp_irq(irq);
}

void __init init_harp_irq(void)
{
    int i;

#if !defined(INVERT_INTMASK_WRITES)
    // On the harp these are set to enable an interrupt
    ctrl_outl(0x00, EPLD_INTMASK0);
    ctrl_outl(0x00, EPLD_INTMASK1);
#else
    // On the Overdrive the data is inverted before being stored in the reg
    ctrl_outl(0xff, EPLD_INTMASK0);
    ctrl_outl(0xff, EPLD_INTMASK1);
#endif

    for (i = 0; i < NUM_EXTERNAL_IRQS; i++) {
        make_harp_irq(i);
    }
}

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