aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-kernel/kernel-module-adsp/kernel-module-xtensa-hifi.bb
blob: 6d659edb8de59cc2f8fef3580dbb755ddc0e3087 (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
DESCRIPTION = "ADSP Driver for Linux"
LICENSE = "GPLv2 & MIT"

LIC_FILES_CHKSUM = " \
    file://COPYING;md5=55979d94ccbb973fdea772250e0c54d6 \
    file://MIT-COPYING;md5=f932f6ad0feea4f97b6e8316e172070e \
"

require include/adsp-control.inc
inherit module

FILESEXTRAPATHS_prepend := "${THISDIR}/xtensa-hifi:"

SRC_URI = "${@base_conditional('USE_ADSP', '1', 'file://RCG3AHPDL4001ZDO.tar.gz', '', d)}"

S = "${WORKDIR}/RCG3AHPDL4001ZDO"

# Define the extra config for using module.bbclass to build ADSP driver
EXTRA_OEMAKE_append = " KDIR=${STAGING_KERNEL_DIR}"

do_install_append(){
    # Create install directories
    install -d ${D}/${includedir}
    install -d ${D}/${includedir}/sys/xt-shmem

    # Install shared header files
    install -m 644 ${S}/include/*.h ${D}/${includedir}/
    install -m 644 ${S}/include/sys/xt-shmem/*.h ${D}/${includedir}/sys/xt-shmem/
}

# The ADSP driver need adsp firmware for running
RDEPENDS_${PN}_append = " adsp-fw-module"
terator_; typedef typename std::list<Observable<T>*>::const_iterator const_iterator_; public: virtual void update(T* observable) = 0; void addObservable(Observable<T>* observable) { std::lock_guard<std::mutex> lock(observableListMutex_); for (auto& obs : observableList_) { if (obs == observable) {return;} } observableList_.push_back(observable); } void delObservable(Observable<T>* observable) { std::lock_guard<std::mutex> lock(observableListMutex_); const_iterator_ it = std::find(observableList_.cbegin(), observableList_.cend(), observable); if(it != observableList_.cend()) {observableList_.erase(it);} } }; template <class T> class Observable { public: void addObserver(Observer<T>* observer) { std::lock_guard<std::mutex> lock(observerListMutex_); observerList_.push_back(observer); observer->addObservable(this); } void delObserver(Observer<T>* observer) { std::lock_guard<std::mutex> lock(observerListMutex_); const_iterator_ it = find(observerList_.cbegin(), observerList_.cend(), observer); if(it != observerList_.cend()) {observerList_.erase(it);} } virtual int initialRecursionCheck() = 0; virtual int recursionCheck(T* obs) = 0; virtual ~Observable() { std::lock_guard<std::mutex> lock(observerListMutex_); for(const auto& obs: observerList_) { obs->delObservable(this); } } protected: std::list<Observer<T>*> observerList_; typedef typename std::list<Observer<T>*>::iterator iterator_; typedef typename std::list<Observer<T>*>::const_iterator const_iterator_; void notify() { std::lock_guard<std::mutex> lock(observerListMutex_); for(const auto& obs: observerList_) { obs->update(static_cast<T*>(this)); } } private: std::mutex observerListMutex_; };