blob: af79704889bd7d7bf924a8f191a62cf163ddc4a7 [file] [log] [blame]
// Copyright 2025 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use starnix_core::task::CurrentTask;
use starnix_core::vfs::{FsNode, FsNodeOps, SymlinkTarget, fs_node_impl_symlink};
use starnix_sync::{FileOpsCore, Locked};
use starnix_uapi::errors::Errno;
/// A node that represents a link to /sys/firmware/devicetree/base
pub struct DeviceTreeSymlink;
impl DeviceTreeSymlink {
pub fn new_node() -> impl FsNodeOps {
Self {}
}
}
impl FsNodeOps for DeviceTreeSymlink {
fs_node_impl_symlink!();
fn readlink(
&self,
_locked: &mut Locked<FileOpsCore>,
_node: &FsNode,
_current_task: &CurrentTask,
) -> Result<SymlinkTarget, Errno> {
Ok(SymlinkTarget::Path("/sys/firmware/devicetree/base".into()))
}
}