516
516
int err = 0, err1, i;
517
517
struct uni_pagedir *p, *q;
519
/* Save original vc_unipagdir_loc in case we allocate a new one */
519
520
p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
520
521
if (p->readonly) return -EIO;
528
529
err1 = con_clear_unimap(vc, NULL);
529
530
if (err1) return err1;
533
* Since refcount was > 1, con_clear_unimap() allocated a
534
* a new uni_pagedir for this vc. Re: p != q
531
536
q = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
532
for (i = 0, l = 0; i < 32; i++)
539
* uni_pgdir is a 32*32*64 table with rows allocated
540
* when its first entry is added. The unicode value must
541
* still be incremented for empty rows. We are copying
542
* entries from "p" (old) to "q" (new).
544
l = 0; /* unicode value */
545
for (i = 0; i < 32; i++)
533
546
if ((p1 = p->uni_pgdir[i]))
534
547
for (j = 0; j < 32; j++)
536
549
for (k = 0; k < 64; k++, l++)
537
550
if (p2[k] != 0xffff) {
552
* Found one, copy entry for unicode
553
* l with fontpos value p2[k].
538
555
err1 = con_insert_unipair(q, l, p2[k]);
541
558
*vc->vc_uni_pagedir_loc = (unsigned long)p;
542
559
con_release_unimap(q);
548
} else if (p == dflt)
565
/* Account for row of 64 empty entries */
569
/* Account for empty table */
573
* Finished copying font table, set vc_uni_pagedir to new table
576
} else if (p == dflt) {
581
* Insert user specified unicode pairs into new table.
552
584
unsigned short unicode, fontpos;
553
585
__get_user(unicode, &list->unicode);
593
* Merge with fontmaps of any other virtual consoles.
560
595
if (con_unify_unimap(vc, p))
563
598
for (i = 0; i <= 3; i++)
564
set_inverse_transl(vc, p, i); /* Update all inverse translations */
599
set_inverse_transl(vc, p, i); /* Update inverse translations */
565
600
set_inverse_trans_unicode(vc, p);