]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/standalone_v5_4/src/pvr.c
Update the Microblaze hardware design and BSP to the latest IP and tool versions.
[freertos] / FreeRTOS / Demo / MicroBlaze_Kintex7_EthernetLite / BSP / microblaze_0 / libsrc / standalone_v5_4 / src / pvr.c
1 /******************************************************************************
2 *
3 * Copyright (C) 2006 - 2014 Xilinx, Inc. All rights reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 *
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
30 *
31 ******************************************************************************/
32 /*****************************************************************************/
33 /**
34 *
35 * @file pvr.c
36 *
37 * This header file contains defines for structures used by the microblaze
38 * PVR routines
39 *
40 ******************************************************************************/
41 #include "xparameters.h"
42 #include "pvr.h"
43 #include <string.h>
44
45 /* Definitions */
46 int microblaze_get_pvr (pvr_t *pvr)
47 {
48   if (!pvr)
49     return -1;
50
51   bzero ((void*)pvr, sizeof (pvr_t));
52
53 #ifdef MICROBLAZE_PVR_NONE
54   return -1;
55 #else
56   getpvr (0, pvr->pvr[0]);
57 #endif  /* MICROBLAZE_PVR_NONE */
58
59 #ifdef MICROBLAZE_PVR_FULL
60   getpvr (1, pvr->pvr[1]);
61   getpvr (2, pvr->pvr[2]);
62   getpvr (3, pvr->pvr[3]);
63
64   getpvr (4, pvr->pvr[4]);
65   getpvr (5, pvr->pvr[5]);
66   getpvr (6, pvr->pvr[6]);
67   getpvr (7, pvr->pvr[7]);
68
69   getpvr (8, pvr->pvr[8]);
70   getpvr (9, pvr->pvr[9]);
71   getpvr (10, pvr->pvr[10]);
72   getpvr (11, pvr->pvr[11]);
73
74 /*   getpvr (12, pvr->pvr[12]); */
75 /*   getpvr (13, pvr->pvr[13]); */
76 /*   getpvr (14, pvr->pvr[14]); */
77 /*   getpvr (15, pvr->pvr[15]); */
78
79 #endif  /* MICROBLAZE_PVR_FULL  */
80
81   return 0;
82 }