Bharata B Rao <bharata....@gmail.com> writes:

> On Mon, Jul 18, 2016 at 10:35 PM, Nikunj A Dadhania
> <nik...@linux.vnet.ibm.com> wrote:
>> ISA 3.0 has introduced EO - Expanded Opcode. Introduce third level
>> indirect opcode table and corresponding parsing routines.
>>
>> EO (11:12) Expanded opcode field
>> Formats: XX1
>>
>> EO (11:15) Expanded opcode field
>> Formats: VX, X, XX2
>>
>> Signed-off-by: Nikunj A Dadhania <nik...@linux.vnet.ibm.com>
>> ---
>> +static int register_trplind_insn (opc_handler_t **ppc_opcodes,
>> +                                  unsigned char idx1, unsigned char idx2,
>> +                                  unsigned char idx3, unsigned char idx4,
>> +                                  opc_handler_t *handler)
>> +{
>> +    opc_handler_t **table;
>> +
>> +    if (register_ind_in_table(ppc_opcodes, idx1, idx2, NULL) < 0) {
>> +        printf("*** ERROR: unable to join indirect table idx "
>> +               "[%02x-%02x]\n", idx1, idx2);
>> +        return -1;
>> +    }
>> +    table = ind_table(ppc_opcodes[idx1]);
>> +    if (register_ind_in_table(table, idx2, idx3, NULL) < 0) {
>> +        printf("*** ERROR: unable to join 2nd-level indirect table idx "
>> +               "[%02x-%02x-%02x]\n", idx1, idx2, idx3);
>> +        return -1;
>> +    }
>> +    table = ind_table(table[idx2]);
>> +    if (register_ind_in_table(table, idx3, idx4, handler) < 0) {
>> +        printf("*** ERROR: unable to insert opcode "
>> +               "[%02x-%02x-%02x-%02x]\n", idx1, idx2, idx3, idx4);
>> +        return -1;
>> +    }
>> +    return 0;
>> +}
>
> If you are adding a 3rd level opcode table, explicit freeing of the
> same from ppc_cpu_unrealizefn() is necessary right ?

Yes, you are right, will add in my next revision.

Regards,
Nikunj


Reply via email to