blob: afb17c1043df91792afe82f460a1b5d6020957d3 [file] [log] [blame]
Thaminda Edirisooriyaa47738d2015-08-26 15:39:16 -07001/*
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äfer99f2f112016-10-28 00:25:02 +020028#include <mcall.h>
Jonathan Neuschäfercc5be8b2016-07-26 01:54:34 +020029#include <string.h>
Jonathan Neuschäfere2e40cc2016-10-12 00:18:00 +020030#include <vm.h>
Thaminda Edirisooriyaa47738d2015-08-26 15:39:16 -070031
Xiang Wang820dcfc2018-07-19 17:35:39 +080032void hls_init(uint32_t hart_id, void *fdt)
Thaminda Edirisooriyaa47738d2015-08-26 15:39:16 -070033{
34 memset(HLS(), 0, sizeof(*HLS()));
Xiang Wang820dcfc2018-07-19 17:35:39 +080035 HLS()->fdt = fdt;
Thaminda Edirisooriyaa47738d2015-08-26 15:39:16 -070036 HLS()->hart_id = hart_id;
Ronald G. Minnich6f3a53b2017-01-15 17:40:51 +010037
Xiang Wang2e38dbe2018-08-28 16:34:29 +080038 mtime_init();
Thaminda Edirisooriyaa47738d2015-08-26 15:39:16 -070039}