Beispiel #1
0
/* incoming message handlers */
static int prd_msg_handle_attn_ack(struct opal_prd_msg *msg)
{
	int rc;

	lock(&ipoll_lock);
	rc = __ipoll_update_mask(msg->attn_ack.proc, false,
			msg->attn_ack.ipoll_ack & PRD_IPOLL_MASK);
	unlock(&ipoll_lock);

	if (rc)
		prlog(PR_ERR, "PRD: Unable to unmask ipoll!\n");

	return rc;
}
Beispiel #2
0
static int prd_msg_handle_fini(void)
{
	struct proc_chip *chip;

	lock(&events_lock);
	prd_active = false;
	unlock(&events_lock);

	lock(&ipoll_lock);
	for_each_chip(chip) {
		__ipoll_update_mask(chip->id, true, PRD_IPOLL_MASK);
	}
	unlock(&ipoll_lock);

	return OPAL_SUCCESS;
}
Beispiel #3
0
static int ipoll_record_and_mask_pending(uint32_t proc)
{
	uint64_t status;
	int rc;

	lock(&ipoll_lock);
	rc = xscom_read(proc, PRD_IPOLL_REG_STATUS, &status);
	if (!rc)
		__ipoll_update_mask(proc, true, status);
	unlock(&ipoll_lock);

	if (!rc)
		ipoll_status[proc] |= (status & PRD_IPOLL_MASK);

	return rc;
}
Beispiel #4
0
void prd_init(void)
{
	struct proc_chip *chip;

	/* mask everything */
	lock(&ipoll_lock);
	for_each_chip(chip) {
		__ipoll_update_mask(chip->id, true, PRD_IPOLL_MASK);
	}
	unlock(&ipoll_lock);

	if (fsp_present()) {
		/* todo: FSP implementation */
		queue_prd_msg = queue_prd_msg_nop;
	} else {
		queue_prd_msg = queue_prd_msg_hbrt;
		opal_register(OPAL_PRD_MSG, opal_prd_msg, 1);
	}
}
Beispiel #5
0
static int prd_msg_handle_init(struct opal_prd_msg *msg)
{
	struct proc_chip *chip;

	lock(&ipoll_lock);
	for_each_chip(chip) {
		__ipoll_update_mask(chip->id, false, msg->init.ipoll);
	}
	unlock(&ipoll_lock);

	/* we're transitioning from inactive to active; send any pending tmgt
	 * interrupts */
	lock(&events_lock);
	prd_active = true;
	if (!prd_msg_inuse)
		send_pending_events();
	unlock(&events_lock);

	return OPAL_SUCCESS;
}