Emery Hemingway
3d68a520cb
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEsIWqvdxEKaxX80hspyRgNBfs1rcFAl3fpmAACgkQpyRgNBfs 1rcezQ//ZoYChufO6m2CByuPUbITql12b6oyOjmvcw16NW+Nsf2EodwMeCk/9yyM kWIxqOtXp1yFPGNf8ebEkTu5YXYMkHrUds4V6nQ4nQnyk7VnQmR3XTnqP8Sr27Hp fHi7Dddjxufexeyb6bwis04mK4PeFWXk/D6H4nh6ZeaR30g/GQ+Wt4N64a+HcQ1g kLMKuLlooOoq0L9q8IVLAtQoKNR1LP6x0FKGH8B6elwns8rXna2fRSlCB+W7qLwl K/pQadaIkwQNj8TEXuQxdGOR1GIrTbUz9ExS6U1yPXjqK06CunDZqsn+Cv5G7p+5 ybMaViXwDGilZjhNLTjAbPhqhoOVu+yDB5gwzKiYt6/gTKP8N+VUpXKhGpzu/0ya wEt2b/43vmPm1NsBQQFU6vmjyW0W0iOl+a1tetv/qFo4mzQNesbVlu6t91b0EAjp C0JzZj9UHj/QkKgLIPkWMVWyz+VtODUeFhMLV6+86wzFmqSNhbaL0K/1LvX3AHZR 5M/sjMRdtRL9U7Xv/LTn/Sgisk5wT2wfI9dpkAZALZjm22751mSTv9XhdLC/+XpA 0F7cfSg36DphYsyPmSQ9+Q79rpU+bvuuTbqAsLdYcflMaW4bsIOd4j5Lk3adIPbN EE0uu+CD1GbqpKy+vLr+2EIlYpVNRTQKLklmkmhb+ZBuvUo00cU= =4dhl -----END PGP SIGNATURE----- Merge tag '19.11' Tag release 19.11
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
/*
|
|
* \brief Kernel cpu object implementations for multiprocessor systems
|
|
* \author Stefan Kalkowski
|
|
* \date 2018-11-18
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2018 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#include "cpu.h"
|
|
|
|
using namespace Kernel;
|
|
|
|
void Cpu::Ipi::occurred()
|
|
{
|
|
/* lambda to iterate over a work-list and execute all work items */
|
|
auto iterate = [] (Genode::List<Genode::List_element<Inter_processor_work>> & li) {
|
|
Genode::List_element<Inter_processor_work> const *e = li.first();
|
|
Genode::List_element<Inter_processor_work> const *next = nullptr;
|
|
for ( ; e; e = next) {
|
|
next = e->next();
|
|
e->object()->execute();
|
|
}
|
|
};
|
|
|
|
/* iterate through the local and global work-list */
|
|
iterate(cpu._local_work_list);
|
|
iterate(cpu._global_work_list);
|
|
|
|
/* mark the IPI as being received */
|
|
pending = false;
|
|
}
|
|
|
|
|
|
void Cpu::trigger_ip_interrupt()
|
|
{
|
|
/* check whether there is still an IPI send */
|
|
if (_ipi_irq.pending) return;
|
|
|
|
_pic.send_ipi(_id);
|
|
_ipi_irq.pending = true;
|
|
}
|
|
|
|
|
|
Cpu::Ipi::Ipi(Cpu & cpu)
|
|
: Irq(Board::Pic::IPI, cpu), cpu(cpu) {
|
|
cpu.pic().unmask(Board::Pic::IPI, cpu.id()); }
|