Skip to content

Commit

Permalink
[Build][x86_64] AlmaLinux 9.5 (Teal Serval) compilation fix (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Dec 19, 2024
1 parent f688e95 commit 902b7ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions x86_64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -23517,7 +23517,8 @@ static long CoreFreqK_ioctl( struct file *filp,
static int CoreFreqK_mmap(struct file *pfile, struct vm_area_struct *vma)
{
unsigned long reqSize = vma->vm_end - vma->vm_start;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) \
|| (defined(RHEL_MAJOR) && (RHEL_MAJOR >= 9) && (RHEL_MINOR >= 5))
vm_flags_t vm_ro = VM_READ;
#endif
int rc = -EIO;
Expand All @@ -23532,7 +23533,8 @@ static int CoreFreqK_mmap(struct file *pfile, struct vm_area_struct *vma)
goto EXIT_PAGE;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) \
|| (defined(RHEL_MAJOR) && (RHEL_MAJOR >= 9) && (RHEL_MINOR >= 5))
vm_flags_reset_once(vma, vm_ro);
#else
vma->vm_flags = VM_READ;
Expand Down Expand Up @@ -23574,7 +23576,8 @@ static int CoreFreqK_mmap(struct file *pfile, struct vm_area_struct *vma)
return -EAGAIN;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) \
|| (defined(RHEL_MAJOR) && (RHEL_MAJOR >= 9) && (RHEL_MINOR >= 5))
vm_flags_reset_once(vma, vm_ro);
#else
vma->vm_flags = VM_READ;
Expand Down Expand Up @@ -23605,7 +23608,8 @@ static int CoreFreqK_mmap(struct file *pfile, struct vm_area_struct *vma)
goto EXIT_PAGE;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) \
|| (defined(RHEL_MAJOR) && (RHEL_MAJOR >= 9) && (RHEL_MINOR >= 5))
vm_flags_reset_once(vma, vm_ro);
#else
vma->vm_flags = VM_READ;
Expand Down

0 comments on commit 902b7ee

Please sign in to comment.