~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to arch/powerpc/math-emu/math_efp.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * arch/powerpc/math-emu/math_efp.c
3
3
 *
4
 
 * Copyright (C) 2006-2008 Freescale Semiconductor, Inc. All rights reserved.
 
4
 * Copyright (C) 2006-2008, 2010 Freescale Semiconductor, Inc.
5
5
 *
6
6
 * Author: Ebony Zhu,   <ebony.zhu@freescale.com>
7
7
 *         Yu Liu,      <yu.liu@freescale.com>
104
104
#define FP_EX_MASK      (FP_EX_INEXACT | FP_EX_INVALID | FP_EX_DIVZERO | \
105
105
                        FP_EX_UNDERFLOW | FP_EX_OVERFLOW)
106
106
 
 
107
static int have_e500_cpu_a005_erratum;
 
108
 
107
109
union dw_union {
108
110
        u64 dp[1];
109
111
        u32 wp[2];
320
322
                        } else {
321
323
                                _FP_ROUND_ZERO(1, SB);
322
324
                        }
323
 
                        FP_TO_INT_S(vc.wp[1], SB, 32, ((func & 0x3) != 0));
 
325
                        FP_TO_INT_S(vc.wp[1], SB, 32,
 
326
                                        (((func & 0x3) != 0) || SB_s));
324
327
                        goto update_regs;
325
328
 
326
329
                default:
458
461
                        } else {
459
462
                                _FP_ROUND_ZERO(2, DB);
460
463
                        }
461
 
                        FP_TO_INT_D(vc.wp[1], DB, 32, ((func & 0x3) != 0));
 
464
                        FP_TO_INT_D(vc.wp[1], DB, 32,
 
465
                                        (((func & 0x3) != 0) || DB_s));
462
466
                        goto update_regs;
463
467
 
464
468
                default:
589
593
                                _FP_ROUND_ZERO(1, SB0);
590
594
                                _FP_ROUND_ZERO(1, SB1);
591
595
                        }
592
 
                        FP_TO_INT_S(vc.wp[0], SB0, 32, ((func & 0x3) != 0));
593
 
                        FP_TO_INT_S(vc.wp[1], SB1, 32, ((func & 0x3) != 0));
 
596
                        FP_TO_INT_S(vc.wp[0], SB0, 32,
 
597
                                        (((func & 0x3) != 0) || SB0_s));
 
598
                        FP_TO_INT_S(vc.wp[1], SB1, 32,
 
599
                                        (((func & 0x3) != 0) || SB1_s));
594
600
                        goto update_regs;
595
601
 
596
602
                default:
652
658
        return 0;
653
659
 
654
660
illegal:
 
661
        if (have_e500_cpu_a005_erratum) {
 
662
                /* according to e500 cpu a005 erratum, reissue efp inst */
 
663
                regs->nip -= 4;
 
664
#ifdef DEBUG
 
665
                printk(KERN_DEBUG "re-issue efp inst: %08lx\n", speinsn);
 
666
#endif
 
667
                return 0;
 
668
        }
 
669
 
655
670
        printk(KERN_ERR "\nOoops! IEEE-754 compliance handler encountered un-supported instruction.\ninst code: %08lx\n", speinsn);
656
671
        return -ENOSYS;
657
672
}
718
733
 
719
734
        return 0;
720
735
}
 
736
 
 
737
int __init spe_mathemu_init(void)
 
738
{
 
739
        u32 pvr, maj, min;
 
740
 
 
741
        pvr = mfspr(SPRN_PVR);
 
742
 
 
743
        if ((PVR_VER(pvr) == PVR_VER_E500V1) ||
 
744
            (PVR_VER(pvr) == PVR_VER_E500V2)) {
 
745
                maj = PVR_MAJ(pvr);
 
746
                min = PVR_MIN(pvr);
 
747
 
 
748
                /*
 
749
                 * E500 revision below 1.1, 2.3, 3.1, 4.1, 5.1
 
750
                 * need cpu a005 errata workaround
 
751
                 */
 
752
                switch (maj) {
 
753
                case 1:
 
754
                        if (min < 1)
 
755
                                have_e500_cpu_a005_erratum = 1;
 
756
                        break;
 
757
                case 2:
 
758
                        if (min < 3)
 
759
                                have_e500_cpu_a005_erratum = 1;
 
760
                        break;
 
761
                case 3:
 
762
                case 4:
 
763
                case 5:
 
764
                        if (min < 1)
 
765
                                have_e500_cpu_a005_erratum = 1;
 
766
                        break;
 
767
                default:
 
768
                        break;
 
769
                }
 
770
        }
 
771
 
 
772
        return 0;
 
773
}
 
774
 
 
775
module_init(spe_mathemu_init);