gpu: nvgpu: Unify posix sort unit with qnx

-Unify sort function with qnx as qsort is posix compliant.
-Update yaml accordingly.

Jira NVGPU-3625

Change-Id: I982570bccb3bc8720596bfacf48eb17a0fca2ddf
Signed-off-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2134355
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Shashank Singh
2019-06-11 17:26:07 +05:30
committed by mobile promotions
parent 03db4f8f33
commit 627a933da5
3 changed files with 10 additions and 7 deletions

View File

@@ -48,10 +48,15 @@ headers:
include/nvgpu/posix/posix-fault-injection.h, include/nvgpu/posix/posix-fault-injection.h,
include/nvgpu/posix/probe.h, include/nvgpu/posix/probe.h,
include/nvgpu/posix/soc_fuse.h, include/nvgpu/posix/soc_fuse.h,
include/nvgpu/posix/sort.h,
include/nvgpu/posix/vm.h, include/nvgpu/posix/vm.h,
include/nvgpu/posix/posix_vidmem.h ] include/nvgpu/posix/posix_vidmem.h ]
sort:
safe: yes
owner: Ajesh K
sources: [ include/nvgpu/posix/sort.h ]
deps:
bug: bug:
safe: yes safe: yes
owner: Ajesh K owner: Ajesh K

View File

@@ -23,13 +23,13 @@
#ifndef NVGPU_POSIX_SORT_H #ifndef NVGPU_POSIX_SORT_H
#define NVGPU_POSIX_SORT_H #define NVGPU_POSIX_SORT_H
#include <nvgpu/bug.h> #include <stdlib.h>
static void sort(void *base, size_t num, size_t size, static void sort(void *base, size_t num, size_t size,
int (*cmp)(const void *a, const void *b), int (*cmp)(const void *a, const void *b),
void (*swap)(void *a, void *b, int n)) void (*swap)(void *a, void *b, int n))
{ {
nvgpu_posix_bug("sort() not implemented yet!"); qsort(base, num, size, cmp);
} }
#endif /* NVGPU_POSIX_SORT_H */ #endif /* NVGPU_POSIX_SORT_H */

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@@ -24,10 +24,8 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/sort.h> #include <linux/sort.h>
#elif defined(__NVGPU_POSIX__)
#include <nvgpu/posix/sort.h>
#else #else
#include <nvgpu_rmos/include/sort.h> #include <nvgpu/posix/sort.h>
#endif #endif
#endif /* NVGPU_SORT_H */ #endif /* NVGPU_SORT_H */