Commit 0b1e9c9e authored by hpi1's avatar hpi1

Added PSR_SAVE event

parent 1989bc1e
......@@ -1699,6 +1699,11 @@ static void _process_psr_event(void *handle, BD_PSR_EVENT *ev)
{
BLURAY *bd = (BLURAY*)handle;
if (ev->ev_type == BD_PSR_SAVE) {
BD_DEBUG(DBG_BLURAY, "PSR SAVE event (%p)\n", bd);
return;
}
/* PSR restore events are handled internally */
if (ev->ev_type == BD_PSR_RESTORE) {
......
......@@ -252,6 +252,22 @@ void bd_psr_save_state(BD_REGISTERS *p)
memcpy(p->psr + 36, p->psr + 4, sizeof(uint32_t) * 5);
memcpy(p->psr + 42, p->psr + 10, sizeof(uint32_t) * 3);
/* generate save event */
if (p->num_cb) {
BD_PSR_EVENT ev = {
.ev_type = BD_PSR_SAVE,
.psr_idx = -1,
.old_val = 0,
.new_val = 0,
};
unsigned j;
for (j = 0; j < p->num_cb; j++) {
p->cb[j].cb(p->cb[j].handle, &ev);
}
}
bd_psr_unlock(p);
}
......
......@@ -207,6 +207,7 @@ void bd_psr_reset_backup_registers(BD_REGISTERS *);
/* event types */
#define BD_PSR_CHANGE 1
#define BD_PSR_RESTORE 2
#define BD_PSR_SAVE 3 /* single event, psr_idx and values undefined */
/* event data */
typedef struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment