summaryrefslogtreecommitdiffstats
path: root/src/sbefw/core/sbeSecurity.H
blob: 1b9c0a0abc75503d823755da5ab451a5c06ea350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/sbefw/core/sbeSecurity.H $                                */
/*                                                                        */
/* OpenPOWER sbe Project                                                  */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2017,2019                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef __SBE_SECURITY_H
#define __SBE_SECURITY_H

#include <stdint.h>
#include <securityAlgo.H>
#include "sbeMemAccessInterface.H"

namespace SBE_SECURITY
{

    typedef enum
    {
        READ = 0,
        WRITE
    } accessType;

    /**
     * @brief An enumeration of all Security list types
     */
    enum secListType
    {
        SEC_WHITE_LIST = 0x0,
        SEC_BLACK_LIST = 0x1,
        SEC_GREY_LIST  = 0x2,
        // Don't count this in the list type, just to intialize the list type
        SEC_INVALID_LIST = 0xF,
    };

    /* @brief isAllowed       - Public function used for address verification
     *                          for a given type of access
     *
     * @param[in] i_addr      - given address to verify
     * @param[in] i_mask      - mask for data
     * @param[in] i_type      - access type - READ/WRITE
     *
     * @return                - boolean to denote if the access on the address
     *                          is allowed or not
     */
    bool isAllowed(const uint32_t i_addr, const uint64_t i_mask,
                   accessType i_type);

    /* @brief sendSecurityListDumpToHB - Public function used for sending
     *                         security dump to hostboot
     *
     * @param[in] i_pMemInterface - pointer to memory interface object
     *
     * @return                - SBE secondary RC
     */
    uint32_t  sendSecurityListDumpToHB(sbeMemAccessInterface *i_pMemInterface);
}
#endif //__SBE_SECURITY_H
OpenPOWER on IntegriCloud