18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _ALPHA_IRQ_H 38c2ecf20Sopenharmony_ci#define _ALPHA_IRQ_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci/* 68c2ecf20Sopenharmony_ci * linux/include/alpha/irq.h 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * (C) 1994 Linus Torvalds 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <linux/linkage.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#if defined(CONFIG_ALPHA_GENERIC) 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* Here NR_IRQS is not exact, but rather an upper bound. This is used 168c2ecf20Sopenharmony_ci many places throughout the kernel to size static arrays. That's ok, 178c2ecf20Sopenharmony_ci we'll use alpha_mv.nr_irqs when we want the real thing. */ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* When LEGACY_START_ADDRESS is selected, we leave out: 208c2ecf20Sopenharmony_ci TITAN 218c2ecf20Sopenharmony_ci WILDFIRE 228c2ecf20Sopenharmony_ci MARVEL 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci This helps keep the kernel object size reasonable for the majority 258c2ecf20Sopenharmony_ci of machines. 268c2ecf20Sopenharmony_ci*/ 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci# if defined(CONFIG_ALPHA_LEGACY_START_ADDRESS) 298c2ecf20Sopenharmony_ci# define NR_IRQS (128) /* max is RAWHIDE/TAKARA */ 308c2ecf20Sopenharmony_ci# else 318c2ecf20Sopenharmony_ci# define NR_IRQS (32768 + 16) /* marvel - 32 pids */ 328c2ecf20Sopenharmony_ci# endif 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_CABRIOLET) || \ 358c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_EB66P) || \ 368c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_EB164) || \ 378c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_PC164) || \ 388c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_LX164) 398c2ecf20Sopenharmony_ci# define NR_IRQS 35 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_EB66) || \ 428c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_EB64P) || \ 438c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_MIKASA) 448c2ecf20Sopenharmony_ci# define NR_IRQS 32 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_ALCOR) || \ 478c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_MIATA) || \ 488c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_RUFFIAN) || \ 498c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_RX164) || \ 508c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_NORITAKE) 518c2ecf20Sopenharmony_ci# define NR_IRQS 48 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_SABLE) || \ 548c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_SX164) 558c2ecf20Sopenharmony_ci# define NR_IRQS 40 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_DP264) || \ 588c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_LYNX) || \ 598c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_SHARK) 608c2ecf20Sopenharmony_ci# define NR_IRQS 64 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_TITAN) 638c2ecf20Sopenharmony_ci#define NR_IRQS 80 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_RAWHIDE) || \ 668c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_TAKARA) || \ 678c2ecf20Sopenharmony_ci defined(CONFIG_ALPHA_EIGER) 688c2ecf20Sopenharmony_ci# define NR_IRQS 128 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_WILDFIRE) 718c2ecf20Sopenharmony_ci# define NR_IRQS 2048 /* enuff for 8 QBBs */ 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#elif defined(CONFIG_ALPHA_MARVEL) 748c2ecf20Sopenharmony_ci# define NR_IRQS (32768 + 16) /* marvel - 32 pids*/ 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ci#else /* everyone else */ 778c2ecf20Sopenharmony_ci# define NR_IRQS 16 788c2ecf20Sopenharmony_ci#endif 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_cistatic __inline__ int irq_canonicalize(int irq) 818c2ecf20Sopenharmony_ci{ 828c2ecf20Sopenharmony_ci /* 838c2ecf20Sopenharmony_ci * XXX is this true for all Alpha's? The old serial driver 848c2ecf20Sopenharmony_ci * did it this way for years without any complaints, so.... 858c2ecf20Sopenharmony_ci */ 868c2ecf20Sopenharmony_ci return ((irq == 2) ? 9 : irq); 878c2ecf20Sopenharmony_ci} 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_cistruct pt_regs; 908c2ecf20Sopenharmony_ciextern void (*perf_irq)(unsigned long, struct pt_regs *); 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci#endif /* _ALPHA_IRQ_H */ 93