Thaminda Edirisooriya | a47738d | 2015-08-26 15:39:16 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013, The Regents of the University of California (Regents). |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * 3. Neither the name of the Regents nor the |
| 13 | * names of its contributors may be used to endorse or promote products |
| 14 | * derived from this software without specific prior written permission. |
| 15 | * |
| 16 | * IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, |
| 17 | * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING |
| 18 | * OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS |
| 19 | * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 20 | * |
| 21 | * REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 23 | * PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED |
| 24 | * HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE |
| 25 | * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 26 | */ |
| 27 | |
Jonathan Neuschäfer | 99f2f11 | 2016-10-28 00:25:02 +0200 | [diff] [blame] | 28 | #include <mcall.h> |
Jonathan Neuschäfer | cc5be8b | 2016-07-26 01:54:34 +0200 | [diff] [blame] | 29 | #include <string.h> |
Jonathan Neuschäfer | e2e40cc | 2016-10-12 00:18:00 +0200 | [diff] [blame] | 30 | #include <vm.h> |
Thaminda Edirisooriya | a47738d | 2015-08-26 15:39:16 -0700 | [diff] [blame] | 31 | |
Xiang Wang | 820dcfc | 2018-07-19 17:35:39 +0800 | [diff] [blame] | 32 | void hls_init(uint32_t hart_id, void *fdt) |
Thaminda Edirisooriya | a47738d | 2015-08-26 15:39:16 -0700 | [diff] [blame] | 33 | { |
| 34 | memset(HLS(), 0, sizeof(*HLS())); |
Xiang Wang | 820dcfc | 2018-07-19 17:35:39 +0800 | [diff] [blame] | 35 | HLS()->fdt = fdt; |
Thaminda Edirisooriya | a47738d | 2015-08-26 15:39:16 -0700 | [diff] [blame] | 36 | HLS()->hart_id = hart_id; |
Ronald G. Minnich | 6f3a53b | 2017-01-15 17:40:51 +0100 | [diff] [blame] | 37 | |
Xiang Wang | 2e38dbe | 2018-08-28 16:34:29 +0800 | [diff] [blame] | 38 | mtime_init(); |
Thaminda Edirisooriya | a47738d | 2015-08-26 15:39:16 -0700 | [diff] [blame] | 39 | } |