subr_intr.c (4be58cba48cc944c9c122f9d4e8f50a05fc53370) | subr_intr.c (5b613c19b52697e9a90fa1acff82a014ada333fb) |
---|---|
1/*- 2 * Copyright (c) 2015-2016 Svatopluk Kraus 3 * Copyright (c) 2015-2016 Michal Meloun 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 453 unchanged lines hidden (view full) --- 462 mtx_lock(&isrc_table_lock); 463 if ((isrc->isrc_flags & INTR_ISRCF_IPI) == 0) 464 isrc_release_counters(isrc); 465 error = isrc_free_irq(isrc); 466 mtx_unlock(&isrc_table_lock); 467 return (error); 468} 469 | 1/*- 2 * Copyright (c) 2015-2016 Svatopluk Kraus 3 * Copyright (c) 2015-2016 Michal Meloun 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 453 unchanged lines hidden (view full) --- 462 mtx_lock(&isrc_table_lock); 463 if ((isrc->isrc_flags & INTR_ISRCF_IPI) == 0) 464 isrc_release_counters(isrc); 465 error = isrc_free_irq(isrc); 466 mtx_unlock(&isrc_table_lock); 467 return (error); 468} 469 |
470#ifdef SMP 471/* 472 * A support function for a PIC to decide if provided ISRC should be inited 473 * on given cpu. The logic of INTR_ISRCF_BOUND flag and isrc_cpu member of 474 * struct intr_irqsrc is the following: 475 * 476 * If INTR_ISRCF_BOUND is set, the ISRC should be inited only on cpus 477 * set in isrc_cpu. If not, the ISRC should be inited on every cpu and 478 * isrc_cpu is kept consistent with it. Thus isrc_cpu is always correct. 479 */ 480bool 481intr_isrc_init_on_cpu(struct intr_irqsrc *isrc, u_int cpu) 482{ 483 484 if (isrc->isrc_handlers == 0) 485 return (false); 486 if ((isrc->isrc_flags & (INTR_ISRCF_PPI | INTR_ISRCF_IPI)) == 0) 487 return (false); 488 if (isrc->isrc_flags & INTR_ISRCF_BOUND) 489 return (CPU_ISSET(cpu, &isrc->isrc_cpu)); 490 491 CPU_SET(cpu, &isrc->isrc_cpu); 492 return (true); 493} 494#endif 495 |
|
470static struct intr_dev_data * 471intr_ddata_alloc(u_int extsize) 472{ 473 struct intr_dev_data *ddata; 474 475 ddata = malloc(sizeof(*ddata) + extsize, M_INTRNG, M_WAITOK | M_ZERO); 476 477 mtx_lock(&isrc_table_lock); --- 767 unchanged lines hidden --- | 496static struct intr_dev_data * 497intr_ddata_alloc(u_int extsize) 498{ 499 struct intr_dev_data *ddata; 500 501 ddata = malloc(sizeof(*ddata) + extsize, M_INTRNG, M_WAITOK | M_ZERO); 502 503 mtx_lock(&isrc_table_lock); --- 767 unchanged lines hidden --- |